Search in sources :

Example 1 with XmlMacroDescriptorParser

use of com.enonic.xp.xml.parser.XmlMacroDescriptorParser in project xp by enonic.

the class MacroDescriptorServiceImpl method parseXml.

private void parseXml(final Resource resource, final MacroDescriptor.Builder builder) {
    try {
        final XmlMacroDescriptorParser parser = new XmlMacroDescriptorParser();
        parser.builder(builder);
        parser.currentApplication(resource.getKey().getApplicationKey());
        parser.source(resource.readString());
        parser.parse();
    } catch (final Exception e) {
        throw new XmlException(e, "Could not load macro descriptor [" + resource.getUrl() + "]: " + e.getMessage());
    }
}
Also used : XmlException(com.enonic.xp.xml.XmlException) XmlMacroDescriptorParser(com.enonic.xp.xml.parser.XmlMacroDescriptorParser) XmlException(com.enonic.xp.xml.XmlException)

Aggregations

XmlException (com.enonic.xp.xml.XmlException)1 XmlMacroDescriptorParser (com.enonic.xp.xml.parser.XmlMacroDescriptorParser)1