Class CStructDescriptor
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor<T>
-
- net.morimekta.providence.descriptor.PMessageDescriptor<T>
-
- net.morimekta.providence.descriptor.PStructDescriptor<CStruct>
-
- net.morimekta.providence.reflect.contained.CStructDescriptor
-
- All Implemented Interfaces:
java.lang.reflect.Type
,net.morimekta.providence.descriptor.PDescriptor
,CAnnotatedDescriptor
,CMessageDescriptor
,net.morimekta.providence.serializer.json.JsonCompactibleDescriptor
public class CStructDescriptor extends net.morimekta.providence.descriptor.PStructDescriptor<CStruct> implements CMessageDescriptor, net.morimekta.providence.serializer.json.JsonCompactibleDescriptor
- Since:
- 07.09.15
- Author:
- Stein Eldar Johnsen
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_COMPACT_FIELDS
-
Constructor Summary
Constructors Constructor Description CStructDescriptor(java.lang.String comment, java.lang.String programName, java.lang.String name, java.util.List<CField<CStruct>> fields, java.util.Map<java.lang.String,java.lang.String> annotations, net.morimekta.providence.descriptor.PDescriptorProvider implementing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CField<CStruct>
findFieldById(int id)
CField<CStruct>
findFieldByName(java.lang.String name)
CField<CStruct>
findFieldByPojoName(java.lang.String pojoName)
java.util.Set<java.lang.String>
getAnnotations()
Get set of available annotations.java.lang.String
getAnnotationValue(java.lang.String name)
Get the given annotation value.java.lang.String
getDocumentation()
The type comment is the last block of comment written before the type declaration.CField<CStruct>[]
getFields()
CInterfaceDescriptor
getImplementing()
boolean
hasAnnotation(java.lang.String name)
Get the given annotation value.boolean
isAutoType()
boolean
isInnerType()
boolean
isJsonCompactible()
boolean
isSimple()
-
Methods inherited from class net.morimekta.providence.descriptor.PMessageDescriptor
builder, equals, fieldForId, fieldForName, fieldForPojoName, getBuilderSupplier, getType, hashCode
-
Methods inherited from class net.morimekta.providence.descriptor.PDeclaredDescriptor
getDefaultValue, getName, getProgramName, getQualifiedName, getTypeName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.reflect.contained.CAnnotatedDescriptor
getAnnotationValue, hasAnnotation
-
Methods inherited from interface net.morimekta.providence.reflect.contained.CMessageDescriptor
fieldForId, fieldForName, getVariant
-
-
-
-
Field Detail
-
MAX_COMPACT_FIELDS
public static final int MAX_COMPACT_FIELDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
isInnerType
public boolean isInnerType()
- Specified by:
isInnerType
in classnet.morimekta.providence.descriptor.PDeclaredDescriptor<CStruct>
-
isAutoType
public boolean isAutoType()
- Specified by:
isAutoType
in classnet.morimekta.providence.descriptor.PDeclaredDescriptor<CStruct>
-
getDocumentation
public final java.lang.String getDocumentation()
Description copied from interface:CAnnotatedDescriptor
The type comment is the last block of comment written before the type declaration. Comments on the same line, after the declaration is ignored.- Specified by:
getDocumentation
in interfaceCAnnotatedDescriptor
- Returns:
- The comment string containing all formatting (not including the comment delimiter and the leading space.
-
getFields
@Nonnull public CField<CStruct>[] getFields()
- Specified by:
getFields
in interfaceCMessageDescriptor
- Specified by:
getFields
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
-
findFieldByName
public CField<CStruct> findFieldByName(java.lang.String name)
- Specified by:
findFieldByName
in interfaceCMessageDescriptor
- Specified by:
findFieldByName
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
-
findFieldByPojoName
public CField<CStruct> findFieldByPojoName(java.lang.String pojoName)
- Specified by:
findFieldByPojoName
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
-
findFieldById
public CField<CStruct> findFieldById(int id)
- Specified by:
findFieldById
in interfaceCMessageDescriptor
- Specified by:
findFieldById
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
-
getImplementing
@Nullable public CInterfaceDescriptor getImplementing()
- Specified by:
getImplementing
in interfaceCMessageDescriptor
- Overrides:
getImplementing
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
-
getAnnotations
@Nonnull public java.util.Set<java.lang.String> getAnnotations()
Description copied from interface:CAnnotatedDescriptor
Get set of available annotations.- Specified by:
getAnnotations
in interfaceCAnnotatedDescriptor
- Returns:
- The annotation set.
-
hasAnnotation
public boolean hasAnnotation(@Nonnull java.lang.String name)
Description copied from interface:CAnnotatedDescriptor
Get the given annotation value.- Specified by:
hasAnnotation
in interfaceCAnnotatedDescriptor
- Parameters:
name
- Name of annotation.- Returns:
- If the annotation is present.
-
getAnnotationValue
public java.lang.String getAnnotationValue(@Nonnull java.lang.String name)
Description copied from interface:CAnnotatedDescriptor
Get the given annotation value.- Specified by:
getAnnotationValue
in interfaceCAnnotatedDescriptor
- Parameters:
name
- Name of annotation.- Returns:
- The annotation value or null.
-
isSimple
public boolean isSimple()
- Specified by:
isSimple
in interfaceCMessageDescriptor
- Overrides:
isSimple
in classnet.morimekta.providence.descriptor.PMessageDescriptor<CStruct>
- Returns:
- True if the message is simple. A simple message contains no containers, and no sub-messages.
-
isJsonCompactible
public boolean isJsonCompactible()
- Specified by:
isJsonCompactible
in interfacenet.morimekta.providence.serializer.json.JsonCompactibleDescriptor
-
-