opendap/src/main/java/opendap/dap/DDS.java
private void populateAttributeTable(AttributeTable atTable, Attribute attr)
            throws DASException
    {
        // Always check for Aliases first! They return the values for their targets
        // when asked if they are containers!
        if (attr.isAlias()) {

            String alias = attr.getEncodedName();
            String attribute = ((Alias) attr).getAliasedToAttributeFieldAsClearString();
            if (_Debug) DAPNode.log.debug("Adding Alias name: " + alias);
            atTable.addAlias(alias, convertDDSAliasFieldsToDASAliasFields(attribute));
        } else if (attr.isContainer()) {
            // If this Attribute is a container of other Attributes (an AttributeTable)
            // then we need to recurse to get it's children.

            // Get this Attribute's container (AttributeTable).
            // Since we are using the AttributeTable
            // interface to build the DAS (which will have a different structure than the
            // table we are getting anyway), we don't need a copy, only the reference.
            AttributeTable thisTable = attr.getContainer();

            // Start a new (child) AttributeTable (using the name of the one we are
            // copying) in the (parent) AttributeTable we are working on.
            if (_Debug) DAPNode.log.debug("Appending AttributeTable name: " + thisTable.getEncodedName());
            AttributeTable newTable = atTable.appendContainer(thisTable.getEncodedName());

            // Get each Attribute in the AttributeTable that we are copying,
            // and then put it's values into our new AttributeTable;
            Enumeration e = thisTable.getNames();
            while (e.hasMoreElements()) {
                String attrName = (String) e.nextElement();
                Attribute thisAttr = thisTable.getAttribute(attrName);
                populateAttributeTable(newTable, thisAttr);
            }
        } else {
            // Since the Attribute is a "leaf" and not a container we need to
            // push it's contents into the AttributeTable that we are building.
            int type = attr.getType();
            String name = attr.getEncodedName();
            Enumeration v = attr.getValues();
            while (v.hasMoreElements()) {
                String value = (String) v.nextElement();
                if (_Debug)
                    DAPNode.log.debug("AtributeTable: " + atTable.getEncodedName() + " Appending Attribute name: " + name + "  type: " + type + " value: " + value);
                atTable.appendAttribute(name, type, value);
            }
        }
    }
private void populateAttributeTable(AttributeTable atTable, Attribute attr)
            throws DASException
    {
        // Always check for Aliases first! They return the values for their targets
        // when asked if they are containers!
        if (attr.isAlias()) {

            String alias = attr.getEncodedName();
            String attribute = ((Alias) attr).getAliasedToAttributeFieldAsClearString();
            if (_Debug) DAPNode.log.debug("Adding Alias name: " + alias);
            atTable.addAlias(alias, convertDDSAliasFieldsToDASAliasFields(attribute));
        } else if (attr.isContainer()) {
            // If this Attribute is a container of other Attributes (an AttributeTable)
            // then we need to recurse to get it's children.

            // Get this Attribute's container (AttributeTable).
            // Since we are using the AttributeTable
            // interface to build the DAS (which will have a different structure than the
            // table we are getting anyway), we don't need a copy, only the reference.
            AttributeTable thisTable = attr.getContainer();

            // Start a new (child) AttributeTable (using the name of the one we are
            // copying) in the (parent) AttributeTable we are working on.
            if (_Debug) DAPNode.log.debug("Appending AttributeTable name: " + thisTable.getEncodedName());
            AttributeTable newTable = atTable.appendContainer(thisTable.getEncodedName());

            // Get each Attribute in the AttributeTable that we are copying,
            // and then put it's values into our new AttributeTable;
            Enumeration e = thisTable.getNames();
            while (e.hasMoreElements()) {
                String attrName = (String) e.nextElement();
                Attribute thisAttr = thisTable.getAttribute(attrName);
                populateAttributeTable(newTable, thisAttr);
            }
        } else {
            // Since the Attribute is a "leaf" and not a container we need to
            // push it's contents into the AttributeTable that we are building.
            int type = attr.getType();
            String name = attr.getEncodedName();
            Enumeration v = attr.getValues();
            while (v.hasMoreElements()) {
                String value = (String) v.nextElement();
                if (_Debug)
                    DAPNode.log.debug("AtributeTable: " + atTable.getEncodedName() + " Appending Attribute name: " + name + "  type: " + type + " value: " + value);
                atTable.appendAttribute(name, type, value);
            }
        }
    }
private void populateAttributeTable ( AttributeTable atTable , Attribute attr ) throws DASException { // Always check for Aliases first! They return the values for their targets // when asked if they are containers! if ( attr . isAlias ( ) ) { String alias = attr . getEncodedName ( ) ; String attribute = ( ( Alias ) attr ) . getAliasedToAttributeFieldAsClearString ( ) ; if ( _Debug ) DAPNode . log . debug ( "Adding Alias name: " + alias ) ; atTable . addAlias ( alias , convertDDSAliasFieldsToDASAliasFields ( attribute ) ) ; } else if ( attr . isContainer ( ) ) { // If this Attribute is a container of other Attributes (an AttributeTable) // then we need to recurse to get it's children. // Get this Attribute's container (AttributeTable). // Since we are using the AttributeTable // interface to build the DAS (which will have a different structure than the // table we are getting anyway), we don't need a copy, only the reference. AttributeTable thisTable = attr . getContainer ( ) ; // Start a new (child) AttributeTable (using the name of the one we are // copying) in the (parent) AttributeTable we are working on. if ( _Debug ) DAPNode . log . debug ( "Appending AttributeTable name: " + thisTable . getEncodedName ( ) ) ; AttributeTable newTable = atTable . appendContainer ( thisTable . getEncodedName ( ) ) ; // Get each Attribute in the AttributeTable that we are copying, // and then put it's values into our new AttributeTable; Enumeration e = thisTable . getNames ( ) ; while ( e . hasMoreElements ( ) ) { String attrName = ( String ) e . nextElement ( ) ; Attribute thisAttr = thisTable . getAttribute ( attrName ) ; populateAttributeTable ( newTable , thisAttr ) ; } } else { // Since the Attribute is a "leaf" and not a container we need to // push it's contents into the AttributeTable that we are building. int type = attr . getType ( ) ; String name = attr . getEncodedName ( ) ; Enumeration v = attr . getValues ( ) ; while ( v . hasMoreElements ( ) ) { String value = ( String ) v . nextElement ( ) ; if ( _Debug ) DAPNode . log . debug ( "AtributeTable: " + atTable . getEncodedName ( ) + " Appending Attribute name: " + name + "  type: " + type + " value: " + value ) ; atTable . appendAttribute ( name , type , value ) ; } } }
Builds AttributeTables (from BaseType variables) for us in
a DAS created by getDAS()

@param atTable
@param attr
@throws DASException
@see #buildDASAttributeTable(BaseType, AttributeTable)
@see #getDAS()
Builds AttributeTables ( from BaseType variables ) for us in a DAS created by getDAS ()