org.apache.camel.model
Class OptionalIdentifiedType<T extends OptionalIdentifiedType>

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedType<T>
Direct Known Subclasses:
FromDefinition, ProcessorDefinition, RoutesDefinition

public abstract class OptionalIdentifiedType<T extends OptionalIdentifiedType>
extends Object

Allows an element to have an optional ID specified

Version:
$Revision: 765910 $

Field Summary
protected static Map<String,AtomicInteger> nodeCounters
           
 
Constructor Summary
OptionalIdentifiedType()
           
 
Method Summary
protected  String createId()
          A helper method to create a new id for this node
 T description(String id, String text, String lang)
          Sets the description of this node
 DescriptionDefinition getDescription()
           
 String getId()
          Gets the value of the id property.
protected static AtomicInteger getNodeCounter(String key)
          Returns the counter for the given node key, lazily creating one if necessary
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 boolean hasCustomIdAssigned()
          Returns whether a custom id has been assigned
 T id(String id)
          Sets the id of this node
 String idOrCreate()
          Gets the node id, creating one if not already set.
 void setDescription(DescriptionDefinition description)
           
 void setId(String value)
          Sets the value of the id property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeCounters

protected static Map<String,AtomicInteger> nodeCounters
Constructor Detail

OptionalIdentifiedType

public OptionalIdentifiedType()
Method Detail

getId

public String getId()
Gets the value of the id property.


setId

public void setId(String value)
Sets the value of the id property.


getDescription

public DescriptionDefinition getDescription()

setDescription

public void setDescription(DescriptionDefinition description)

getShortName

public String getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images

Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

description

public T description(String id,
                     String text,
                     String lang)
Sets the description of this node

Parameters:
id - sets the id, use null to not set an id
text - sets the text description, use null to not set a text
lang - sets the language for the description, use null to not set a language
Returns:
the builder

id

public T id(String id)
Sets the id of this node

Parameters:
id - the id
Returns:
the builder

idOrCreate

public String idOrCreate()
Gets the node id, creating one if not already set.


hasCustomIdAssigned

public boolean hasCustomIdAssigned()
Returns whether a custom id has been assigned


createId

protected String createId()
A helper method to create a new id for this node


getNodeCounter

protected static AtomicInteger getNodeCounter(String key)
Returns the counter for the given node key, lazily creating one if necessary



Apache CAMEL