|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.ExchangeProperty<T>
public class ExchangeProperty<T>
Represents an instance and a type safe registry of well known Camel Exchange properties.
Usage pattern:
public static final ExchangeProperty myProperty =
new ExchangeProperty("myProperty", "org.apache.myproject.mypackage.myproperty", Boolean.class);
Then in your code set this property's value:
myProperty.set(exchange, Boolean.TRUE);
Check the value of this property where required:
ExchangeProperty> property = ExchangeProperty.get("myProperty");
if (property != null && property.get(exchange) == Boolean.TRUE) {
// do your thing ...
}
Or
Boolean value = myProperty.get(exchange);
if (value == Boolean.TRUE) {
// do your thing
}
When your code no longer requires this property then deregister it:
ExchangeProperty.deregister(myProperty);
Or
ExchangeProperty.deregister("myProperty");
Note: that if ExchangeProperty instance get or set methods are used then type checks
of property's value are performed and a runtime exception can be thrown if type
safety is violated.
| Constructor Summary | |
|---|---|
ExchangeProperty(String literal,
String name,
Class<T> type)
Deprecated. |
|
| Method Summary | |
|---|---|
static void |
deregister(ExchangeProperty<?> property)
Deprecated. |
static void |
deregister(String literal)
Deprecated. |
T |
get(Exchange exchange)
Deprecated. |
static ExchangeProperty<?> |
get(String literal)
Deprecated. |
static ExchangeProperty<?> |
getByName(String name)
Deprecated. |
String |
literal()
Deprecated. |
String |
name()
Deprecated. |
static void |
register(ExchangeProperty<?> property)
Deprecated. |
T |
remove(Exchange exchange)
Deprecated. |
T |
set(Exchange exchange,
T value)
Deprecated. |
String |
toString()
Deprecated. |
Class<T> |
type()
Deprecated. |
static ExchangeProperty<?>[] |
values()
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExchangeProperty(String literal,
String name,
Class<T> type)
| Method Detail |
|---|
public String literal()
public String name()
public Class<T> type()
public T get(Exchange exchange)
public static ExchangeProperty<?> get(String literal)
public static ExchangeProperty<?> getByName(String name)
public T set(Exchange exchange,
T value)
public T remove(Exchange exchange)
public String toString()
toString in class Objectpublic static void register(ExchangeProperty<?> property)
public static void deregister(ExchangeProperty<?> property)
public static void deregister(String literal)
public static ExchangeProperty<?>[] values()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||