public class BeanSerializer extends java.lang.Object implements Serializer
BeanSerializer
is a Serializer
implementation which serializes EntityType
instances into JavaBean classesModifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_JAVADOC_SUFFIX |
static boolean |
DEFAULT_PROPERTY_ANNOTATIONS |
Constructor and Description |
---|
BeanSerializer()
Create a new BeanSerializer
|
BeanSerializer(boolean propertyAnnotations)
Create a new BeanSerializer
|
BeanSerializer(boolean propertyAnnotations,
java.lang.String javadocSuffix)
Create a new BeanSerializer
|
BeanSerializer(boolean propertyAnnotations,
java.lang.String javadocSuffix,
java.lang.Class<? extends java.lang.annotation.Annotation> generatedAnnotationClass)
Create a new BeanSerializer
|
BeanSerializer(java.lang.String javadocSuffix)
Create a new BeanSerializer with the given javadoc suffix
|
BeanSerializer(java.lang.String javadocSuffix,
java.lang.Class<? extends java.lang.annotation.Annotation> generatedAnnotationClass)
Create a new BeanSerializer with the given javadoc suffix and generatedAnnotationClass
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFullConstructor(EntityType model,
CodeWriter writer) |
void |
addInterface(java.lang.Class<?> iface) |
void |
addInterface(Type type) |
protected void |
addToString(EntityType model,
CodeWriter writer) |
protected void |
bodyEnd(EntityType model,
CodeWriter writer) |
protected void |
bodyStart(EntityType model,
CodeWriter writer) |
void |
serialize(EntityType model,
SerializerConfig serializerConfig,
CodeWriter writer)
Serialize the given
EntityType |
void |
setAddFullConstructor(boolean addFullConstructor) |
void |
setAddToString(boolean addToString) |
void |
setPrintSupertype(boolean printSupertype) |
public static final java.lang.String DEFAULT_JAVADOC_SUFFIX
public static final boolean DEFAULT_PROPERTY_ANNOTATIONS
public BeanSerializer()
public BeanSerializer(java.lang.String javadocSuffix)
javadocSuffix
- suffix to be used after the simple name in class level javadoc@Inject public BeanSerializer(@Named(value="javadocSuffix") java.lang.String javadocSuffix, @Named(value="generatedAnnotationClass") java.lang.Class<? extends java.lang.annotation.Annotation> generatedAnnotationClass)
javadocSuffix
- suffix to be used after the simple name in class level javadocgeneratedAnnotationClass
- the fully qualified class name of the Single-Element Annotation (with String
element) to be used on the generated classes.public BeanSerializer(boolean propertyAnnotations)
propertyAnnotations
- true, to serialize property annotationspublic BeanSerializer(boolean propertyAnnotations, java.lang.String javadocSuffix)
propertyAnnotations
- true, to serialize property annotationsjavadocSuffix
- suffix to be used after the simple name in class level javadocpublic BeanSerializer(boolean propertyAnnotations, java.lang.String javadocSuffix, java.lang.Class<? extends java.lang.annotation.Annotation> generatedAnnotationClass)
propertyAnnotations
- true, to serialize property annotationsjavadocSuffix
- suffix to be used after the simple name in class level javadocgeneratedAnnotationClass
- the fully qualified class name of the Single-Element Annotation (with String
element) to be used on the generated classes.
* @see Single-Element Annotationpublic void serialize(EntityType model, SerializerConfig serializerConfig, CodeWriter writer) throws java.io.IOException
Serializer
EntityType
serialize
in interface Serializer
model
- EntityType to serializeserializerConfig
- serializer configurationwriter
- serialization targetjava.io.IOException
protected void addFullConstructor(EntityType model, CodeWriter writer) throws java.io.IOException
java.io.IOException
protected void addToString(EntityType model, CodeWriter writer) throws java.io.IOException
java.io.IOException
protected void bodyStart(EntityType model, CodeWriter writer) throws java.io.IOException
java.io.IOException
protected void bodyEnd(EntityType model, CodeWriter writer) throws java.io.IOException
java.io.IOException
public void addInterface(java.lang.Class<?> iface)
public void addInterface(Type type)
public void setAddToString(boolean addToString)
public void setAddFullConstructor(boolean addFullConstructor)
public void setPrintSupertype(boolean printSupertype)
Copyright © 2007–2021 Querydsl. All rights reserved.