Package com.dslplatform.json.processor
Class ConverterTemplate
java.lang.Object
com.dslplatform.json.processor.ConverterTemplate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Writerprivate final Contextprivate final EnumTemplate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidasFormatConverter(StructInfo si, String name, String className, boolean binding) private voidbuildArrayType(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures) private static intcalcWeakHash(String name) private voidcheckMandatory(List<AttributeInfo> attributes, int start) private voidcheckMandatory(List<AttributeInfo> attributes, String padding) private voidcreateConverter(StructInfo si, String typeName, String typeArguments) private voidcreateLazyReaderAndWriter(AttributeInfo attr, TypeMirror mirror, String namePrefix, StructInfo si) private StringcreateTypeSignature(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures) private voidcreateTypeSignature(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures, StringBuilder builder) (package private) voidemptyArray(StructInfo si, String className) (package private) voidemptyObject(StructInfo si, String className) private StringextractSingleType(AttributeInfo attr, List<String> types) private StringextractTypeSignature(AttributeInfo attr, TypeMirror type, Map<String, TypeMirror> genericSignatures) (package private) void(package private) voidfromArray(StructInfo si, String className) (package private) voidfromObject(StructInfo si, String className) private voidhandleSwitch(StructInfo si, String alignment, boolean useInstance) private booleanisStaticEnum(AttributeInfo attr) private voidprocessPropertyValue(AttributeInfo attr, String alignment, boolean useInstance, Map<String, TypeMirror> genericSignatures) private voidreturnInstance(String alignment, StructInfo info, String className) private voidwriteArray(String className, List<AttributeInfo> sortedAttributes) private voidprivate voidwriteObject(StructInfo si, String className, List<AttributeInfo> sortedAttributes) private voidwriteProperty(AttributeInfo attr, boolean checkedDefault, String alignment)
-
Field Details
-
code
-
context
-
enumTemplate
-
-
Constructor Details
-
ConverterTemplate
ConverterTemplate(Context context, EnumTemplate enumTemplate)
-
-
Method Details
-
isStaticEnum
-
factoryForGenericConverter
- Throws:
IOException
-
createConverter
private void createConverter(StructInfo si, String typeName, String typeArguments) throws IOException - Throws:
IOException
-
asFormatConverter
private void asFormatConverter(StructInfo si, String name, String className, boolean binding) throws IOException - Throws:
IOException
-
extractTypeSignature
private String extractTypeSignature(AttributeInfo attr, TypeMirror type, Map<String, TypeMirror> genericSignatures) -
extractSingleType
-
createLazyReaderAndWriter
private void createLazyReaderAndWriter(AttributeInfo attr, TypeMirror mirror, String namePrefix, StructInfo si) throws IOException - Throws:
IOException
-
createTypeSignature
private String createTypeSignature(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures) -
createTypeSignature
private void createTypeSignature(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures, StringBuilder builder) -
buildArrayType
private void buildArrayType(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, throws IOExceptionTypeMirror> genericSignatures) - Throws:
IOException
-
emptyObject
- Throws:
IOException
-
fromObject
- Throws:
IOException
-
writeDiscriminator
- Throws:
IOException
-
writeObject
private void writeObject(StructInfo si, String className, List<AttributeInfo> sortedAttributes) throws IOException - Throws:
IOException
-
checkMandatory
- Throws:
IOException
-
checkMandatory
- Throws:
IOException
-
emptyArray
- Throws:
IOException
-
fromArray
- Throws:
IOException
-
returnInstance
- Throws:
IOException
-
writeArray
- Throws:
IOException
-
writeProperty
private void writeProperty(AttributeInfo attr, boolean checkedDefault, String alignment) throws IOException - Throws:
IOException
-
handleSwitch
- Throws:
IOException
-
processPropertyValue
private void processPropertyValue(AttributeInfo attr, String alignment, boolean useInstance, Map<String, TypeMirror> genericSignatures) throws IOException- Throws:
IOException
-
calcWeakHash
-