Class FieldFactory

    • Constructor Detail

      • FieldFactory

        public FieldFactory​(Factory factory)
        Creates a new field sub-factory.
        Parameters:
        factory - the parent factory
    • Method Detail

      • create

        public <T> CtField<T> create​(CtType<?> target,
                                     java.util.Set<ModifierKind> modifiers,
                                     CtTypeReference<T> type,
                                     java.lang.String name)
        Creates a field.
        Parameters:
        target - the target type to which the field is added
        modifiers - the modifiers
        type - the field's type
        name - the field's name
      • create

        public <T> CtField<T> create​(CtType<?> target,
                                     java.util.Set<ModifierKind> modifiers,
                                     CtTypeReference<T> type,
                                     java.lang.String name,
                                     CtExpression<T> defaultExpression)
        Creates a field.
        Parameters:
        target - the target type to which the field is added
        modifiers - the modifiers
        type - the field's type
        name - the field's name
        defaultExpression - the initializing expression
      • create

        public <T> CtField<T> create​(CtType<?> target,
                                     CtField<T> source)
        Creates a field by copying an existing field.
        Type Parameters:
        T - the type of the field
        Parameters:
        target - the target type where the new field has to be inserted to
        source - the source field to be copied
        Returns:
        the newly created field
      • createReference

        public <T> CtFieldReference<T> createReference​(CtField<T> field)
        Creates a field reference from an existing field.
      • createReference

        public <T> CtFieldReference<T> createReference​(java.lang.reflect.Field field)
        Creates a field reference from a java.lang.reflect field.
      • createReference

        public <T> CtFieldReference<T> createReference​(java.lang.String signature)
        Creates a field reference from its signature, as defined by the field reference's toString.