Class JsonAnnotations
- java.lang.Object
-
- org.eclipse.emfcloud.jackson.annotations.JsonAnnotations
-
public final class JsonAnnotations extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>getAliases(org.eclipse.emf.ecore.ENamedElement element)Returns the configured alias name or null, if there is none.static StringgetElementName(org.eclipse.emf.ecore.ENamedElement element, int features)Returns the name that should be use to serialize the property.static StringgetIdentityProperty(org.eclipse.emf.ecore.EClassifier classifier)Returns the property that should be use to serialize the identity of the object.static EcoreTypeInfogetTypeProperty(org.eclipse.emf.ecore.EClassifier classifier)Returns the property that should be use to store the type information of the classifier.static EcoreTypeInfogetTypeProperty(org.eclipse.emf.ecore.EClassifier classifier, ValueReader<String,org.eclipse.emf.ecore.EClass> valueReader, ValueWriter<org.eclipse.emf.ecore.EClass,String> valueWriter)Returns the property that should be use to store the type information of the classifier.protected static StringgetValue(org.eclipse.emf.ecore.ENamedElement element, String annotation, String property)protected static List<String>getValues(org.eclipse.emf.ecore.ENamedElement element, String annotation, String property)static booleanisRawValue(org.eclipse.emf.ecore.EStructuralFeature feature)Returnstrue, if the feature is annotated to be treated as raw JSON.static booleanshouldIgnore(org.eclipse.emf.ecore.EStructuralFeature feature)Returns true if the feature should not be serialize.static booleanshouldIgnoreType(org.eclipse.emf.ecore.EClassifier classifier)Returns true if the classifier type information should not be serialize.
-
-
-
Method Detail
-
getElementName
public static String getElementName(org.eclipse.emf.ecore.ENamedElement element, int features)
Returns the name that should be use to serialize the property.- Parameters:
element- any elementfeatures- the EMF module's feature flags- Returns:
- name of property
-
getAliases
public static List<String> getAliases(org.eclipse.emf.ecore.ENamedElement element)
Returns the configured alias name or null, if there is none.- Parameters:
element- any element- Returns:
- the property's alias
-
shouldIgnore
public static boolean shouldIgnore(org.eclipse.emf.ecore.EStructuralFeature feature)
Returns true if the feature should not be serialize.- Parameters:
feature- any feature- Returns:
- true if should not be serialize
-
getTypeProperty
public static EcoreTypeInfo getTypeProperty(org.eclipse.emf.ecore.EClassifier classifier)
Returns the property that should be use to store the type information of the classifier.- Parameters:
classifier- any classifier- Returns:
- the type information property
-
getTypeProperty
public static EcoreTypeInfo getTypeProperty(org.eclipse.emf.ecore.EClassifier classifier, ValueReader<String,org.eclipse.emf.ecore.EClass> valueReader, ValueWriter<org.eclipse.emf.ecore.EClass,String> valueWriter)
Returns the property that should be use to store the type information of the classifier.- Parameters:
classifier- any classifiervalueReader- the reader to use for deserializing type infovalueWriter- the reader to use for serializing type info- Returns:
- the type information property
-
shouldIgnoreType
public static boolean shouldIgnoreType(org.eclipse.emf.ecore.EClassifier classifier)
Returns true if the classifier type information should not be serialize. This is true when the classifier possesses an annotation @JsonType with include = "false".- Parameters:
classifier- any classifier- Returns:
- true if type info should not be serialize
-
getIdentityProperty
public static String getIdentityProperty(org.eclipse.emf.ecore.EClassifier classifier)
Returns the property that should be use to serialize the identity of the object.- Parameters:
classifier- any classifier- Returns:
- the identity property
-
isRawValue
public static boolean isRawValue(org.eclipse.emf.ecore.EStructuralFeature feature)
Returnstrue, if the feature is annotated to be treated as raw JSON.- Parameters:
feature- any feature- Returns:
true, if raw (de)serialization should be done for this feature
-
getValue
protected static String getValue(org.eclipse.emf.ecore.ENamedElement element, String annotation, String property)
-
-