|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.AbstractNode
org.mmbase.bridge.implementation.VirtualNode
Implementation of Node. Simply wraps virtual node of core into an bridge Node. This class can be
used even if you don't know the precise implementation of the Cloud object (in contradiction to BasicNode, and therefore has a public constructor
VirtualNode(org.mmbase.module.core.VirtualNode, Cloud).
Node,
VirtualNode| Field Summary | |
protected Cloud |
cloud
|
protected NodeManager |
nodeManager
This is normally, but not always, a VirtualBuilder. |
protected VirtualNode |
noderef
|
| Fields inherited from class org.mmbase.bridge.util.AbstractNode |
ACTION_COMMIT, ACTION_CREATE, ACTION_DELETE, ACTION_EDIT |
| Constructor Summary | |
protected |
VirtualNode(Cloud cloud,
VirtualNode node,
NodeManager nm)
|
|
VirtualNode(Map values,
Cloud cloud)
Makes a Node from a map of values. |
|
VirtualNode(VirtualNode node,
Cloud cloud)
|
| Method Summary | |
protected FieldValue |
createFunctionValue(Object result)
|
Parameters |
createParameters(String functionName)
Creates a parameter list for a function. |
protected void |
edit(int action)
|
boolean |
getBooleanValue(String fieldName)
Returns the value of the specified field as a boolean. |
byte[] |
getByteValue(String fieldName)
Returns the value of the specified field as a byte array. |
Cloud |
getCloud()
Returns the cloud this node belongs to. |
Date |
getDateValue(String fieldName)
|
double |
getDoubleValue(String fieldName)
Returns the value of the specified field as a double. |
float |
getFloatValue(String fieldName)
Returns the value of the specified field as a float. |
Collection |
getFunctions()
Returns all the Function objects of this Node |
InputStream |
getInputStreamValue(String fieldName)
Returns the value of the specified field as a java.io.InputStream This is
especially usefull for large byte-array fields. |
int |
getIntValue(String fieldName)
Returns the value of the specified field as an int. |
List |
getListValue(String fieldName)
|
long |
getLongValue(String fieldName)
Returns the value of the specified field as a long. |
protected MMObjectNode |
getNode()
Obtains a reference to the underlying MMObjectNode. |
protected Function |
getNodeFunction(String functionName)
|
NodeManager |
getNodeManager()
Returns the node manager for this node. |
VirtualNode |
getNodeRef()
Returns the MMObjectNode on which the VirtualNode was based |
Node |
getNodeValue(String fieldName)
Returns the Node value of a certain field, but in the case of a VirtualNode this can also occasionally be null
because the node can have been deleted. |
int |
getNumber()
Returns the unique number for this node. |
long |
getSize(String fieldName)
Returns the 'size' (e.g. |
String |
getStringValue(String fieldName)
Returns the value of the specified field as a String. |
Object |
getValueWithoutProcess(String fieldName)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. |
protected static VirtualNode |
getVirtualNode(Map values)
|
Document |
getXMLValue(String fieldName)
Returns the value of the specified field as a dom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML. |
boolean |
isNodeManager()
Determine whether this Node is a NodeManager. |
boolean |
isNull(String fieldName)
Whether the value for the speficied field is null. |
boolean |
isRelation()
Determine whether this Node is a Relation. |
boolean |
isRelationManager()
Determine whether this Node is a RelationManager. |
void |
setSize(String fieldName,
long size)
|
protected void |
setValueWithoutChecks(String fieldName,
Object value)
|
NodeManager |
toNodeManager()
Returns this as a NodeManager. |
Relation |
toRelation()
Returns this as a Relation. |
RelationManager |
toRelationManager()
Returns this as a RelationManager. |
String |
toString()
Converts the node to a string |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Field Detail |
protected final VirtualNode noderef
protected final NodeManager nodeManager
protected final Cloud cloud
| Constructor Detail |
protected VirtualNode(Cloud cloud,
VirtualNode node,
NodeManager nm)
public VirtualNode(VirtualNode node,
Cloud cloud)
public VirtualNode(Map values,
Cloud cloud)
| Method Detail |
public String toString()
Node
toString in interface Nodeprotected static VirtualNode getVirtualNode(Map values)
public VirtualNode getNodeRef()
public boolean isRelation()
Node
isRelation in interface NodeisRelation in class AbstractNodepublic Relation toRelation()
Node
toRelation in interface NodetoRelation in class AbstractNodepublic boolean isNodeManager()
Node
isNodeManager in interface NodeisNodeManager in class AbstractNodepublic NodeManager toNodeManager()
Node
toNodeManager in interface NodetoNodeManager in class AbstractNodepublic boolean isRelationManager()
Node
isRelationManager in interface NodeisRelationManager in class AbstractNodepublic RelationManager toRelationManager()
Node
toRelationManager in interface NodetoRelationManager in class AbstractNodeprotected final MMObjectNode getNode()
NotFoundException - if no node was specified. This generally means thepublic Cloud getCloud()
Node
getCloud in interface Nodepublic NodeManager getNodeManager()
Node
getNodeManager in interface Nodepublic int getNumber()
Node
getNumber in interface NodegetNumber in class AbstractNodeprotected void edit(int action)
edit in class AbstractNodepublic boolean isNull(String fieldName)
Nodenull. This avoids acquiring the
complete value if you only want to check if for emptyness.
isNull in interface NodeisNull in class AbstractNode
public void setSize(String fieldName,
long size)
setSize in class AbstractNodepublic long getSize(String fieldName)
Node
getSize in interface Node
protected void setValueWithoutChecks(String fieldName,
Object value)
setValueWithoutChecks in class AbstractNodepublic Object getValueWithoutProcess(String fieldName)
Node
getValueWithoutProcess in interface NodefieldName - name of fieldpublic boolean getBooleanValue(String fieldName)
Nodeboolean.
If the actual value is numeric, this call returns true
if the value is a positive, non-zero, value. In other words, values '0'
and '-1' are considered false.
If the value is a string, this call returns true if
the value is "true" or "yes" (case-insensitive).
In all other cases (including calling byte fields), false
is returned.
getBooleanValue in interface NodegetBooleanValue in class AbstractNodepublic Date getDateValue(String fieldName)
getDateValue in interface NodegetDateValue in class AbstractNodepublic List getListValue(String fieldName)
getListValue in interface NodegetListValue in class AbstractNodepublic Node getNodeValue(String fieldName)
null
because the node can have been deleted.
getNodeValue in interface NodegetNodeValue in class AbstractNodepublic int getIntValue(String fieldName)
Nodeint.
Numeric fields are simply converted. Double and float values may be truncated.
For Node values, the numeric key is returned.
Long values return -1 of the value is too large.
Boolean fields return 0 if false, and 1 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1
getIntValue in interface NodegetIntValue in class AbstractNodepublic float getFloatValue(String fieldName)
Nodefloat.
This function attempts to convert the value to a float.
Numeric fields are simply converted.
Boolean fields return 0.0 if false, and 1.0 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1.0.
getFloatValue in interface NodegetFloatValue in class AbstractNodepublic long getLongValue(String fieldName)
Nodelong.
This function attempts to convert the value to a long.
Numeric fields are simply converted. Double and float values may be truncated.
Boolean fields return 0 if false, and 1 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1
getLongValue in interface NodegetLongValue in class AbstractNodepublic double getDoubleValue(String fieldName)
Nodedouble.
This function attempts to convert the value to a double.
Numeric fields are simply converted. Double may be truncated.
Boolean fields return 0.0 if false, and 1.0 if true.
String fields are parsed.
If a parsed string contains an error, ot the field value is not of a type that can be converted
(i.e. a byte array), this function returns -1.0.
getDoubleValue in interface NodegetDoubleValue in class AbstractNodepublic byte[] getByteValue(String fieldName)
Nodebyte array.
This function returns either the value of a byte field, or the byte value of a string
(converted using the default encoding, i.e. UTF8)
Other types of values return an empty byte-array.
getByteValue in interface NodegetByteValue in class AbstractNodepublic InputStream getInputStreamValue(String fieldName)
Nodejava.io.InputStream This is
especially usefull for large byte-array fields. By this you can avoid them to be completely
stored in memory.
getInputStreamValue in interface NodegetInputStreamValue in class AbstractNodepublic String getStringValue(String fieldName)
NodeString.
Byte arrays are converted to string using the default encoding (UTF8).
Node values return a string representation of their numeric key.
For other values the result is calling the toString() method on the actual object.
getStringValue in interface NodegetStringValue in class AbstractNodepublic Document getXMLValue(String fieldName)
Nodedom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML.
This included the empty string, but not the 'null' value.
If the value is null, this method returns null
getXMLValue in interface NodegetXMLValue in class AbstractNodepublic Collection getFunctions()
Node
getFunctions in interface NodeFunction objects.protected Function getNodeFunction(String functionName)
getNodeFunction in class AbstractNodepublic Parameters createParameters(String functionName)
Node
createParameters in interface NodecreateParameters in class AbstractNodeprotected FieldValue createFunctionValue(Object result)
createFunctionValue in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||