org.wildfly.extras.creaper.commands.foundation.offline.xml
Class GroovyXmlTransform

java.lang.Object
  extended by org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform
All Implemented Interfaces:
Command, OfflineCommand

public final class GroovyXmlTransform
extends Object
implements OfflineCommand

An offline command that runs a XML transformation on the configuration file which the offline management client is connected to. The transformation is defined by a Groovy script loaded from classpath.


Nested Class Summary
static class GroovyXmlTransform.Builder
           
 
Field Summary
 
Fields inherited from interface org.wildfly.extras.creaper.core.offline.OfflineCommand
NOOP
 
Method Summary
 void apply(OfflineCommandContext ctx)
           
static GroovyXmlTransform.Builder of(Class clazz)
          A convenience shortcut for a case when the script is stored alongside the clazz on the classpath, has the same name and the .groovy extension.
static GroovyXmlTransform.Builder of(Class resourceLoader, String path)
          Creates a GroovyXmlTransform from a script loaded from classpath at path.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

of

public static GroovyXmlTransform.Builder of(Class clazz)
A convenience shortcut for a case when the script is stored alongside the clazz on the classpath, has the same name and the .groovy extension.

Parameters:
clazz - the class that will be used for loading the script and also for discovering its name
See Also:
of(Class, String)

of

public static GroovyXmlTransform.Builder of(Class resourceLoader,
                                            String path)
Creates a GroovyXmlTransform from a script loaded from classpath at path. The resource will be loaded by the resourceLoader class (Class.getResourceAsStream(String)).

Parameters:
resourceLoader - class that will be used to load the script from classpath
path - path to the script on classpath (absolute or relative to resourceLoader)

apply

public void apply(OfflineCommandContext ctx)
           throws CommandFailedException,
                  IOException
Specified by:
apply in interface OfflineCommand
Throws:
CommandFailedException
IOException

toString

public String toString()
Specified by:
toString in interface OfflineCommand
Overrides:
toString in class Object


Copyright © 2016. All rights reserved.