Class ColladaLibrary<T>

  • All Implemented Interfaces:
    XMLEventParser

    public class ColladaLibrary<T>
    extends ColladaAbstractObject
    Represents the COLLADA Library element and provides access to its contents. This class can be used for any library element (library_nodes, library_effects, etc.) by specifying a generic parameter that defines the parser for the elements in the library. For example new ColladaLibrary<ColladaNode>(ns) creates a library of ColladaNodes.
    • Field Detail

      • elementName

        protected java.lang.String elementName
        Local name of the elements in the library. This is determined from the name of the library element. For example, if the library element is "library_nodes" then the element name is "node".
      • elements

        protected java.util.List<T> elements
        Elements in the library.
    • Constructor Detail

      • ColladaLibrary

        public ColladaLibrary​(java.lang.String ns)
        Construct an instance.
        Parameters:
        ns - the qualifying namespace URI. May be null to indicate no namespace qualification.
    • Method Detail

      • getElements

        public java.util.List<T> getElements()
        Indicates the elements in the library.
        Returns:
        Elements in the library. Returns an empty list if the library is empty.
      • parse

        public java.lang.Object parse​(XMLEventParserContext context,
                                      javax.xml.stream.events.XMLEvent event,
                                      java.lang.Object... args)
                               throws javax.xml.stream.XMLStreamException
        Parse the event and initialize the parser's values to those found in the event.
        Specified by:
        parse in interface XMLEventParser
        Overrides:
        parse in class AbstractXMLEventParser
        Parameters:
        context - a current parser context.
        event - the event to parse.
        args - an optional list of arguments that may by used by subclasses.
        Returns:
        if parsing is successful, returns this, otherwise returns null.
        Throws:
        javax.xml.stream.XMLStreamException - if an exception occurs during event-stream reading.
      • getElementName

        protected java.lang.String getElementName​(java.lang.String libraryName)