Package org.jibx.schema.codegen
Interface IClassHolder
-
- All Known Implementing Classes:
ClassHolder,EnumerationClassHolder,StructureClassHolder
public interface IClassHolderInterface for working with classes during code generation.- Author:
- Dennis M. Sosnoski
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddField(FieldDeclaration field)Add field declaration to class.booleanaddImport(java.lang.String type)Add import for class.voidaddInterface(java.lang.String interf)Add an interface to this class definition.voidaddMethod(MethodDeclaration method)Add method declaration to class.voidaddType(TypeDeclaration type)Add inner type declaration to class.FieldDeclaration[]getFields()Get the fields defined in this class.java.lang.StringgetFullName()Get fully-qualified name.java.lang.String[]getInterfaces()Get the interfaces implemented by this class.MethodDeclaration[]getMethods()Get the methods defined in this class.java.lang.StringgetName()Get simple name.IClassHoldergetOuterClass()Get containing class of inner class.java.lang.StringgetSuperClassName()Get name of base class to be extended.java.lang.StringgetTypeName(java.lang.String type)Get the name to be used for a type.booleanisSuperClassForced()Check if superclass is forced by schema model.voidsetListImplementation(java.lang.String list)Set name of list implementation class to be used for initializing instances.voidsetSuperClassName(java.lang.String base)Set name of base class to be extended.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get simple name.- Returns:
- name
-
getFullName
java.lang.String getFullName()
Get fully-qualified name.- Returns:
- name
-
getOuterClass
IClassHolder getOuterClass()
Get containing class of inner class.- Returns:
- outer containing class, or
nullif not an inner class
-
isSuperClassForced
boolean isSuperClassForced()
Check if superclass is forced by schema model.- Returns:
trueif superclass forced,falseif not
-
getSuperClassName
java.lang.String getSuperClassName()
Get name of base class to be extended.- Returns:
- base (
nullif none)
-
setSuperClassName
void setSuperClassName(java.lang.String base)
Set name of base class to be extended. This method can only be used ifisSuperClassForced()returnsfalse.- Parameters:
base- fully-qualified class name of base class (nullif none)
-
setListImplementation
void setListImplementation(java.lang.String list)
Set name of list implementation class to be used for initializing instances.- Parameters:
list- fully-qualified class name of list implementation (non-null)
-
addImport
boolean addImport(java.lang.String type)
Add import for class. If the requested import doesn't conflict with the current set it's added, otherwise it's ignored.- Parameters:
type- fully qualified class name- Returns:
trueif added as import
-
getTypeName
java.lang.String getTypeName(java.lang.String type)
Get the name to be used for a type. If the type has been imported this returns the short form of the name; otherwise it just returns the fully-qualified name.- Parameters:
type- fully-qualified type name- Returns:
- name
-
getInterfaces
java.lang.String[] getInterfaces()
Get the interfaces implemented by this class.- Returns:
- interface names
-
getFields
FieldDeclaration[] getFields()
Get the fields defined in this class.- Returns:
- fields
-
getMethods
MethodDeclaration[] getMethods()
Get the methods defined in this class.- Returns:
- methods
-
addInterface
void addInterface(java.lang.String interf)
Add an interface to this class definition.- Parameters:
interf- interface type
-
addField
void addField(FieldDeclaration field)
Add field declaration to class.- Parameters:
field-
-
addMethod
void addMethod(MethodDeclaration method)
Add method declaration to class.- Parameters:
method-
-
addType
void addType(TypeDeclaration type)
Add inner type declaration to class.- Parameters:
type-
-
-