|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uni_paderborn.tools.util.ClassDeclaration
The class ClassDeclaration provides information about a String that declares a class. It tries to parse the provided parameter, that has to be a fujaba-like declaration (see below).
Field Summary | |
static java.lang.String |
CLASS_IS_KEYWORD
No comment provided by developer, please add a comment to improve documentation. |
private java.lang.String |
classError
No comment provided by developer, please add a comment to improve documentation. |
private java.util.HashSet |
constructors
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
EMPTY_DECLARATION
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
ILLEGAL_CONSTRUCTORS_DECLARATION
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
INVALID_CLASS_DECLARATION
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
isAbstract
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
isInterface
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
isPersistent
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
isReference
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
isStatic
No comment provided by developer, please add a comment to improve documentation. |
private java.lang.String |
name
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
NO_CONSTRUCTORS_ALLOWED
No comment provided by developer, please add a comment to improve documentation. |
private java.lang.String |
original
The originally provided String. |
private java.lang.String |
packageName
No comment provided by developer, please add a comment to improve documentation. |
private int |
paramcount
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
UNPRECISE_CONSTRUCTORS_DECLARATION
No comment provided by developer, please add a comment to improve documentation. |
static java.lang.String |
VALID_DECLARATION
No comment provided by developer, please add a comment to improve documentation. |
Constructor Summary | |
ClassDeclaration(java.lang.String declaration)
Creates a new object of ClassDeclareation and parses the provided String. |
Method Summary | |
void |
clear()
No comment provided by developer, please add a comment to improve documentation. |
java.lang.String |
getClassError()
Returns the method error, that is an error occured while parsing. |
java.util.HashSet |
getConstructors()
Returns all defined constructors in a HashSet. |
java.lang.String |
getName()
Returns the name of this Declaration. |
java.lang.String |
getPackage()
Get the package attribute of the ClassDeclaration object |
java.lang.String |
getStatus()
Returns information about this declaration. |
boolean |
isAbstract()
Returns true if this Declaration is abstract, false otherwise. |
boolean |
isEmpty()
Returns true if this ClassDeclaration is empty. |
boolean |
isInterface()
Get the interface attribute of the ClassDeclaration object |
boolean |
isPersistent()
Get the persistent attribute of the ClassDeclaration object |
boolean |
isReference()
Get the reference attribute of the ClassDeclaration object |
boolean |
isStatic()
Returns true if this Declaration is static, false otherwise. |
boolean |
isValid()
Returns true, if this declaration is valid, NOT considerung parameters or return type. |
private void |
parse()
Tries to parse the provided String as a new class. |
private int |
parseParam(java.lang.String str)
Parses the parameters |
private boolean |
putToConstructors(java.lang.String string)
Parses the provided String to be a constructor-definition. |
void |
showStatus()
Shows the status provided by getStatus() in a JOptionPane. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String VALID_DECLARATION
public static final java.lang.String EMPTY_DECLARATION
public static final java.lang.String INVALID_CLASS_DECLARATION
public static final java.lang.String CLASS_IS_KEYWORD
public static final java.lang.String ILLEGAL_CONSTRUCTORS_DECLARATION
public static final java.lang.String NO_CONSTRUCTORS_ALLOWED
public static final java.lang.String UNPRECISE_CONSTRUCTORS_DECLARATION
private java.lang.String original
private java.lang.String classError
private boolean isAbstract
private boolean isStatic
private boolean isInterface
private boolean isPersistent
private boolean isReference
private java.lang.String name
private java.lang.String packageName
private java.util.HashSet constructors
private int paramcount
Constructor Detail |
public ClassDeclaration(java.lang.String declaration)
declaration
- The String to be a class declaration.
NullPointerException,
- if declaration
is null.Method Detail |
private void parse()
Any of the ones above can be followed by parenthesis representing the parameters of the
(only then) created constructor(s). The parameters have to be divided by komma or semicolon,
otherwise they won't be recognized. You can provide different types only, or even a type
with a variable.
When the class name is a Java keyword this declaration is invalid. Parameter types and
theri representing variables can be divided by white-space (then the declaration has
to be java-like, e. g. String s, int i
), or it has to be divided by colon
(then the declaration has to be uml-like, e. g. s:String, i:int
).
private int parseParam(java.lang.String str)
str
- No description provided
private boolean putToConstructors(java.lang.String string)
string
- No description provided
public java.util.HashSet getConstructors()
String
or
Integer
, each even cell represents the variable-bname to its predecessor
public java.lang.String getName()
public java.lang.String getStatus()
public void showStatus()
public java.lang.String getClassError()
public boolean isAbstract()
public boolean isStatic()
public boolean isInterface()
public boolean isPersistent()
public boolean isReference()
public boolean isEmpty()
public boolean isValid()
public java.lang.String getPackage()
public void clear()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |