public interface TargetRegistrar
The registrar enables answering these questions:
Modifier and Type | Method and Description |
---|---|
void |
addIdentifierReference(java.lang.String referenceLocation,
Identifier identifier)
Adds a reference to a target identifier.
|
void |
addTarget(java.lang.String parentLocation,
TargetType type,
java.lang.String location)
Indicates that a target was discovered in the subtree
being validated.
|
void |
addTargetReference(java.lang.String referenceLocation,
java.lang.String targetLocation)
Adds a reference from a label to a target.
|
java.util.Collection<ValidationTarget> |
getChildTargets(ValidationTarget parent)
Gets the locations of children of a given target.
|
java.util.Collection<IdentifierReference> |
getDanglingReferences()
Gets a collection of identifiers that are referenced but not defined.
|
java.util.Map<Identifier,java.lang.String> |
getIdentifierDefinitions()
Gets a mapping of identifiers to their locations.
|
java.lang.String |
getIdentifierReferenceLocation(Identifier id)
Gets the location of where the given identifier is referenced.
|
int |
getLabelCount()
Gets the number of labels encountered so far.
|
java.util.Collection<Identifier> |
getReferencedIdentifiers()
Gets a collection of referenced identifiers.
|
ValidationTarget |
getRoot()
Gets the root location.
|
int |
getTargetCount(TargetType type)
Gets the number of targets encountered so far for a target type.
|
java.lang.String |
getTargetForIdentifier(Identifier identifier)
Gets the location where an identifier was defined.
|
java.util.Collection<Identifier> |
getUnreferencedIdentifiers()
Gets a collection of identifiers that are defined but never
referenced.
|
java.util.Collection<java.lang.String> |
getUnreferencedTargets()
Gets a collection of target locations that are never referenced.
|
boolean |
hasTarget(java.lang.String targetLocation)
Tests whether a target exists for a location.
|
boolean |
isIdentifierReferenced(Identifier identifier)
Tests whether an identifier was referenced.
|
boolean |
isTargetReferenced(java.lang.String location)
Tests whether a target was referenced.
|
void |
setTargetIdentifier(java.lang.String location,
Identifier identifier)
Sets an identifier for uniquely identifying the target.
|
void |
setTargetIsLabel(java.lang.String location,
boolean isLabel)
Indicates whether a target is a label.
|
ValidationTarget getRoot()
void addTarget(java.lang.String parentLocation, TargetType type, java.lang.String location)
parentLocation
- the parent target location, or null, if this is the root targettype
- the target typelocation
- the target locationjava.util.Collection<ValidationTarget> getChildTargets(ValidationTarget parent)
parent
- the parent targetboolean hasTarget(java.lang.String targetLocation)
targetLocation
- the target locationint getTargetCount(TargetType type)
type
- the target typevoid setTargetIsLabel(java.lang.String location, boolean isLabel)
location
- the target locationisLabel
- true, if the target is a labelint getLabelCount()
void setTargetIdentifier(java.lang.String location, Identifier identifier)
location
- the target locationidentifier
- the target identifiervoid addTargetReference(java.lang.String referenceLocation, java.lang.String targetLocation)
referenceLocation
- the label locationtargetLocation
- the target location referred to in the labelboolean isTargetReferenced(java.lang.String location)
location
- the target locationvoid addIdentifierReference(java.lang.String referenceLocation, Identifier identifier)
referenceLocation
- the location of the referenceidentifier
- the target identifier being referencedboolean isIdentifierReferenced(Identifier identifier)
identifier
- the identifierjava.lang.String getTargetForIdentifier(Identifier identifier)
identifier
- the identifierjava.util.Map<Identifier,java.lang.String> getIdentifierDefinitions()
java.util.Collection<java.lang.String> getUnreferencedTargets()
java.util.Collection<Identifier> getUnreferencedIdentifiers()
java.util.Collection<IdentifierReference> getDanglingReferences()
java.util.Collection<Identifier> getReferencedIdentifiers()
java.lang.String getIdentifierReferenceLocation(Identifier id)
id
- The identifier to find.Copyright © 2010-2019 Planetary Data System. All Rights Reserved.