|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.varia.deployment.convertor.JarTransformer
JarTransformer is used to transform passed in jar file. Transformation algorithm: 1. open JarInputStream on passed in Jar file, open JarOutputStream for result; 2. read next Jar entry; 3. check whether Jar entry is an XML file - if it's not, copy Jar entry to result and go to step 2. 4. check whether there is an XSL file with name equal to XML file's in classpath. - if there isn't, copy Jar entry to result and go to step 2. 5. check whether there is a properties file with the name equal to XML file's name + "-output.properties" 6. set needed xsl parameters 7. transform Jar entry with xsl template and output properties (if were found) 8. check whether there is a property "newname" in output properties - if there is, write transformed entry to result with the value of "newname"; - otherwise write transformed entry to result with the original Jar entry name
Constructor Summary | |
JarTransformer()
|
Method Summary | |
static byte[] |
readBytes(InputStream is)
Returns byte array read from InputStream |
static void |
transform(File root,
Properties globalXslParams)
Applies transformations to xml sources for passed in jar file |
static byte[] |
transformBytes(byte[] bytes,
InputStream xslIs,
Properties outputProps,
Properties xslParams)
Returns byte array that is the result of transformation of the passed in byte array with xsl template, output properties and xsl parameters |
static byte[] |
transformBytes(DOMSource source,
InputStream xslIs,
Properties outputProps,
Properties xslParams)
Returns byte array that is the result of transformation of the passed in byte array with xsl template, output properties and xsl parameters |
static void |
writeBytes(OutputStream os,
byte[] bytes)
Writes byte array to OutputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JarTransformer()
Method Detail |
public static void transform(File root, Properties globalXslParams) throws Exception
Exception
public static byte[] transformBytes(byte[] bytes, InputStream xslIs, Properties outputProps, Properties xslParams) throws Exception
Exception
public static byte[] transformBytes(DOMSource source, InputStream xslIs, Properties outputProps, Properties xslParams) throws Exception
Exception
public static void writeBytes(OutputStream os, byte[] bytes) throws Exception
Exception
public static byte[] readBytes(InputStream is) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |