|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DBWeb.Entity
An Entity represents a set of property/value pairs. Properties are always Strings. Values can be either singular or plural, but in either case are normally strings. A plural value may be retrieved in various ways. Entities also contain an ErrRecord, which remembers any errors or warnings associated with the Entity. Created on September 16, 2003, 3:37 PM
Field Summary | |
static java.lang.String[] |
fieldOrder
|
Constructor Summary | |
Entity()
Creates a new instance of Entity |
|
Entity(javax.servlet.http.HttpServletRequest rq)
Create an Entity from an HttpServletRequest. |
|
Entity(java.sql.ResultSet rs)
Creates a new instance of Entity from a SQL ResultSet. |
Method Summary | |
void |
add(java.lang.String key,
java.lang.String val)
Add an association between the key and val. |
void |
addError(java.lang.String key,
java.lang.String err)
Adds an error message associated with the key to the Entity. |
void |
addWarning(java.lang.String key,
java.lang.String err)
Adds a warning message associated with the key to the Entity. |
int |
compareTo(java.lang.Object other)
Entities should be compared by lexicographic ordering according to some order among their fields. |
void |
defaultFrom(DBWeb.Entity other)
Copies over any properties that aren't in this Entity from other. |
java.lang.String |
get(java.lang.String key)
Retrieves the value associated with the String key. |
java.lang.String |
getDmdy(java.lang.String key)
|
java.lang.String |
getDmy(java.lang.String key)
|
java.lang.String |
getDSql(java.lang.String key)
Retrieves the value associated with the String key as a date appropriate for storing in a SQL database, e.g., 1995-07-14. |
java.lang.String |
getDy(java.lang.String key)
|
java.lang.String |
getH(java.lang.String key)
Retrieves value(s) associated with the String key. |
java.util.ArrayList |
getP(java.lang.String key)
Retrieves an ArrayList of values associated with the key. |
java.lang.String |
getQ(java.lang.String key)
Retrieves value(s) associated with the String key. |
java.lang.String |
getS(java.lang.String key)
Retrives the value(s) associated with the String key. |
boolean |
isOK()
Is true if there are no errors associated with this Entity. |
void |
put(java.lang.String key,
java.lang.String val)
Create an association between the key and val, both Strings. |
void |
putP(java.lang.String key,
java.util.Collection c)
Create an association between the key and all elements of the Collection c, where all are Strings. |
void |
putP(java.lang.String key,
java.lang.String[] vals)
Create an association between the key and all elements of vals[], where all are Strings. |
void |
reconcileEntities(EntityModel em,
DBWeb.Entity other)
Compares the field values of this and the OTHER Entity and adds warnings for any fields that differ. |
java.lang.String |
toErrHtml()
Returns HTML needed to display any errors or warnings. |
java.lang.String |
toHtml()
Returns a String suitable for displaying the content of the Entity as an HTML table. |
java.lang.String |
toString()
Returns a compact String representation of an Entity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static java.lang.String[] fieldOrder
Constructor Detail |
public Entity()
public Entity(java.sql.ResultSet rs)
rs
- ResultSetpublic Entity(javax.servlet.http.HttpServletRequest rq)
rq
- HttpServletRequestMethod Detail |
public void put(java.lang.String key, java.lang.String val)
key
- A String holding the key.val
- A String holding the value.public void putP(java.lang.String key, java.lang.String[] vals)
key
- A String holding the key.vals
- A String[] holding the values.public void putP(java.lang.String key, java.util.Collection c)
key
- A String holding the key.public void add(java.lang.String key, java.lang.String val)
key
- A String holding the key.val
- A String holding the new key to add.public void addError(java.lang.String key, java.lang.String err)
key
- A String holding the key.err
- A String holding the error message.public void addWarning(java.lang.String key, java.lang.String err)
key
- A String holding the key.err
- A String holding the warning message.public java.lang.String get(java.lang.String key)
key
- A String holding the key.
public java.lang.String getS(java.lang.String key)
key
- A String holding the key.
public java.lang.String getH(java.lang.String key)
key
- A String holding the key.
public java.lang.String getQ(java.lang.String key)
key
- A String holding the key.
public java.lang.String getDSql(java.lang.String key)
key
- A String holding the key.
public java.lang.String getDmdy(java.lang.String key)
public java.lang.String getDmy(java.lang.String key)
public java.lang.String getDy(java.lang.String key)
public java.util.ArrayList getP(java.lang.String key)
key
- A String holding the key.
public boolean isOK()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHtml()
public java.lang.String toErrHtml()
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- The other object to which this should be compared.public void reconcileEntities(EntityModel em, DBWeb.Entity other)
public void defaultFrom(DBWeb.Entity other)
other
- The Entity from which to default properties
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |