org.jibx.schema.codegen.extend
Class CollectionMethodsDecorator

java.lang.Object
  extended by org.jibx.schema.codegen.extend.CollectionMethodsDecorator
All Implemented Interfaces:
ClassDecorator

public class CollectionMethodsDecorator
extends java.lang.Object
implements ClassDecorator

Code generation decorator which adds sizeXXX(), addXXX(YYY) getXXX(int), and clearXXX() methods for each collection value using a java.util.List representation.


Field Summary
private  ASTParser m_parser
          Parser instance used by class.
private static java.lang.String s_classText
          Text for template class.
 
Constructor Summary
CollectionMethodsDecorator()
           
 
Method Summary
 void finish(IClassHolder holder)
          Method called after completing code generation for the target class.
private static void replace(java.lang.String match, java.lang.String replace, java.lang.StringBuffer buff)
          Replace all occurrences of one string with another in a buffer.
 void start(IClassHolder holder)
          Method called before starting code generation for the target class.
 void valueAdded(java.lang.String basename, boolean collect, java.lang.String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, java.lang.String descript, IClassHolder holder)
          Method called after adding each data value to class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_classText

private static final java.lang.String s_classText
Text for template class.

See Also:
Constant Field Values

m_parser

private final ASTParser m_parser
Parser instance used by class.

Constructor Detail

CollectionMethodsDecorator

public CollectionMethodsDecorator()
Method Detail

finish

public void finish(IClassHolder holder)
Method called after completing code generation for the target class.

Specified by:
finish in interface ClassDecorator
Parameters:
holder -

start

public void start(IClassHolder holder)
Method called before starting code generation for the target class.

Specified by:
start in interface ClassDecorator
Parameters:
holder -

replace

private static void replace(java.lang.String match,
                            java.lang.String replace,
                            java.lang.StringBuffer buff)
Replace all occurrences of one string with another in a buffer.

Parameters:
match -
replace -
buff -

valueAdded

public void valueAdded(java.lang.String basename,
                       boolean collect,
                       java.lang.String type,
                       FieldDeclaration field,
                       MethodDeclaration getmeth,
                       MethodDeclaration setmeth,
                       java.lang.String descript,
                       IClassHolder holder)
Method called after adding each data value to class.

Specified by:
valueAdded in interface ClassDecorator
Parameters:
basename - base name used for data value
collect - repeated value flag
type - value type (item value type, in the case of a repeated value)
field - actual field
getmeth - read access method (null if a flag value)
setmeth - write access method (null if a flag value)
descript - value description text
holder -


Project Web Site