info.magnolia.cms.core
Class NonExistingNodeData

java.lang.Object
  extended by info.magnolia.cms.core.AbstractNodeData
      extended by info.magnolia.cms.core.NonExistingNodeData
All Implemented Interfaces:
NodeData, Cloneable

public class NonExistingNodeData
extends AbstractNodeData

Represents an non-mutable empty node data. This is returned by Content.getNodeData(String) in case the node data does not exist. This is the case because jcr doesn't support empty properties. All reading methods will return a default value which might be null in some cases. All writing methods will throw an ItemNotFoundException.

Version:
$Id$
Author:
pbaerfuss

Field Summary
 
Fields inherited from class info.magnolia.cms.core.AbstractNodeData
name
 
Fields inherited from interface info.magnolia.cms.core.NodeData
MULTIVALUE_FALSE, MULTIVALUE_TRUE, MULTIVALUE_UNDEFINED
 
Constructor Summary
NonExistingNodeData(Content parent, String name)
           
 
Method Summary
 void delete()
          Remove this path.
 String getAttribute(String name)
          get attribute, available only if NodeData is of type Binary.
 boolean getBoolean()
          Returns the boolean representation of the value.
protected  Content getContentFromJCRReference()
          Specific implementation for retrieving the referenced node when using a property of type REFERENCE.
 long getContentLength()
          returns size in bytes.
 Calendar getDate()
          Returns the Calendar representation of the value.
 double getDouble()
          Returns the double representation of the value.
 javax.jcr.Property getJCRProperty()
          Access to property at the JCR level.
 long getLong()
          Returns the long representation of the value.
 InputStream getStream()
          Returns the InputStream representation of the value.
 String getString()
          Returns the String representation of the value.
 int getType()
          Returns the type of this NodeData.
 javax.jcr.Value getValue()
          Returns the value of this NodeData.
 javax.jcr.Value[] getValues()
          For multi-value properties.
 boolean isExist()
          checks if the atom exists in the repository.
 void refresh(boolean keepChanges)
          Refreshes current node keeping all changes.
 void save()
          Persists all changes to the repository if validation succeeds.
 void setValue(boolean value)
          set value of type boolean.
 void setValue(Calendar value)
          set value of type Calendar.
 void setValue(Content value)
          Sets a reference value.
 void setValue(double value)
          set value of type double.
 void setValue(InputStream value)
          set value of type InputStream.
 void setValue(int value)
          set value of type int.
 void setValue(long value)
          set value of type long.
 void setValue(String value)
          set value of type String.
 void setValue(javax.jcr.Value value)
          set value of type Value.
 void setValue(javax.jcr.Value[] value)
          set value of type Value[].
 
Methods inherited from class info.magnolia.cms.core.AbstractNodeData
getAttributeNames, getHandle, getHierarchyManager, getName, getParent, getReferencedContent, getReferencedContent, getReferencedContent, getString, isGranted, isMultiValue, setAttribute, setAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonExistingNodeData

public NonExistingNodeData(Content parent,
                           String name)
Method Detail

getContentFromJCRReference

protected Content getContentFromJCRReference()
                                      throws javax.jcr.RepositoryException
Description copied from class: AbstractNodeData
Specific implementation for retrieving the referenced node when using a property of type REFERENCE.

Specified by:
getContentFromJCRReference in class AbstractNodeData
Throws:
javax.jcr.RepositoryException

delete

public void delete()
            throws javax.jcr.RepositoryException
Description copied from interface: NodeData
Remove this path.

Throws:
javax.jcr.RepositoryException

getBoolean

public boolean getBoolean()
Description copied from interface: NodeData
Returns the boolean representation of the value.

Returns:
boolean

getContentLength

public long getContentLength()
Description copied from interface: NodeData
returns size in bytes.

Returns:
content length

getDate

public Calendar getDate()
Description copied from interface: NodeData
Returns the Calendar representation of the value.

Returns:
Calendar

getDouble

public double getDouble()
Description copied from interface: NodeData
Returns the double representation of the value.

Returns:
double

getJCRProperty

public javax.jcr.Property getJCRProperty()
Description copied from interface: NodeData
Access to property at the JCR level. Available only to be available, should not be used in normal circumstances!

Returns:
Property

getLong

public long getLong()
Description copied from interface: NodeData
Returns the long representation of the value.

Returns:
long

getStream

public InputStream getStream()
Description copied from interface: NodeData
Returns the InputStream representation of the value.

Returns:
boolean

getString

public String getString()
Description copied from interface: NodeData
Returns the String representation of the value.

Returns:
String

getAttribute

public String getAttribute(String name)
Description copied from interface: NodeData
get attribute, available only if NodeData is of type Binary.

Specified by:
getAttribute in interface NodeData
Overrides:
getAttribute in class AbstractNodeData
Returns:
string value

getType

public int getType()
Description copied from interface: NodeData
Returns the type of this NodeData. One of:

Returns:
PropertyType

getValue

public javax.jcr.Value getValue()
Description copied from interface: NodeData
Returns the value of this NodeData. One of type:

Returns:
Value

getValues

public javax.jcr.Value[] getValues()
Description copied from interface: NodeData
For multi-value properties.

Returns:
Value[]

isExist

public boolean isExist()
Description copied from interface: NodeData
checks if the atom exists in the repository.

Returns:
boolean

refresh

public void refresh(boolean keepChanges)
             throws javax.jcr.RepositoryException
Description copied from interface: NodeData
Refreshes current node keeping all changes.

Throws:
javax.jcr.RepositoryException
See Also:
Item.refresh(boolean)

save

public void save()
          throws javax.jcr.RepositoryException
Description copied from interface: NodeData
Persists all changes to the repository if validation succeeds.

Throws:
javax.jcr.RepositoryException

setValue

public void setValue(String value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type String.

Parameters:
value - , string to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(int value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type int.

Parameters:
value - , int value to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(long value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type long.

Parameters:
value - , long value to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(InputStream value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type InputStream.

Parameters:
value - , InputStream to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(double value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type double.

Parameters:
value - , double value to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(boolean value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type boolean.

Parameters:
value - , boolean value to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(Calendar value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type Calendar.

Parameters:
value - , Calendar value to be set
Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(Content value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
Sets a reference value.

Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(javax.jcr.Value value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type Value.

Throws:
javax.jcr.RepositoryException
AccessDeniedException

setValue

public void setValue(javax.jcr.Value[] value)
              throws javax.jcr.RepositoryException,
                     AccessDeniedException
Description copied from interface: NodeData
set value of type Value[].

Throws:
javax.jcr.RepositoryException
AccessDeniedException


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.