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
 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.
 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

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 if a superclass has not been forced by the schema model. It is always safe to use this method if getSuperClassName() returns null.

Parameters:
base - fully-qualified class name of base class (null if none)

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 -


Project Web Site