Class POBNodeBuilder

  • All Implemented Interfaces:

    
    public class POBNodeBuilder
    
                        

    Builder Class containing a Node which is used to build a POBXMLNodeListener model class

    • Constructor Detail

      • POBNodeBuilder

        POBNodeBuilder(Node node)
        Constructor to instantiate the class object with provided argument
        Parameters:
        node - xml node
    • Method Detail

      • getObjectList

        @Nullable() <T extends POBXMLNodeListener> List<T> getObjectList(@NonNull() String path, @NonNull() Class<T> elementType)

        Creates and returns a list of provided class type for provided xPath

        Parameters:
        path - sub-node relative xpath of sub-node from current node
        elementType - class of which instance to be created
        Returns:

        list of provided class type

      • getStringList

        @Nullable() List<String> getStringList(@NonNull() String path)

        Creates and returns a list of node values with provided xPath

        Parameters:
        path - sub-node relative xpath of sub-node from current node
        Returns:

        list of values provided class

      • getNodeValue

        @Nullable() String getNodeValue(@NonNull() String path)

        Returns the value of sub-node

        Parameters:
        path - sub-node relative xpath of sub-node from current node
        Returns:

        xml sub-node value

      • getNode

        @Nullable() Node getNode(@NonNull() String path)

        Retrieves a sub-node at provide xpath and returns it.

        Parameters:
        path - relative xpath of sub-node from current node
        Returns:

        Node based on provided xpath

      • getNodeObject

        @Nullable() <T extends POBXMLNodeListener> T getNodeObject(@NonNull() String path, @NonNull() Class<T> elementType)

        Creates and returns an instance of provided class type for provided xPath

        Parameters:
        path - sub-node relative xpath of sub-node from current node
        elementType - class of which list to be created
        Returns:

        Instance of provided class type

      • getAttributeValue

        @Nullable() String getAttributeValue(@NonNull() String attPath)

        Returns the value of current node attribute for provided attribute name

        Parameters:
        attPath - attribute xpath from current node
        Returns:

        current xml node value