All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.xml.parser.XmlApplicationParser Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.xml.parser;

import com.enonic.xp.app.ApplicationDescriptor;
import com.enonic.xp.xml.DomElement;

public final class XmlApplicationParser
    extends XmlModelParser
{
    private static final String ROOT_TAG_NAME = "application";

    private static final String DESCRIPTION = "description";

    private ApplicationDescriptor.Builder appDescriptorBuilder;

    public XmlApplicationParser appDescriptorBuilder( final ApplicationDescriptor.Builder appDescriptorBuilder )
    {
        this.appDescriptorBuilder = appDescriptorBuilder;
        return this;
    }

    @Override
    protected void doParse( final DomElement root )
        throws Exception
    {
        assertTagName( root, ROOT_TAG_NAME );
        this.appDescriptorBuilder.key( currentApplication );
        final DomElement descriptionElement = root.getChild( DESCRIPTION );
        if ( descriptionElement != null )
        {
            this.appDescriptorBuilder.description( descriptionElement.getValue() );
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy