Package org.jibx.schema.codegen
Interface IClassHolder
-
- All Known Implementing Classes:
ClassHolder
,EnumerationClassHolder
,StructureClassHolder
public interface IClassHolder
Interface for working with classes during code generation.- Author:
- Dennis M. Sosnoski
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addField(FieldDeclaration field)
Add field declaration to class.boolean
addImport(java.lang.String type)
Add import for class.void
addInterface(java.lang.String interf)
Add an interface to this class definition.void
addMethod(MethodDeclaration method)
Add method declaration to class.void
addType(TypeDeclaration type)
Add inner type declaration to class.FieldDeclaration[]
getFields()
Get the fields defined in this class.java.lang.String
getFullName()
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.String
getName()
Get simple name.IClassHolder
getOuterClass()
Get containing class of inner class.java.lang.String
getSuperClassName()
Get name of base class to be extended.java.lang.String
getTypeName(java.lang.String type)
Get the name to be used for a type.boolean
isSuperClassForced()
Check if superclass is forced by schema model.void
setListImplementation(java.lang.String list)
Set name of list implementation class to be used for initializing instances.void
setSuperClassName(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
null
if not an inner class
-
isSuperClassForced
boolean isSuperClassForced()
Check if superclass is forced by schema model.- Returns:
true
if superclass forced,false
if not
-
getSuperClassName
java.lang.String getSuperClassName()
Get name of base class to be extended.- Returns:
- base (
null
if 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 (null
if 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:
true
if 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
-
-
-