
public class JomcResourceTransformer extends org.codehaus.plexus.logging.AbstractLogEnabled implements ResourceTransformer
ResourceTransformer implementation for shading JOMC resources.
 Maven Shade Plugin Usage
 <transformer implementation="org.jomc.mojo.JomcResourceTransformer">
   <model>http://jomc.org/model</model>
   <modelContextFactoryClassName>class name</modelContextFactoryClassName>
     <modelContextAttributes>
       <modelContextAttribute>
         <key>The name of the attribute</key>
         <value>The name of the attribute</value>
         <type>The name of the class of the object.</type>
       </modelContextAttribute>
     </modelContextAttributes/>
   <moduleEncoding>${project.build.sourceEncoding}</moduleEncoding>
   <moduleName>${project.name}</moduleName>
   <moduleVersion>${project.version}</moduleVersion>
   <moduleVendor>${project.organization.name}</moduleVendor>
   <moduleResource>META-INF/custom-jomc.xml</moduleResource>
   <moduleResources>
     <moduleResource>META-INF/jomc.xml</moduleResource>
   </moduleResources>
   <moduleIncludes>
     <moduleInclude>module name</moduleInclude>
   </moduleIncludes>
   <moduleExcludes>
     <moduleExclude>module name</moduleExclude>
   </moduleExcludes>
   <modletEncoding>${project.build.sourceEncoding}</modletEncoding>
   <modletName>${project.name}</modletName>
   <modletVersion>${project.version}</modletVersion>
   <modletVendor>${project.organization.name}</modletVendor>
   <modletResource>META-INF/custom-jomc-modlet.xml</modletResource>
   <modletResources>
     <modletResource>META-INF/jomc-modlet.xml</modletResource>
   </modletResources>
   <modletIncludes>
     <modletInclude>modlet name</modletInclude>
   </modletIncludes>
   <modletExcludes>
     <modletExclude>modlet name</modletExclude>
   </modletExcludes>
   <modelObjectStylesheet>Location of a XSLT document to use for transforming the merged model document.</modelObjectStylesheet>
   <modletObjectStylesheet>Location of a XSLT document to use for transforming the merged modlet document.</modletObjectStylesheet>
   <providerLocation>META-INF/custom-services</providerLocation>
   <platformProviderLocation>${java.home}/jre/lib/custom-jomc.properties</platformProviderLocation>
   <modletLocation>META-INF/custom-jomc-modlet.xml</modletLocation>
   <modletSchemaSystemId>http://custom.host.tld/custom/path/jomc-modlet-1.9.xsd</modletSchemaSystemId>
 </transformer>
 
  | 
| Constructor and Description | 
|---|
JomcResourceTransformer()
Creates a new  
JomcResourceTransformer instance. | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
canTransformResource(String arg)  | 
protected URL | 
getResource(String location)
Creates an  
URL for a given resource location. | 
boolean | 
hasTransformedResource()  | 
void | 
modifyOutputStream(JarOutputStream out)  | 
void | 
processResource(InputStream in)  | 
void | 
processResource(String name,
                              InputStream in,
                              List<Relocator> relocators)  | 
public JomcResourceTransformer()
JomcResourceTransformer instance.public boolean canTransformResource(String arg)
canTransformResource in interface ResourceTransformerpublic void processResource(InputStream in) throws IOException
processResource in interface ResourceTransformerIOExceptionpublic void processResource(String name, InputStream in, List<Relocator> relocators) throws IOException
IOExceptionpublic boolean hasTransformedResource()
hasTransformedResource in interface ResourceTransformerpublic void modifyOutputStream(JarOutputStream out) throws IOException
modifyOutputStream in interface ResourceTransformerIOExceptionprotected URL getResource(String location) throws IOException
URL for a given resource location.
 
 This method first searches the class loader of the class for a single resource matching location. If
 such a resource is found, the URL of that resource is returned. If no such resource is found, an attempt is made
 to parse the given location to an URL. On successful parsing, that URL is returned. Failing that, the given
 location is interpreted as a file name. If that file is found, the URL of that file is returned. Otherwise an
 IOException is thrown.
 
location - The location to create an URL from.URL for location.NullPointerException - if location is null.IOException - if creating an URL fails.Copyright © 2005–2016 The JOMC Project. All rights reserved.