Class AbstractNode
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractNode
-
- All Implemented Interfaces:
javax.xml.transform.Source,javax.xml.transform.SourceLocator,net.sf.saxon.lib.ActiveSource,net.sf.saxon.om.GroundedValue,net.sf.saxon.om.Item,net.sf.saxon.om.NodeInfo,net.sf.saxon.om.Sequence,net.sf.saxon.s9api.Location,org.xml.sax.Locator
- Direct Known Subclasses:
AttributeNode,ElementNode,RootNode
public abstract class AbstractNode extends java.lang.Object implements net.sf.saxon.om.NodeInfo
Represents general class forElementNode,RootNodeandAttributeNode.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AbstractNode>childrenThe children.private net.sf.saxon.om.TreeInfotreeInfoTheTreeInfoobject.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNode(net.sf.saxon.om.TreeInfo treeInfo)Constructor of the abstract classAbstractNode.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description net.sf.saxon.om.AtomicSequenceatomize()Returns AtomicSequence.voidcopy(net.sf.saxon.event.Receiver receiver, int index, net.sf.saxon.s9api.Location location)Copy method.protected abstract java.util.List<AbstractNode>createChildren()Creates nodes for children.private static java.lang.UnsupportedOperationExceptioncreateUnsupportedOperationException()Returns UnsupportedOperationException exception.voidgenerateId(java.lang.StringBuilder buffer)Generate id method.net.sf.saxon.om.NamespaceMapgetAllNamespaces()Returns namespace array.java.lang.StringgetBaseURI()Returns base uri.protected java.util.List<AbstractNode>getChildren()Getter method for children.net.sf.saxon.ConfigurationgetConfiguration()Returns configuration.net.sf.saxon.om.NamespaceBinding[]getDeclaredNamespaces(net.sf.saxon.om.NamespaceBinding[] namespaceBindings)Returns namespace array.abstract intgetDepth()Getter method for node depth.java.lang.StringgetDisplayName()Returns display name.intgetFingerprint()Returns fingerprint.java.lang.StringgetPrefix()Returns prefix.java.lang.StringgetPublicId()Returns public id.net.sf.saxon.type.SchemaTypegetSchemaType()Returns type of the schema.java.lang.StringgetStringValue()Returns string value.java.lang.StringgetSystemId()Returns system id.abstract intgetTokenType()Getter method for token type.net.sf.saxon.om.TreeInfogetTreeInfo()Returns tree info.abstract DetailASTgetUnderlyingNode()Returns underlying node.net.sf.saxon.str.UnicodeStringgetUnicodeStringValue()Returns the value of the item as a Unicode string.java.lang.StringgetURI()Returns uri of the namespace for the current node.booleanhasFingerprint()Returns if implementation provides fingerprints.booleanisId()Returns boolean.booleanisIdref()Returns boolean.booleanisNilled()Returns boolean.booleanisSameNodeInfo(net.sf.saxon.om.NodeInfo nodeInfo)Returns true if nodes are same, false otherwise.booleanisStreamed()Returns boolean.net.sf.saxon.tree.iter.AxisIteratoriterateAxis(int axisNumber, net.sf.saxon.pattern.NodePredicate nodeTest)Determines axis iteration algorithm.net.sf.saxon.s9api.LocationsaveLocation()Returns location.voidsetSystemId(java.lang.String systemId)Sets system id.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, itemAt, iterate, reduce, subsequence
-
-
-
-
Field Detail
-
treeInfo
private final net.sf.saxon.om.TreeInfo treeInfo
TheTreeInfoobject.
-
children
private java.util.List<AbstractNode> children
The children.
-
-
Constructor Detail
-
AbstractNode
protected AbstractNode(net.sf.saxon.om.TreeInfo treeInfo)
Constructor of the abstract classAbstractNode.- Parameters:
treeInfo-TreeInfoobject
-
-
Method Detail
-
getTokenType
public abstract int getTokenType()
Getter method for token type.- Returns:
- token type
-
getUnderlyingNode
public abstract DetailAST getUnderlyingNode()
Returns underlying node.- Returns:
- underlying node
-
getDepth
public abstract int getDepth()
Getter method for node depth.- Returns:
- depth
-
createChildren
protected abstract java.util.List<AbstractNode> createChildren()
Creates nodes for children.- Returns:
- children list
-
getChildren
protected java.util.List<AbstractNode> getChildren()
Getter method for children.- Returns:
- children list
-
isSameNodeInfo
public boolean isSameNodeInfo(net.sf.saxon.om.NodeInfo nodeInfo)
Returns true if nodes are same, false otherwise.- Specified by:
isSameNodeInfoin interfacenet.sf.saxon.om.NodeInfo- Parameters:
nodeInfo- other node- Returns:
TreeInfo
-
hasFingerprint
public boolean hasFingerprint()
Returns if implementation provides fingerprints.- Specified by:
hasFingerprintin interfacenet.sf.saxon.om.NodeInfo- Returns:
boolean
-
getURI
public java.lang.String getURI()
Returns uri of the namespace for the current node.- Specified by:
getURIin interfacenet.sf.saxon.om.NodeInfo- Returns:
- uri
-
iterateAxis
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(int axisNumber, net.sf.saxon.pattern.NodePredicate nodeTest)
Determines axis iteration algorithm.- Specified by:
iterateAxisin interfacenet.sf.saxon.om.NodeInfo- Parameters:
axisNumber- element fromAxisInfonodeTest- filter for iterator- Returns:
AxisIteratorobject
-
getTreeInfo
public final net.sf.saxon.om.TreeInfo getTreeInfo()
Returns tree info.- Specified by:
getTreeInfoin interfacenet.sf.saxon.om.NodeInfo- Returns:
- tree info
-
getStringValue
public java.lang.String getStringValue()
Returns string value. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getStringValuein interfacenet.sf.saxon.om.GroundedValue- Specified by:
getStringValuein interfacenet.sf.saxon.om.Item- Returns:
- string value
-
getDeclaredNamespaces
public final net.sf.saxon.om.NamespaceBinding[] getDeclaredNamespaces(net.sf.saxon.om.NamespaceBinding[] namespaceBindings)
Returns namespace array. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getDeclaredNamespacesin interfacenet.sf.saxon.om.NodeInfo- Parameters:
namespaceBindings- namespace array- Returns:
- namespace array
-
getAllNamespaces
public net.sf.saxon.om.NamespaceMap getAllNamespaces()
Returns namespace array. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getAllNamespacesin interfacenet.sf.saxon.om.NodeInfo- Returns:
- namespace map
-
isId
public final boolean isId()
Returns boolean. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
isIdin interfacenet.sf.saxon.om.NodeInfo- Returns:
- boolean
-
isIdref
public final boolean isIdref()
Returns boolean. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
isIdrefin interfacenet.sf.saxon.om.NodeInfo- Returns:
- boolean
-
isNilled
public final boolean isNilled()
Returns boolean. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
isNilledin interfacenet.sf.saxon.om.NodeInfo- Returns:
- boolean
-
isStreamed
public final boolean isStreamed()
Returns boolean. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
isStreamedin interfacenet.sf.saxon.om.Item- Specified by:
isStreamedin interfacenet.sf.saxon.om.NodeInfo- Returns:
- boolean
-
getConfiguration
public final net.sf.saxon.Configuration getConfiguration()
Returns configuration. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getConfigurationin interfacenet.sf.saxon.om.NodeInfo- Returns:
- configuration
-
setSystemId
public final void setSystemId(java.lang.String systemId)
Sets system id. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
setSystemIdin interfacenet.sf.saxon.om.NodeInfo- Specified by:
setSystemIdin interfacejavax.xml.transform.Source- Parameters:
systemId- system id
-
getSystemId
public final java.lang.String getSystemId()
Returns system id. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getSystemIdin interfacenet.sf.saxon.s9api.Location- Specified by:
getSystemIdin interfaceorg.xml.sax.Locator- Specified by:
getSystemIdin interfacenet.sf.saxon.om.NodeInfo- Specified by:
getSystemIdin interfacejavax.xml.transform.Source- Specified by:
getSystemIdin interfacejavax.xml.transform.SourceLocator- Returns:
- system id
-
getPublicId
public final java.lang.String getPublicId()
Returns public id. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getPublicIdin interfacenet.sf.saxon.s9api.Location- Specified by:
getPublicIdin interfaceorg.xml.sax.Locator- Specified by:
getPublicIdin interfacenet.sf.saxon.om.NodeInfo- Specified by:
getPublicIdin interfacejavax.xml.transform.SourceLocator- Returns:
- public id
-
getBaseURI
public final java.lang.String getBaseURI()
Returns base uri. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getBaseURIin interfacenet.sf.saxon.om.NodeInfo- Returns:
- base uri
-
saveLocation
public final net.sf.saxon.s9api.Location saveLocation()
Returns location. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
saveLocationin interfacenet.sf.saxon.s9api.Location- Returns:
- location
-
getUnicodeStringValue
public final net.sf.saxon.str.UnicodeString getUnicodeStringValue()
Returns the value of the item as a Unicode string. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getUnicodeStringValuein interfacenet.sf.saxon.om.GroundedValue- Specified by:
getUnicodeStringValuein interfacenet.sf.saxon.om.Item- Returns:
- CharSequence string value
-
getFingerprint
public final int getFingerprint()
Returns fingerprint. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getFingerprintin interfacenet.sf.saxon.om.NodeInfo- Returns:
- fingerprint
-
getDisplayName
public final java.lang.String getDisplayName()
Returns display name. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getDisplayNamein interfacenet.sf.saxon.om.NodeInfo- Returns:
- display name
-
getPrefix
public final java.lang.String getPrefix()
Returns prefix. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getPrefixin interfacenet.sf.saxon.om.NodeInfo- Returns:
- prefix
-
getSchemaType
public final net.sf.saxon.type.SchemaType getSchemaType()
Returns type of the schema. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
getSchemaTypein interfacenet.sf.saxon.om.NodeInfo- Returns:
- type of the schema
-
atomize
public final net.sf.saxon.om.AtomicSequence atomize()
Returns AtomicSequence. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
atomizein interfacenet.sf.saxon.om.Item- Specified by:
atomizein interfacenet.sf.saxon.om.NodeInfo- Returns:
- AtomicSequence
-
generateId
public final void generateId(java.lang.StringBuilder buffer)
Generate id method. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
generateIdin interfacenet.sf.saxon.om.NodeInfo- Parameters:
buffer- buffer
-
copy
public final void copy(net.sf.saxon.event.Receiver receiver, int index, net.sf.saxon.s9api.Location location)
Copy method. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
copyin interfacenet.sf.saxon.om.NodeInfo- Parameters:
receiver- receiverindex- indexlocation- location
-
createUnsupportedOperationException
private static java.lang.UnsupportedOperationException createUnsupportedOperationException()
Returns UnsupportedOperationException exception. Methods which throws this exception are not supported for all nodes.- Returns:
- UnsupportedOperationException exception
-
-