Class POBNodeBuilder
-
- All Implemented Interfaces:
public class POBNodeBuilderBuilder Class containing a Node which is used to build a POBXMLNodeListener model class
-
-
Constructor Summary
Constructors Constructor Description POBNodeBuilder(Node node)Constructor to instantiate the class object with provided argument
-
Method Summary
Modifier and Type Method Description StringgetNodeName()Returns the name of current node StringgetNodeValue()Returns the value of current node <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 List<String>getStringList(@NonNull() String path)Creates and returns a list of node values with provided xPath StringgetNodeValue(@NonNull() String path)Returns the value of sub-node NodegetNode(@NonNull() String path)Retrieves a sub-node at provide xpath and returns it. <T extends POBXMLNodeListener> TgetNodeObject(@NonNull() String path, @NonNull() Class<T> elementType)Creates and returns an instance of provided class type for provided xPath StringgetAttributeValue(@NonNull() String attPath)Returns the value of current node attribute for provided attribute name -
-
Constructor Detail
-
POBNodeBuilder
POBNodeBuilder(Node node)
Constructor to instantiate the class object with provided argument- Parameters:
node- xml node
-
-
Method Detail
-
getNodeName
@Nullable() String getNodeName()
Returns the name of current node
- Returns:
current xml node name
-
getNodeValue
@Nullable() String getNodeValue()
Returns the value of current node
- Returns:
current xml node value
-
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 nodeelementType- 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 nodeelementType- 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
-
-
-
-