org.modeshape.repository
Class ModeShapeConfiguration.GraphReturnable<ReturnType,ThisType>

java.lang.Object
  extended by org.modeshape.repository.ModeShapeConfiguration.BaseReturnable<ReturnType>
      extended by org.modeshape.repository.ModeShapeConfiguration.GraphReturnable<ReturnType,ThisType>
Type Parameters:
ReturnType - the type to be returned
ThisType - the type to be returned by the set properties, set description, etc. methods
All Implemented Interfaces:
ModeShapeConfiguration.Removable<ReturnType>, ModeShapeConfiguration.Returnable<ReturnType>, ModeShapeConfiguration.SetDescription<ThisType>, ModeShapeConfiguration.SetProperties<ThisType>
Direct Known Subclasses:
JcrConfiguration.RepositoryBuilder, ModeShapeConfiguration.GraphComponentBuilder
Enclosing class:
ModeShapeConfiguration

protected abstract static class ModeShapeConfiguration.GraphReturnable<ReturnType,ThisType>
extends ModeShapeConfiguration.BaseReturnable<ReturnType>
implements ModeShapeConfiguration.SetDescription<ThisType>, ModeShapeConfiguration.SetProperties<ThisType>, ModeShapeConfiguration.Removable<ReturnType>

Base class for ModeShapeConfiguration.Returnable types that work on a node in the graph.


Field Summary
protected  Graph.Batch batch
           
protected  ExecutionContext context
           
protected  Path path
           
 
Fields inherited from class org.modeshape.repository.ModeShapeConfiguration.BaseReturnable
returnObject
 
Constructor Summary
protected ModeShapeConfiguration.GraphReturnable(ReturnType returnObject, Graph.Batch batch, Path path, Name... names)
           
 
Method Summary
protected  Graph.Create<Graph.Batch> createIfMissing(Name segment)
          Create the node at the supplied path under the current path, and return the Create operation for the last node created.
protected  Graph.Create<Graph.Batch> createIfMissing(Name child, String... segments)
          Create the node at the supplied path under the current path, and return the Create operation for the last node created.
protected  Graph.Create<Graph.Batch> createIfMissing(Path path, Name... segments)
          Create the node at the supplied path under the current path, and return the Create operation for the last node created.
 String getDescription()
          Get the description of this component.
 String getName()
           
 Property getProperty(Name beanPropertyName)
           
 Property getProperty(String beanPropertyName)
          Get the property.
 ReturnType remove()
          Remove this configuration component.
 ThisType setDescription(String description)
          Specify the description of this component.
protected  ThisType setProperty(Name propertyName, Object value)
           
 ThisType setProperty(Name propertyName, Object[] values)
           
 ThisType setProperty(String beanPropertyName, boolean value)
          Set the property value to a boolean.
 ThisType setProperty(String beanPropertyName, double value)
          Set the property value to a double.
 ThisType setProperty(String beanPropertyName, float value)
          Set the property value to a float.
 ThisType setProperty(String beanPropertyName, int value)
          Set the property value to an integer.
 ThisType setProperty(String beanPropertyName, long value)
          Set the property value to a long number.
 ThisType setProperty(String propertyName, Object value)
          Set the property value to an object.
 ThisType setProperty(String propertyName, Object[] values)
          Set the property values to an object.
 ThisType setProperty(String beanPropertyName, short value)
          Set the property value to a short.
 ThisType setProperty(String beanPropertyName, String value)
          Set the property value to a string.
 ThisType setProperty(String beanPropertyName, String firstValue, String... additionalValues)
          Set the property value to a string.
protected  Path subpath(Name... segments)
           
protected abstract  ThisType thisType()
           
 
Methods inherited from class org.modeshape.repository.ModeShapeConfiguration.BaseReturnable
and
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected final ExecutionContext context

batch

protected final Graph.Batch batch

path

protected final Path path
Constructor Detail

ModeShapeConfiguration.GraphReturnable

protected ModeShapeConfiguration.GraphReturnable(ReturnType returnObject,
                                                 Graph.Batch batch,
                                                 Path path,
                                                 Name... names)
Method Detail

createIfMissing

protected Graph.Create<Graph.Batch> createIfMissing(Name child,
                                                    String... segments)
Create the node at the supplied path under the current path, and return the Create operation for the last node created. The caller must call Graph.Create#and() to complete the operation.

Parameters:
child - the name of the child
segments - the segments in the remainder of the path
Returns:
the newly-created but incomplete operation

createIfMissing

protected Graph.Create<Graph.Batch> createIfMissing(Name segment)
Create the node at the supplied path under the current path, and return the Create operation for the last node created. The caller must call Graph.Create#and() to complete the operation.

Parameters:
segment - the name segment for the child
Returns:
the newly-created but incomplete operation

createIfMissing

protected Graph.Create<Graph.Batch> createIfMissing(Path path,
                                                    Name... segments)
Create the node at the supplied path under the current path, and return the Create operation for the last node created. The caller must call Graph.Create#and() to complete the operation.

Parameters:
path - the path to the node
segments - the segments in the remainder of the path
Returns:
the newly-created but incomplete operation

subpath

protected Path subpath(Name... segments)

thisType

protected abstract ThisType thisType()

getName

public String getName()

setDescription

public ThisType setDescription(String description)
Description copied from interface: ModeShapeConfiguration.SetDescription
Specify the description of this component.

Specified by:
setDescription in interface ModeShapeConfiguration.SetDescription<ThisType>
Parameters:
description - the description; may be null or empty
Returns:
the next component to continue configuration; never null

getDescription

public String getDescription()
Description copied from interface: ModeShapeConfiguration.SetDescription
Get the description of this component.

Specified by:
getDescription in interface ModeShapeConfiguration.SetDescription<ThisType>
Returns:
the description, or null if there is no description

setProperty

protected ThisType setProperty(Name propertyName,
                               Object value)

setProperty

public ThisType setProperty(String propertyName,
                            Object value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to an object.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
propertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(Name propertyName,
                            Object[] values)

setProperty

public ThisType setProperty(String propertyName,
                            Object[] values)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property values to an object.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
propertyName - the name of the JavaBean-style property (e.g., "retryLimit")
values - the array of new values for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            boolean value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a boolean.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            int value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to an integer.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            short value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a short.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            long value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a long number.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            double value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a double.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            float value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a float.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            String value)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a string.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
value - the new value for the property
Returns:
the next component to continue configuration; never null

setProperty

public ThisType setProperty(String beanPropertyName,
                            String firstValue,
                            String... additionalValues)
Description copied from interface: ModeShapeConfiguration.SetProperties
Set the property value to a string.

Specified by:
setProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
firstValue - the first string value for the property
additionalValues - the additional string values for the property
Returns:
the next component to continue configuration; never null

getProperty

public Property getProperty(String beanPropertyName)
Description copied from interface: ModeShapeConfiguration.SetProperties
Get the property.

Specified by:
getProperty in interface ModeShapeConfiguration.SetProperties<ThisType>
Parameters:
beanPropertyName - the name of the JavaBean-style property (e.g., "retryLimit")
Returns:
the property object, or null if there is no such property

getProperty

public Property getProperty(Name beanPropertyName)

remove

public ReturnType remove()
Description copied from interface: ModeShapeConfiguration.Removable
Remove this configuration component.

Specified by:
remove in interface ModeShapeConfiguration.Removable<ReturnType>
Returns:
the configuration; never null


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.