edu.indiana.dde.mylead.common
Class MyLeadAttrData

java.lang.Object
  extended by edu.indiana.dde.mylead.common.MyLeadAttrData

public class MyLeadAttrData
extends java.lang.Object

This class is used to create a dynamic attribute to be added for an object in a myLEAD metadata catalog. After populating the attribute, the wrapAttribute method can be used to create a detail node that can be added to an existing myLEAD metadata object.


Field Summary
static java.lang.String MYLEAD_SOURCE_DEFAULT
           
 
Constructor Summary
MyLeadAttrData(java.lang.String attrName)
          This version of the MyLeadAttrData constructor takes a String as a parameter which is the name used for the attribute when inserted.
MyLeadAttrData(java.lang.String attrSrc, java.lang.String attrName)
          This version of the MyLeadAttrData constructor takes both name and source parameters.
 
Method Summary
 void addAttribute(MyLeadAttrData leadAttribute)
          This method is used to add an instance of this class as a subattribute.
 void addElement(MyLeadElementData leadElement)
          This method is used to add an instance of MyLeadElementData as an element of this attribute.
 java.lang.String getName()
          This method returns the attribute name currently set for this attribute.
 java.lang.String getSource()
          This method returns the attribute source currently set for this attribute.
 void setName(java.lang.String attrName)
          Sets the attribute name for an existing instance of MyLeadAttrData.
 void setSource(java.lang.String attrSrc)
          Sets the attribute source for an existing instance of MyLeadAttrData.
 java.lang.String wrapAttribute()
          This routine wraps up an attribute and returns a string that can then be used as a parameter in the myLEAD addAttribute method.
 java.lang.String wrapSubAttribute()
          This routine wraps up an attribute as a subattribute and returns a string that can then be used as a parameter in the myLEAD addAttribute method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MYLEAD_SOURCE_DEFAULT

public static final java.lang.String MYLEAD_SOURCE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

MyLeadAttrData

public MyLeadAttrData(java.lang.String attrName)
This version of the MyLeadAttrData constructor takes a String as a parameter which is the name used for the attribute when inserted. The source uses the default and must be set if the source is not the default myLEAD source.

Parameters:
attrName - String with the name of the attribute.

MyLeadAttrData

public MyLeadAttrData(java.lang.String attrSrc,
                      java.lang.String attrName)
This version of the MyLeadAttrData constructor takes both name and source parameters. Both are needed to identify a dynamic attribute.

Parameters:
attrName - String with the name of the attribute.
attrSrc - String with the source of the attribute definition.
Method Detail

setName

public void setName(java.lang.String attrName)
Sets the attribute name for an existing instance of MyLeadAttrData. The string passed as the name can be a blank String.

Parameters:
attrName - String with the attribute name.

getName

public java.lang.String getName()
This method returns the attribute name currently set for this attribute.

Returns:
String with the attribute name, which could be a blank string.

setSource

public void setSource(java.lang.String attrSrc)
Sets the attribute source for an existing instance of MyLeadAttrData. The string passed as the source can be a blank String.

Parameters:
attrSrc - String with the attribute source.

getSource

public java.lang.String getSource()
This method returns the attribute source currently set for this attribute.

Returns:
String with the attribute source, which could be a blank string.

addAttribute

public void addAttribute(MyLeadAttrData leadAttribute)
This method is used to add an instance of this class as a subattribute. However, this instance of the MyLeadAttrData class should never be passed to it as its own subattribute. Any attribute added as a subattribute in a query must be defined as a subattribute of this attribute in the lead_attribute_definition table.

Parameters:
leadAttribute - Instance of this class that is a subattribute.

addElement

public void addElement(MyLeadElementData leadElement)
This method is used to add an instance of MyLeadElementData as an element of this attribute. Any element added using this method must already be defined in the lead_element_definition table. If this is not a valid element for this attribute, it will still be included in the CLOB stored for this attribute, but it will not be queryable.

Parameters:
leadElement - The instance of MyLeadElementData to be added.

wrapAttribute

public java.lang.String wrapAttribute()
This routine wraps up an attribute and returns a string that can then be used as a parameter in the myLEAD addAttribute method. Any sub attributes are nested.

Returns:
String that wraps the elements in this attribute and any sub-attributes.

wrapSubAttribute

public java.lang.String wrapSubAttribute()
This routine wraps up an attribute as a subattribute and returns a string that can then be used as a parameter in the myLEAD addAttribute method. Any sub attributes are nested. In a dynamic attribute, subattributes have a different structure than attributes. It is assumed that the FGDC and LEADElement namespaces have been declared in the XML for the enclosing attribute with the fc and le namespace prefixes respectively.

Returns:
String that wraps the elements in this attribute as a subattribute.