Class ModelUtil
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.model.ModelUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IDataTypeAdapter<?>
getDataTypeAdapter(Class<? extends IDataTypeAdapter<?>> adapterClass, IBindingContext bindingContext)
static Object
resolveDefaultValue(String defaultValue, IDataTypeAdapter<?> adapter)
static String
resolveLocalName(String value, String defaultValue)
Resolves a provided local name value.static String
resolveNamespace(String annotationValue, IClassBinding classBinding)
static String
resolveOptionalNamespace(String annotationValue, IClassBinding classBinding)
static MarkupLine
resolveToMarkupLine(String annotationValue)
Get the markup value of a markdown string.static MarkupMultiline
resolveToMarkupMultiline(String annotationValue)
Get the markup value of a markdown string.static String
resolveToString(String annotationValue)
Get the string value of a string.
-
-
-
Method Detail
-
resolveLocalName
public static String resolveLocalName(String value, String defaultValue)
Resolves a provided local name value. If the value isnull
or "##default", then the provided default value will be used instead. If the value is "##none", then the value will benull
. Otherwise, the value is returned.- Parameters:
value
- the requested valuedefaultValue
- the default value- Returns:
- the resolved value
-
resolveOptionalNamespace
@Nullable public static String resolveOptionalNamespace(String annotationValue, IClassBinding classBinding)
-
resolveNamespace
@NonNull public static String resolveNamespace(String annotationValue, IClassBinding classBinding)
-
resolveToMarkupLine
@Nullable public static MarkupLine resolveToMarkupLine(@NonNull String annotationValue)
Get the markup value of a markdown string.- Parameters:
annotationValue
- markdown text or"##none"
if no text is provided- Returns:
- the markup line content or
null
if no markup content was provided
-
resolveToMarkupMultiline
@Nullable public static MarkupMultiline resolveToMarkupMultiline(@NonNull String annotationValue)
Get the markup value of a markdown string.- Parameters:
annotationValue
- markdown text or"##none"
if no text is provided- Returns:
- the markup line content or
null
if no markup content was provided
-
resolveToString
@Nullable public static String resolveToString(@NonNull String annotationValue)
Get the string value of a string.- Parameters:
annotationValue
- text or"##none"
if no text is provided- Returns:
- the string content or
null
if no string content was provided
-
getDataTypeAdapter
@NonNull public static IDataTypeAdapter<?> getDataTypeAdapter(@NonNull Class<? extends IDataTypeAdapter<?>> adapterClass, IBindingContext bindingContext)
-
resolveDefaultValue
@Nullable public static Object resolveDefaultValue(@NonNull String defaultValue, IDataTypeAdapter<?> adapter)
-
-