Class CollectionJ2MemberAndAccessorFactory

Direct Known Subclasses:
CollectionJ2NoIndexMemberAndAccessorFactory

public class CollectionJ2MemberAndAccessorFactory extends CollectionMemberAndAccessorFactory
The Factory for Java2 Collections.
  • Constructor Details

    • CollectionJ2MemberAndAccessorFactory

      public CollectionJ2MemberAndAccessorFactory(JavaNaming naming)
      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:
      createCollectionIterationMethods in class CollectionMemberAndAccessorFactory
      Parameters:
      fieldInfo - the collectionI to translate
      jClass - the JClass to which we add this method
      useJava50 - 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:
      createEnumerateMethod in class CollectionMemberAndAccessorFactory
      Parameters:
      fieldInfo - the collectionInfo to translate
      jClass - the jClass to add the method to.
      useJava50 - java version flag
    • createAddMethod

      protected final void createAddMethod(CollectionInfo fieldInfo, JClass jClass)
      Creates the add method for this collection.
      Overrides:
      createAddMethod in class CollectionMemberAndAccessorFactory
      Parameters:
      fieldInfo - the collectionInfo to translate
      jClass - the jClass to add the method to.