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

org.xmlet.xsdparser.xsdelements.XsdDocumentation Maven / Gradle / Ivy

package org.xmlet.xsdparser.xsdelements;

import org.xmlet.xsdparser.core.XsdParserCore;
import org.xmlet.xsdparser.core.utils.ParseData;
import org.xmlet.xsdparser.xsdelements.elementswrapper.ReferenceBase;
import org.xmlet.xsdparser.xsdelements.visitors.XsdAbstractElementVisitor;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * A class representing the xsd:documentation element. This class extends from {@link XsdAnnotationChildren} since it
 * shares a few similarities with {@link XsdAppInfo}, which is the other possible children of {@link XsdAnnotation}
 * elements. For more information check {@link XsdAnnotationChildren}.
 *
 * @see xsd:documentation element description and usage at w3c
 */
public class XsdDocumentation extends XsdAnnotationChildren {

    public static final String XSD_TAG = "xsd:documentation";
    public static final String XS_TAG = "xs:documentation";
    public static final String TAG = "documentation";

    /**
     * Specifies the language used in the {@link XsdAnnotationChildren#content}
     */
    private String xmlLang;

    private XsdDocumentation(@NotNull XsdParserCore parser, @NotNull Map attributesMap) {
        super(parser, attributesMap);
        this.xmlLang = attributesMap.getOrDefault(XML_LANG_TAG, xmlLang);
    }

    @Override
    public void accept(XsdAbstractElementVisitor xsdAbstractElementVisitor) {
        super.accept(xsdAbstractElementVisitor);
        xsdAbstractElementVisitor.visit(this);
    }

    public static ReferenceBase parse(@NotNull ParseData parseData){
        return xsdAnnotationChildrenParse(parseData.node, new XsdDocumentation(parseData.parserInstance, convertNodeMap(parseData.node.getAttributes())));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy