edu.indiana.dde.mylead.common
Class MyLeadAttrData

java.lang.Object
  extended byedu.indiana.dde.mylead.common.MyLeadAttrData

public class MyLeadAttrData
extends java.lang.Object

The purpose of the MyLeadAttrData class is to provide a means for a user to specify an attribute to be added to a myLEAD metadata catalog. An attribute has a name, elements, and possibly recursive layers of subattributes. The attribute and any subattributes it contains must already be defined in the lead_attribute_definition table in the myLEAD database and the subattributes must already be defined as being subattributes of the attribute. Likewise, and elements the attribute contains must already be defined in the lead_element_definition table as elements of the attribute.


Constructor Summary
MyLeadAttrData()
          Default constructor for the MyLeadAttrData class.
MyLeadAttrData(java.lang.String attrName)
          This version of the MyLeadAttrData constructor takes a name for the attribute being added.
 
Method Summary
 void addAttribute(MyLeadAttrData leadAttribute)
          This method allows an attribute to be added as a subattribute of this attribute.
 void addElement(MyLeadElemData leadElement)
          This method allows an instance of MyLeadElemData to be added as an element of this attribute.
 void addGeoElement(MyLeadGeoData leadGeoElement)
          This method allows a spatial element to be added as an element of this attribute.
 java.lang.String getName()
          This method returns the name currently set for this attribute.
 void setName(java.lang.String attrName)
          Method that allows the attribute name to be set or changed.
 java.lang.String wrapAttribute()
          This routine wraps up an attribute and returns a string that can then be used in a myLEAD OGSA-DAI perform document for adding attributes or adding attributes as part of a file or collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadAttrData

public MyLeadAttrData()
Default constructor for the MyLeadAttrData class. This method calls initialize with an empty string to set the attribute name to a blank string and then create the array lists for elements, spatial elements (geoElements), and subattributes. The attribute name must actually be set before the attribute can be used.


MyLeadAttrData

public MyLeadAttrData(java.lang.String attrName)
This version of the MyLeadAttrData constructor takes a name for the attribute being added. As with the default constructor, this version also calls the initialize method, but passes the name that is specified as a parameter.

Parameters:
attrName - The name of the attribute being added.
Method Detail

setName

public void setName(java.lang.String attrName)
Method that allows the attribute name to be set or changed.

Parameters:
attrName - String with the new attribute name setting.

getName

public java.lang.String getName()
This method returns the name currently set for this attribute. If the MyLeadAttrData class were to be used to return values for query results, this method could be used to extract the attribute's name.

Returns:
String with the atrribute's name.

addAttribute

public void addAttribute(MyLeadAttrData leadAttribute)
This method allows an attribute to be added as a subattribute of this attribute.

Parameters:
leadAttribute - An instance of this class to add a subattribute to this attribute (which itself may be a subattribute).

addElement

public void addElement(MyLeadElemData leadElement)
This method allows an instance of MyLeadElemData to be added as an element of this attribute.

Parameters:
leadElement - The MyLeadElemData instance to be added as an element of this attribute.

addGeoElement

public void addGeoElement(MyLeadGeoData leadGeoElement)
This method allows a spatial element to be added as an element of this attribute. The spatial element can be a mySQL spatial data type and can generate its data in the WKT format used by mySQL.

Parameters:
leadGeoElement - Instance of MyLeadGeoData class being added as a spatial element for this attribute.

wrapAttribute

public java.lang.String wrapAttribute()
This routine wraps up an attribute and returns a string that can then be used in a myLEAD OGSA-DAI perform document for adding attributes or adding attributes as part of a file or collection. Any sub attributes are nested.

Returns:
String that wraps the elements in this attribute as well as any sub-attributes of this attribute.