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. |
validInstanceOf
public StructRefDefinition(String name)
name
- structure name; must not be null
public StructRefDefinition(StructDefinition structDefinition)
structDefinition
- structure definition; must not be
null
public String getName()
null
public StructDefinition getTarget()
null
for an
unresolved referencepublic void setTarget(StructDefinition structDefinition)
structDefinition
- structure definition; must not be
null
CoreException
- 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()
DataDefinition
DataType
for this type.getType
in class DataDefinition
DataType
for this typepublic void accept(DefinitionVisitor visitor)
DataDefinition
accept
in class DataDefinition
visitor
- the visitor operating on this data-definitionpublic List<Message> validate(DataValue value)
DataDefinition
DataValue
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 DataDefinition
value
- the DataValue
to validatepublic void completeValue(DataValue value)
DataDefinition
completeValue
in class DataDefinition
value
- the value to checkpublic String toString()
DataDefinition
toString
in class DataDefinition
Copyright © 2015. All Rights Reserved.