Package io.polygenesis.transformers.java
Class AbstractClassTransformer<S extends io.polygenesis.core.Nameable,F extends io.polygenesis.abstraction.thing.FunctionProvider>
- java.lang.Object
-
- io.polygenesis.transformers.java.AbstractTransformer
-
- io.polygenesis.transformers.java.AbstractClassTransformer<S,F>
-
- Type Parameters:
S- the type parameterF- 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 Summary
Fields Modifier and Type Field Description protected io.polygenesis.generators.java.shared.transformer.MethodTransformer<F>methodTransformerThe Method transformer.-
Fields inherited from class io.polygenesis.transformers.java.AbstractTransformer
dataTypeTransformer
-
-
Constructor Summary
Constructors Constructor Description AbstractClassTransformer(io.polygenesis.core.DataTypeTransformer dataTypeTransformer, io.polygenesis.generators.java.shared.transformer.MethodTransformer<F> methodTransformer)Instantiates a new Abstract new class transformer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>annotations(S source, Object... args)Set<io.polygenesis.representations.code.ConstructorRepresentation>constructorRepresentations(S source, Object... args)protected Set<io.polygenesis.representations.code.ParameterRepresentation>convertFieldRepresentationsToParameterRepresentations(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Convert field representations to parameter representations set.io.polygenesis.representations.code.ClassRepresentationcreate(S source, Object... args)protected io.polygenesis.representations.code.ConstructorRepresentationcreateConstructorWithDirectAssignment(String dataType, Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations)Create constructor with direct assignment constructor representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateConstructorWithDirectAssignmentFromFieldRepresentations(String dataType, Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Create constructor with direct assignment from field representations constructor representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateConstructorWithImplementation(String dataType, Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations, String implementation)Create constructor with implementation constructor representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateConstructorWithSetters(String dataType, Set<io.polygenesis.representations.code.ParameterRepresentation> parameterRepresentations)Create constructor constructor representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateConstructorWithSettersFromFieldRepresentations(String dataType, Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Create constructor with setters from field representations constructor representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateEmptyConstructorWithImplementation(String dataType, Set<String> annotations, String modifiers, String implementation)Create empty constructor with implementation constructor representation.protected io.polygenesis.representations.code.MethodRepresentationcreateGetterMethod(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation, Set<String> annotations)Create getter method representation.protected io.polygenesis.representations.code.MethodRepresentationcreateGuardMethod(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation, Set<String> annotations)Create guard method method representation.protected io.polygenesis.representations.code.ConstructorRepresentationcreateNoArgsConstructorForPersistence(String modifier)Create no args constructor for persistence constructor representation.protected io.polygenesis.representations.code.MethodRepresentationcreateSetterMethod(io.polygenesis.representations.code.FieldRepresentation fieldRepresentation, Set<String> annotations)Create setter method method representation.Set<io.polygenesis.representations.code.FieldRepresentation>dependencyFieldRepresentations(S source, Object... args)Stringdescription(S source, Object... args)StringfullObjectName(S source, Object... args)Set<String>imports(S source, Object... args)protected StringmakeCanonicalObjectName(io.polygenesis.commons.valueobjects.PackageName packageName, String dataType)Make canonical object name string.Set<io.polygenesis.representations.code.MethodRepresentation>methodRepresentations(S source, Object... args)protected Set<io.polygenesis.representations.code.MethodRepresentation>methodRepresentationsForGetters(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Method representations for getters set.protected Set<io.polygenesis.representations.code.MethodRepresentation>methodRepresentationsForGettersAndGuards(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Method representations for getters and guards set.protected Set<io.polygenesis.representations.code.MethodRepresentation>methodRepresentationsForGettersAndSetters(Set<io.polygenesis.representations.code.FieldRepresentation> fieldRepresentations)Method representations for getters and setters set.Stringmodifiers(S source, Object... args)StringpackageName(S source, Object... args)StringsimpleObjectName(S source, Object... args)Set<io.polygenesis.representations.code.FieldRepresentation>stateFieldRepresentations(S source, Object... args)Set<io.polygenesis.representations.code.FieldRepresentation>staticFieldRepresentations(S source, Object... args)-
Methods inherited from class io.polygenesis.transformers.java.AbstractTransformer
makeVariableDataType, makeVariableName
-
-
-
-
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 transformermethodTransformer- the method transformer
-
-
Method Detail
-
create
public io.polygenesis.representations.code.ClassRepresentation create(S source, Object... args)
- Specified by:
createin interfaceio.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:
staticFieldRepresentationsin interfaceio.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:
stateFieldRepresentationsin interfaceio.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:
dependencyFieldRepresentationsin interfaceio.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:
constructorRepresentationsin interfaceio.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:
methodRepresentationsin interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
packageName
public String packageName(S source, Object... args)
- Specified by:
packageNamein interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
imports
public Set<String> imports(S source, Object... args)
- Specified by:
importsin interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
annotations
public Set<String> annotations(S source, Object... args)
- Specified by:
annotationsin interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
description
public String description(S source, Object... args)
- Specified by:
descriptionin interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
modifiers
public String modifiers(S source, Object... args)
- Specified by:
modifiersin interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
simpleObjectName
public String simpleObjectName(S source, Object... args)
- Specified by:
simpleObjectNamein interfaceio.polygenesis.generators.java.shared.transformer.ClassTransformer<S extends io.polygenesis.core.Nameable>
-
fullObjectName
public String fullObjectName(S source, Object... args)
- Specified by:
fullObjectNamein interfaceio.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 typeannotations- the annotationsmodifiers- the modifiersimplementation- 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 typeparameterRepresentations- the parameter representationsimplementation- 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 typeparameterRepresentations- 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 typeparameterRepresentations- 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 typefieldRepresentations- 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 typefieldRepresentations- 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 representationannotations- 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 representationannotations- 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 representationannotations- 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 namedataType- 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
-
-