Package com.querydsl.codegen
Class DefaultEntitySerializer
java.lang.Object
com.querydsl.codegen.DefaultEntitySerializer
- All Implemented Interfaces:
EntitySerializer,Serializer
- Direct Known Subclasses:
DefaultEmbeddableSerializer,DefaultSupertypeSerializer
EntitySerializer is a Serializer implementation for entity types- Author:
- tiwe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<? extends Annotation>protected final Collection<String>protected final TypeMappings -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEntitySerializer(TypeMappings mappings, Collection<String> keywords) Create a newEntitySerializerinstanceDefaultEntitySerializer(TypeMappings mappings, Collection<String> keywords, Class<? extends Annotation> generatedAnnotationClass) Create a newEntitySerializerinstance -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconstructorContent(CodeWriter writer, EntityType model) protected voidconstructors(EntityType model, SerializerConfig config, CodeWriter writer) protected voidconstructorsForVariables(CodeWriter writer, EntityType model) protected voidcustomField(EntityType model, Property field, SerializerConfig config, CodeWriter writer) protected voidentityAccessor(EntityType model, Property field, CodeWriter writer) protected voidentityField(EntityType model, Property field, SerializerConfig config, CodeWriter writer) protected Stringprotected booleanhasOwnEntityProperties(EntityType model) protected voidinitEntityField(CodeWriter writer, SerializerConfig config, EntityType model, Property field) protected voidinitEntityFields(CodeWriter writer, SerializerConfig config, EntityType model) protected voidintro(EntityType model, SerializerConfig config, CodeWriter writer) protected voidintroClassHeader(CodeWriter writer, EntityType model) protected voidintroDefaultInstance(CodeWriter writer, EntityType model, String defaultName) protected voidintroDelegatePackages(CodeWriter writer, EntityType model) protected voidintroFactoryMethods(CodeWriter writer, EntityType model) protected voidintroImports(CodeWriter writer, SerializerConfig config, EntityType model) protected voidintroInits(CodeWriter writer, EntityType model) protected voidintroJavadoc(CodeWriter writer, EntityType model) protected voidintroPackage(CodeWriter writer, EntityType model) protected voidintroSuper(CodeWriter writer, EntityType model) protected booleanisImportExprPackage(EntityType model) protected voidlistAccessor(EntityType model, Property field, CodeWriter writer) protected voidmapAccessor(EntityType model, Property field, CodeWriter writer) protected voidoutro(EntityType model, CodeWriter writer) protected voidserialize(EntityType model, Property field, Type type, CodeWriter writer, String factoryMethod, String... args) voidserialize(EntityType model, SerializerConfig config, CodeWriter writer) Serialize the givenEntityTypeprotected voidserializeProperties(EntityType model, SerializerConfig config, CodeWriter writer)
-
Field Details
-
typeMappings
-
keywords
-
generatedAnnotationClass
-
-
Constructor Details
-
DefaultEntitySerializer
@Inject public DefaultEntitySerializer(TypeMappings mappings, @Named("keywords") Collection<String> keywords, @Named("generatedAnnotationClass") Class<? extends Annotation> generatedAnnotationClass) Create a newEntitySerializerinstance- Parameters:
mappings- type mappings to be usedkeywords- keywords to be usedgeneratedAnnotationClass- the fully qualified class name of the Single-Element Annotation (withStringelement) to be used on the generated classes.- See Also:
-
DefaultEntitySerializer
Create a newEntitySerializerinstance- Parameters:
mappings- type mappings to be usedkeywords- keywords to be used
-
-
Method Details
-
constructors
protected void constructors(EntityType model, SerializerConfig config, CodeWriter writer) throws IOException - Throws:
IOException
-
constructorContent
- Throws:
IOException
-
getAdditionalConstructorParameter
-
constructorsForVariables
- Throws:
IOException
-
entityAccessor
protected void entityAccessor(EntityType model, Property field, CodeWriter writer) throws IOException - Throws:
IOException
-
entityField
protected void entityField(EntityType model, Property field, SerializerConfig config, CodeWriter writer) throws IOException - Throws:
IOException
-
hasOwnEntityProperties
-
initEntityFields
protected void initEntityFields(CodeWriter writer, SerializerConfig config, EntityType model) throws IOException - Throws:
IOException
-
initEntityField
protected void initEntityField(CodeWriter writer, SerializerConfig config, EntityType model, Property field) throws IOException - Throws:
IOException
-
intro
protected void intro(EntityType model, SerializerConfig config, CodeWriter writer) throws IOException - Throws:
IOException
-
introClassHeader
- Throws:
IOException
-
introDefaultInstance
protected void introDefaultInstance(CodeWriter writer, EntityType model, String defaultName) throws IOException - Throws:
IOException
-
introFactoryMethods
- Throws:
IOException
-
introImports
protected void introImports(CodeWriter writer, SerializerConfig config, EntityType model) throws IOException - Throws:
IOException
-
isImportExprPackage
-
introDelegatePackages
- Throws:
IOException
-
introInits
- Throws:
IOException
-
introJavadoc
- Throws:
IOException
-
introPackage
- Throws:
IOException
-
introSuper
- Throws:
IOException
-
listAccessor
- Throws:
IOException
-
mapAccessor
- Throws:
IOException
-
outro
- Throws:
IOException
-
serialize
public void serialize(EntityType model, SerializerConfig config, CodeWriter writer) throws IOException Description copied from interface:SerializerSerialize the givenEntityType- Specified by:
serializein interfaceSerializer- Parameters:
model- EntityType to serializeconfig- serializer configurationwriter- serialization target- Throws:
IOException
-
serialize
protected void serialize(EntityType model, Property field, Type type, CodeWriter writer, String factoryMethod, String... args) throws IOException - Throws:
IOException
-
customField
protected void customField(EntityType model, Property field, SerializerConfig config, CodeWriter writer) throws IOException - Throws:
IOException
-
serializeProperties
protected void serializeProperties(EntityType model, SerializerConfig config, CodeWriter writer) throws IOException - Throws:
IOException
-