Package com.querydsl.codegen
Class BeanSerializer
java.lang.Object
com.querydsl.codegen.BeanSerializer
- All Implemented Interfaces:
Serializer
BeanSerializer is a Serializer implementation which serializes EntityType
instances into JavaBean classes- Author:
- tiwe
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new BeanSerializerBeanSerializer(boolean propertyAnnotations) Create a new BeanSerializerBeanSerializer(boolean propertyAnnotations, String javadocSuffix) Create a new BeanSerializerBeanSerializer(boolean propertyAnnotations, String javadocSuffix, Class<? extends Annotation> generatedAnnotationClass) Create a new BeanSerializerBeanSerializer(String javadocSuffix) Create a new BeanSerializer with the given javadoc suffixBeanSerializer(String javadocSuffix, Class<? extends Annotation> generatedAnnotationClass) Create a new BeanSerializer with the given javadoc suffix and generatedAnnotationClass -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFullConstructor(EntityType model, CodeWriter writer) voidaddInterface(Type type) voidaddInterface(Class<?> iface) protected voidaddToString(EntityType model, CodeWriter writer) protected voidbodyEnd(EntityType model, CodeWriter writer) protected voidbodyStart(EntityType model, CodeWriter writer) voidserialize(EntityType model, SerializerConfig serializerConfig, CodeWriter writer) Serialize the givenEntityTypevoidsetAddFullConstructor(boolean addFullConstructor) voidsetAddToString(boolean addToString) voidsetPrintSupertype(boolean printSupertype)
-
Field Details
-
DEFAULT_JAVADOC_SUFFIX
- See Also:
-
DEFAULT_PROPERTY_ANNOTATIONS
public static final boolean DEFAULT_PROPERTY_ANNOTATIONS- See Also:
-
-
Constructor Details
-
BeanSerializer
public BeanSerializer()Create a new BeanSerializer -
BeanSerializer
Create a new BeanSerializer with the given javadoc suffix- Parameters:
javadocSuffix- suffix to be used after the simple name in class level javadoc
-
BeanSerializer
@Inject public BeanSerializer(@Named("javadocSuffix") String javadocSuffix, @Named("generatedAnnotationClass") Class<? extends Annotation> generatedAnnotationClass) Create a new BeanSerializer with the given javadoc suffix and generatedAnnotationClass- Parameters:
javadocSuffix- suffix to be used after the simple name in class level javadocgeneratedAnnotationClass- the fully qualified class name of the Single-Element Annotation (withStringelement) to be used on the generated classes.- See Also:
-
BeanSerializer
public BeanSerializer(boolean propertyAnnotations) Create a new BeanSerializer- Parameters:
propertyAnnotations- true, to serialize property annotations
-
BeanSerializer
Create a new BeanSerializer- Parameters:
propertyAnnotations- true, to serialize property annotationsjavadocSuffix- suffix to be used after the simple name in class level javadoc
-
BeanSerializer
public BeanSerializer(boolean propertyAnnotations, String javadocSuffix, Class<? extends Annotation> generatedAnnotationClass) Create a new BeanSerializer- Parameters:
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 (withStringelement) to be used on the generated classes. * @see Single-Element Annotation
-
-
Method Details
-
serialize
public void serialize(EntityType model, SerializerConfig serializerConfig, CodeWriter writer) throws IOException Description copied from interface:SerializerSerialize the givenEntityType- Specified by:
serializein interfaceSerializer- Parameters:
model- EntityType to serializeserializerConfig- serializer configurationwriter- serialization target- Throws:
IOException
-
addFullConstructor
- Throws:
IOException
-
addToString
- Throws:
IOException
-
bodyStart
- Throws:
IOException
-
bodyEnd
- Throws:
IOException
-
addInterface
-
addInterface
-
setAddToString
public void setAddToString(boolean addToString) -
setAddFullConstructor
public void setAddFullConstructor(boolean addFullConstructor) -
setPrintSupertype
public void setPrintSupertype(boolean printSupertype)
-