站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 varia API Documentation 英文版文档

JarTransformer (Various API) - JBoss 3.2.7 varia API Documentation 英文版文档


org.jboss.varia.deployment.convertor
Class JarTransformer

java.lang.Object
  extended byorg.jboss.varia.deployment.convertor.JarTransformer

public class JarTransformer
extends Object

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

Version:
$Revision: 1.4.2.4 $
Author:
Alex Loubyansky

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

JarTransformer

public JarTransformer()
Method Detail

transform

public static void transform(File root,
                             Properties globalXslParams)
                      throws Exception
Applies transformations to xml sources for passed in jar file

Throws:
Exception

transformBytes

public static byte[] transformBytes(byte[] bytes,
                                    InputStream xslIs,
                                    Properties outputProps,
                                    Properties xslParams)
                             throws Exception
Returns byte array that is the result of transformation of the passed in byte array with xsl template, output properties and xsl parameters

Throws:
Exception

transformBytes

public static byte[] transformBytes(DOMSource source,
                                    InputStream xslIs,
                                    Properties outputProps,
                                    Properties xslParams)
                             throws Exception
Returns byte array that is the result of transformation of the passed in byte array with xsl template, output properties and xsl parameters

Throws:
Exception

writeBytes

public static void writeBytes(OutputStream os,
                              byte[] bytes)
                       throws Exception
Writes byte array to OutputStream.

Throws:
Exception

readBytes

public static byte[] readBytes(InputStream is)
                        throws IOException
Returns byte array read from InputStream

Throws:
IOException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.