|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.jomc.tools.JomcTool
org.jomc.tools.ClassFileProcessor
public class ClassFileProcessor extends JomcTool
Processes class files.
Use cases
commitModelObjects(org.jomc.modlet.ModelContext, java.io.File)commitModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File)commitModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File)commitModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext, java.io.File)validateModelObjects(org.jomc.modlet.ModelContext)validateModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext)validateModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext)validateModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext)validateModelObjects(org.jomc.modlet.ModelContext, java.io.File)validateModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File)validateModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File)validateModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext, java.io.File)transformModelObjects(org.jomc.modlet.ModelContext, java.io.File, java.util.List)transformModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File, java.util.List)transformModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File, java.util.List)transformModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File, java.util.List)
JomcTool.getModules()| Modifier and Type | Class and Description |
|---|
| Nested classes/interfaces inherited from class org.jomc.tools.JomcTool |
|---|
JomcTool.Listener |
| Constructor and Description |
|---|
ClassFileProcessor()
Creates a new ClassFileProcessor instance. |
ClassFileProcessor(ClassFileProcessor tool)
Creates a new ClassFileProcessor instance taking a ClassFileProcessor instance to initialize the
instance with. |
| Modifier and Type | Method and Description | |
|---|---|---|
void |
commitModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Marshaller marshaller,
org.apache.bcel.classfile.JavaClass javaClass)
Commits model objects of a given implementation of the modules of the instance to a given class file. |
|
void |
commitModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Commits model objects of a given implementation of the modules of the instance to class files. |
|
void |
commitModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory)
Commits model objects of the modules of the instance to class files. |
|
void |
commitModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Commits model objects of a given module of the modules of the instance to class files. |
|
void |
commitModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Marshaller marshaller,
org.apache.bcel.classfile.JavaClass javaClass)
Commits model objects of a given specification of the modules of the instance to a given class file. |
|
void |
commitModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Commits model objects of a given specification of the modules of the instance to class files. |
|
|
decodeModelObject(javax.xml.bind.Unmarshaller unmarshaller,
byte[] bytes,
Class<T> type)
Decodes a model object from a byte array. |
|
byte[] |
encodeModelObject(javax.xml.bind.Marshaller marshaller,
javax.xml.bind.JAXBElement<? extends org.jomc.model.ModelObject> modelObject)
Encodes a model object to a byte array. |
|
byte[] |
getClassfileAttribute(org.apache.bcel.classfile.JavaClass clazz,
String attributeName)
Gets an attribute from a java class. |
|
void |
setClassfileAttribute(org.apache.bcel.classfile.JavaClass clazz,
String attributeName,
byte[] data)
Adds or updates an attribute in a java class. |
|
void |
transformModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Marshaller marshaller,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass,
List<Transformer> transformers)
Transforms model objects of a given implementation of the modules of the instance. |
|
void |
transformModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
Transforms model objects of class files of a given implementation of the modules of the instance. |
|
void |
transformModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
Transforms model objects of class files of the modules of the instance. |
|
void |
transformModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
Transforms model objects of class files of a given module of the modules of the instance. |
|
void |
transformModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Marshaller marshaller,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass,
List<Transformer> transformers)
Transforms model objects of a given specification of the modules of the instance. |
|
void |
transformModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
Transforms model objects of class files of a given specification of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context)
Validates model objects of class files of a given implementation of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Validates model objects of class files of a given implementation of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass)
Validates model objects of a given implementation of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.modlet.ModelContext context)
Validates model objects of class files of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory)
Validates model objects of class files of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context)
Validates model objects of class files of a given module of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Validates model objects of class files of a given module of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context)
Validates model objects of class files of a given specification of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory)
Validates model objects of class files of a given specification of the modules of the instance. |
|
org.jomc.modlet.ModelValidationReport |
validateModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass)
Validates model objects of a given specification of the modules of the instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassFileProcessor()
ClassFileProcessor instance.
public ClassFileProcessor(ClassFileProcessor tool)
throws IOException
ClassFileProcessor instance taking a ClassFileProcessor instance to initialize the
instance with.
tool - The instance to initialize the new instance with,NullPointerException - if tool is null.IOException - if copying tool fails.| Method Detail |
|---|
public final void commitModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
context - The model context to use for committing the model objects.classesDirectory - The directory holding the class files.NullPointerException - if context or classesDirectory is null.IOException - if committing model objects fails.commitModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File)
public final void commitModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
module - The module to process.context - The model context to use for committing the model objects.classesDirectory - The directory holding the class files.NullPointerException - if module, context or classesDirectory is null.IOException - if committing model objects fails.commitModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File),
commitModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext, java.io.File)
public final void commitModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
specification - The specification to process.context - The model context to use for committing the model objects.classesDirectory - The directory holding the class files.NullPointerException - if specification, context or classesDirectory is
null.IOException - if committing model objects fails.commitModelObjects(org.jomc.model.Specification, javax.xml.bind.Marshaller, org.apache.bcel.classfile.JavaClass)
public final void commitModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
implementation - The implementation to process.context - The model context to use for committing the model objects.classesDirectory - The directory holding the class files.NullPointerException - if implementation, context or classesDirectory is
null.IOException - if committing model objects fails.commitModelObjects(org.jomc.model.Implementation, javax.xml.bind.Marshaller, org.apache.bcel.classfile.JavaClass)
public void commitModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Marshaller marshaller,
org.apache.bcel.classfile.JavaClass javaClass)
throws IOException
specification - The specification to process.marshaller - The marshaller to use for committing the model objects.javaClass - The java class to commit.NullPointerException - if specification, marshaller or javaClass is null.IOException - if committing model objects fails.
public void commitModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Marshaller marshaller,
org.apache.bcel.classfile.JavaClass javaClass)
throws IOException
implementation - The implementation to process.marshaller - The marshaller to use for committing the model objects.javaClass - The java class to commit.NullPointerException - if implementation, marshaller or javaClass is null.IOException - if committing model objects fails.
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.modlet.ModelContext context)
throws IOException
context - The model context to use for validating model objects.NullPointerException - if context is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context)
throws IOException
module - The module to process.context - The model context to use for validating model objects.NullPointerException - if module or context is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext),
validateModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context)
throws IOException
specification - The specification to process.context - The model context to use for validating model objects.NullPointerException - if specification or context is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Specification, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context)
throws IOException
implementation - The implementation to process.context - The model context to use for validating model objects.NullPointerException - if implementation or context is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Implementation, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
context - The model context to use for validating model objects.classesDirectory - The directory holding the class files.NullPointerException - if context or classesDirectory is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
module - The module to process.context - The model context to use for validating model objects.classesDirectory - The directory holding the class files.NullPointerException - if module, context or classesDirectory is null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File),
validateModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext, java.io.File)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
specification - The specification to process.context - The model context to use for validating model objects.classesDirectory - The directory holding the class files.NullPointerException - if specification, context or classesDirectory is
null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Specification, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass)
public final org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory)
throws IOException
implementation - The implementation to process.context - The model context to use for validating model objects.classesDirectory - The directory holding the class files.NullPointerException - if implementation, context or classesDirectory is
null.IOException - if validating model objects fails.validateModelObjects(org.jomc.model.Implementation, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass)
public org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass)
throws IOException
specification - The specification to process.unmarshaller - The unmarshaller to use for validating model objects.javaClass - The java class to validate.NullPointerException - if specification, unmarshaller or javaClass is null.IOException - if validating model objects fails.
public org.jomc.modlet.ModelValidationReport validateModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass)
throws IOException
implementation - The implementation to process.unmarshaller - The unmarshaller to use for validating model objects.javaClass - The java class to validate.NullPointerException - if implementation, unmarshaller or javaClass is null.IOException - if validating model objects fails.
public final void transformModelObjects(org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
throws IOException
context - The model context to use for transforming model objects.classesDirectory - The directory holding the class files.transformers - The transformers to use for transforming model objects.NullPointerException - if context, classesDirectory or transformers is
null.IOException - if transforming model objects fails.transformModelObjects(org.jomc.model.Module, org.jomc.modlet.ModelContext, java.io.File, java.util.List)
public final void transformModelObjects(org.jomc.model.Module module,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
throws IOException
module - The module to process.context - The model context to use for transforming model objects.classesDirectory - The directory holding the class files.transformers - The transformers to use for transforming the model objects.NullPointerException - if module, context, classesDirectory or transformers
is null.IOException - if transforming model objects fails.transformModelObjects(org.jomc.model.Specification, org.jomc.modlet.ModelContext, java.io.File, java.util.List),
transformModelObjects(org.jomc.model.Implementation, org.jomc.modlet.ModelContext, java.io.File, java.util.List)
public final void transformModelObjects(org.jomc.model.Specification specification,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
throws IOException
specification - The specification to process.context - The model context to use for transforming model objects.classesDirectory - The directory holding the class files.transformers - The transformers to use for transforming the model objects.NullPointerException - if specification, context, classesDirectory or
transformers is null.IOException - if transforming model objects fails.transformModelObjects(org.jomc.model.Specification, javax.xml.bind.Marshaller, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass, java.util.List)
public final void transformModelObjects(org.jomc.model.Implementation implementation,
org.jomc.modlet.ModelContext context,
File classesDirectory,
List<Transformer> transformers)
throws IOException
implementation - The implementation to process.context - The model context to use for transforming model objects.classesDirectory - The directory holding the class files.transformers - The transformers to use for transforming the model objects.NullPointerException - if implementation, context, classesDirectory or
transformers is null.IOException - if transforming model objects fails.transformModelObjects(org.jomc.model.Implementation, javax.xml.bind.Marshaller, javax.xml.bind.Unmarshaller, org.apache.bcel.classfile.JavaClass, java.util.List)
public void transformModelObjects(org.jomc.model.Specification specification,
javax.xml.bind.Marshaller marshaller,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass,
List<Transformer> transformers)
throws IOException
specification - The specification to process.marshaller - The marshaller to use for transforming model objects.unmarshaller - The unmarshaller to use for transforming model objects.javaClass - The the class file to transform.transformers - The transformers to use for transforming the model objects.NullPointerException - if specification, marshaller, unmarshaller,
javaClass or transformers is null.IOException - if transforming model objects fails.
public void transformModelObjects(org.jomc.model.Implementation implementation,
javax.xml.bind.Marshaller marshaller,
javax.xml.bind.Unmarshaller unmarshaller,
org.apache.bcel.classfile.JavaClass javaClass,
List<Transformer> transformers)
throws IOException
implementation - The implementation to process.marshaller - The marshaller to use for transforming model objects.unmarshaller - The unmarshaller to use for transforming model objects.javaClass - The the class file to transform.transformers - The transformers to use for transforming the model objects.NullPointerException - if implementation, marshaller, unmarshaller,
javaClass or transformers is null.IOException - if transforming model objects fails.
public byte[] getClassfileAttribute(org.apache.bcel.classfile.JavaClass clazz,
String attributeName)
throws IOException
clazz - The java class to get an attribute from.attributeName - The name of the attribute to get.attributeName of clazz or null if no such attribute
exists.NullPointerException - if clazz or attributeName is null.IOException - if getting the attribute fails.JavaClass.getAttributes()
public void setClassfileAttribute(org.apache.bcel.classfile.JavaClass clazz,
String attributeName,
byte[] data)
throws IOException
clazz - The class to update.attributeName - The name of the attribute to update.data - The new data of the attribute to update the classFile with.NullPointerException - if clazz or attributeName is null.IOException - if updating the class file fails.JavaClass.getAttributes()
public byte[] encodeModelObject(javax.xml.bind.Marshaller marshaller,
javax.xml.bind.JAXBElement<? extends org.jomc.model.ModelObject> modelObject)
throws IOException
marshaller - The marshaller to use for encoding the object.modelObject - The model object to encode.modelObject.NullPointerException - if marshaller or modelObject is null.IOException - if encoding modelObject fails.
public <T extends org.jomc.model.ModelObject> T decodeModelObject(javax.xml.bind.Unmarshaller unmarshaller,
byte[] bytes,
Class<T> type)
throws IOException
T - The type of the decoded model object.unmarshaller - The unmarshaller to use for decoding the object.bytes - The encoded model object to decode.type - The type of the encoded model object.bytes.NullPointerException - if unmarshaller, bytes or type is null.IOException - if decoding bytes fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||