|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Model
The general model extends JSONObject's interfaces.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change event listener to this model |
void |
addToListField(String fieldName,
Object item)
Adds the passed Object to the list field with the specified name. |
PropertyChangeListener[] |
findPropertyChangeListeners()
Gets the property change listeners registered and associated with this property change listener. |
Object |
getField(String fieldName)
Returns the value of the specified field as an Object. |
List |
getFieldAsList(String fieldName)
Returns the value of the specified field as a List. |
Map |
getFieldAsMap(String fieldName)
Returns the value of the specified field as a Map. |
String |
getFieldAsString(String fieldName)
Returns the value of the specified field as a String. |
String[] |
getFieldNames()
Returns the complete set of properties associated with the model instance. |
boolean |
hasField(String fieldName)
Returns true if a value is associated with the specified field name, false otherwise. |
boolean |
isFieldMultikeyed(String fieldName)
Returns true if the value of the specified field implements Map, false otherwise. |
boolean |
isFieldMultivalued(String fieldName)
Returns true if the value of the specified field implements List, false otherwise. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change event listener which was added to this model. |
void |
setField(String fieldName,
Object value)
Sets the value of the specified field to the passed Object. |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from interface org.json.simple.JSONAware |
|---|
toJSONString |
| Methods inherited from interface org.json.simple.JSONStreamAware |
|---|
writeJSONString |
| Method Detail |
|---|
String[] getFieldNames()
boolean hasField(String fieldName)
true if a value is associated with the specified field name, false otherwise.
fieldName - name of field to look up
Object getField(String fieldName)
fieldName - name of field whose value is to be returned
Map getFieldAsMap(String fieldName)
Map. Equivalent to (Map) getField(fieldName), hence
this method will throw a ClassCastException if the field does not implement Map.
fieldName - name of field whose value is to be returned
ClassCastExceptionList getFieldAsList(String fieldName)
List. Equivalent to (List)
getField(fieldName), hence this method will throw a ClassCastException if the field does not implement List.
fieldName - name of field whose value is to be returned
ClassCastExceptionString getFieldAsString(String fieldName)
String. Equivalent to (String) getField(fieldName),
hence this method will throw a ClassCastException if the field is not of type String.
fieldName - name of field whose value is to be returned
ClassCastExceptionboolean isFieldMultikeyed(String fieldName)
true if the value of the specified field implements Map, false otherwise.
fieldName - name of field to look up
boolean isFieldMultivalued(String fieldName)
true if the value of the specified field implements List, false otherwise.
fieldName - name of field to look up
void setField(String fieldName,
Object value)
fieldName - name of field to setvalue - object to associate with passed field name
void addToListField(String fieldName,
Object item)
fieldName - name of list field for which the passed item should be addeditem - item to addvoid addPropertyChangeListener(PropertyChangeListener listener)
listener - The listener to be addedvoid removePropertyChangeListener(PropertyChangeListener listener)
listener - The listener to be removed.PropertyChangeListener[] findPropertyChangeListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||