Class NameReference
- java.lang.Object
-
- org.yamcs.xtce.util.NameReference
-
- Direct Known Subclasses:
ResolvedNameReference,UnresolvedNameReference
public abstract class NameReference extends Object
Used when referencing a directory style "NameType".All characters are legal.
All name references use a Unix ‘like’ name referencing mechanism across the SpaceSystem Tree (e.g., SimpleSat/Bus/EPDS/BatteryOne/Voltage) where the '/', ‘..’ and ‘.’ are used to navigate through the hierarchy. The use of an unqualified name will search for an item in the current SpaceSystem first, then if none is found, in progressively higher SpaceSystems. A SpaceSystem is a name space (i.e., a named type declared in MetaCommandData is also declared in TelemetryMetaData - and vice versa).
This is used only while reading the database, then all the references are resolved and we use Java references to real objects
The ResolvedAction.resolved will be called once the reference is resolved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNameReference.ResolvedActionstatic classNameReference.Type
-
Field Summary
Fields Modifier and Type Field Description protected Stringrefprotected NameReference.Typetype
-
Constructor Summary
Constructors Constructor Description NameReference(String ref, NameReference.Type type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract NameReferenceaddResolvedAction(NameReference.ResolvedAction action)Adds an action to the list to be executed when the reference is resolved and returns this.StringgetReference()abstract CompletableFuture<NameDescription>getResolvedFuture()returns a future that is called when the reference is resolvedNameReference.TypegetType()abstract booleanisResolved()StringtoString()abstract booleantryResolve(NameDescription nd)Execute all the actions (if not already executed) and return true if the reference has been resolved.
-
-
-
Field Detail
-
ref
protected final String ref
-
type
protected final NameReference.Type type
-
-
Constructor Detail
-
NameReference
public NameReference(String ref, NameReference.Type type)
-
-
Method Detail
-
tryResolve
public abstract boolean tryResolve(NameDescription nd)
Execute all the actions (if not already executed) and return true if the reference has been resolved.- Parameters:
nd-- Returns:
- true if the reference has been resolved
-
addResolvedAction
public abstract NameReference addResolvedAction(NameReference.ResolvedAction action)
Adds an action to the list to be executed when the reference is resolved and returns this. If the reference is already resolved, execute the action immediately.- Parameters:
action-- Returns:
- this
-
getReference
public String getReference()
-
getType
public NameReference.Type getType()
-
isResolved
public abstract boolean isResolved()
-
getResolvedFuture
public abstract CompletableFuture<NameDescription> getResolvedFuture()
returns a future that is called when the reference is resolved- Returns:
-
-