public class EntitySerializer extends Object implements Serializer
Serializer
implementation for entity typesModifier and Type | Field and Description |
---|---|
protected Collection<String> |
keywords |
protected TypeMappings |
typeMappings |
Constructor and Description |
---|
EntitySerializer(TypeMappings mappings,
Collection<String> keywords)
Create a new EntitySerializer instance
|
Modifier and Type | Method and Description |
---|---|
protected void |
constructorContent(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
constructors(EntityType model,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer) |
protected void |
constructorsForVariables(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
customField(EntityType model,
Property field,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer) |
protected void |
entityAccessor(EntityType model,
Property field,
com.mysema.codegen.CodeWriter writer) |
protected void |
entityField(EntityType model,
Property field,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer) |
protected String |
getAdditionalConstructorParameter(EntityType model) |
protected boolean |
hasOwnEntityProperties(EntityType model) |
protected void |
initEntityField(com.mysema.codegen.CodeWriter writer,
SerializerConfig config,
EntityType model,
Property field) |
protected void |
initEntityFields(com.mysema.codegen.CodeWriter writer,
SerializerConfig config,
EntityType model) |
protected void |
intro(EntityType model,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer) |
protected void |
introClassHeader(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introDefaultInstance(com.mysema.codegen.CodeWriter writer,
EntityType model,
String defaultName) |
protected void |
introDelegatePackages(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introFactoryMethods(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introImports(com.mysema.codegen.CodeWriter writer,
SerializerConfig config,
EntityType model) |
protected void |
introInits(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introJavadoc(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introPackage(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected void |
introSuper(com.mysema.codegen.CodeWriter writer,
EntityType model) |
protected boolean |
isImportExprPackage(EntityType model) |
protected void |
listAccessor(EntityType model,
Property field,
com.mysema.codegen.CodeWriter writer) |
protected void |
mapAccessor(EntityType model,
Property field,
com.mysema.codegen.CodeWriter writer) |
protected void |
outro(EntityType model,
com.mysema.codegen.CodeWriter writer) |
protected void |
serialize(EntityType model,
Property field,
com.mysema.codegen.model.Type type,
com.mysema.codegen.CodeWriter writer,
String factoryMethod,
String... args) |
void |
serialize(EntityType model,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer)
Serialize the given
EntityType |
protected void |
serializeProperties(EntityType model,
SerializerConfig config,
com.mysema.codegen.CodeWriter writer) |
protected final TypeMappings typeMappings
protected final Collection<String> keywords
@Inject public EntitySerializer(TypeMappings mappings, @Named(value="keywords") Collection<String> keywords)
mappings
- keywords
- protected void constructors(EntityType model, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void constructorContent(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected String getAdditionalConstructorParameter(EntityType model)
protected void constructorsForVariables(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void entityAccessor(EntityType model, Property field, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void entityField(EntityType model, Property field, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected boolean hasOwnEntityProperties(EntityType model)
protected void initEntityFields(com.mysema.codegen.CodeWriter writer, SerializerConfig config, EntityType model) throws IOException
IOException
protected void initEntityField(com.mysema.codegen.CodeWriter writer, SerializerConfig config, EntityType model, Property field) throws IOException
IOException
protected void intro(EntityType model, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void introClassHeader(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introDefaultInstance(com.mysema.codegen.CodeWriter writer, EntityType model, String defaultName) throws IOException
IOException
protected void introFactoryMethods(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introImports(com.mysema.codegen.CodeWriter writer, SerializerConfig config, EntityType model) throws IOException
IOException
protected boolean isImportExprPackage(EntityType model)
protected void introDelegatePackages(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introInits(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introJavadoc(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introPackage(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void introSuper(com.mysema.codegen.CodeWriter writer, EntityType model) throws IOException
IOException
protected void listAccessor(EntityType model, Property field, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void mapAccessor(EntityType model, Property field, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void outro(EntityType model, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
public void serialize(EntityType model, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
Serializer
EntityType
serialize
in interface Serializer
model
- EntityType to serializeconfig
- TODOwriter
- serialization targetIOException
protected void serialize(EntityType model, Property field, com.mysema.codegen.model.Type type, com.mysema.codegen.CodeWriter writer, String factoryMethod, String... args) throws IOException
IOException
protected void customField(EntityType model, Property field, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
protected void serializeProperties(EntityType model, SerializerConfig config, com.mysema.codegen.CodeWriter writer) throws IOException
IOException
Copyright © 2007–2015 Mysema Ltd. All rights reserved.