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

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

public abstract class OptionalIdentifiedDefinition<T extends OptionalIdentifiedDefinition<T>>
extends Object

Allows an element to have an optional ID specified

Version:

Constructor Summary
OptionalIdentifiedDefinition()
           
 
Method Summary
 T description(String id, String text, String lang)
          Sets the description of this node
 DescriptionDefinition getDescription()
           
 String getDescriptionText()
          Returns the description text or null if there is no description text associated with this node
 String getId()
          Gets the value of the id property.
 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(NodeIdFactory factory)
          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
 

Constructor Detail

OptionalIdentifiedDefinition

public OptionalIdentifiedDefinition()
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(NodeIdFactory factory)
Gets the node id, creating one if not already set.


hasCustomIdAssigned

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


getDescriptionText

public String getDescriptionText()
Returns the description text or null if there is no description text associated with this node



Apache CAMEL