Class SpinXmlNode<T extends SpinXmlNode<?>>

  • Direct Known Subclasses:
    SpinXmlAttribute, SpinXmlElement

    public abstract class SpinXmlNode<T extends SpinXmlNode<?>>
    extends Spin<T>
    An element in a tree-oriented XML data format.
    Author:
    Sebastian Menski, Daniel Meyer
    • Constructor Summary

      Constructors 
      Constructor Description
      SpinXmlNode()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract boolean hasNamespace​(java.lang.String namespace)
      Checks if the node has a given namespace.
      abstract boolean hasPrefix​(java.lang.String prefix)
      Checks if the node has a given prefix.
      abstract <C> C mapTo​(java.lang.Class<C> type)
      Maps XML into specific class
      abstract <C> C mapTo​(java.lang.String canonicalName)
      Maps Xml into specific class
      abstract java.lang.String name()
      Returns the local name of the node without namespace or prefix.
      abstract java.lang.String namespace()
      Returns the namespace uri of the node and not the prefix.
      abstract java.lang.String prefix()
      Returns the prefix of the node and not the namespace uri.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SpinXmlNode

        public SpinXmlNode()
    • Method Detail

      • name

        public abstract java.lang.String name()
        Returns the local name of the node without namespace or prefix.
        Returns:
        the name of the node
      • namespace

        public abstract java.lang.String namespace()
        Returns the namespace uri of the node and not the prefix.
        Returns:
        the namespace of the node
      • prefix

        public abstract java.lang.String prefix()
        Returns the prefix of the node and not the namespace uri.
        Returns:
        the prefix of the node
      • hasPrefix

        public abstract boolean hasPrefix​(java.lang.String prefix)
        Checks if the node has a given prefix.
        Parameters:
        prefix - the prefix to check
        Returns:
        true if the name has the same prefix
      • hasNamespace

        public abstract boolean hasNamespace​(java.lang.String namespace)
        Checks if the node has a given namespace.
        Parameters:
        namespace - the namespace to check
        Returns:
        true if the node has the same namespace
      • mapTo

        public abstract <C> C mapTo​(java.lang.Class<C> type)
        Maps XML into specific class
        Specified by:
        mapTo in class Spin<T extends SpinXmlNode<?>>
        Parameters:
        type - Class to which the Xml should be mapped
        Returns:
        mapped Class
        Throws:
        SpinDataFormatException - in case the input cannot be mapped to class for several reasons
      • mapTo

        public abstract <C> C mapTo​(java.lang.String canonicalName)
        Maps Xml into specific class
        Specified by:
        mapTo in class Spin<T extends SpinXmlNode<?>>
        Parameters:
        canonicalName - canonical name of the class
        Returns:
        mapped class
        Throws:
        SpinDataFormatException - in case the input cannot be mapped to class for several reasons