Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
attributes
The attributes.
|
protected List<XMLNode> |
children
The children nodes.
|
protected String |
name
The node name.
|
protected XMLNode |
nodeParent
The node parent.
|
Constructor and Description |
---|
XMLNode(String nodeName)
Create the Node.
|
XMLNode(XMLNode parent,
String nodeName)
Create a Node.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String attrName,
boolean value)
Add an attribute for this Node.
|
void |
addAttribute(String attrName,
float value)
Add an attribute for this Node.
|
void |
addAttribute(String attrName,
int value)
Add an attribute for this Node.
|
void |
addAttribute(String attrName,
String value)
Add an attribute for this Node.
|
void |
addChild(XMLNode child)
Add a child to this Node.
|
int |
countAttributes()
Return the number of attributes of the Node.
|
int |
countChildren()
Return the number of children of the Node.
|
boolean |
equals(Object obj) |
Map<String,String> |
getAttributes()
Return the Map of attributes for this node.
|
String |
getAttributeValue(String attrName)
Return the value of an attribute of a specified name.
|
boolean |
getAttributeValueAsBoolean(String attrName)
Return the value of an attribute of a specified name as a boolean.
|
boolean |
getAttributeValueAsBoolean(String attrName,
boolean defaultValue)
Return the value of an attribute of a specified name as a boolean.
|
float |
getAttributeValueAsFloat(String attrName)
Return the value of an attribute of a specified name as a float.
|
float |
getAttributeValueAsFloat(String attrName,
float defaultValue)
Return the value of an attribute of a specified name as a float.
|
int |
getAttributeValueAsInt(String attrName)
Return the value of an attribute of a specified name as an int.
|
int |
getAttributeValueAsInt(String attrName,
int defaultValue)
Return the value of an attribute of a specified name as an int.
|
String |
getCDATA()
Return the CDATA content for the node.
|
List<XMLNode> |
getChildren()
Return the ordered list of children of this Node.
|
double |
getDoubleValue(String attrName)
Return the value of an attribute of a specified name as a double.
|
double |
getDoubleValue(String attrName,
double defaultValue)
Return the value of an attribute of a specified name as a double.
|
XMLNode |
getFirstChild()
Return the first child of the Node.
|
XMLNode |
getLastChild()
Return the last child of the Node.
|
double |
getLengthValue(String attrName,
boolean isWidth,
javafx.geometry.Bounds bounds,
Viewport viewport)
Return the value of an attribute of a specified name as a double.
|
double |
getLengthValue(String attrName,
boolean isWidth,
javafx.geometry.Bounds bounds,
Viewport viewport,
double defaultValue)
Return the value of a length attribute of a specified name as a double.
|
double |
getLengthValue(String attrName,
boolean isWidth,
Viewport viewport)
Return the value of an attribute of a specified name as a double.
|
double |
getLengthValue(String attrName,
Viewport viewport)
Return the value of an attribute of a specified name as a double.
|
double |
getLengthValue(String attrName,
Viewport viewport,
double defaultValue)
Return the value of an attribute of a specified name as a double.
|
double |
getLineWidthValue(String attrName,
Viewport viewport,
double defaultValue)
Return the value of an lirn width of a specified name as a double.
|
String |
getName()
Return the Node name.
|
XMLNode |
getNextSibling()
Return the next sibling of the Node.
|
XMLNode |
getParent()
Return the Node parent (or null if the Node is the root of the XML File).
|
double |
getPositionValue(String attrName,
boolean isWidth,
javafx.geometry.Bounds bounds,
Viewport viewport)
Return the value of an attribute of a specified name as a double.
|
double |
getPositionValue(String attrName,
boolean isWidth,
javafx.geometry.Bounds bounds,
Viewport viewport,
double defaultValue)
Return the value of a position attribute of a specified name as a double.
|
double |
getPositionValue(String attrName,
boolean isWidth,
Viewport viewport)
Return the value of an attribute of a specified name as a double.
|
XMLNode |
getPreviousSibling()
Return the previous sibling of the Node.
|
boolean |
hasAttribute(String attrName)
Return true if the Node has an attribute of a specified name.
|
boolean |
hasCDATA()
Return true if there is a the CDATA content for the node.
|
boolean |
hasChildren()
Return true if this Node has children.
|
int |
hashCode() |
void |
setCDATA(String cData)
Set the CDATA content for the node.
|
String |
toString() |
protected String name
protected XMLNode nodeParent
public XMLNode(String nodeName)
nodeName
- the Node namepublic XMLNode getParent()
public String getName()
public List<XMLNode> getChildren()
public XMLNode getFirstChild()
public XMLNode getLastChild()
public XMLNode getNextSibling()
public XMLNode getPreviousSibling()
public void addChild(XMLNode child)
child
- the Node childpublic boolean hasChildren()
public int countChildren()
public int countAttributes()
public Map<String,String> getAttributes()
public String getAttributeValue(String attrName)
attrName
- the attribute namepublic boolean getAttributeValueAsBoolean(String attrName)
attrName
- the attribute namepublic boolean getAttributeValueAsBoolean(String attrName, boolean defaultValue)
attrName
- the attribute namedefaultValue
- the default valuepublic float getAttributeValueAsFloat(String attrName)
attrName
- the attribute namepublic float getAttributeValueAsFloat(String attrName, float defaultValue)
attrName
- the attribute namedefaultValue
- the default valuepublic double getDoubleValue(String attrName)
attrName
- the attribute namepublic double getDoubleValue(String attrName, double defaultValue)
attrName
- the attribute namedefaultValue
- the default valuepublic double getLengthValue(String attrName, Viewport viewport)
attrName
- the attribute nameviewport
- the viewportpublic double getPositionValue(String attrName, boolean isWidth, Viewport viewport)
attrName
- the attribute nameisWidth
- true for a width lengthviewport
- the viewportpublic double getPositionValue(String attrName, boolean isWidth, javafx.geometry.Bounds bounds, Viewport viewport)
attrName
- the attribute nameisWidth
- true for a width lengthbounds
- the optional bounds of the figure for which it is relative toviewport
- the viewportpublic double getLengthValue(String attrName, boolean isWidth, Viewport viewport)
attrName
- the attribute nameisWidth
- true for a width lengthviewport
- the viewportpublic double getLengthValue(String attrName, boolean isWidth, javafx.geometry.Bounds bounds, Viewport viewport)
attrName
- the attribute nameisWidth
- true for a width lengthbounds
- the optional bounds of the figure for which it is relative toviewport
- the viewportpublic double getLengthValue(String attrName, Viewport viewport, double defaultValue)
attrName
- the attribute nameviewport
- the viewportdefaultValue
- the default valuepublic double getLineWidthValue(String attrName, Viewport viewport, double defaultValue)
attrName
- the attribute nameviewport
- the viewportdefaultValue
- the default valuepublic double getLengthValue(String attrName, boolean isWidth, javafx.geometry.Bounds bounds, Viewport viewport, double defaultValue)
attrName
- the attribute nameisWidth
- true for a width lengthbounds
- the optional bounds of the figure for which it is relative toviewport
- the viewportdefaultValue
- the default valuepublic double getPositionValue(String attrName, boolean isWidth, javafx.geometry.Bounds bounds, Viewport viewport, double defaultValue)
attrName
- the attribute nameisWidth
- true for a width lengthbounds
- the Bounds
of the objectBoundingBox or nullviewport
- the viewportdefaultValue
- the default valuepublic int getAttributeValueAsInt(String attrName)
attrName
- the attribute namepublic int getAttributeValueAsInt(String attrName, int defaultValue)
attrName
- the attribute namedefaultValue
- the default valuepublic void addAttribute(String attrName, int value)
attrName
- the attribute namevalue
- the attribute valuepublic void addAttribute(String attrName, String value)
attrName
- the attribute namevalue
- the attribute valuepublic void addAttribute(String attrName, float value)
attrName
- the attribute namevalue
- the attribute valuepublic void addAttribute(String attrName, boolean value)
attrName
- the attribute namevalue
- the attribute valuepublic void setCDATA(String cData)
cData
- the CDATA contentpublic String getCDATA()
public boolean hasCDATA()
public boolean hasAttribute(String attrName)
attrName
- the attribute nameCopyright © 2023. All rights reserved.