Class CollectionJ2MemberAndAccessorFactory
java.lang.Object
org.exolab.castor.builder.factory.FieldMemberAndAccessorFactory
org.exolab.castor.builder.factory.CollectionMemberAndAccessorFactory
org.exolab.castor.builder.factory.CollectionJ2MemberAndAccessorFactory
- Direct Known Subclasses:
CollectionJ2NoIndexMemberAndAccessorFactory
The Factory for Java2 Collections.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new CollectionJ2MemberAndAccessorFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcreateAddMethod(CollectionInfo fieldInfo, JClass jClass) Creates the add method for this collection.protected final voidcreateCollectionIterationMethods(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Generate methods for iterating over the objects in the collection.protected final voidcreateEnumerateMethod(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Creates the enumerate method.Methods inherited from class CollectionMemberAndAccessorFactory
addMaxSizeCheck, createAccessMethods, createAddByIndexMethod, createBoundPropertyCode, createGetByIndexMethod, createIteratorMethod, createRemoveByIndexMethod, createSetByIndexMethod, generateInitializerCodeModifier and TypeMethodDescriptionprotected voidaddMaxSizeCheck(CollectionInfo fieldInfo, String methodName, JSourceCode sourceCode) Creates the add max size check.final voidcreateAccessMethods(FieldInfo fieldInfo, JClass jClass, boolean useJava50, AnnotationBuilder[] annotationBuilders) Adds the getter/setter for this field to the jClass.protected voidcreateAddByIndexMethod(CollectionInfo fieldInfo, JClass jClass) Creates the add by index method.protected voidcreateBoundPropertyCode(CollectionInfo fieldInfo, JSourceCode sourceCode) Creates bound property code..protected voidcreateGetByIndexMethod(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Creates the get by index method.protected voidcreateIteratorMethod(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Creates the iterate method.protected voidcreateRemoveByIndexMethod(CollectionInfo fieldInfo, JClass jClass) Creates the remove by index method.protected voidcreateSetByIndexMethod(CollectionInfo fieldInfo, JClass jClass) Creates the set by index method.voidgenerateInitializerCode(FieldInfo fieldInfo, JSourceCode sourceCode) Creates the field initialization code in a constructor.Methods inherited from class FieldMemberAndAccessorFactory
createJavaField, getJavaNaming, setUseOldFieldNamingModifier and TypeMethodDescriptionfinal voidcreateJavaField(FieldInfo fieldInfo, JClass jClass) Adds the suitable JField to the JClass.Returns the javaNaming.voidsetUseOldFieldNaming(boolean useOldFieldNaming)
-
Constructor Details
-
CollectionJ2MemberAndAccessorFactory
Creates a new CollectionJ2MemberAndAccessorFactory.- Parameters:
naming- the javaNaming to use
-
-
Method Details
-
createCollectionIterationMethods
protected final void createCollectionIterationMethods(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Generate methods for iterating over the objects in the collection. For Java-1 collections, we only generate an Enumerator. Implementations for other versions of Java should call this method for backward compatbility and then add any additional new methods.
To the Java-1 collection iterators, we add the Java-2 Iterator.- Overrides:
createCollectionIterationMethodsin classCollectionMemberAndAccessorFactory- Parameters:
fieldInfo- the collectionI to translatejClass- the JClass to which we add this methoduseJava50- true if source code is supposed to be generated for Java 5
-
createEnumerateMethod
protected final void createEnumerateMethod(CollectionInfo fieldInfo, JClass jClass, boolean useJava50) Creates the enumerate method.- Overrides:
createEnumerateMethodin classCollectionMemberAndAccessorFactory- Parameters:
fieldInfo- the collectionInfo to translatejClass- the jClass to add the method to.useJava50- java version flag
-
createAddMethod
Creates the add method for this collection.- Overrides:
createAddMethodin classCollectionMemberAndAccessorFactory- Parameters:
fieldInfo- the collectionInfo to translatejClass- the jClass to add the method to.
-