Arch4J generator 1.1

org.arch4j.generator
Class JavaAccessModifier

java.lang.Object
  |
  +--org.arch4j.generator.JavaAccessModifier

public class JavaAccessModifier
extends Object

This class represents a Java access control modifier. The four modifiers are available as static fields available via this class name. There is also a static method available to find the appropriate access modifier via a keyword string, such as public.

Version:
1.0
Author:
Ross E. Greinke

Field Summary
static JavaAccessModifier PACKAGE_ACCESS
          The default or package access control modifier.
static JavaAccessModifier PRIVATE_ACCESS
          The private access control modifier.
static JavaAccessModifier PROTECTED_ACCESS
          The protected access control modifier.
static JavaAccessModifier PUBLIC_ACCESS
          The public access control modifier.
 
Method Summary
 boolean equals(Object obj)
          Returns true if this access modifier is equal to another object.
 int hashCode()
          Returns a hash code value for this JavaAccessModifier.
 boolean isPackageAccess()
          Returns true if the receiver represents package access.
 boolean isPrivate()
          Returns true if the receiver represents private access.
 boolean isProtected()
          Returns true if the receiver represents protected access.
 boolean isPublic()
          Returns true if the receiver represents public access.
static JavaAccessModifier modifierFor(String accessModifier)
          Returns the appropriate static field for the given access modifier string.
 String toString()
          Returns a String object representing this JavaAccessModifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLIC_ACCESS

public static final JavaAccessModifier PUBLIC_ACCESS
The public access control modifier.


PROTECTED_ACCESS

public static final JavaAccessModifier PROTECTED_ACCESS
The protected access control modifier.


PACKAGE_ACCESS

public static final JavaAccessModifier PACKAGE_ACCESS
The default or package access control modifier.


PRIVATE_ACCESS

public static final JavaAccessModifier PRIVATE_ACCESS
The private access control modifier.

Method Detail

modifierFor

public static JavaAccessModifier modifierFor(String accessModifier)
Returns the appropriate static field for the given access modifier string. If a null or invalid modifier is given, the default or package access control will be returned.

Parameters:
accessModifier - The access control modifier to get.

isPublic

public boolean isPublic()
Returns true if the receiver represents public access.

Returns:
true if the receiver represents public access.

isProtected

public boolean isProtected()
Returns true if the receiver represents protected access.

Returns:
true if the receiver represents protected access.

isPackageAccess

public boolean isPackageAccess()
Returns true if the receiver represents package access.

Returns:
true if the receiver represents package access.

isPrivate

public boolean isPrivate()
Returns true if the receiver represents private access.

Returns:
true if the receiver represents private access.

equals

public boolean equals(Object obj)
Returns true if this access modifier is equal to another object. A JavaAccessModifier is deemed equal to another if they both contain the same access modifier string.

Overrides:
equals in class Object
Parameters:
obj - The object to compare with.
Returns:
true if this access modifier is equal to the specified object.

hashCode

public int hashCode()
Returns a hash code value for this JavaAccessModifier.

Overrides:
hashCode in class Object
Returns:
The hash code value for this JavaAccessModifier.

toString

public String toString()
Returns a String object representing this JavaAccessModifier.

Overrides:
toString in class Object
Returns:
A String object representing this JavaAccessModifier.

Arch4J generator 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.