Search in sources :

Example 1 with XmlPartDescriptorParser

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

the class PartDescriptorLoader method parseXml.

private void parseXml(final Resource resource, final PartDescriptor.Builder builder) {
    try {
        final XmlPartDescriptorParser parser = new XmlPartDescriptorParser();
        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 part descriptor [" + resource.getUrl() + "]: " + e.getMessage());
    }
}
Also used : XmlPartDescriptorParser(com.enonic.xp.xml.parser.XmlPartDescriptorParser) XmlException(com.enonic.xp.xml.XmlException) XmlException(com.enonic.xp.xml.XmlException)

Aggregations

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