public class StructRefDefinition extends DataDefinition
StructDefinition. If the reference is resolved, it is
bound to a specific StructDefinition target. If the reference is
unresolved, its target is null.
Thread-safety: Conditionally thread-safe. Resolving the reference via
setTarget(StructDefinition) is not thread-safe.
| Constructor and Description |
|---|
StructRefDefinition(String name)
Creates an unresolved reference.
|
StructRefDefinition(StructDefinition structDefinition)
Creates a resolved reference.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(DefinitionVisitor visitor)
Applies a visitor to this data-definition.
|
void |
completeValue(DataValue value)
Check the value to see if the data-definition can fill in any missing
data before validation
|
boolean |
equals(Object obj) |
String |
getName()
Returns the structure name of this reference.
|
StructDefinition |
getTarget()
Returns the target structure definition of this reference.
|
DataType |
getType()
Returns the
DataType for this type. |
int |
hashCode() |
void |
setTarget(StructDefinition structDefinition)
Resolves the reference.
|
String |
toString() |
List<Message> |
validate(DataValue value)
Validates that the specified
DataValue is an instance of this
data definition. |
validInstanceOfpublic StructRefDefinition(String name)
name - structure name; must not be nullpublic StructRefDefinition(StructDefinition structDefinition)
structDefinition - structure definition; must not be
nullpublic String getName()
nullpublic StructDefinition getTarget()
null for an
unresolved referencepublic void setTarget(StructDefinition structDefinition)
structDefinition - structure definition; must not be
nullCoreException - if the reference is already resolved (already has
a target) or if the name of the reference does not
match the name of the definitionpublic DataType getType()
DataDefinitionDataType for this type.getType in class DataDefinitionDataType for this typepublic void accept(DefinitionVisitor visitor)
DataDefinitionaccept in class DataDefinitionvisitor - the visitor operating on this data-definitionpublic List<Message> validate(DataValue value)
DataDefinitionDataValue is an instance of this
data definition.
Validates that supplied value is not null
and it's type matches the type of this definition.
validate in class DataDefinitionvalue - the DataValue to validatepublic void completeValue(DataValue value)
DataDefinitioncompleteValue in class DataDefinitionvalue - the value to checkpublic String toString()
DataDefinitiontoString in class DataDefinitionCopyright © 2023. All rights reserved.