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

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedType<T>
Direct Known Subclasses:
FromType, ProcessorType, RoutesType

public abstract class OptionalIdentifiedType<T extends OptionalIdentifiedType>
extends Object

Allows an element to have an optional ID specified

Version:
$Revision: 43775 $

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 text)
           
 T description(String text, String lang)
           
 Description 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
 T id(String id)
           
 String idOrCreate()
           
 void setDescription(Description 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.

Returns:
possible object is String

setId

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

Parameters:
value - allowed object is String

getDescription

public Description getDescription()

setDescription

public void setDescription(Description 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 text)

description

public T description(String text,
                     String lang)

id

public T id(String id)

idOrCreate

public String idOrCreate()

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



Copyright © 2008 IONA Open Source Community. All Rights Reserved.