com.jeffpalm.javaparser
Class AccessNode

java.lang.Object
  extended by com.jeffpalm.javaparser.SimpleNode
      extended by com.jeffpalm.javaparser.AccessNode
All Implemented Interfaces:
ModifierHolder, Node
Direct Known Subclasses:
ASTAnnotationMethodDeclaration, ASTAnnotationTypeDeclaration, ASTAnnotationTypeMemberDeclaration, ASTClassDeclaration, ASTConstantDeclaration, ASTConstructorDeclaration, ASTEnumDeclaration, ASTFieldDeclaration, ASTInterfaceDeclaration, ASTMethodDeclaration, ASTNestedClassDeclaration, ASTNestedInterfaceDeclaration

public class AccessNode
extends SimpleNode
implements ModifierHolder

This class is the base for all Nodes that contain modifiers ("public", "native", etc.).

Since:
jRefactory 2.9.0, created October 16, 2003
Author:
Mike Atkinson

Field Summary
static int ALPHABETICAL_ORDER
          Description of the Field
protected  int modifiers
          Description of the Field
static int STANDARD_ORDER
          Description of the Field
 
Fields inherited from class com.jeffpalm.javaparser.SimpleNode
children, id, parent, parser, specials
 
Fields inherited from interface com.jeffpalm.javaparser.ModifierHolder
ABSTRACT, EXPLICIT, FINAL, INTERFACE, names, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICTFP, SYNCHRONIZED, TRANSIENT, VOLATILE
 
Constructor Summary
AccessNode(int identifier)
          Constructor for the AccessNode object Access nodes are not designed to be constructed directly.
AccessNode(JavaParser parser, int identifier)
          Constructor for the AccessNode object.
 
Method Summary
 void addModifier(java.lang.String mod)
          Add a modifier
 void copyModifiers(ModifierHolder source)
          Copies the modifiers from another source
 boolean equalModifiers(java.lang.Object obj)
          Compare the modifiers of these two nodes.
 int getModifiers()
          Gets the modifier bits
 java.lang.String getModifiersString(int code)
          Returns a string containing all the modifiers
 boolean isAbstract()
          Determine if the node is abstract
 boolean isExplicit()
          Determine if the node is explicit
 boolean isFinal()
          Determine if the node is final
 boolean isInterface()
          Determine if the node is interface
 boolean isNative()
          Determine if the node is native
 boolean isPackage()
          Determines if this has package scope
 boolean isPrivate()
          Determine if the node is private
 boolean isProtected()
          Determine if the node is protected
 boolean isPublic()
          Determine if the node is public
 boolean isStatic()
          Determine if the node is static
 boolean isStrictFP()
          Determine if the node is strictFP
 boolean isSynchronized()
          Determine if the node is synchronized
 boolean isTransient()
          Determine if the node is transient
 boolean isVolatile()
          Determine if the node is volatile
protected  java.lang.String printModifiers()
          Description of the Method
 void setAbstract()
          Sets the abstract bit (to true) in the modifiers
 void setAbstract(boolean value)
          Sets the abstract bit in the modifiers
protected  void setCode(boolean value, int code)
          Sets or resets a single bit in the modifiers
 void setFinal()
          Sets the Final bit (to true) of the in the modifiers
 void setInterface()
          Sets the Final bit (to true) of the in the modifiers
 void setModifiers(int modifiers)
          Sets the modifier bits
 void setNative()
          Sets the Final bit (to true) of the in the modifiers
 void setPrivate()
          Sets the private bit (to true) in the modifiers
 void setPrivate(boolean value)
          Sets the private bit in the modifiers
 void setProtected()
          Sets the protected bit (to true) in the modifiers
 void setProtected(boolean value)
          Sets the protected bit in the modifiers
 void setPublic()
          Sets the public bit (to true) in the modifiers
 void setPublic(boolean value)
          Sets the public bit in the modifiers
 void setStatic()
          Sets the Static bit (to true) in the modifiers
 void setStatic(boolean value)
          Sets the Static bit in the modifiers
 void setStrict()
          Sets the StrictFP bit (to true) of the in the modifiers
 void setSynchronized()
          Sets the Synchronized bit (to true) in the modifiers
 void setSynchronized(boolean value)
          Sets the Synchronized bit in the modifiers
 void setTransient()
          Sets the Final bit (to true) of the in the modifiers
 void setVolatile()
          Sets the Final bit (to true) of the in the modifiers
 int skipAnnotations()
           
 int skipAnnotationsAndTypeParameters()
           
 java.lang.String toStandardOrderString()
          Convert the node to a string
 java.lang.String toStringAlphabetical()
          Convert the node to a string
 
Methods inherited from class com.jeffpalm.javaparser.SimpleNode
addSpecial, childrenAccept, dump, dumpString, findChildrenOfType, findChildrenOfType, findChildrenOfType, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getName, getScope, getSpecial, hasAnyChildren, init, isRequired, jjtAccept, jjtAddChild, jjtAddFirstChild, jjtClose, jjtDeleteChild, jjtGetChild, jjtGetFirstChild, jjtGetID, jjtGetNumChildren, jjtGetParent, jjtInsertChild, jjtOpen, jjtSetParent, removeSpecial, setLineAndColumnInfo, setScope, testingOnly__setBeginColumn, testingOnly__setBeginLine, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiers

protected int modifiers
Description of the Field


ALPHABETICAL_ORDER

public static final int ALPHABETICAL_ORDER
Description of the Field

See Also:
Constant Field Values

STANDARD_ORDER

public static final int STANDARD_ORDER
Description of the Field

See Also:
Constant Field Values
Constructor Detail

AccessNode

public AccessNode(JavaParser parser,
                  int identifier)
Constructor for the AccessNode object. Access nodes are not designed to be constructed directly.

Parameters:
parser - Description of Parameter
identifier - Description of Parameter

AccessNode

public AccessNode(int identifier)
Constructor for the AccessNode object Access nodes are not designed to be constructed directly.

Parameters:
identifier - Description of Parameter
Method Detail

setPrivate

public void setPrivate(boolean value)
Sets the private bit in the modifiers

Specified by:
setPrivate in interface ModifierHolder
Parameters:
value - true if we are setting the private modifier

setPrivate

public void setPrivate()
Sets the private bit (to true) in the modifiers

Specified by:
setPrivate in interface ModifierHolder

setProtected

public void setProtected(boolean value)
Sets the protected bit in the modifiers

Specified by:
setProtected in interface ModifierHolder
Parameters:
value - true if we are setting the protected modifier

setProtected

public void setProtected()
Sets the protected bit (to true) in the modifiers

Specified by:
setProtected in interface ModifierHolder

setPublic

public void setPublic(boolean value)
Sets the public bit in the modifiers

Specified by:
setPublic in interface ModifierHolder
Parameters:
value - true if we are setting the public modifier

setPublic

public void setPublic()
Sets the public bit (to true) in the modifiers

Specified by:
setPublic in interface ModifierHolder

setAbstract

public void setAbstract(boolean value)
Sets the abstract bit in the modifiers

Specified by:
setAbstract in interface ModifierHolder
Parameters:
value - true if we are setting the modifier

setAbstract

public void setAbstract()
Sets the abstract bit (to true) in the modifiers

Specified by:
setAbstract in interface ModifierHolder

setSynchronized

public void setSynchronized(boolean value)
Sets the Synchronized bit in the modifiers

Specified by:
setSynchronized in interface ModifierHolder
Parameters:
value - The new Synchronized value

setSynchronized

public void setSynchronized()
Sets the Synchronized bit (to true) in the modifiers

Specified by:
setSynchronized in interface ModifierHolder

setStatic

public void setStatic(boolean value)
Sets the Static bit in the modifiers

Specified by:
setStatic in interface ModifierHolder
Parameters:
value - The new Static value

setStatic

public void setStatic()
Sets the Static bit (to true) in the modifiers

Specified by:
setStatic in interface ModifierHolder

setFinal

public void setFinal()
Sets the Final bit (to true) of the in the modifiers

Specified by:
setFinal in interface ModifierHolder

setVolatile

public void setVolatile()
Sets the Final bit (to true) of the in the modifiers


setTransient

public void setTransient()
Sets the Final bit (to true) of the in the modifiers


setNative

public void setNative()
Sets the Final bit (to true) of the in the modifiers


setInterface

public void setInterface()
Sets the Final bit (to true) of the in the modifiers


setStrict

public void setStrict()
Sets the StrictFP bit (to true) of the in the modifiers

Specified by:
setStrict in interface ModifierHolder

setModifiers

public void setModifiers(int modifiers)
Sets the modifier bits

Specified by:
setModifiers in interface ModifierHolder
Parameters:
modifiers - the modifier bits

isAbstract

public boolean isAbstract()
Determine if the node is abstract

Specified by:
isAbstract in interface ModifierHolder
Returns:
true if this stores an ABSTRACT flag

isExplicit

public boolean isExplicit()
Determine if the node is explicit

Specified by:
isExplicit in interface ModifierHolder
Returns:
true if this stores an EXPLICIT flag

isFinal

public boolean isFinal()
Determine if the node is final

Specified by:
isFinal in interface ModifierHolder
Returns:
true if this stores an FINAL flag

isInterface

public boolean isInterface()
Determine if the node is interface

Specified by:
isInterface in interface ModifierHolder
Returns:
true if this stores an INTERFACE flag

isNative

public boolean isNative()
Determine if the node is native

Specified by:
isNative in interface ModifierHolder
Returns:
true if this stores an NATIVE flag

isPrivate

public boolean isPrivate()
Determine if the node is private

Specified by:
isPrivate in interface ModifierHolder
Returns:
true if this stores an PRIVATE flag

isProtected

public boolean isProtected()
Determine if the node is protected

Specified by:
isProtected in interface ModifierHolder
Returns:
true if this stores an PROTECTED flag

isPublic

public boolean isPublic()
Determine if the node is public

Specified by:
isPublic in interface ModifierHolder
Returns:
true if this stores an PUBLIC flag

isStatic

public boolean isStatic()
Determine if the node is static

Specified by:
isStatic in interface ModifierHolder
Returns:
true if this stores an static flag

isStrictFP

public boolean isStrictFP()
Determine if the node is strictFP

Specified by:
isStrictFP in interface ModifierHolder
Returns:
true if this stores an STRICTFP flag

isSynchronized

public boolean isSynchronized()
Determine if the node is synchronized

Specified by:
isSynchronized in interface ModifierHolder
Returns:
true if this stores an SYNCHRONIZED flag

isTransient

public boolean isTransient()
Determine if the node is transient

Specified by:
isTransient in interface ModifierHolder
Returns:
true if this stores an TRANSIENT flag

isVolatile

public boolean isVolatile()
Determine if the node is volatile

Specified by:
isVolatile in interface ModifierHolder
Returns:
true if this stores an VOLATILE flag

isPackage

public boolean isPackage()
Determines if this has package scope

Specified by:
isPackage in interface ModifierHolder
Returns:
true if this has package scope

getModifiers

public int getModifiers()
Gets the modifier bits

Specified by:
getModifiers in interface ModifierHolder
Returns:
the modifier bits

getModifiersString

public java.lang.String getModifiersString(int code)
Returns a string containing all the modifiers

Parameters:
code - the code used to determine the order of the modifiers
Returns:
the string representationof the order

addModifier

public void addModifier(java.lang.String mod)
Add a modifier

Specified by:
addModifier in interface ModifierHolder
Parameters:
mod - the new modifier

toStringAlphabetical

public java.lang.String toStringAlphabetical()
Convert the node to a string

Returns:
a string describing the modifiers

toStandardOrderString

public java.lang.String toStandardOrderString()
Convert the node to a string

Returns:
a string describing the modifiers

copyModifiers

public void copyModifiers(ModifierHolder source)
Copies the modifiers from another source

Specified by:
copyModifiers in interface ModifierHolder
Parameters:
source - the source

equalModifiers

public boolean equalModifiers(java.lang.Object obj)
Compare the modifiers of these two nodes.

Parameters:
obj - the other node.
Returns:
true if they are the same

setCode

protected void setCode(boolean value,
                       int code)
Sets or resets a single bit in the modifiers

Parameters:
value - true if we are setting the bit
code - The new Code value

printModifiers

protected java.lang.String printModifiers()
Description of the Method

Overrides:
printModifiers in class SimpleNode
Returns:
Description of the Returned Value

skipAnnotations

public int skipAnnotations()

skipAnnotationsAndTypeParameters

public int skipAnnotationsAndTypeParameters()