public class CollectionMethodsDecorator extends java.lang.Object implements ClassDecorator
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.| Modifier and Type | Field and Description |
|---|---|
private ASTParser |
m_parser
Parser instance used by class.
|
private static java.lang.String |
s_classText
Text for template class.
|
| Constructor and Description |
|---|
CollectionMethodsDecorator() |
| Modifier and Type | Method and Description |
|---|---|
void |
finish(ElementBase binding,
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.
|
private static final java.lang.String s_classText
private final ASTParser m_parser
public void finish(ElementBase binding, IClassHolder holder)
finish in interface ClassDecoratorbinding - holder - public void start(IClassHolder holder)
start in interface ClassDecoratorholder - private static void replace(java.lang.String match,
java.lang.String replace,
java.lang.StringBuffer buff)
match - replace - buff - 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)
valueAdded in interface ClassDecoratorbasename - 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 (null if a flag value)setmeth - write access method (null if a flag value)descript - value description textholder -