use of org.eclipse.sapphire.modeling.annotations.EnumSerialization in project liferay-ide by liferay.
the class ScriptPropertyEditorInput method getScriptLanguage.
public String getScriptLanguage() {
String retval = null;
try {
Scriptable scriptable = _modelElement.nearest(Scriptable.class);
Value<ScriptLanguageType> languageType = scriptable.getScriptLanguage();
ScriptLanguageType scriptType = languageType.content();
Class<?> scriptTypeClass = scriptType.getClass();
Field field = scriptTypeClass.getFields()[scriptType.ordinal()];
EnumSerialization enumValue = field.getAnnotation(EnumSerialization.class);
retval = enumValue.primary();
} catch (Exception e) {
}
return retval;
}
use of org.eclipse.sapphire.modeling.annotations.EnumSerialization in project liferay-ide by liferay.
the class KaleoModelUtil method getEnumSerializationAnnotation.
public static String getEnumSerializationAnnotation(Enum<?> type) {
try {
Class<?> typeClass = type.getClass();
Field field = typeClass.getField(type.name());
EnumSerialization enumAnnotation = field.getAnnotation(EnumSerialization.class);
return enumAnnotation.primary();
} catch (Exception e) {
return null;
}
}
Aggregations