com.mysema.query.codegen
Class EntitySerializer

java.lang.Object
  extended by com.mysema.query.codegen.EntitySerializer
All Implemented Interfaces:
Serializer
Direct Known Subclasses:
EmbeddableSerializer, MetaDataSerializer, SupertypeSerializer

@Immutable
public class EntitySerializer
extends Object
implements Serializer

EntitySerializer is a Serializer implementation for entity types

Author:
tiwe

Field Summary
protected  Collection<String> keywords
           
protected  TypeMappings typeMappings
           
 
Constructor Summary
EntitySerializer(TypeMappings mappings, Collection<String> keywords)
           
 
Method Summary
protected  void constructors(EntityType model, SerializerConfig config, com.mysema.codegen.CodeWriter writer)
           
protected  void constructorsForVariables(com.mysema.codegen.CodeWriter writer, EntityType model)
           
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  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)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeMappings

protected final TypeMappings typeMappings

keywords

protected final Collection<String> keywords
Constructor Detail

EntitySerializer

@Inject
public EntitySerializer(TypeMappings mappings,
                               @Named(value="keywords")
                               Collection<String> keywords)
Method Detail

constructors

protected void constructors(EntityType model,
                            SerializerConfig config,
                            com.mysema.codegen.CodeWriter writer)
                     throws IOException
Throws:
IOException

constructorsForVariables

protected void constructorsForVariables(com.mysema.codegen.CodeWriter writer,
                                        EntityType model)
                                 throws IOException
Throws:
IOException

entityAccessor

protected void entityAccessor(EntityType model,
                              Property field,
                              com.mysema.codegen.CodeWriter writer)
                       throws IOException
Throws:
IOException

entityField

protected void entityField(EntityType model,
                           Property field,
                           SerializerConfig config,
                           com.mysema.codegen.CodeWriter writer)
                    throws IOException
Throws:
IOException

hasOwnEntityProperties

protected boolean hasOwnEntityProperties(EntityType model)

initEntityFields

protected void initEntityFields(com.mysema.codegen.CodeWriter writer,
                                SerializerConfig config,
                                EntityType model)
                         throws IOException
Throws:
IOException

initEntityField

protected void initEntityField(com.mysema.codegen.CodeWriter writer,
                               SerializerConfig config,
                               EntityType model,
                               Property field)
                        throws IOException
Throws:
IOException

intro

protected void intro(EntityType model,
                     SerializerConfig config,
                     com.mysema.codegen.CodeWriter writer)
              throws IOException
Throws:
IOException

introClassHeader

protected void introClassHeader(com.mysema.codegen.CodeWriter writer,
                                EntityType model)
                         throws IOException
Throws:
IOException

introDefaultInstance

protected void introDefaultInstance(com.mysema.codegen.CodeWriter writer,
                                    EntityType model)
                             throws IOException
Throws:
IOException

introFactoryMethods

protected void introFactoryMethods(com.mysema.codegen.CodeWriter writer,
                                   EntityType model)
                            throws IOException
Throws:
IOException

introImports

protected void introImports(com.mysema.codegen.CodeWriter writer,
                            SerializerConfig config,
                            EntityType model)
                     throws IOException
Throws:
IOException

isImportExprPackage

protected boolean isImportExprPackage(EntityType model)

introDelegatePackages

protected void introDelegatePackages(com.mysema.codegen.CodeWriter writer,
                                     EntityType model)
                              throws IOException
Throws:
IOException

introInits

protected void introInits(com.mysema.codegen.CodeWriter writer,
                          EntityType model)
                   throws IOException
Throws:
IOException

introJavadoc

protected void introJavadoc(com.mysema.codegen.CodeWriter writer,
                            EntityType model)
                     throws IOException
Throws:
IOException

introPackage

protected void introPackage(com.mysema.codegen.CodeWriter writer,
                            EntityType model)
                     throws IOException
Throws:
IOException

introSuper

protected void introSuper(com.mysema.codegen.CodeWriter writer,
                          EntityType model)
                   throws IOException
Throws:
IOException

listAccessor

protected void listAccessor(EntityType model,
                            Property field,
                            com.mysema.codegen.CodeWriter writer)
                     throws IOException
Throws:
IOException

mapAccessor

protected void mapAccessor(EntityType model,
                           Property field,
                           com.mysema.codegen.CodeWriter writer)
                    throws IOException
Throws:
IOException

outro

protected void outro(EntityType model,
                     com.mysema.codegen.CodeWriter writer)
              throws IOException
Throws:
IOException

serialize

public void serialize(EntityType model,
                      SerializerConfig config,
                      com.mysema.codegen.CodeWriter writer)
               throws IOException
Description copied from interface: Serializer
Serialize the given EntityType

Specified by:
serialize in interface Serializer
Parameters:
model - EntityType to serialize
config - TODO
writer - serialization target
Throws:
IOException

serialize

protected void serialize(EntityType model,
                         Property field,
                         com.mysema.codegen.model.Type type,
                         com.mysema.codegen.CodeWriter writer,
                         String factoryMethod,
                         String... args)
                  throws IOException
Throws:
IOException

serializeProperties

protected void serializeProperties(EntityType model,
                                   SerializerConfig config,
                                   com.mysema.codegen.CodeWriter writer)
                            throws IOException
Throws:
IOException


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.