Class AbstractClassTransformer<S extends io.polygenesis.core.Nameable,​F extends io.polygenesis.abstraction.thing.FunctionProvider>

  • Type Parameters:
    S - the type parameter
    F - the type parameter
    All Implemented Interfaces:
    io.polygenesis.core.TemplateTransformer<S>, io.polygenesis.generators.java.shared.transformer.ClassTransformer<S>

    public abstract class AbstractClassTransformer<S extends io.polygenesis.core.Nameable,​F extends io.polygenesis.abstraction.thing.FunctionProvider>
    extends AbstractTransformer
    implements io.polygenesis.generators.java.shared.transformer.ClassTransformer<S>
    The type Abstract class representable.
    Author:
    Christos Tsakostas
    • Field Detail

      • methodTransformer

        protected final io.polygenesis.generators.java.shared.transformer.MethodTransformer<F extends io.polygenesis.abstraction.thing.FunctionProvider> methodTransformer
        The Method transformer.
    • Constructor Detail

      • AbstractClassTransformer

        public AbstractClassTransformer​(io.polygenesis.core.DataTypeTransformer dataTypeTransformer,
                                        io.polygenesis.generators.java.shared.transformer.MethodTransformer<F> methodTransformer)
        Instantiates a new Abstract new class transformer.
        Parameters:
        dataTypeTransformer - the data type transformer
        methodTransformer - the method transformer
    • Method Detail

      • create

        public io.polygenesis.representations.code.ClassRepresentation create​(S source,
                                                                              Object... args)
        Specified by:
        create in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • staticFieldRepresentations

        public Set<io.polygenesis.representations.code.FieldRepresentation> staticFieldRepresentations​(S source,
                                                                                                       Object... args)
        Specified by:
        staticFieldRepresentations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • stateFieldRepresentations

        public Set<io.polygenesis.representations.code.FieldRepresentation> stateFieldRepresentations​(S source,
                                                                                                      Object... args)
        Specified by:
        stateFieldRepresentations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • dependencyFieldRepresentations

        public Set<io.polygenesis.representations.code.FieldRepresentation> dependencyFieldRepresentations​(S source,
                                                                                                           Object... args)
        Specified by:
        dependencyFieldRepresentations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • constructorRepresentations

        public Set<io.polygenesis.representations.code.ConstructorRepresentation> constructorRepresentations​(S source,
                                                                                                             Object... args)
        Specified by:
        constructorRepresentations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • methodRepresentations

        public Set<io.polygenesis.representations.code.MethodRepresentation> methodRepresentations​(S source,
                                                                                                   Object... args)
        Specified by:
        methodRepresentations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • packageName

        public String packageName​(S source,
                                  Object... args)
        Specified by:
        packageName in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • imports

        public Set<String> imports​(S source,
                                   Object... args)
        Specified by:
        imports in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • annotations

        public Set<String> annotations​(S source,
                                       Object... args)
        Specified by:
        annotations in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • description

        public String description​(S source,
                                  Object... args)
        Specified by:
        description in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • modifiers

        public String modifiers​(S source,
                                Object... args)
        Specified by:
        modifiers in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • simpleObjectName

        public String simpleObjectName​(S source,
                                       Object... args)
        Specified by:
        simpleObjectName in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • fullObjectName

        public String fullObjectName​(S source,
                                     Object... args)
        Specified by:
        fullObjectName in interface io.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
      • createEmptyConstructorWithImplementation

        protected io.polygenesis.representations.code.ConstructorRepresentation createEmptyConstructorWithImplementation​(String dataType,
                                                                                                                         Set<String> annotations,
                                                                                                                         String modifiers,
                                                                                                                         String implementation)
        Create empty constructor with implementation constructor representation.
        Parameters:
        dataType - the data type
        annotations - the annotations
        modifiers - the modifiers
        implementation - the implementation
        Returns:
        the constructor representation
      • createConstructorWithImplementation

        protected io.polygenesis.representations.code.ConstructorRepresentation createConstructorWithImplementation​(String dataType,
                                                                                                                    Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations,
                                                                                                                    String implementation)
        Create constructor with implementation constructor representation.
        Parameters:
        dataType - the data type
        parameterRepresentations - the parameter representations
        implementation - the implementation
        Returns:
        the constructor representation
      • createConstructorWithSetters

        protected io.polygenesis.representations.code.ConstructorRepresentation createConstructorWithSetters​(String dataType,
                                                                                                             Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations)
        Create constructor constructor representation.
        Parameters:
        dataType - the data type
        parameterRepresentations - the parameter representations
        Returns:
        the constructor representation
      • createConstructorWithDirectAssignment

        protected io.polygenesis.representations.code.ConstructorRepresentation createConstructorWithDirectAssignment​(String dataType,
                                                                                                                      Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations)
        Create constructor with direct assignment constructor representation.
        Parameters:
        dataType - the data type
        parameterRepresentations - the parameter representations
        Returns:
        the constructor representation
      • createNoArgsConstructorForPersistence

        protected io.polygenesis.representations.code.ConstructorRepresentation createNoArgsConstructorForPersistence​(String modifier)
        Create no args constructor for persistence constructor representation.
        Parameters:
        modifier - the modifier
        Returns:
        the constructor representation
      • createConstructorWithSettersFromFieldRepresentations

        protected io.polygenesis.representations.code.ConstructorRepresentation createConstructorWithSettersFromFieldRepresentations​(String dataType,
                                                                                                                                     Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Create constructor with setters from field representations constructor representation.
        Parameters:
        dataType - the data type
        fieldRepresentations - the field representations
        Returns:
        the constructor representation
      • createConstructorWithDirectAssignmentFromFieldRepresentations

        protected io.polygenesis.representations.code.ConstructorRepresentation createConstructorWithDirectAssignmentFromFieldRepresentations​(String dataType,
                                                                                                                                              Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Create constructor with direct assignment from field representations constructor representation.
        Parameters:
        dataType - the data type
        fieldRepresentations - the field representations
        Returns:
        the constructor representation
      • methodRepresentationsForGettersAndSetters

        protected Set<io.polygenesis.representations.code.MethodRepresentation> methodRepresentationsForGettersAndSetters​(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Method representations for getters and setters set.
        Parameters:
        fieldRepresentations - the field representations
        Returns:
        the set
      • methodRepresentationsForGettersAndGuards

        protected Set<io.polygenesis.representations.code.MethodRepresentation> methodRepresentationsForGettersAndGuards​(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Method representations for getters and guards set.
        Parameters:
        fieldRepresentations - the field representations
        Returns:
        the set
      • methodRepresentationsForGetters

        protected Set<io.polygenesis.representations.code.MethodRepresentation> methodRepresentationsForGetters​(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Method representations for getters set.
        Parameters:
        fieldRepresentations - the field representations
        Returns:
        the set
      • createGetterMethod

        protected io.polygenesis.representations.code.MethodRepresentation createGetterMethod​(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation,
                                                                                              Set<String> annotations)
        Create getter method representation.
        Parameters:
        fieldRepresentation - the field representation
        annotations - the annotations
        Returns:
        the method representation
      • createGuardMethod

        protected io.polygenesis.representations.code.MethodRepresentation createGuardMethod​(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation,
                                                                                             Set<String> annotations)
        Create guard method method representation.
        Parameters:
        fieldRepresentation - the field representation
        annotations - the annotations
        Returns:
        the method representation
      • createSetterMethod

        protected io.polygenesis.representations.code.MethodRepresentation createSetterMethod​(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation,
                                                                                              Set<String> annotations)
        Create setter method method representation.
        Parameters:
        fieldRepresentation - the field representation
        annotations - the annotations
        Returns:
        the method representation
      • makeCanonicalObjectName

        protected String makeCanonicalObjectName​(io.polygenesis.commons.valueobjects.PackageName packageName,
                                                 String dataType)
        Make canonical object name string.
        Parameters:
        packageName - the package name
        dataType - the data type
        Returns:
        the string
      • convertFieldRepresentationsToParameterRepresentations

        protected Set<io.polygenesis.representations.code.ParameterRepresentation> convertFieldRepresentationsToParameterRepresentations​(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)
        Convert field representations to parameter representations set.
        Parameters:
        fieldRepresentations - the field representations
        Returns:
        the set