public abstract class ClassHolder extends TypeData implements IClassHolder
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ClassHolder.DataNode
Information for a data structure component of a class definition.
|
protected static class |
ClassHolder.LeafNode
Information for a leaf node of the data structure tree.
|
protected static class |
ClassHolder.ParentNode
Information for an interior node of the data structure tree.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
COLLECTION_VARIABLE_NAME |
protected static String |
COLLECTION_VARIABLE_TYPE |
protected String |
m_baseName
Base class name (for use when generating separate classes for nested structures).
|
protected ClassDecorator[] |
m_decorators
Decorators to be called in order during class code generation.
|
protected BindingHolder |
m_holder
Holder for class binding definition.
|
protected ImportsTracker |
m_importsTracker
Tracker for imports.
|
protected LazyList |
m_inners
Holders for inner classes defined within this class (
null if an inner class). |
protected String |
m_listImplClass
Class used for initializing list instances.
|
protected NameConverter |
m_nameConverter
Name conversion handler.
|
protected UniqueNameSet |
m_nameSet
Value names used in class.
|
protected ClassHolder |
m_outerClass
Containing class (
null if not an inner class). |
protected PackageHolder |
m_package
Package containing class.
|
protected boolean |
m_useInnerClasses
Use inner classes for substructures flag.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ClassHolder(String name,
ClassHolder context,
boolean simple)
Constructor for creating a child inner class definition.
|
|
ClassHolder(String name,
String base,
PackageHolder pack,
BindingHolder holder,
NameConverter nconv,
ClassDecorator[] decorators,
boolean inner,
boolean simple)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addField(org.eclipse.jdt.core.dom.FieldDeclaration field)
Add separately-constructed field to this class definition.
|
boolean |
addImport(String fqname)
Add import for class.
|
void |
addInterface(String interf)
Add an interface to this class definition.
|
void |
addMethod(org.eclipse.jdt.core.dom.MethodDeclaration method)
Add separately-constructed method declaration to this class definition.
|
void |
addType(org.eclipse.jdt.core.dom.TypeDeclaration type)
Add separately-constructed inner class declaration to this class definition.
|
void |
buildDataStructure(GroupItem group,
BindingHolder bindhold)
Convert an item structure to a class representation.
|
protected static String |
describe(ClassHolder.DataNode node)
Describe the schema component associated with a node.
|
protected String |
extractDocumentation(AnnotatedBase element)
Extract schema documentation from an element.
|
protected void |
finishClass(ElementBase binding)
Finish class construction.
|
abstract void |
generate(boolean verbose,
SourceBuilder builder)
Generate this class.
|
protected void |
generateInner(boolean verbose,
SourceBuilder builder)
Generate any inner classes of this class.
|
protected ClassBuilder |
getBuilder()
Get the builder for this class.
|
org.eclipse.jdt.core.dom.FieldDeclaration[] |
getFields()
Get the fields defined in this class.
|
ImportsTracker |
getImports()
Get imports information.
|
String[] |
getInterfaces()
Get the interfaces implemented by this class.
|
org.eclipse.jdt.core.dom.MethodDeclaration[] |
getMethods()
Get the methods defined in this class.
|
String |
getName()
Get simple name.
|
IClassHolder |
getOuterClass()
Get containing class of inner class.
|
PackageHolder |
getPackage()
Get containing package.
|
SchemaCustom |
getSchemaCustom()
Get the schema customization associated with root schema component matching this class.
|
StringPair[] |
getSortedFields()
Get a sorted array of the field names and types defined in this class.
|
TypeData |
getSuperClass()
Get base class to be extended.
|
String |
getSuperClassName()
Get name of base class to be extended.
|
String |
getTypeName(String type)
Get the name to be used for a type.
|
protected void |
importValueType(ClassHolder.DataNode value)
Import the type associated with an item, if not directly accessible
|
protected void |
initClass(boolean verbose,
ClassBuilder builder,
ClassHolder.ParentNode root)
Initialize the class construction.
|
boolean |
isGenerated()
Check if the class has been generated.
|
boolean |
isSuperClassForced()
Check if superclass is forced by schema model.
|
void |
setListImplementation(String list)
Set name of list implementation class to be used for initializing instances.
|
void |
setSuperClass(TypeData sclas)
Set superclass to be extended.
|
void |
setSuperClassName(String base)
Set name of base class to be extended.
|
getBindingName, getFullName, isPregenerated, isSimpleValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFullNameprotected static final String COLLECTION_VARIABLE_TYPE
protected static final String COLLECTION_VARIABLE_NAME
protected final PackageHolder m_package
protected final BindingHolder m_holder
protected final NameConverter m_nameConverter
protected final String m_baseName
protected final ClassDecorator[] m_decorators
protected final boolean m_useInnerClasses
protected final LazyList m_inners
null if an inner class).protected final ClassHolder m_outerClass
null if not an inner class).protected final ImportsTracker m_importsTracker
protected String m_listImplClass
protected UniqueNameSet m_nameSet
public ClassHolder(String name, String base, PackageHolder pack, BindingHolder holder, NameConverter nconv, ClassDecorator[] decorators, boolean inner, boolean simple)
name - class namebase - base class namepack - package informationholder - binding holdernconv - name converterdecorators - class decoratorsinner - use inner classes for substructuressimple - simple value flagprotected ClassHolder(String name, ClassHolder context, boolean simple)
name - class namecontext - parent classsimple - simple value flagpublic SchemaCustom getSchemaCustom()
protected String extractDocumentation(AnnotatedBase element)
element - null if noneprotected static String describe(ClassHolder.DataNode node)
node - protected void importValueType(ClassHolder.DataNode value)
value - public void buildDataStructure(GroupItem group, BindingHolder bindhold)
group - item groupbindhold - associated binding definition holderpublic PackageHolder getPackage()
public String getName()
getName in interface IClassHolderpublic IClassHolder getOuterClass()
getOuterClass in interface IClassHoldernull if not an inner classpublic TypeData getSuperClass()
null if none)public void setSuperClass(TypeData sclas)
sclas - (null if none)public boolean isSuperClassForced()
isSuperClassForced in interface IClassHoldertrue if superclass forced, false if notpublic String getSuperClassName()
getSuperClassName in interface IClassHoldernull if none)public void setSuperClassName(String base)
getSuperClassName() returns null.setSuperClassName in interface IClassHolderbase - fully-qualified class name of base class (null if none)public void setListImplementation(String list)
setListImplementation in interface IClassHolderlist - fully-qualified class name of list implementation (non-null)public boolean isGenerated()
generate(boolean, SourceBuilder), in order to prevent multiple generation passes over the same class.true if generated, false if notprotected ClassBuilder getBuilder()
public String[] getInterfaces()
getInterfaces in interface IClassHolderpublic ImportsTracker getImports()
public org.eclipse.jdt.core.dom.FieldDeclaration[] getFields()
getFields in interface IClassHolderpublic org.eclipse.jdt.core.dom.MethodDeclaration[] getMethods()
getMethods in interface IClassHolderpublic boolean addImport(String fqname)
addImport in interface IClassHolderfqname - fully qualified class nametrue if added as importpublic String getTypeName(String type)
getTypeName in interface IClassHoldertype - fully qualified class namepublic void addInterface(String interf)
addInterface in interface IClassHolderinterf - interface typepublic void addField(org.eclipse.jdt.core.dom.FieldDeclaration field)
addField in interface IClassHolderfield - public void addMethod(org.eclipse.jdt.core.dom.MethodDeclaration method)
addMethod in interface IClassHoldermethod - public void addType(org.eclipse.jdt.core.dom.TypeDeclaration type)
addType in interface IClassHoldertype - public StringPair[] getSortedFields()
protected void initClass(boolean verbose,
ClassBuilder builder,
ClassHolder.ParentNode root)
verbose - builder - root - data structure tree root nodeprotected void finishClass(ElementBase binding)
binding - binding definition component for this classprotected void generateInner(boolean verbose,
SourceBuilder builder)
verbose - builder - class source file builderpublic abstract void generate(boolean verbose,
SourceBuilder builder)
initClass(boolean, ClassBuilder, ParentNode) before doing their own code generation.verbose - builder - class source file builderCopyright © 2005-2014 jibx.org. All Rights Reserved.