org.jtool.jxplatform.wrapper
Class JxField

java.lang.Object
  extended byorg.jtool.jxplatform.wrapper.JxElement
      extended byorg.jtool.jxplatform.wrapper.JxDefUseExpression
          extended byorg.jtool.jxplatform.wrapper.JxField
Direct Known Subclasses:
JxBinaryField

public class JxField
extends JxDefUseExpression

An object wrapping the Field element.

Author:
Katsuhisa Maruyama

Field Summary
protected  java.lang.String fqn
          The fully-qualified type name of this field.
protected  JxVariable jvariable
          The variable declared in this field declaration.
protected  org.w3c.dom.Element[] mcallElems
          Elements of method calls within in this fields.
protected  java.lang.String name
          The name of this field.
protected  java.lang.String type
          The type of this field.
protected  org.w3c.dom.Element[] vaccessElems
          Elements of variable accesses within in this field.
 
Fields inherited from class org.jtool.jxplatform.wrapper.JxDefUseExpression
defs, expressions, uses
 
Fields inherited from class org.jtool.jxplatform.wrapper.JxElement
element
 
Constructor Summary
protected JxField()
          Creates a new, empty object.
protected JxField(org.w3c.dom.Element elem)
          Creates a new object wrapping a Field element.
 
Method Summary
 boolean enclose(org.w3c.dom.Element elem)
          Tests if this field element encloses a given element.
 boolean equals(JxField jfield)
          Tests if a given field wrapper equals to this one.
 java.lang.String getAccess()
          Returns the access setting for this field.
 org.w3c.dom.Element[] getAllMethodCallElements()
          Returns the elements of method calls contained in this method.
 org.w3c.dom.Element[] getAllVariableAccessElements()
          Returns the elements of variable accesses contained in this static inotializer.
 JxField getDeclarativeField()
          Returns the field with its type among the fields sharing the same type-declaration.
static org.w3c.dom.Element getFieldElement(org.w3c.dom.Element elem)
          Returns the Field element containing a given element.
 JxClass getJxClass()
          Obtains a class wrapper defining this field.
 JxVariable getJxVariable()
          Returns the variable wrapper declared in this field.
 java.lang.String getModifier()
          Returns modifiers of this method.
 java.lang.String getName()
          Returns the name if this field.
 org.w3c.dom.Element getNameNode()
          Returns the name element of this field.
 int getNumOfDeclaredFields()
          Returns the number of the fields sharing the same type-declaration.
 java.lang.String getTypeFqn()
          Returns the fully qualified name of the type of this field.
 java.lang.String getTypeName()
          Returns the name of the type of this field.
 boolean hasInitialValue()
          Test if the value of the varibale in this field declaration is given.
 boolean isDefault()
          Test if the access setting of this field is default.
static boolean isField(org.w3c.dom.Element elem)
          Tests if a given element equals to Field.
 boolean isFinal()
          Test if this field is final.
 boolean isOmitted()
          Test if the type of the declared field is ommited.
 boolean isPrivate()
          Test if the access setting of this field is private.
 boolean isProtected()
          Test if the access setting of this field is protected.
 boolean isPublic()
          Test if the access setting of this field is public.
 boolean isStatic()
          Test if this field is static.
 boolean isTransient()
          Test if this field is volatile.
 boolean isVolatile()
          Test if this field is volatile.
 void print()
          Displays information about this field wrapper for debugging.
 
Methods inherited from class org.jtool.jxplatform.wrapper.JxDefUseExpression
addDefinedVariable, addDefinedVariableFirst, addUsedVariable, addUsedVariableFirst, clearDefinedVariable, clearUsedVariable, definesVariable, equals, getDefinedVariables, getExpressions, getUsedVariables, removeDefinedVariable, removeUsedVariable, usesVariable
 
Methods inherited from class org.jtool.jxplatform.wrapper.JxElement
equals, existInTheSameClass, existInTheSameField, existInTheSameFile, existInTheSameMethod, existsInTheSameClass, existsInTheSameFile, existsInTheSameMethod, existsInTheSamePackage, getArrayOfElements, getChildElement, getChildElement, getChildElements, getChildElements, getChildNodes, getChildNodes, getClassElement, getDescendantElements, getDescendantElements, getDescendantElements, getDescendantElements, getElement, getElementById, getExpressionElements, getFieldElement, getFileElement, getFirstChildElement, getFirstChildElement, getId, getId, getIdentName, getIdentName, getJxField, getJxFile, getJxMethod, getJxStaticInit, getKeyword, getLine, getMethodElement, getStatementElement, getStaticInitElement, getTypeElement, getTypeElements, indexOf, indexOf, isBinary, isClass, isClassOrInterface, isConstructor, isExpression, isField, isFile, isImport, isInterface, isInTheSameField, isLocal, isMethod, isMethodOrConstructor, isPackage, isParameter, isStatement, isStaticInit, isTerminalElement, isType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name of this field.


fqn

protected java.lang.String fqn
The fully-qualified type name of this field.


type

protected java.lang.String type
The type of this field.


jvariable

protected JxVariable jvariable
The variable declared in this field declaration.


mcallElems

protected org.w3c.dom.Element[] mcallElems
Elements of method calls within in this fields.


vaccessElems

protected org.w3c.dom.Element[] vaccessElems
Elements of variable accesses within in this field.

Constructor Detail

JxField

protected JxField()
Creates a new, empty object.


JxField

protected JxField(org.w3c.dom.Element elem)
           throws JxWrapperException
Creates a new object wrapping a Field element.

Parameters:
elem - An DOM element to be wrapped.
Throws:
JxWrapperException - if the specified element is not valid.
Method Detail

getName

public java.lang.String getName()
Returns the name if this field.

Returns:
The name string.

getNameNode

public org.w3c.dom.Element getNameNode()
Returns the name element of this field.

Returns:
The element indicating the filed name.

getTypeFqn

public java.lang.String getTypeFqn()
Returns the fully qualified name of the type of this field.

Returns:
The fully-qualified name string.

getTypeName

public java.lang.String getTypeName()
Returns the name of the type of this field.

Overrides:
getTypeName in class JxElement
Returns:
The return type string.

getJxVariable

public JxVariable getJxVariable()
Returns the variable wrapper declared in this field.

Returns:
The JavaVariable wrapper declared in this field.

getAccess

public java.lang.String getAccess()
Returns the access setting for this field.

Returns:
The string of the access setting (Public, Protected, Private, or Default).

getJxClass

public JxClass getJxClass()
Obtains a class wrapper defining this field.

Overrides:
getJxClass in class JxElement
Returns:
The JavaClass wrapper defining this field.

isField

public static boolean isField(org.w3c.dom.Element elem)
Tests if a given element equals to Field.

Parameters:
elem - An element of the DOM.
Returns:
if the element equals to Field.

getFieldElement

public static org.w3c.dom.Element getFieldElement(org.w3c.dom.Element elem)
Returns the Field element containing a given element.

Parameters:
elem - An element of the DOM.
Returns:
The Field element, or null if thereis no such element.

equals

public boolean equals(JxField jfield)
Tests if a given field wrapper equals to this one.

Parameters:
jfield - A field wrapper.
Returns:
true if the field wrapper equals to this one, otherwise false.

enclose

public boolean enclose(org.w3c.dom.Element elem)
Tests if this field element encloses a given element.

Parameters:
elem - An element of the DOM.
Returns:
true if this element encloses the element.

isPublic

public boolean isPublic()
Test if the access setting of this field is public.

Returns:
true if this field is public.

isProtected

public boolean isProtected()
Test if the access setting of this field is protected.

Returns:
true if this field is protected.

isPrivate

public boolean isPrivate()
Test if the access setting of this field is private.

Returns:
true if this field is private.

isDefault

public boolean isDefault()
Test if the access setting of this field is default.

Returns:
true if this field has no specified access setting.

isFinal

public boolean isFinal()
Test if this field is final.

Returns:
true if this field is final.

isStatic

public boolean isStatic()
Test if this field is static.

Returns:
true if this field is static.

isVolatile

public boolean isVolatile()
Test if this field is volatile.

Returns:
true if this field is volatile.

isTransient

public boolean isTransient()
Test if this field is volatile.

Returns:
true if this field is volatile.

isOmitted

public boolean isOmitted()
Test if the type of the declared field is ommited.

Returns:
true if the type is omitted.

hasInitialValue

public boolean hasInitialValue()
Test if the value of the varibale in this field declaration is given.

Returns:
true if this field declaration has initial value.

getModifier

public java.lang.String getModifier()
Returns modifiers of this method.

Returns:
The canonical string of modifiers.

getAllMethodCallElements

public org.w3c.dom.Element[] getAllMethodCallElements()
Returns the elements of method calls contained in this method.

Returns:
The elements of method calls.

getAllVariableAccessElements

public org.w3c.dom.Element[] getAllVariableAccessElements()
Returns the elements of variable accesses contained in this static inotializer.

Returns:
The elememts of variable accesses.

getNumOfDeclaredFields

public int getNumOfDeclaredFields()
Returns the number of the fields sharing the same type-declaration.

Returns:
The number of the declared fields.

getDeclarativeField

public JxField getDeclarativeField()
                            throws JxWrapperException
Returns the field with its type among the fields sharing the same type-declaration.

Returns:
The field with its declarative type.
Throws:
JxWrapperException - if no declarative field was found.

print

public void print()
Displays information about this field wrapper for debugging.

Overrides:
print in class JxDefUseExpression