|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.manipulator.Pojoization
public class Pojoization
Pojoization allows creating an iPOJO bundle from a "normal" bundle.
Field Summary | |
---|---|
static String |
IPOJO_PACKAGE_VERSION
iPOJO Imported Package Version. |
Constructor Summary | |
---|---|
Pojoization()
|
Method Summary | |
---|---|
void |
addManifestAttributeFilters(ManifestAttributeFilter filter)
Adds a Manifest attribute filter to the list |
void |
directoryPojoization(File directory,
File metadataFile,
File manifestFile)
Manipulates an expanded bundles. |
void |
disableAnnotationProcessing()
Activates annotation processing. |
protected void |
error(String mes)
Add an error in the error list. |
protected byte[] |
getBytecode(String classname)
Gets a byte array that contains the bytecode of the given classname. |
List |
getErrors()
|
protected InputStream |
getInputStream(String classname)
Gets an input stream on the given class. |
protected InputStream |
getManifestInputStream()
Retrieves an InputStream to read the Manifest. |
List |
getWarnings()
|
Map |
parseHeader(String value)
Standard OSGi header parser. |
void |
pojoization(File in,
File out,
File metadataFile)
Manipulates an input bundle. |
void |
pojoization(File in,
File out,
InputStream metadata)
Manipulates an input bundle. |
String |
printClauses(Map exports,
String allowedDirectives)
Print a standard Map based OSGi header. |
protected void |
searchClassFiles(File dir,
List classes)
Navigates across directories to find class files. |
protected void |
setBytecode(File classFile,
byte[] rawClass)
Writes the .class raw data to the storage support |
void |
setUseLocalXSD()
Activates the entity resolver loading XSD files from the classloader. |
void |
warn(String mes)
Add a warning in the warning list. |
protected void |
writeManifest(Manifest mf)
Retrieves an OutputStream to write in the Manifest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String IPOJO_PACKAGE_VERSION
Constructor Detail |
---|
public Pojoization()
Method Detail |
---|
protected void error(String mes)
mes
- : error message.public void warn(String mes)
mes
- : warning messagepublic List getErrors()
public void disableAnnotationProcessing()
public void setUseLocalXSD()
public void pojoization(File in, File out, InputStream metadata)
in
- the original bundle.out
- the final bundle.metadata
- the iPOJO metadata input stream.public void pojoization(File in, File out, File metadataFile)
in
- the original bundle.out
- the final bundle.metadataFile
- the iPOJO metadata file (XML).public void directoryPojoization(File directory, File metadataFile, File manifestFile)
directory
- the directory containing classesmetadataFile
- the metadata filemanifestFile
- the manifest file. null
to use directory/META-INF/MANIFEST.mfprotected byte[] getBytecode(String classname) throws IOException
classname
- name of a class to be read
IOException
- if the classname cannot be readprotected InputStream getInputStream(String classname) throws IOException
classname
- the class name
IOException
- if the file cannot be readprotected void searchClassFiles(File dir, List classes)
dir
- the directory to analyzeclasses
- discovered classespublic Map parseHeader(String value)
value
- : String to parse.
public String printClauses(Map exports, String allowedDirectives)
exports
- : map { name => Map { attribute|directive => value } }allowedDirectives
- : list of allowed directives.
public void addManifestAttributeFilters(ManifestAttributeFilter filter)
filter
- The new Manifest attribute filterprotected void writeManifest(Manifest mf) throws IOException
IOException
protected InputStream getManifestInputStream() throws IOException
IOException
protected void setBytecode(File classFile, byte[] rawClass) throws IOException
classFile
- - Output .class filerawClass
- - Raw class representation
IOException
- - Something wrong occurred while writing the filepublic List getWarnings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |