Klasse SourceElement
java.lang.Object
org.apache.torque.generator.source.SourceElement
- Alle implementierten Schnittstellen:
Serializable
An element in the source graph.
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSourceElement
(String name) Constructor.SourceElement
(SourceElementName sourceElementName) Constructor. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()
Creates a deep copy of this RichSourceelementImpl object.getAttribute
(String name) Returns the object stored in a given attribute.getAttribute
(SourceAttributeName sourceAttributeName) Returns the object stored in a given attribute.Returns the name of all set attributes.Returns the first child of this SourceElement which has the given name.getChild
(SourceElementName sourceElementName) Returns the first child of this SourceElement which has the given name.Returns all children of this SourceElement.getChildren
(String name) Returns all children of this SourceElement which have the given name.getChildren
(SourceElementName sourceElementName) Returns all children of this SourceElement which have the given name.Returns the first child of this source element.getFollowing
(String name) Returns all the following elements after this element with the given name.Returns the following element after this element If this element has no parent, null is returned.Returns the last child of this source element.getName()
Returns the name of this source element.Returns the primary parent of this SourceElement.Returns the list of parents of this SourceElement.getPreceding
(String name) Returns all the preceding elements before this element with the given name.Returns the preceding element after this element.Returns the object stored in the attribute with key null.boolean
graphEquals
(SourceElement toCompare) Checks whether the source element graph of this sourceElement, and its position therein, equals the source element graph and the position of the provided SourceElement.boolean
Returns whether children with the given name exist.boolean
Returns whether a following element exists as a child of the parent of this element.boolean
Returns whether a following element exists as a child of the parent of this element, which has the same name as this source element.boolean
Returns whether an preceding exists as a child of the parent of this element.boolean
Returns whether an preceding exists as a child of the parent of this element, which has the same name as this source element.setAttribute
(String name, Object value) Sets the attribute of a Source element.setAttribute
(SourceAttributeName sourceAttributeName, Object value) Sets the attribute of a Source element.toString()
-
Konstruktordetails
-
SourceElement
Constructor.- Parameter:
name
- the name of the element, not null.- Löst aus:
NullPointerException
- if name is null.
-
SourceElement
Constructor.- Parameter:
sourceElementName
- sourceElementName name of the element, not null.- Löst aus:
NullPointerException
- if sourceElementName is null.
-
-
Methodendetails
-
getName
Returns the name of this source element.- Gibt zurück:
- the name of this source element, never null.
-
getParent
Returns the primary parent of this SourceElement.- Gibt zurück:
- the primary parent of this SourceElement, or null if this is a root element of the source graph.
-
getParents
Returns the list of parents of this SourceElement. Parents can be added and removed via the methods exposed by the returned list.- Gibt zurück:
- the list of parents of this source element, never null.
-
getChildren
Returns all children of this SourceElement. Children can be added and removed via the methods exposed by the returned list.- Gibt zurück:
- the list of children of this source element, never null.
-
getChildren
Returns all children of this SourceElement which have the given name. Modifications on the returned list have no effect on the list of children of this SourceElement.- Parameter:
name
- the name of the children to select, not null.- Gibt zurück:
- the list of children of this source element with the given name, never null.
- Löst aus:
NullPointerException
- if name is null.
-
getChildren
Returns all children of this SourceElement which have the given name. Modifications on the returned list have no effect on the list of children of this SourceElement.- Parameter:
sourceElementName
- contains the name of the child to select, not null.- Gibt zurück:
- the list of children of this source element with the given name, never null.
- Löst aus:
NullPointerException
- if sourceElementName is null.
-
getChild
Returns the first child of this SourceElement which has the given name.- Parameter:
name
- the name of the child to select, not null.- Gibt zurück:
- the first child with the given name, or null if no child with the given name exits.
- Löst aus:
NullPointerException
- if name is null.
-
getChild
Returns the first child of this SourceElement which has the given name.- Parameter:
sourceElementName
- contains the name of the child to select, not null.- Gibt zurück:
- the first child with the given name, or null if no child with the given name exits.
- Löst aus:
NullPointerException
- if sourceElementName is null.
-
hasChild
Returns whether children with the given name exist.- Parameter:
name
- the name of the child element, not null.- Gibt zurück:
- true if children with the given name exist, false otherwise.
- Löst aus:
NullPointerException
- if name is null.
-
getFirstChild
Returns the first child of this source element.- Gibt zurück:
- the first child, or null if this source element has no children.
-
getLastChild
Returns the last child of this source element.- Gibt zurück:
- the last child, or null if this source element has no children.
-
getFollowing
Returns all the following elements after this element with the given name. If name is null, all following elements are returned. If this element has no parent, an empty list is returned.- Parameter:
name
- the name of the following elements to select, or null to select all following elements.- Gibt zurück:
- a list containing the following elements with the given name, never null.
- Siehe auch:
-
getFollowingSourceElement
Returns the following element after this element If this element has no parent, null is returned.- Parameter:
parent
- the parent of this source Element in which child list the following element should be looked for.- Gibt zurück:
- the following source element, or null if no following source element exists.
- Löst aus:
IllegalArgumentException
- if parent is not a parent of this SourceElement.
-
hasFollowing
public boolean hasFollowing()Returns whether a following element exists as a child of the parent of this element.- Gibt zurück:
- true if a following element exists, false if not.
-
hasPreceding
public boolean hasPreceding()Returns whether an preceding exists as a child of the parent of this element.- Gibt zurück:
- true if a preceding element exists, false if not.
-
hasFollowingSibling
public boolean hasFollowingSibling()Returns whether a following element exists as a child of the parent of this element, which has the same name as this source element.- Gibt zurück:
- true if a following sibling exists, false if not.
-
hasPrecedingSibling
public boolean hasPrecedingSibling()Returns whether an preceding exists as a child of the parent of this element, which has the same name as this source element.- Gibt zurück:
- true if a preceding sibling exists, false if not.
-
getPreceding
Returns all the preceding elements before this element with the given name. If name is null, all preceding elements are returned. If this element has no parent, an empty list is returned.- Parameter:
name
- the name of the preceding elements to select, or null to select all preceding elements.- Gibt zurück:
- a list containing the following elements with the given name, never null.
- Siehe auch:
-
getPrecedingSourceElement
Returns the preceding element after this element. If this element has no parent, null is returned.- Parameter:
parent
- the parent of this source Element in which child list the following element should be looked for.- Gibt zurück:
- the preceding source element, or null if no preceding source element exists.
- Löst aus:
IllegalArgumentException
- if parent is not a parent of this SourceElement.
-
getTextAttribute
Returns the object stored in the attribute with key null.- Gibt zurück:
- the stored object, or null if no object is stored under the key null.
-
getAttribute
Returns the object stored in a given attribute.- Parameter:
name
- the name of the attribute, can be null.- Gibt zurück:
- the stored object, or null if no object is stored under that key.
-
getAttribute
Returns the object stored in a given attribute.- Parameter:
sourceAttributeName
- contains the name of the attribute, not null.- Gibt zurück:
- the stored object, or null if no object is stored under that key.
- Löst aus:
NullPointerException
- if sourceAttributeName is null.
-
setAttribute
Sets the attribute of a Source element.- Parameter:
name
- the name of the attribute.value
- the value of the attribute, or null to remove the attribute.- Gibt zurück:
- the previous value of this attribute.
-
setAttribute
Sets the attribute of a Source element.- Parameter:
sourceAttributeName
- contains the name of the attribute, not null.value
- the value of the attribute, or null to remove the attribute.- Gibt zurück:
- the previous value of this attribute.
-
getAttributeNames
Returns the name of all set attributes. Note : null may be contained in the set.- Gibt zurück:
- the name of all set values.
-
copy
Creates a deep copy of this RichSourceelementImpl object. All the elements in the source graph of this Element are copied as well (i.e the copy contains the children, the children's children, ...., the parents, the parent's parents...)- Gibt zurück:
- the copy, not null.
-
graphEquals
Checks whether the source element graph of this sourceElement, and its position therein, equals the source element graph and the position of the provided SourceElement. This is an expensive operation if the graphs are large.- Parameter:
toCompare
- the source element to compare, may be null.- Gibt zurück:
- true if all source elements in the toCompare tree have the equal content as the source elements in this tree.
-
toString
-