edu.indiana.dde.mylead.common
Class MyLeadElementData

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

public class MyLeadElementData
extends java.lang.Object

This class is used to create an element within a dynamic attribute to be added for an object in a myLEAD metadata catalog. After populating the element, the wrapElement method can be used to create a attr node that can be added as an element within an attr or detailed node.


Field Summary
static java.lang.String MYLEAD_SOURCE_DEFAULT
           
 
Constructor Summary
MyLeadElementData(java.lang.String elementName)
          This version of the MyLeadElementData constructor takes a String as a parameter which is the name used for the element when inserted.
MyLeadElementData(java.lang.String elementSrc, java.lang.String elementName)
          This version of the MyLeadElementData constructor takes both name and source parameters.
MyLeadElementData(java.lang.String elementSrc, java.lang.String elementName, java.lang.String elementValue)
          This version of the MyLeadElementData constructor takes a name and source parameter as well as a value parameter.
 
Method Summary
 void addDate(java.util.Date elementValue)
          Adds a date variable as a date element value to an existing instance of MyLeadElementData.
 void addDateTime(java.util.Date elementValue)
          Adds a date variable as a dateTime element value to an existing instance of MyLeadElementData.
 void addTime(java.util.Date elementValue)
          Adds a date variable as a time element value to an existing instance of MyLeadElementData.
 java.lang.String getName()
          This method returns the element name currently set for this element.
 java.lang.String getSource()
          This method returns the element source currently set for this element.
 java.lang.String getValue(int pos)
          This method returns the element value currently set for this element at the position specified by the parameter.
 void setName(java.lang.String elementName)
          Sets the element name for an existing instance of MyLeadElementData.
 void setSource(java.lang.String elementSrc)
          Sets the element source for an existing instance of MyLeadElementData.
 void setValue(java.lang.String elementValue)
          Adds an element value to an existing instance of MyLeadElementData.
 java.lang.String wrapElement()
          This routine wraps up an element and returns a string that can then be included in the LMS fragment for a detailed attribute.
 
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

MyLeadElementData

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

Parameters:
elementName - String with the name of the element.

MyLeadElementData

public MyLeadElementData(java.lang.String elementSrc,
                         java.lang.String elementName)
This version of the MyLeadElementData constructor takes both name and source parameters. Both are needed to identify an element within a dynamic attribute.

Parameters:
elementName - String with the name of the element.
elementSrc - String with the source of the element's definition.

MyLeadElementData

public MyLeadElementData(java.lang.String elementSrc,
                         java.lang.String elementName,
                         java.lang.String elementValue)
This version of the MyLeadElementData constructor takes a name and source parameter as well as a value parameter.

Parameters:
elementName - String with the name of the element.
elementSrc - String with the source of the element's definition.
elementValue - String with the value (properly formatted if a different data type)
Method Detail

setName

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

Parameters:
elementName - String with the element name.

getName

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

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

setSource

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

Parameters:
elementSrc - String with the element source.

getSource

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

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

setValue

public void setValue(java.lang.String elementValue)
Adds an element value to an existing instance of MyLeadElementData. The string passed as the value can be a blank String.

Parameters:
elementValue - String with the element value.

addDateTime

public void addDateTime(java.util.Date elementValue)
Adds a date variable as a dateTime element value to an existing instance of MyLeadElementData. The string passed as the value can be a blank String.

Parameters:
elementValue - String with the element value.

addDate

public void addDate(java.util.Date elementValue)
Adds a date variable as a date element value to an existing instance of MyLeadElementData. The string passed as the value can be a blank String.

Parameters:
elementValue - String with the element value.

addTime

public void addTime(java.util.Date elementValue)
Adds a date variable as a time element value to an existing instance of MyLeadElementData. The string passed as the value can be a blank String.

Parameters:
elementValue - String with the element value.

getValue

public java.lang.String getValue(int pos)
This method returns the element value currently set for this element at the position specified by the parameter. The first element value is position 0. If an invalid position is specified, then a blank string is returned.

Returns:
String with the element value, which could be a blank string.

wrapElement

public java.lang.String wrapElement()
This routine wraps up an element and returns a string that can then be included in the LMS fragment for a detailed attribute. 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 element.