Interface INamedInstance
-
- All Superinterfaces:
IInstance
,IModelElement
,INamedModelElement
- All Known Subinterfaces:
IAssemblyInstance
,IFieldInstance
,IFlagInstance
,INamedModelInstance
- All Known Implementing Classes:
AbstractAssemblyInstance
,AbstractFieldInstance
,AbstractFlagInstance
public interface INamedInstance extends IInstance, INamedModelElement
This marker interface indicates that the instance has a flag, field, or assembly name associated with it which will be used in JSON/YAML or XML to identify the data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IDefinition
getDefinition()
Retrieve the definition of this instance.default MarkupLine
getEffectiveDescription()
Get the text that describes the basic use of the element, which allows an instance to override a definition's description.default String
getEffectiveFormalName()
The resolved formal display name, which allows an instance to override a definition's name.default String
getEffectiveName()
Get the name to use based on the provided names.Object
getValue(Object parentInstance)
Get the current value from the providedparentInstance
object.default String
getXmlNamespace()
Retrieve the XML namespace for this instance.default QName
getXmlQName()
Get the XML qualified name to use in XML.default String
toCoordinates()
Generates a "coordinate" string for the provided information element instance.-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IInstance
getContainingDefinition, getContainingModule, getParentContainer
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelElement
getModelType, getRemarks
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.INamedModelElement
getDescription, getFormalName, getJsonName, getName, getProperties, getPropertyValues, getUseName, hasProperty, hasPropertyValue
-
-
-
-
Method Detail
-
getDefinition
@NonNull IDefinition getDefinition()
Retrieve the definition of this instance.- Returns:
- the corresponding definition
-
getXmlQName
default QName getXmlQName()
Get the XML qualified name to use in XML.- Returns:
- the XML qualified name, or
null
if there isn't one
-
getXmlNamespace
default String getXmlNamespace()
Retrieve the XML namespace for this instance.- Returns:
- the XML namespace or
null
if no namespace is defined
-
getValue
Object getValue(@NonNull Object parentInstance)
Get the current value from the providedparentInstance
object. The provided object must be of the type associated with the definition containing this property.- Parameters:
parentInstance
- the object associated with the definition containing this property- Returns:
- the value if available, or
null
otherwise
-
toCoordinates
default String toCoordinates()
Generates a "coordinate" string for the provided information element instance. A coordinate consists of the element's:- containing Metaschema module's short name
- model type
- name
- hash code
- the hash code of the definition
- Specified by:
toCoordinates
in interfaceIInstance
- Specified by:
toCoordinates
in interfaceIModelElement
- Returns:
- the coordinate
-
getEffectiveName
@NonNull default String getEffectiveName()
Description copied from interface:INamedModelElement
Get the name to use based on the provided names. This method will return the use name provided byINamedModelElement.getUseName()
if the call is notnull
, and fall back to the name provided byINamedModelElement.getName()
otherwise. This is the model name to use for the for an instance where the instance is referenced.- Specified by:
getEffectiveName
in interfaceINamedModelElement
- Returns:
- the use name if available, or the name if not
- See Also:
INamedModelElement.getUseName()
,INamedModelElement.getName()
-
getEffectiveFormalName
default String getEffectiveFormalName()
Description copied from interface:INamedModelElement
The resolved formal display name, which allows an instance to override a definition's name.- Specified by:
getEffectiveFormalName
in interfaceINamedModelElement
- Returns:
- the formal name or
null
if not defined
-
getEffectiveDescription
default MarkupLine getEffectiveDescription()
Description copied from interface:INamedModelElement
Get the text that describes the basic use of the element, which allows an instance to override a definition's description.- Specified by:
getEffectiveDescription
in interfaceINamedModelElement
- Returns:
- a line of markup text or
null
if not defined
-
-