Package org.dom4j

Examples of org.dom4j.Element.elements()


                        new BitRasterImpl(bs, length)));

            } else if (EventOrderConstraint.class.getSimpleName().equals(element.getName())) {
                UnsupportedOperationException excFirstEl = new UnsupportedOperationException(
                        "First element in eventOrderConstraint must be the event!" + element.getPath());
                for (Object eocObj : element.elements()) {
                    Element eocEl = (Element) eocObj;
                    if ("event".equals(eocEl.getName())) {
                        Event ev = getObject(getRef(eocEl), Event.class);
                        constraint = new EventOrderConstraint(ev);
                    } else if ("beforeEvent".equals(eocEl.getName())) {
View Full Code Here


        Element childElement = getChildElement();
        if (childElement == null) {
            return null;
        }
        // Search for extensions in the child element
        List extensions = childElement.elements(QName.get(name, namespace));
        if (!extensions.isEmpty()) {
            Class extensionClass = PacketExtension.getExtensionClass(name, namespace);
            if (extensionClass != null) {
                try {
                    Constructor constructor = extensionClass.getDeclaredConstructor(new Class[]{
View Full Code Here

        Element childElement = getChildElement();
        if (childElement == null) {
            return false;
        }
        // Delete extensions in the child element
        List extensions = childElement.elements(QName.get(name, namespace));
        if (!extensions.isEmpty()) {
            childElement.remove((Element) extensions.get(0));
            return true;
        }
        return false;
View Full Code Here

    @PostConstruct
    public void init() throws Exception {
        InputStream in = getResource(servletContext, menuPath);
        Element root = Dom4JUtils.parse(in).getRootElement();
        menuBar = new MenuBar();
        for (Object menu : root.elements("menu")) menuBar.addMenu(buildMenu((Element) menu));
    }

    protected Menu buildMenu(Element element) {
        Menu m = null;
        if (element != null) {
View Full Code Here

    void getChildren(Object node, String localName, String namespaceUri, List result) {
        if(node instanceof Element) {
            Element e = (Element)node;
            if(localName == null) {
                result.addAll(e.elements());
            }
            else {
                result.addAll(e.elements(e.getQName().getDocumentFactory().createQName(localName, "", namespaceUri)));
            }
        }
View Full Code Here

            Element e = (Element)node;
            if(localName == null) {
                result.addAll(e.elements());
            }
            else {
                result.addAll(e.elements(e.getQName().getDocumentFactory().createQName(localName, "", namespaceUri)));
            }
        }
        else if(node instanceof Document) {
            Element root = ((Document)node).getRootElement();
            if(localName == null || (equal(root.getName(), localName) && equal(root.getNamespaceURI(), namespaceUri))) {
View Full Code Here

    }

    private void bindCacheRegions(Element descriptor, PluginModule module) {
        Element cacheRegionsDescriptor = descriptor.element("cache-regions");
        if (cacheRegionsDescriptor != null) {
            List<Element> cacheRegions = cacheRegionsDescriptor.elements("cache-region");
            if (cacheRegions.size() > 0) {
                for (Element cacheRegion : cacheRegions) {
                    String unqualifiedCacheRegionName = cacheRegion.attributeValue("name");
                    module.addFragmentCacheRegion(unqualifiedCacheRegionName);
View Full Code Here

    private void bindMacroRenderOptions(Element descriptor, MacroPluginModule module) {
        Element renderOptions = descriptor.element("render-options");
        if (renderOptions != null) {
            List<MacroPluginModule.RenderOption> renderOptionList =
                        new ArrayList<MacroPluginModule.RenderOption>();
            List<Element> options = renderOptions.elements();
            for (Element option : options) {
                if (option.getName().equals("singleton"))
                    renderOptionList.add(MacroPluginModule.RenderOption.SINGLETON);
            }
            MacroPluginModule.RenderOption[] renderOptionArray =
View Full Code Here

        }

        List<String> result = new ArrayList<String>();

        Element filesElement = tocDoc.getRootElement().element("files");
        List<Element> fileElementList = filesElement.elements("file");
        for (Element el : fileElementList) {
            String docFullName = el.getStringValue();

            if (patternFilter == null || docFullName.matches(patternFilter)) {
                result.add(docFullName);
View Full Code Here

        Pattern pattern = patternFilter == null ? null : Pattern.compile(patternFilter);

        Element filesElement = tocDoc.getRootElement().element("files");
        @SuppressWarnings("unchecked")
        List<Element> fileElementList = filesElement.elements("file");
        for (Element el : fileElementList) {
            String docFullName = el.getStringValue();

            if (pattern == null || pattern.matcher(docFullName).matches()) {
                result.add(new DocumentReference(RESOLVER.resolve("xwiki:" + docFullName, EntityType.DOCUMENT)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.