|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
org.json.simple.JSONObject
org.exoplatform.social.client.core.model.ModelImpl
public class ModelImpl
ModelImpl implements Model.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected PropertyChangeSupport |
propertyChanges
The property change event support for this model. |
| Constructor Summary | |
|---|---|
ModelImpl()
|
|
| 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 class org.json.simple.JSONObject |
|---|
escape, toJSONString, toJSONString, toString, toString, writeJSONString, writeJSONString |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| 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 |
| Field Detail |
|---|
protected PropertyChangeSupport propertyChanges
| Constructor Detail |
|---|
public ModelImpl()
| Method Detail |
|---|
public String[] getFieldNames()
getFieldNames in interface Modelpublic boolean hasField(String fieldName)
true if a value is associated with the specified field name, false otherwise.
hasField in interface ModelfieldName - name of field to look up
public Object getField(String fieldName)
getField in interface ModelfieldName - name of field whose value is to be returned
public Map getFieldAsMap(String fieldName)
Map. Equivalent to (Map) getField(fieldName), hence
this method will throw a ClassCastException if the field does not implement Map.
getFieldAsMap in interface ModelfieldName - name of field whose value is to be returned
ClassCastExceptionpublic List getFieldAsList(String fieldName)
List. Equivalent to (List)
getField(fieldName), hence this method will throw a ClassCastException if the field does not implement List.
getFieldAsList in interface ModelfieldName - name of field whose value is to be returned
ClassCastExceptionpublic String getFieldAsString(String fieldName)
String. Equivalent to (String) getField(fieldName),
hence this method will throw a ClassCastException if the field is not of type String.
getFieldAsString in interface ModelfieldName - name of field whose value is to be returned
ClassCastExceptionpublic boolean isFieldMultikeyed(String fieldName)
true if the value of the specified field implements Map, false otherwise.
isFieldMultikeyed in interface ModelfieldName - name of field to look up
public boolean isFieldMultivalued(String fieldName)
true if the value of the specified field implements List, false otherwise.
isFieldMultivalued in interface ModelfieldName - name of field to look up
public void setField(String fieldName,
Object value)
setField in interface ModelfieldName - name of field to setvalue - object to associate with passed field name
public void addToListField(String fieldName,
Object item)
addToListField in interface ModelfieldName - name of list field for which the passed item should be addeditem - item to addpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface Modellistener - The listener to be addedpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface Modellistener - The listener to be removed.public PropertyChangeListener[] findPropertyChangeListeners()
findPropertyChangeListeners in interface Model
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||