Class DefaultAssemblyClassBinding
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.model.DefaultAssemblyClassBinding
-
- All Implemented Interfaces:
IConstrained,IModelConstrained,gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureModelConstrained,gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureValueConstrained,IValueConstrained,IAssembly,IAssemblyDefinition,IContainer,IDefinition,IFeatureFlagContainer<IBoundFlagInstance>,IFeatureModelContainer<IBoundNamedModelInstance,IBoundNamedModelInstance,IBoundFieldInstance,IBoundAssemblyInstance,IChoiceInstance>,IFlagContainer,IModelContainer,IModelElement,INamedModelElement,IAssemblyClassBinding,IClassBinding
public class DefaultAssemblyClassBinding extends Object implements IAssemblyClassBinding
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.metaschema.core.model.IDefinition
DEFAULT_DEFINITION_MODEL_SCOPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAssemblyClassBinding(Class<?> clazz, IBindingContext bindingContext)Construct a newIClassBindingfor a Java bean annotated with theBoundAssemblyannotation.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IAssembly
getModelType
-
Methods inherited from interface gov.nist.secauto.metaschema.databind.model.IAssemblyClassBinding
getOwningDefinition, getProperties
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IAssemblyDefinition
getRootJsonName, isSimple
-
Methods inherited from interface gov.nist.secauto.metaschema.databind.model.IClassBinding
callAfterDeserialize, callBeforeDeserialize, copyBoundObject, getBindingContext, getBoundClass, newInstance
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IDefinition
getModuleScope, toCoordinates
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IFeatureFlagContainer
getFlagInstanceByName, getFlagInstances, getJsonKeyFlagInstance
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureModelConstrained
addConstraint, addConstraint, addConstraint, getHasCardinalityConstraints, getIndexConstraints, getUniqueConstraints
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IFeatureModelContainer
getAssemblyInstanceByName, getAssemblyInstances, getChoiceInstances, getFieldInstanceByName, getFieldInstances, getModelInstanceByName, getModelInstances, getNamedModelInstances
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureValueConstrained
addConstraint, addConstraint, addConstraint, addConstraint, getAllowedValuesConstraints, getConstraints, getExpectConstraints, getIndexHasKeyConstraints, getMatchesConstraints
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IFlagContainer
hasJsonKey
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.IModelElement
getContainingModule
-
Methods inherited from interface gov.nist.secauto.metaschema.core.model.INamedModelElement
getEffectiveDescription, getEffectiveFormalName, getEffectiveName, getJsonName, getPropertyValues, getUseName, hasProperty, hasPropertyValue
-
-
-
-
Constructor Detail
-
DefaultAssemblyClassBinding
protected DefaultAssemblyClassBinding(@NonNull Class<?> clazz, @NonNull IBindingContext bindingContext)
Construct a newIClassBindingfor a Java bean annotated with theBoundAssemblyannotation.- Parameters:
clazz- the Java bean classbindingContext- the class binding context for which this class is participating
-
-
Method Detail
-
createInstance
@NonNull public static DefaultAssemblyClassBinding createInstance(@NonNull Class<?> clazz, @NonNull IBindingContext bindingContext)
Create a newIClassBindingfor a Java bean annotated with theBoundAssemblyannotation.- Parameters:
clazz- the Java bean classbindingContext- information about how Java classes are bound to Module definitions- Returns:
- the Module assembly binding for the class
-
getFlagContainer
public IFlagContainerSupport<IBoundFlagInstance> getFlagContainer()
- Specified by:
getFlagContainerin interfaceIFeatureFlagContainer<IBoundFlagInstance>
-
getModelContainer
public IModelContainerSupport<IBoundNamedModelInstance,IBoundNamedModelInstance,IBoundFieldInstance,IBoundAssemblyInstance,IChoiceInstance> getModelContainer()
- Specified by:
getModelContainerin interfaceIFeatureModelContainer<IBoundNamedModelInstance,IBoundNamedModelInstance,IBoundFieldInstance,IBoundAssemblyInstance,IChoiceInstance>
-
getFormalName
public String getFormalName()
- Specified by:
getFormalNamein interfaceINamedModelElement
-
getDescription
public MarkupLine getDescription()
- Specified by:
getDescriptionin interfaceINamedModelElement
-
getRemarks
@Nullable public MarkupMultiline getRemarks()
- Specified by:
getRemarksin interfaceIModelElement
-
getName
public String getName()
- Specified by:
getNamein interfaceINamedModelElement
-
isInline
public boolean isInline()
- Specified by:
isInlinein interfaceIDefinition
-
getInlineInstance
public IBoundAssemblyInstance getInlineInstance()
- Specified by:
getInlineInstancein interfaceIAssemblyDefinition- Specified by:
getInlineInstancein interfaceIDefinition- Specified by:
getInlineInstancein interfaceIFlagContainer
-
isRoot
public boolean isRoot()
- Specified by:
isRootin interfaceIAssemblyDefinition
-
getRootName
public String getRootName()
- Specified by:
getRootNamein interfaceIAssemblyDefinition
-
getRootXmlQName
public QName getRootXmlQName()
- Specified by:
getRootXmlQNamein interfaceIAssemblyDefinition
-
getConstraintSupport
public IModelConstrained getConstraintSupport()
- Specified by:
getConstraintSupportin interfacegov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureModelConstrained- Specified by:
getConstraintSupportin interfacegov.nist.secauto.metaschema.core.model.constraint.impl.IFeatureValueConstrained
-
copyBoundObjectInternal
protected void copyBoundObjectInternal(@NonNull Object fromInstance, @NonNull Object toInstance) throws BindingException
- Throws:
BindingException
-
getModuleClass
protected Class<? extends IModule> getModuleClass()
-
getBoundClass
public Class<?> getBoundClass()
Description copied from interface:IClassBindingThe class this binding is for.- Specified by:
getBoundClassin interfaceIClassBinding- Returns:
- the bound class
-
getBindingContext
public IBindingContext getBindingContext()
- Specified by:
getBindingContextin interfaceIClassBinding
-
getUseName
public String getUseName()
- Specified by:
getUseNamein interfaceINamedModelElement
-
toCoordinates
public String toCoordinates()
- Specified by:
toCoordinatesin interfaceIDefinition- Specified by:
toCoordinatesin interfaceIModelElement
-
getModuleScope
@NonNull public ModuleScopeEnum getModuleScope()
- Specified by:
getModuleScopein interfaceIDefinition
-
initModule
@NonNull protected IModule initModule()
-
getContainingModule
public IModule getContainingModule()
- Specified by:
getContainingModulein interfaceIModelElement
-
newInstance
@NonNull public <CLASS> CLASS newInstance() throws BindingExceptionGets a new instance of the bound class.- Specified by:
newInstancein interfaceIClassBinding- Type Parameters:
CLASS- the type of the bound class- Returns:
- a Java object for the class
- Throws:
BindingException- if the instance cannot be created due to a binding error
-
callBeforeDeserialize
public void callBeforeDeserialize(Object targetObject, Object parentObject) throws BindingException
Calls the method named "beforeDeserialize" on each class in the object's hierarchy if the method exists on the class.These methods can be used to set the initial state of the target bound object before data is read and applied during deserialization.
- Specified by:
callBeforeDeserializein interfaceIClassBinding- Parameters:
targetObject- the data object target to call the method(s) onparentObject- the object target's parent object, which is used as the method argument- Throws:
BindingException- if an error occurs while calling the method
-
callAfterDeserialize
public void callAfterDeserialize(Object targetObject, Object parentObject) throws BindingException
Calls the method named "afterDeserialize" on each class in the object's hierarchy if the method exists.These methods can be used to modify the state of the target bound object after data is read and applied during deserialization.
- Specified by:
callAfterDeserializein interfaceIClassBinding- Parameters:
targetObject- the data object target to call the method(s) onparentObject- the object target's parent object, which is used as the method argument- Throws:
BindingException- if an error occurs while calling the method
-
copyBoundObject
public Object copyBoundObject(Object item, Object parentInstance) throws BindingException
Description copied from interface:IClassBindingCreate a deep copy of the provided bound object.- Specified by:
copyBoundObjectin interfaceIClassBinding- Parameters:
item- the bound object to copyparentInstance- the new object's parent instance ornull- Returns:
- the copy
- Throws:
BindingException- if an error occurred copying content between java instances
-
-