com.mentata.sg8
Class SG8StringAttribute

java.lang.Object
  extended bycom.mentata.l3d.L3DAttribute
      extended bycom.mentata.sg8.SG8StringAttribute
All Implemented Interfaces:
Comparator, SG8Attribute
Direct Known Subclasses:
SG8ConstantAttribute, SG8DateAttribute, SG8DiscreteAttribute, SG8EmailAttribute, SG8HTMLBlockAttribute, SG8ImageAttribute, SG8MLSAttribute, SG8PasswordAttribute, SG8TextAttribute, SG8URLAttribute, SG8UTCAttribute

public class SG8StringAttribute
extends L3DAttribute
implements SG8Attribute

A string attribute for use with SG8 objects.

Since:
0.7
Author:
Jon Roberts

Field Summary
 
Fields inherited from interface com.mentata.sg8.SG8Attribute
TEXT_RESOURCES
 
Constructor Summary
SG8StringAttribute()
           
 
Method Summary
 String[] getHTMLValues()
          Returns the attribute values formatted for HTML output.
 String getHyperlink()
          Returns an SG8 gateway hyperlink for displaying the attribute.
 String getSeparator()
          Returns a separator string to display between values in HTML output.
protected  SG8Object getSG8Object()
          Returns an empty instance of the containing SG8 object for this attribute.
 String getUpdateHTML()
          Returns HTML form elements for modifying the attribute.
 boolean isAugmenting()
          Indicates if the attribute only accepts additional values.
 boolean isHTMLExceeded()
          Indicates if the number of values for the attribute exceeds the maximum for HTML display.
 boolean processUpdateHTML(HttpServletRequest req)
          Reads and processes attribute changes from relevant HTML request form parameters.
 void setAugmenting()
          Configures the attribute to only accept additional values.
 void setHTMLThreshold(int threshold)
          Sets the maximum number of values to display in HTML output.
 void setSeparator(String separator)
          Sets the separator string to display between values in HTML output.
 
Methods inherited from class com.mentata.l3d.L3DAttribute
addValue, compare, getAttribute, getBind, getContext, getLabel, getLengthThreshold, getName, getObject, getObject, getPrerequisites, getShortValues, getSize, getThreshold, getValues, initialize, isBound, isExceeded, isGenerated, isLengthExceeded, isMultivalue, isRequired, removeValue, same, setGenerated, setLabel, setLengthThreshold, setPrerequisites, setThreshold, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SG8StringAttribute

public SG8StringAttribute()
Method Detail

getSG8Object

protected SG8Object getSG8Object()
                          throws SG8Exception
Returns an empty instance of the containing SG8 object for this attribute.

Returns:
the containing SG8 object
Throws:
SG8Exception - if the containing object is improperly defined

getHTMLValues

public String[] getHTMLValues()
                       throws SG8Exception
Returns the attribute values formatted for HTML output.

Specified by:
getHTMLValues in interface SG8Attribute
Returns:
the short values
Throws:
SG8Exception

setHTMLThreshold

public void setHTMLThreshold(int threshold)
Sets the maximum number of values to display in HTML output.

Specified by:
setHTMLThreshold in interface SG8Attribute
Parameters:
threshold - a maximum number of values to display

isHTMLExceeded

public boolean isHTMLExceeded()
Indicates if the number of values for the attribute exceeds the maximum for HTML display.

Specified by:
isHTMLExceeded in interface SG8Attribute
Returns:
whether the attribute exceeds the HTML threshold

getHyperlink

public String getHyperlink()
                    throws SG8Exception
Returns an SG8 gateway hyperlink for displaying the attribute.

Specified by:
getHyperlink in interface SG8Attribute
Returns:
the hyperlink HTML
Throws:
SG8Exception

setSeparator

public void setSeparator(String separator)
Sets the separator string to display between values in HTML output.

Specified by:
setSeparator in interface SG8Attribute
Parameters:
separator - a string to display between values

getSeparator

public String getSeparator()
Returns a separator string to display between values in HTML output.

Specified by:
getSeparator in interface SG8Attribute
Returns:
the separator string

setAugmenting

public void setAugmenting()
Configures the attribute to only accept additional values.

Specified by:
setAugmenting in interface SG8Attribute

isAugmenting

public boolean isAugmenting()
Indicates if the attribute only accepts additional values.

Specified by:
isAugmenting in interface SG8Attribute
Returns:
whether the attribute only accepts additional values

getUpdateHTML

public String getUpdateHTML()
                     throws SG8Exception
Returns HTML form elements for modifying the attribute.

Specified by:
getUpdateHTML in interface SG8Attribute
Returns:
the HTML modification form elements
Throws:
SG8Exception - if the attribute is generated

processUpdateHTML

public boolean processUpdateHTML(HttpServletRequest req)
                          throws SG8Exception
Reads and processes attribute changes from relevant HTML request form parameters.

Specified by:
processUpdateHTML in interface SG8Attribute
Parameters:
req - a servlet request
Returns:
whether the attribute values changed
Throws:
SG8Exception - if form values are inappropriate or the attribute is generated