public class CompileUnit extends Object
| Constructor and Description |
|---|
CompileUnit(String classCanonName)
Construct a new CompileUnit, which always is for a specific top level
class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addProperty(SimpleVariable variableElement)
Register an AndHow Property declaration in the current scope - either
directly in the the top level class or the recorded path to an inner
class.
|
boolean |
addProperty(String name,
boolean _static,
boolean _final)
Register an AndHow Property declaration in the current scope - either
directly in the the top level class or the recorded path to an inner
class.
|
void |
addPropertyError(String propName,
String msg) |
List<String> |
getErrors()
The list of Property errors, either directly added or created indirectly
by adding properties that had invalid modifiers.
|
List<SimpleType> |
getInnerPath()
Return the state of inner class nesting from the outermost to the
innermost.
|
List<String> |
getInnerPathNames()
Return the inner class names, in order from the outermost to the
innermost.
|
PropertyRegistrationList |
getRegistrations()
The list of Properties in the CompileUnit, along with all the needed
metadata to register them.
|
String |
getRootCanonicalName()
The fully qualified name of the top level class this CompileUnit is for.
|
String |
getRootPackageName()
Get just the package of the root class.
|
String |
getRootSimpleName()
Get just the simple name of the root class.
|
boolean |
hasErrors()
Returns true if the getErrors() list would be non-empty.
|
boolean |
hasRegistrations()
Returns true if getRegistrations() would return a non-empty list.
|
boolean |
isInitClass() |
boolean |
istestInitClass() |
SimpleType |
popType() |
void |
pushType(SimpleType simpleName) |
void |
pushType(String name,
boolean _static) |
void |
setInitClass(boolean initClass) |
void |
setTestInitClass(boolean testInitClass) |
public CompileUnit(String classCanonName)
classCanonName - The fully qualified name of a top level class.public boolean isInitClass()
public void setInitClass(boolean initClass)
public boolean istestInitClass()
public void setTestInitClass(boolean testInitClass)
public void pushType(SimpleType simpleName)
public void pushType(String name, boolean _static)
public SimpleType popType()
public boolean addProperty(SimpleVariable variableElement)
variableElement - A SimpleType representing a variable to which an
AndHow property is constructed and assigned to.public boolean addProperty(String name, boolean _static, boolean _final)
name - The name of the variable the Property is assigned to._static - Does the variable has the static modifier?_final - Is the variable declared as static?public List<SimpleType> getInnerPath()
for just the names of the nested inner classes.public List<String> getInnerPathNames()
public String getRootCanonicalName()
public String getRootSimpleName()
public String getRootPackageName()
public PropertyRegistrationList getRegistrations()
public List<String> getErrors()
public boolean hasErrors()
public boolean hasRegistrations()
Copyright © 2017. All rights reserved.