Package org.jibx.schema.codegen.extend
Class CollectionMethodsDecorator
java.lang.Object
org.jibx.schema.codegen.extend.CollectionMethodsDecorator
- All Implemented Interfaces:
ClassDecorator
Code generation decorator which adds
sizeXXX(), addXXX(YYY) getXXX(int), and
clearXXX() methods for each collection value using a java.util.List representation. In a
change from the original version of this class, the form of the name used for the sizeXXX() and
clearXXX() methods is based on the supplied getXXX() method, which normally uses a plural
form of the name.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ASTParserParser instance used by class.private static final StringText for template class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish(ElementBase binding, IClassHolder holder) Method called after completing code generation for the target class.private static voidreplace(String match, String replace, StringBuffer buff) Replace all occurrences of one string with another in a buffer.voidstart(IClassHolder holder) Method called before starting code generation for the target class.voidvalueAdded(String basename, boolean collect, String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, String descript, IClassHolder holder) Method called after adding each data value to class.
-
Field Details
-
s_classText
Text for template class.- See Also:
-
m_parser
private final ASTParser m_parserParser instance used by class.
-
-
Constructor Details
-
CollectionMethodsDecorator
public CollectionMethodsDecorator()
-
-
Method Details
-
finish
Method called after completing code generation for the target class.- Specified by:
finishin interfaceClassDecorator- Parameters:
binding-holder-
-
start
Method called before starting code generation for the target class.- Specified by:
startin interfaceClassDecorator- Parameters:
holder-
-
replace
Replace all occurrences of one string with another in a buffer.- Parameters:
match-replace-buff-
-
valueAdded
public void valueAdded(String basename, boolean collect, String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, String descript, IClassHolder holder) Method called after adding each data value to class.- Specified by:
valueAddedin interfaceClassDecorator- Parameters:
basename- base name used for data valuecollect- repeated value flagtype- value type (item value type, in the case of a repeated value)field- actual fieldgetmeth- read access method (nullif a flag value)setmeth- write access method (nullif a flag value)descript- value description textholder-
-