opendap/src/main/java/opendap/dap/DDS.java
private void resolveAliases(BaseType bt) throws MalformedAliasException, UnresolvedAliasException, NoSuchAttributeException
    {

        // cache the current/parent BaseType (a container)
        BaseType cacheBT = currentBT;
        try {
        // Make the one we are about to search the current one.
        currentBT = bt;

        // Make the current AttributeTable null to indicate that we are at the top
        // AttributeTable of a new current BaseType.
        currentAT = null;


        if (Debug.isSet("DDS.resolveAliases"))
            DAPNode.log.debug("Searching for Aliases in the Attributes of Variable: " + bt.getEncodedName());

        // Process the Attributes of this BaseType.
        resolveAliases(bt.getAttributeTable());

        // Now if this current BaseType is a container type, then we better
        // search and resolve Aliases in it's children.
        if (bt instanceof DConstructor) {
            if (Debug.isSet("DDS.resolveAliases"))
                DAPNode.log.debug("Searching for Aliases in the children of Variable: " + bt.getEncodedName());

            Enumeration bte = ((DConstructor) bt).getVariables();

            while (bte.hasMoreElements()) {
                BaseType thisBT = (BaseType) bte.nextElement();

                // Recursive call...
                resolveAliases(thisBT);
            }
        }
        } finally {
        // Restore the previous current BaseType state.
        currentBT = cacheBT;
        }
    }
private void resolveAliases(BaseType bt) throws MalformedAliasException, UnresolvedAliasException, NoSuchAttributeException
    {

        // cache the current/parent BaseType (a container)
        BaseType cacheBT = currentBT;
        try {
        // Make the one we are about to search the current one.
        currentBT = bt;

        // Make the current AttributeTable null to indicate that we are at the top
        // AttributeTable of a new current BaseType.
        currentAT = null;


        if (Debug.isSet("DDS.resolveAliases"))
            DAPNode.log.debug("Searching for Aliases in the Attributes of Variable: " + bt.getEncodedName());

        // Process the Attributes of this BaseType.
        resolveAliases(bt.getAttributeTable());

        // Now if this current BaseType is a container type, then we better
        // search and resolve Aliases in it's children.
        if (bt instanceof DConstructor) {
            if (Debug.isSet("DDS.resolveAliases"))
                DAPNode.log.debug("Searching for Aliases in the children of Variable: " + bt.getEncodedName());

            Enumeration bte = ((DConstructor) bt).getVariables();

            while (bte.hasMoreElements()) {
                BaseType thisBT = (BaseType) bte.nextElement();

                // Recursive call...
                resolveAliases(thisBT);
            }
        }
        } finally {
        // Restore the previous current BaseType state.
        currentBT = cacheBT;
        }
    }
Before the DDS can be used all of the Aliases in the various
AttributeTables must be resolved. This means that it is necessary to verify that
each Alias references an Attribute that exists, and is not another Alias. This
is accomplished by searching the DDS's variable's attribute holdings for Aliases
Everytime an Alias is located, a new search begins to find the Attribute that the
Alias is attempting to reference.
<p/>
This method recursively searchs through the passed <code>BaseType</code> parameter
bt for Alias members of AttributeTables, and when they are found attempts to
resolve them to a specific Attribute.
<p/>
This method gets called at the top level at the parser ONLY after the entire
DDS has been parsed and built. It's intial invocation get passed the DDS (which
is in fact a <code>BaseType</code>)
<p/>
<p/>
This method manipulates the global variable <code>currentBT</code>.

@param bt The <code>BaseType</code> in which to search for and resolve Alias members