Class XMLAttributeUtil


  • public final class XMLAttributeUtil
    extends Object
    This class provides XML utilities related to attributes.
    Since:
    15.0
    Version:
    17.0 2020-01-04 14:41:51
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.advanced
    Maven Artifact Id:
    attributes
    • Method Detail

      • writeAttributeContainer

        public static void writeAttributeContainer​(Element element,
                                                   AttributeProvider container,
                                                   XMLBuilder builder,
                                                   XMLResources resources,
                                                   boolean writeStandardAttribute)
        Put in the given XML element the attributes stored in the given container. This function ignores the attributes with the names "id", "name", "color", "icon", and "geoId" if the parameter writeStandardAttribute is false.
        Parameters:
        element - is the XML element to fill.
        container - is the container of attributes.
        builder - is the tool to create XML nodes.
        resources - is the tool that permits to gather the resources.
        writeStandardAttribute - indicates if the attributes "id", "name", "color", and "geoId" should be write or not.
      • readAttributeContainer

        public static void readAttributeContainer​(Element element,
                                                  AttributeCollection container,
                                                  PathBuilder pathBuilder,
                                                  XMLResources resources,
                                                  boolean readStandardAttribute)
                                           throws IOException
        Put the attributes in the given container from the given XML element. This function ignores the attributes with the names "id", "name", "color", and "geoId" if the parameter readStandardAttribute is false.
        Parameters:
        element - is the XML element to fill.
        container - is the container of attributes.
        pathBuilder - is the tool to make paths absolute.
        resources - is the tool that permits to gather the resources.
        readStandardAttribute - indicates if the attributes "id", "name", "color", and "geoId" should be write or not.
        Throws:
        IOException - in case of error.