Package opendap.dap

Class Alias

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Alias
    extends Attribute
    The Alias type is a special attribute. It is simply a reference (like a "soft link" in a UNIX file system) to another attribute.

    The rules for the definiton and interpretation an Alias are as follows:

    In the persistent representation of the DDS (XML, or old DAS & DDS syntax) Alias definitions will contain 2 fields: name, attribute. Example from a DDS:

     Alias CalDate  .profiler.cast.conductivity.calibration.date
     
    Or a DDX:
     <Alias name="CalDate" attribute=".profiler.cast.conductivity.calibration.date"/>
     

    The rules for the interpretation of these fields are as follows:

    • Then Alias defintion begins with the word Alias
    • The name field is consumed in it's entirety (unparsed) and used as the name of the Alias.

    • There a number of rules specific to the representation and interpretation of the attribute field in the Alias declaration.
      • The " (double quote) and the \ (backslash aka escape) characters MUST be escaped (using \ character) in the value of the attribute field.
      • Each variable and attribute name in the attribute field must be enclosed in double quotes if their values contain the dot (.) character. For example: .sometimes."names.contain".dots would be three names sometimes, names.contain, and dots.
      • Fully qualified attribute names always begin with the dot (.) character.
      • All attribute names always MUST be fully qualified (begin with a dot). The leading dot represents a fully qualifed path attribute reference, starting at top level of DDX, or the DAS.
      • If the attribute field contains only the dot (.) character, then it is referencing the collection of attributes associated with the highest level of the Dataset (global attributes) This collection always exists, but may be empty.
      • The attribute field MUST NOT be empty.
      • The attribute field MUST NOT point to another Alias.

    • After the parser has completely parsed the DDX (or DAS) it will attempt to reslove each alias to a specific attribute. If an alias cannot be resolved to some attribute, and exception will be thrown by the parser.

    Warning: DAS and DDS objects built using methods other than DDS.parse(), DDS.parseXML, DDS.getDAS(), or DAS.parse() must call DDS.resolveAliases() or DAS.resolveAliases() prior to allowing client software access to these objects. Since an Alias essentially represents a "pointer" to some (other) Attribute, that Attribute object must be found. Once this has been done (by calling the correct resolveAliases() method) the Aliases will act transparently as references to their target Attributes.

    See Also:
    AttributeTable, DDS, DDS.parse(java.io.InputStream), DDS.parseXML(java.io.InputStream, boolean), DDS.getDAS(), DAS, Serialized Form
    • Constructor Detail

      • Alias

        public Alias​(String aName,
                     String attributeName)
        Construct an Alias. This constructor is used by the DDSXMLParser to and the DAS parser build Aliases for the DDX.
        Parameters:
        aName - a String containing the name of the alias.
        attributeName - the String containing the normalized name of the variable and attribute that this Alias references.