Class JSArrayImpl<T extends JSValue>
- java.lang.Object
-
- org.bedework.jsforj.impl.values.JSValueImpl
-
- org.bedework.jsforj.impl.values.collections.JSArrayImpl<T>
-
- Direct Known Subclasses:
JSEntriesImpl,JSIntArrayImpl,JSRecurrenceRulesImpl,JSStringArrayImpl,JSUnsignedIntArrayImpl
public abstract class JSArrayImpl<T extends JSValue> extends JSValueImpl implements JSArray<T>
User: mike Date: 10/25/19 Time: 12:45
-
-
Field Summary
-
Fields inherited from class org.bedework.jsforj.impl.values.JSValueImpl
factory, type
-
-
Constructor Summary
Constructors Constructor Description JSArrayImpl(String type, com.fasterxml.jackson.databind.JsonNode node)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(T val)voidclear()Remove all contained properties and valuesprotected abstract com.fasterxml.jackson.databind.JsonNodeconvertToElement(T val)protected abstract TconvertToT(com.fasterxml.jackson.databind.JsonNode node)List<T>get()Returns a list even though it's an array in jsonTget(int index)voidpreWrite()Called before we output the object.voidremove(int index)booleanremove(T val)intsize()Returns the number of elements in this array.-
Methods inherited from class org.bedework.jsforj.impl.values.JSValueImpl
assertArray, assertBooleanNode, assertIntNode, assertObject, assertStringNode, equals, getBooleanProperty, getBooleanValue, getChanged, getFactory, getNode, getObjectType, getOverrideGenerated, getOwner, getParentProperty, getProperties, getProperty, getProperty, getPropertyValue, getStringProperty, getStringValue, getType, getUnsignedIntegerProperty, getValue, hasChanges, hasProperty, isString, makeProperty, makeProperty, markOverrideGenerated, newProperty, removeProperty, setMasterCopy, setOwner, setParentProperty, setProperty, setProperty, setProperty, setProperty, setProperty, writeValue, writeValueAsString, writeValueAsStringFormatted
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.jsforj.model.values.JSValue
copy, getBooleanProperty, getBooleanValue, getChanged, getNode, getObjectType, getOverrideGenerated, getOwner, getParentProperty, getProperties, getProperty, getProperty, getPropertyValue, getStringProperty, getStringValue, getType, getUnsignedIntegerProperty, getValue, hasChanges, hasProperty, isString, makeProperty, markOverrideGenerated, newProperty, removeProperty, setProperty, setProperty, setProperty, setProperty, setProperty, writeValue, writeValueAsString, writeValueAsStringFormatted
-
-
-
-
Constructor Detail
-
JSArrayImpl
public JSArrayImpl(String type, com.fasterxml.jackson.databind.JsonNode node)
-
-
Method Detail
-
convertToElement
protected abstract com.fasterxml.jackson.databind.JsonNode convertToElement(T val)
- Parameters:
val- external representation- Returns:
- internal representation (json field name)
-
convertToT
protected abstract T convertToT(com.fasterxml.jackson.databind.JsonNode node)
- Parameters:
node- representing the object- Returns:
- external representation
-
preWrite
public void preWrite()
Description copied from interface:JSValueCalled before we output the object. Objects MUST call all children to allow any processing before output - e.g. generate patches.- Specified by:
preWritein interfaceJSValue- Overrides:
preWritein classJSValueImpl
-
size
public int size()
Description copied from interface:JSArrayReturns the number of elements in this array. If this array contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.
-
get
public List<T> get()
Description copied from interface:JSArrayReturns a list even though it's an array in json
-
get
public T get(int index)
-
add
public void add(T val)
-
remove
public void remove(int index)
-
remove
public boolean remove(T val)
-
clear
public void clear()
Description copied from interface:JSValueRemove all contained properties and values- Specified by:
clearin interfaceJSValue- Overrides:
clearin classJSValueImpl
-
-