com.cedarsoft.serialization.generator.output.serializer
Class AbstractXmlGenerator

java.lang.Object
  extended by com.cedarsoft.serialization.generator.output.GeneratorBase<T>
      extended by com.cedarsoft.serialization.generator.output.serializer.AbstractGenerator<XmlDecisionCallback>
          extended by com.cedarsoft.serialization.generator.output.serializer.AbstractXmlGenerator

public abstract class AbstractXmlGenerator
extends AbstractGenerator<XmlDecisionCallback>


Field Summary
static String METHOD_NAME_FROM
           
static String METHOD_NAME_TO
           
static String METHOD_SUPER
           
static com.cedarsoft.Version VERSION
          The version the serializer supports
 
Fields inherited from class com.cedarsoft.serialization.generator.output.serializer.AbstractGenerator
METHOD_NAME_DESERIALIZE, METHOD_NAME_DESERIALIZE_FROM, METHOD_NAME_SERIALIZE, PARAM_NAME_CONTEXT, PARAM_NAME_FORMAT_VERSION, PARAM_NAME_SERIALIZE_TO, SERIALIZER_CLASS_NAME_SUFFIX, VAR_NAME_OBJECT
 
Fields inherited from class com.cedarsoft.serialization.generator.output.GeneratorBase
codeGenerator, codeModel
 
Constructor Summary
protected AbstractXmlGenerator(com.cedarsoft.codegen.CodeGenerator<XmlDecisionCallback> codeGenerator)
          Creates a new generator
 
Method Summary
protected  com.sun.codemodel.JMethod createConstructor(com.sun.codemodel.JDefinedClass serializerClass, com.cedarsoft.codegen.model.DomainObjectDescriptor domainObjectDescriptor)
          Creates the constructor for the given serializer class (if necessary)
protected  com.sun.codemodel.JInvocation createDefaultVersionRangeInvocation(com.cedarsoft.Version from, com.cedarsoft.Version to)
          Creates the default version range invocation
protected  String getDefaultElementName(com.cedarsoft.codegen.model.DomainObjectDescriptor domainObjectDescriptor)
          Returns the default element name
protected  String getNamespace(String domainObjectType)
          Returns the namespace that is used for the serialized documents
 
Methods inherited from class com.cedarsoft.serialization.generator.output.serializer.AbstractGenerator
addDelegatingSerializerToConstructor, appendDeserializeStatement, appendSerializeStatement, constructDeserializedObject, createDeserializeMethodStub, createSerializeMethodStub, createSerializerClassName, createSerializerExtendsExpression, fillDeSerializationMethods, finishConstructor, generateSerializer, getExceptionType, getSerializeFromType, getSerializerRefFor, getSerializeToType
 
Methods inherited from class com.cedarsoft.serialization.generator.output.GeneratorBase
getCodeGenerator, getCodeModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

@NotNull
public static final com.cedarsoft.Version VERSION
The version the serializer supports


METHOD_NAME_FROM

@NonNls
public static final String METHOD_NAME_FROM
See Also:
Constant Field Values

METHOD_NAME_TO

@NonNls
public static final String METHOD_NAME_TO
See Also:
Constant Field Values

METHOD_SUPER

@NonNls
public static final String METHOD_SUPER
See Also:
Constant Field Values
Constructor Detail

AbstractXmlGenerator

protected AbstractXmlGenerator(@NotNull
                               com.cedarsoft.codegen.CodeGenerator<XmlDecisionCallback> codeGenerator)
Creates a new generator

Parameters:
codeGenerator - the used code generator
Method Detail

createConstructor

@NotNull
protected com.sun.codemodel.JMethod createConstructor(@NotNull
                                                              com.sun.codemodel.JDefinedClass serializerClass,
                                                              @NotNull
                                                              com.cedarsoft.codegen.model.DomainObjectDescriptor domainObjectDescriptor)
Description copied from class: AbstractGenerator
Creates the constructor for the given serializer class (if necessary)

Specified by:
createConstructor in class AbstractGenerator<XmlDecisionCallback>
Parameters:
serializerClass - the serialize class
domainObjectDescriptor - the domain object descriptor
Returns:
the created constructor

getNamespace

@NotNull
@NonNls
protected String getNamespace(@NotNull@NonNls
                                             String domainObjectType)
Returns the namespace that is used for the serialized documents

Parameters:
domainObjectType - the domain object type
Returns:
the namespace

getDefaultElementName

@NotNull
@NonNls
protected String getDefaultElementName(@NotNull
                                                      com.cedarsoft.codegen.model.DomainObjectDescriptor domainObjectDescriptor)
Returns the default element name

Parameters:
domainObjectDescriptor - the descriptor
Returns:
the default element name

createDefaultVersionRangeInvocation

@NotNull
protected com.sun.codemodel.JInvocation createDefaultVersionRangeInvocation(@NotNull
                                                                                    com.cedarsoft.Version from,
                                                                                    @NotNull
                                                                                    com.cedarsoft.Version to)
Creates the default version range invocation

Parameters:
from - the from version
to - the to version
Returns:
the invocation creating the version range


Copyright © 2010 cedarsoft GmbH. All Rights Reserved.