Class ImmutableProcessor
- java.lang.Object
-
- jadex.commons.transformation.traverser.ImmutableProcessor
-
- All Implemented Interfaces:
ITraverseProcessor
public class ImmutableProcessor extends java.lang.Object implements ITraverseProcessor
Processor for immutable types.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.Class<?>>
DEFAULT_IMMUTABLES
Default immutables.protected java.util.Set<java.lang.Class<?>>
immutables
The immutable types.
-
Constructor Summary
Constructors Constructor Description ImmutableProcessor()
Create a new processor.ImmutableProcessor(java.lang.Class<?>[] immutables)
Create a new processor.ImmutableProcessor(java.util.Set<java.lang.Class<?>> immutables)
Create a new processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, java.lang.Object context)
Test if the processor is applicable.java.lang.Object
process(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, java.lang.Object context)
Process an object.
-
-
-
Constructor Detail
-
ImmutableProcessor
public ImmutableProcessor()
Create a new processor.
-
ImmutableProcessor
public ImmutableProcessor(java.util.Set<java.lang.Class<?>> immutables)
Create a new processor.
-
ImmutableProcessor
public ImmutableProcessor(java.lang.Class<?>[] immutables)
Create a new processor.
-
-
Method Detail
-
isApplicable
public boolean isApplicable(java.lang.Object object, java.lang.reflect.Type type, java.lang.ClassLoader targetcl, java.lang.Object context)
Test if the processor is applicable.- Specified by:
isApplicable
in interfaceITraverseProcessor
- Parameters:
object
- The object.targetcl
- If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.- Returns:
- True, if is applicable.
-
process
public java.lang.Object process(java.lang.Object object, java.lang.reflect.Type type, Traverser traverser, java.util.List<ITraverseProcessor> conversionprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, java.lang.ClassLoader targetcl, java.lang.Object context)
Process an object.- Specified by:
process
in interfaceITraverseProcessor
- Parameters:
object
- The object.targetcl
- If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.- Returns:
- The processed object.
-
-