Package org.jnode.nanoxml

Examples of org.jnode.nanoxml.XMLElement


        return this.syntaxes;
    }

    @Override
    public XMLElement basicElement(String name) {
        XMLElement element = super.basicElement(name);
        for (Syntax child : this.syntaxes) {
            element.addChild((child == null ? MY_EMPTY : child).toXML());
        }
        return element;
    }
View Full Code Here


   


    @Override
    public XMLElement toXML() {
        XMLElement element = basicElement("repeat");
        if (minCount > 0) {
            element.setAttribute("minCount", minCount);
        }
        if (maxCount != Integer.MAX_VALUE) {
            element.setAttribute("maxCount", maxCount);
        }
        if (eager) {
            element.setAttribute("eager", "true");
        }
        return element;
    }
View Full Code Here

     * @param pluginId the plugin to be processed
     * @throws EmuException
     */
    public void configurePlugin(String pluginId) throws EmuException {
        if (!configuredPlugins.contains(pluginId)) {
            XMLElement pluginDescriptor = loadPluginDescriptor(pluginId);
            extractAliases(pluginDescriptor);
            extractSyntaxBundles(pluginDescriptor);
            configuredPlugins.add(pluginId);
        }
    }
View Full Code Here

     * @param pluginDescriptor the plugin descriptor's root XML element
     * @throws EmuException
     */
    private void extractSyntaxBundles(XMLElement pluginDescriptor)
        throws EmuException {
        XMLElement syntaxesDescriptor = findExtension(pluginDescriptor, SyntaxManager.SYNTAXES_EP_NAME);
        if (syntaxesDescriptor == null) {
            return;
        }
        SyntaxSpecLoader loader = new SyntaxSpecLoader();
        for (XMLElement syntaxDescriptor : syntaxesDescriptor.getChildren()) {
            if (!syntaxDescriptor.getName().equals("syntax")) {
                continue;
            }
            SyntaxSpecAdapter adaptedElement = new XMLSyntaxSpecAdapter(syntaxDescriptor);
            try {
View Full Code Here

     *
     * @param pluginDescriptor the plugin descriptor's root XML element
     * @throws EmuException
     */
    private void extractAliases(XMLElement pluginDescriptor) {
        XMLElement aliasesDescriptor = findExtension(pluginDescriptor, AliasManager.ALIASES_EP_NAME);
        if (aliasesDescriptor == null) {
            return;
        }
        for (XMLElement aliasDescriptor : aliasesDescriptor.getChildren()) {
            if (aliasDescriptor.getName().equals("alias")) {
                String alias = aliasDescriptor.getStringAttribute("name");
                String className = aliasDescriptor.getStringAttribute("class");
                aliasMgr.add(alias, className);
            }
View Full Code Here

            throw new EmuException("Cannot find plugin descriptor file for '" +
                pluginName + "': " + file.getAbsolutePath());
        }
        BufferedReader br = null;
        try {
            XMLElement elem = new XMLElement();
            br = new BufferedReader(new FileReader(file));
            elem.parseFromReader(br);
            if (!elem.getName().equals("plugin")) {
                throw new EmuException("File does not contain a 'plugin' descriptor: " + file);
            }
            return elem;
        } catch (IOException ex) {
            throw new EmuException("Problem reading / parsing plugin descriptor file " + file, ex);
View Full Code Here

        return new MuSymbol(label, symbol);
    }

    @Override
    public XMLElement toXML() {
        XMLElement element = basicElement("symbol");
        element.setAttribute("symbol", symbol);
        return element;
    }
View Full Code Here

        return sb.toString();
    }

    @Override
    public XMLElement toXML() {
        XMLElement element = basicElement("powerSet");
        if (eager) {
            element.setAttribute("eager", "true");
        }
        return element;
    }
View Full Code Here

        return argName;
    }

    @Override
    public XMLElement toXML() {
        XMLElement element = basicElement("argument");
        element.setAttribute("argLabel", argName);
        return element;
    }
View Full Code Here

                new MuPreset(arg.getLabel(), "true"));
    }

    @Override
    public XMLElement toXML() {
        XMLElement element = basicElement("verb");
        element.setAttribute("symbol", symbol);
        element.setAttribute("argName", argName);
        return element;
    }
View Full Code Here

TOP

Related Classes of org.jnode.nanoxml.XMLElement

Copyright © 2018 www.massapicom. 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.