|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jtool.jxplatform.wrapper.JxElement
The root element of all Java-XML wrappers.
| Field Summary | |
protected org.w3c.dom.Element |
element
A wrapped DOM element correspoinding to the source code element. |
| Constructor Summary | |
protected |
JxElement()
Creates a new, empty object. |
protected |
JxElement(org.w3c.dom.Element elem)
Creates a new object wrapping an XML element. |
| Method Summary | |
boolean |
equals(JxElement jelem)
Indicates whether a given wrapper is equal to this one. |
protected boolean |
existInTheSameClass(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
Tests if both elements exist in the same class. |
protected boolean |
existInTheSameField(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
Tests if the elements of a given and this wrappers exist in the same field. |
protected boolean |
existInTheSameFile(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
Tests if both elements exist in the same file. |
protected boolean |
existInTheSameMethod(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
Tests if both elements exist in the same method. |
boolean |
existsInTheSameClass(JxElement jelem)
Tests if both elements of a given and this wrappers exist in the same class. |
boolean |
existsInTheSameFile(JxElement jelem)
Tests if both elements of a given and this wrappers exist in the same file. |
boolean |
existsInTheSameMethod(JxElement jelem)
Tests if both elements of a given and this wrappers exist in the same method. |
boolean |
existsInTheSamePackage(JxElement jelem)
Tests if both elements of a given and this wrappers exist in the same package. |
protected org.w3c.dom.Element[] |
getArrayOfElements(java.util.ArrayList nodes)
Converts ArrayList into the array of its elements. |
static org.w3c.dom.Element |
getChildElement(org.w3c.dom.Element elem,
java.lang.String elemName,
int n)
Returns the nth element of a specified kind of children of a given element. |
org.w3c.dom.Element |
getChildElement(java.lang.String elemName,
int n)
Returns the nth element of a specified kind of children of this element. |
static org.w3c.dom.Element[] |
getChildElements(org.w3c.dom.Element elem,
java.lang.String elemName)
Returns an array contains a specified kind of children of a given element. |
org.w3c.dom.Element[] |
getChildElements(java.lang.String elemName)
Returns an array contains a specified kind of children of this element. |
org.w3c.dom.Node[] |
getChildNodes()
Returns an array contains all children of this element. |
static org.w3c.dom.Node[] |
getChildNodes(org.w3c.dom.Element elem)
Returns an array contains all children of a given element. |
org.w3c.dom.Element |
getClassElement()
Returns the Class or Intf element containing this element. |
static org.w3c.dom.Element[] |
getDescendantElements(org.w3c.dom.Element elem,
java.lang.String elemName)
Returns an array contains a specified kind of descendants of a given element. |
static org.w3c.dom.Element[] |
getDescendantElements(org.w3c.dom.Element elem,
java.lang.String elemName,
java.lang.String sort)
Returns an array contains a specified kind of descendants of a given element. |
org.w3c.dom.Element[] |
getDescendantElements(java.lang.String elemName)
Returns an array contains a specified kind of descendants of this element. |
org.w3c.dom.Element[] |
getDescendantElements(java.lang.String elemName,
java.lang.String sort)
Returns an array contains a specified kind of descendants of this element. |
org.w3c.dom.Element |
getElement()
Returns the DOM element wrapped in this wrapper. |
protected static org.w3c.dom.Element |
getElementById(org.w3c.dom.NodeList nl,
java.lang.String defid)
Retrieves the element with the specified identifier among a given node list of DOM elements. |
org.w3c.dom.Element[] |
getExpressionElements()
Returns all Expression elements appendant to this element. |
org.w3c.dom.Element |
getFieldElement()
Returns the Field element containing this element. |
org.w3c.dom.Element |
getFileElement()
Returns the File element containing this element. |
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Element elem,
java.lang.String elemName)
Returns the first element of a specified kind of children of a given element. |
org.w3c.dom.Element |
getFirstChildElement(java.lang.String elemName)
Returns the first element of a specified kind of children of this element. |
java.lang.String |
getId()
Returns the identifier indicating the wrapped element. |
static java.lang.String |
getId(org.w3c.dom.Element elem)
Returns the identifier indicating a given element. |
java.lang.String |
getIdentName()
Returns the name appendant to a given element. |
static java.lang.String |
getIdentName(org.w3c.dom.Element elem)
Returns the name appendant to a given element. |
JxClass |
getJxClass()
Obtains a class wrapper defining this element. |
JxField |
getJxField()
Obtains a field wrapper defining this element. |
JxFile |
getJxFile()
Obtains a file wrapper defining this element. |
JxMethod |
getJxMethod()
Obtains a method wrapper defining this element. |
JxStaticInit |
getJxStaticInit()
Obtains a static initializer wrapper defining this element. |
static java.lang.String |
getKeyword(org.w3c.dom.Element elem)
Returns the keyword appendant to a given element. |
int |
getLine()
Returns the line number where this element exists in the source code. |
org.w3c.dom.Element |
getMethodElement()
Returns the Method or Ctor element containing this element. |
org.w3c.dom.Element |
getStatementElement()
Returns the Stmt element containing this element. |
org.w3c.dom.Element |
getStaticInitElement()
Returns the SInit element containing this element. |
static org.w3c.dom.Element |
getTypeElement(org.w3c.dom.Element elem)
Returns the type element appendant to a given element. |
org.w3c.dom.Element[] |
getTypeElements()
Returns all Type elements appendant to this element. |
java.lang.String |
getTypeName()
Returns the type name appendant to a given element. |
static int |
indexOf(org.w3c.dom.Element elem,
java.lang.String elemName)
Returns the index of the first occurrence of the specified element within the element's children. |
int |
indexOf(java.lang.String elemName)
Returns the index of the first occurrence of the specified element within the element's children. |
static boolean |
isBinary(org.w3c.dom.Element elem)
Tests if a DOM element is contained in a binary class file. |
boolean |
isClass()
Tests if this element equals to Class. |
boolean |
isClassOrInterface()
Tests if this element equals to either Class or Intf. |
boolean |
isConstructor()
Tests if this element equals to Ctor. |
boolean |
isExpression()
Tests if this given element equals to Expr. |
boolean |
isField()
Tests if this element equals to Field. |
boolean |
isFile()
Tests if this element equals to File. |
boolean |
isImport()
Tests if this element equals to Import. |
boolean |
isInterface()
Tests if this element equals to Intf. |
boolean |
isInTheSameField(JxElement jelem)
Tests if the elements of a given and this wrappers exist in the same field. |
boolean |
isLocal()
Tests if this element equals to Local. |
boolean |
isMethod()
Tests if this element equals to Method. |
boolean |
isMethodOrConstructor()
Tests if this element equals to either Method or Ctor. |
boolean |
isPackage()
Tests if this element equals to Package. |
boolean |
isParameter()
Tests if this element equals to Param. |
boolean |
isStatement()
Tests if this element equals to Stmt. |
boolean |
isStaticInit()
Tests if this element equals to SInit. |
boolean |
isTerminalElement(org.w3c.dom.Element elem)
Tests if a given element is terminal one. |
boolean |
isType()
Tests if this element equals to Type. |
java.lang.String |
toString()
Obtains the XML text of element indicated by this wrapper. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected org.w3c.dom.Element element
| Constructor Detail |
protected JxElement()
protected JxElement(org.w3c.dom.Element elem)
elem - A DOM element to be wrapped.| Method Detail |
public org.w3c.dom.Element getElement()
public boolean equals(JxElement jelem)
jelem - A wrapper object.
true if the wrapper is equals to this, otherwise false.public java.lang.String getId()
public static java.lang.String getId(org.w3c.dom.Element elem)
elem - A DOM element.
public java.lang.String getIdentName()
ident element.public static java.lang.String getIdentName(org.w3c.dom.Element elem)
elem - A DOM element.
ident element.public static java.lang.String getKeyword(org.w3c.dom.Element elem)
elem - A DOM element.
kw element.public java.lang.String getTypeName()
Type element.public static org.w3c.dom.Element getTypeElement(org.w3c.dom.Element elem)
elem - A DOM element.
null if there is no such element.public int getLine()
public JxFile getJxFile()
JxFile wrapper defining this element.public JxClass getJxClass()
JxClass wrapper defining this element.public JxMethod getJxMethod()
JxMethod wrapper defining this element.public JxField getJxField()
JxField wrapper defining this element.public JxStaticInit getJxStaticInit()
JxStaticInit wrapper defining this element.public org.w3c.dom.Element getFirstChildElement(java.lang.String elemName)
elemName - The kind of an element to be returned.
null if there is no such element.
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Element elem,
java.lang.String elemName)
elem - An element of the DOM.elemName - The kind of an element to be returned.
null if there is no such element.
public org.w3c.dom.Element getChildElement(java.lang.String elemName,
int n)
nth element of a specified kind of children of this element.
elemName - The kind of an element to be returned.n - The position number of an element to be returned.
nth child element, or null if there is no such element.
public static org.w3c.dom.Element getChildElement(org.w3c.dom.Element elem,
java.lang.String elemName,
int n)
nth element of a specified kind of children of a given element.
elem - An element of the DOM.elemName - The kind of an element to be returned.n - The position number of an element to be returned. The origin is 0.
nth child element, or null if there is no such element.public org.w3c.dom.Node[] getChildNodes()
public static org.w3c.dom.Node[] getChildNodes(org.w3c.dom.Element elem)
elem - An element of the DOM.
public org.w3c.dom.Element[] getChildElements(java.lang.String elemName)
elemName - The kind of an element to be returned.
public static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Element elem,
java.lang.String elemName)
elem - An element of the DOM.elemName - The kind of an element to be returned.
public org.w3c.dom.Element[] getDescendantElements(java.lang.String elemName)
elemName - The kind of an element to be returned.
public static org.w3c.dom.Element[] getDescendantElements(org.w3c.dom.Element elem,
java.lang.String elemName)
elem - An element of the DOM.elemName - The kind of an element to be returned.
public org.w3c.dom.Element[] getDescendantElements(java.lang.String elemName,
java.lang.String sort)
elemName - The kind of an element to be returned.sort - The sort of a source code element corresponding to the element.
public static org.w3c.dom.Element[] getDescendantElements(org.w3c.dom.Element elem,
java.lang.String elemName,
java.lang.String sort)
elem - An element of the DOM.elemName - The kind of an element to be returned.sort - The sort of a source code element corresponding to the element.
public org.w3c.dom.Element[] getTypeElements()
Type elements appendant to this element.
Type elements.public org.w3c.dom.Element[] getExpressionElements()
Expression elements appendant to this element.
Expression elements.public int indexOf(java.lang.String elemName)
elemName - The kind of an element to be checked.
public static int indexOf(org.w3c.dom.Element elem,
java.lang.String elemName)
elem - An element of the DOM.elemName - The kind of an element to be checked.
public boolean isFile()
File.
true if this element equals to File.public boolean isPackage()
Package.
true if this element equals to Package, otherwise false.public boolean isImport()
Import.
true if this element equals to Import, otherwise false.public boolean isClassOrInterface()
Class or Intf.
Class or Intf, otherwise false.public boolean isClass()
Class.
true if this element equals to Class, otherwise false.public boolean isInterface()
Intf.
true if this element equals to Intf, otherwise false.public boolean isStaticInit()
SInit.
true if this element equals to SInit, otherwise false.public boolean isMethodOrConstructor()
Method or Ctor.
true if this element equals to Method or Ctor, otherwise false.public boolean isMethod()
Method.
true if this element equals to Method, otherwise false.public boolean isConstructor()
Ctor.
true if this element equals to Ctor, otherwise false.public boolean isField()
Field.
true if this element equals to Field, otherwise false.public boolean isParameter()
Param.
true if this element equals to Param, otherwise false.public boolean isLocal()
Local.
true if this element equals to Local, otherwise false.public boolean isType()
Type.
true if this element equals to Type, otherwise false.public boolean isStatement()
Stmt.
true if this element equals to Stmt, otherwise false.public boolean isExpression()
Expr.
true if this element equals to Expr, otherwise false.public org.w3c.dom.Element getFileElement()
File element containing this element.
File element,
or null if there is no element found.public org.w3c.dom.Element getClassElement()
Class or Intf element containing this element.
Class or Intf element,
or null if there is no element found.public org.w3c.dom.Element getMethodElement()
Method or Ctor element containing this element.
Method or Ctor element,
or null if there is no element found.public org.w3c.dom.Element getFieldElement()
Field element containing this element.
Field element,
or null if there is no element found.public org.w3c.dom.Element getStaticInitElement()
SInit element containing this element.
SInit element,
or null if there is no element found.public org.w3c.dom.Element getStatementElement()
Stmt element containing this element.
Stmt element,
or null if there is no element found.public boolean existsInTheSamePackage(JxElement jelem)
jelem - A wrapper.
true if the elements exist in the same package.public boolean existsInTheSameFile(JxElement jelem)
jelem - A wrapper.
true if the elements exist in the same file.
protected boolean existInTheSameFile(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
elem1 - An element.elem2 - An element.
true if the elements exist in the same file.public boolean existsInTheSameClass(JxElement jelem)
jelem - A wrapper.
true if the elements exist in the same class.
protected boolean existInTheSameClass(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
elem1 - An element.elem2 - An element.
true if the elements exist in the same class.public boolean existsInTheSameMethod(JxElement jelem)
jelem - A wrapper.
true if the elements exist in the same method.
protected boolean existInTheSameMethod(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
elem1 - An element.elem2 - An element.
true if the elements exist in the same method.public boolean isInTheSameField(JxElement jelem)
jelem - A wrapper.
true if the elements exist in the same field.
protected boolean existInTheSameField(org.w3c.dom.Element elem1,
org.w3c.dom.Element elem2)
elem1 - A wrapper.elem2 - A wrapper.
true if the elements exist in the same field.public boolean isTerminalElement(org.w3c.dom.Element elem)
elem - An element.
true if the element is terminal.protected org.w3c.dom.Element[] getArrayOfElements(java.util.ArrayList nodes)
ArrayList into the array of its elements.
nodes - An object of ArrayList
protected static org.w3c.dom.Element getElementById(org.w3c.dom.NodeList nl,
java.lang.String defid)
nl - The node list of DOM elements.defid - An identifier.
null if there is no element found.public static boolean isBinary(org.w3c.dom.Element elem)
elem - A DOM node to be wrapped.
if - the element is contained in a binary class file.public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||