Class XmlElementImpl

    • Constructor Detail

      • XmlElementImpl

        XmlElementImpl​(String name)
        package
      • XmlElementImpl

        XmlElementImpl​(String namespaceName,
                       String name)
        package
    • Method Detail

      • getRoot

        public XmlContainer getRoot()
        Description copied from interface: XmlElement
        Get top most container that is either XmlDocument or XmlElement (may be event this element!!!)
        Specified by:
        getRoot in interface XmlElement
      • getParent

        public XmlContainer getParent()
        Description copied from interface: XmlElement
        XML Infoset [parent] property. If current element is not child of containing parent XmlElement or XmlDocument then builder exception will be thrown
        Specified by:
        getParent in interface XmlContained
        Specified by:
        getParent in interface XmlElement
      • getNamespace

        public XmlNamespace getNamespace()
        Description copied from interface: XmlElement
        Return namespace of current element (XML Infoset [namespace name] and [prefix] properties combined) null is only returned if element was created without namespace
        Specified by:
        getNamespace in interface XmlElement
      • getNamespaceName

        public String getNamespaceName()
        Description copied from interface: XmlElement
        Return namespace name (XML Infoset [namespace name]property or null if element has no namespace
        Specified by:
        getNamespaceName in interface XmlElement
      • setNamespace

        public void setNamespace​(XmlNamespace namespace)
        Description copied from interface: XmlElement
        Set namespace ot use for theis element. Note: namespace prefix is always ignored.
        Specified by:
        setNamespace in interface XmlElement
      • getName

        public String getName()
        Description copied from interface: XmlElement
        XML Infoset [local name] property.
        Specified by:
        getName in interface XmlElement
        Returns:
        a String
      • setName

        public void setName​(String name)
        Description copied from interface: XmlElement
        XML Infoset [local name] property.
        Specified by:
        setName in interface XmlElement
        Parameters:
        name - a String
      • getBaseUri

        public String getBaseUri()
        Description copied from interface: XmlElement
        XML Infoset [base URI] property
        Specified by:
        getBaseUri in interface XmlElement
        Returns:
        a String
      • setBaseUri

        public void setBaseUri​(String baseUri)
        Description copied from interface: XmlElement
        XML Infoset [base URI] property
        Specified by:
        setBaseUri in interface XmlElement
        Parameters:
        baseUri - a String
      • attributes

        public Iterator attributes()
        Description copied from interface: XmlElement
        Return Iterator - null is never returned if there is no children then iteraotr over empty collection is returned
        Specified by:
        attributes in interface XmlElement
      • addAttribute

        public XmlAttribute addAttribute​(XmlAttribute attributeValueToAdd)
        Description copied from interface: XmlElement
        Add attribute (adds it to the XML Infoset [namespace attributes] set) Attribute mist
        Specified by:
        addAttribute in interface XmlElement
        Parameters:
        attributeValueToAdd - a XmlAttribute
        Returns:
        a XmlAttribute
      • addAttribute

        public XmlAttribute addAttribute​(String attributeType,
                                         XmlNamespace namespace,
                                         String name,
                                         String value)
        Description copied from interface: XmlElement
        Method addAttribute
        Specified by:
        addAttribute in interface XmlElement
        Parameters:
        attributeType - a String
        namespace - a XmlNamespace
        name - a String
        value - a String
        Returns:
        a XmlAttribute
      • addAttribute

        public XmlAttribute addAttribute​(String attributeType,
                                         XmlNamespace namespace,
                                         String name,
                                         String value,
                                         boolean specified)
        Description copied from interface: XmlElement
        Method addAttribute
        Specified by:
        addAttribute in interface XmlElement
        Parameters:
        attributeType - a String
        namespace - a XmlNamespace
        name - a String
        value - a String
        specified - a boolean
        Returns:
        a XmlAttribute
      • addAttribute

        public XmlAttribute addAttribute​(String attributeType,
                                         String attributePrefix,
                                         String attributeNamespace,
                                         String attributeName,
                                         String attributeValue,
                                         boolean specified)
        Description copied from interface: XmlElement
        Method addAttribute
        Specified by:
        addAttribute in interface XmlElement
        Parameters:
        attributeType - a String
        attributePrefix - a String
        attributeNamespace - a String
        attributeName - a String
        attributeValue - a String
        specified - a boolean
        Returns:
        a XmlAttribute
      • ensureAttributeCapacity

        public void ensureAttributeCapacity​(int minCapacity)
        Description copied from interface: XmlElement
        Method ensureAttributeCapacity
        Specified by:
        ensureAttributeCapacity in interface XmlElement
        Parameters:
        minCapacity - an int
      • getAttributeValue

        public String getAttributeValue​(String attributeNamespaceName,
                                        String attributeName)
        Description copied from interface: XmlElement
        Method getAttributeValue
        Specified by:
        getAttributeValue in interface XmlElement
        attributeName - a String
        Returns:
        a String
      • hasAttributes

        public boolean hasAttributes()
        Description copied from interface: XmlElement
        Method hasAttributes
        Specified by:
        hasAttributes in interface XmlElement
        Returns:
        a boolean
      • attribute

        public XmlAttribute attribute​(String attributeName)
        Description copied from interface: XmlElement
        Find attribute that matches given name or namespace Returns null if not found. Will match only attribute that have no namesapce.
        Specified by:
        attribute in interface XmlElement
      • attribute

        public XmlAttribute attribute​(XmlNamespace attributeNamespace,
                                      String attributeName)
        Description copied from interface: XmlElement
        Find attribute that matches given name or namespace Returns null if not found. NOTE: if namespace is null in this case it will match only attributes that have no namespace.
        Specified by:
        attribute in interface XmlElement
      • findAttribute

        public XmlAttribute findAttribute​(String attributeNamespace,
                                          String attributeName)
        Deprecated.
        Description copied from interface: XmlElement
        Find attribute that matches given name or namespace Returns null if not found. NOTE: if namespace is null in this case it will match only attributes that has no namespace.
        Specified by:
        findAttribute in interface XmlElement
      • declareNamespace

        public XmlNamespace declareNamespace​(String prefix,
                                             String namespaceName)
        Description copied from interface: XmlElement
        Create new namespace with prefix and namespace name (both must be not null) and add it to current element.
        Specified by:
        declareNamespace in interface XmlElement
      • hasNamespaceDeclarations

        public boolean hasNamespaceDeclarations()
        Description copied from interface: XmlElement
        Method hasNamespaceDeclarations
        Specified by:
        hasNamespaceDeclarations in interface XmlElement
        Returns:
        a boolean
      • lookupNamespaceByPrefix

        public XmlNamespace lookupNamespaceByPrefix​(String namespacePrefix)
        Description copied from interface: XmlElement
        Find namespace (will have non empty prefix) corresponding to namespace prefix checking first current elemen and if not found continue in parent (if element has parent) and so on.
        Specified by:
        lookupNamespaceByPrefix in interface XmlElement
      • lookupNamespaceByName

        public XmlNamespace lookupNamespaceByName​(String namespaceName)
        Description copied from interface: XmlElement
        Find namespace (will have non empty prefix) corresponding to namespace name checking first current elemen and if not found continue in parent (if element has parent). and so on.
        Specified by:
        lookupNamespaceByName in interface XmlElement
      • namespaces

        public Iterator namespaces()
        Description copied from interface: XmlElement
        Return Iterator - null is never returned if there is no children then iteraotr over empty collection is returned
        Specified by:
        namespaces in interface XmlElement
      • ensureNamespaceDeclarationsCapacity

        public void ensureNamespaceDeclarationsCapacity​(int minCapacity)
        Description copied from interface: XmlElement
        Method ensureNamespaceDeclarationsCapacity
        Specified by:
        ensureNamespaceDeclarationsCapacity in interface XmlElement
        Parameters:
        minCapacity - an int
      • addChild

        public void addChild​(Object child)
        Description copied from interface: XmlElement
        NOTE: =child added is _not_ checked if it XmlContainer, caller must manually fix parent in child by calling setParent() !!!!
        Specified by:
        addChild in interface XmlElement
      • addChild

        public void addChild​(int index,
                             Object child)
        Description copied from interface: XmlElement
        Method addChild
        Specified by:
        addChild in interface XmlElement
        Parameters:
        index - an int (starting from 0)
        child - an Object
      • addElement

        public XmlElement addElement​(XmlElement element)
        Description copied from interface: XmlElement
        NOTE: the child element must unattached to be added (it is atttached if it is XmlContainer of recognized type and getParent() != null)
        Specified by:
        addElement in interface XmlElement
      • addElement

        public XmlElement addElement​(int pos,
                                     XmlElement element)
        Description copied from interface: XmlElement
        Method addElement
        Specified by:
        addElement in interface XmlElement
        Parameters:
        pos - an int (starting from 0)
        element - a XmlElement
        Returns:
        a XmlElement