public class Node extends Object implements StateAccessor
Node
implementation. The actual data is stored in contained objects that are Fragment
s.Modifier and Type | Field and Description |
---|---|
protected org.nuxeo.ecm.core.storage.sql.FragmentsMap |
fragments
Fragment information for each additional mixin or inherited fragment.
|
protected SimpleFragment |
hierFragment
The hierarchy/main fragment.
|
protected String |
path
Path, only for immediate consumption after construction (will be reset to null afterwards).
|
Modifier | Constructor and Description |
---|---|
protected |
Node(PersistenceContext context,
org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup,
String path)
Creates a Node.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearCache()
Clears the properties cache, used when removing mixins.
|
boolean |
equals(Object other) |
Set<String> |
getAllMixinTypes()
Gets the mixins.
|
Object[] |
getArray(String name)
Gets an array value.
|
CollectionProperty |
getCollectionProperty(String name)
Gets a collection property from the node, given its name.
|
protected SimpleFragment |
getHierFragment() |
Serializable |
getId()
Gets the node unique id, usually a Long or a String.
|
String[] |
getMixinTypes()
Gets the instance mixins.
|
String |
getName() |
Serializable |
getParentId() |
String |
getPath()
Gets the path that was assigned at
Node construction time. |
Long |
getPos() |
String |
getPrimaryType() |
protected ModelProperty |
getPropertyInfo(String name) |
SimpleProperty |
getSimpleProperty(String name)
Gets a simple property from the node, given its name.
|
Object |
getSingle(String name)
Gets a single value.
|
int |
hashCode() |
boolean |
hasMixinType(String mixin)
Checks the mixins.
|
boolean |
isProxy() |
boolean |
isVersion() |
protected CollectionProperty |
makeCollectionProperty(String name,
ModelProperty propertyInfo) |
protected SimpleProperty |
makeSimpleProperty(String name,
ModelProperty propertyInfo) |
void |
setArray(String name,
Object[] value)
Sets an array value.
|
void |
setCollectionProperty(String name,
Object[] value) |
void |
setSimpleProperty(String name,
Object value) |
void |
setSingle(String name,
Object value)
Sets a single value.
|
String |
toString() |
protected final SimpleFragment hierFragment
protected final org.nuxeo.ecm.core.storage.sql.FragmentsMap fragments
protected Node(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path)
context
- the persistence contextfragmentGroup
- the group of fragments for the nodepath
- the path, if known at construction timepublic Serializable getId()
public String getPrimaryType()
public Serializable getParentId()
public String getPath()
Node
construction time. Then it's reset to null
. Should only
be used once.null
for unknownprotected SimpleFragment getHierFragment()
public boolean isVersion()
public boolean isProxy()
public String[] getMixinTypes()
Never returns null
.
public Set<String> getAllMixinTypes()
public boolean hasMixinType(String mixin)
protected void clearCache()
public SimpleProperty getSimpleProperty(String name)
name
- the property namePropertyNotFoundException
- if the name is invalidprotected SimpleProperty makeSimpleProperty(String name, ModelProperty propertyInfo)
public CollectionProperty getCollectionProperty(String name)
name
- the property namePropertyNotFoundException
- if the name is invalidprotected CollectionProperty makeCollectionProperty(String name, ModelProperty propertyInfo)
protected ModelProperty getPropertyInfo(String name)
public void setSimpleProperty(String name, Object value)
public void setCollectionProperty(String name, Object[] value)
public Object getSingle(String name) throws PropertyException
StateAccessor
getSingle
in interface StateAccessor
name
- the namePropertyException
public Object[] getArray(String name) throws PropertyException
StateAccessor
getArray
in interface StateAccessor
name
- the namePropertyException
public void setSingle(String name, Object value) throws PropertyException
StateAccessor
setSingle
in interface StateAccessor
name
- the namevalue
- the valuePropertyException
public void setArray(String name, Object[] value) throws PropertyException
StateAccessor
setArray
in interface StateAccessor
name
- the namevalue
- the valuePropertyException
Copyright © 2017 Nuxeo. All rights reserved.