diff --git a/.travis.yml b/.travis.yml index c37f80d3..62e87025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,14 @@ branches: only: - develop -install: mvn install +before_install: + # Importing key used to sign jars, necessary for release artifacts deployment in Maven Central + - openssl aes-256-cbc -K $encrypted_dd05710e44e2_key -iv $encrypted_dd05710e44e2_iv -in secring.gpg.enc -out secring.gpg -d + - gpg --import secring.gpg + +install: + # Building and deploying artifacts to Maven Central + - mvn -B -s settings.xml deploy -Possrh after_success: # Installing Codacy code coverage reporter upload tool @@ -22,5 +29,3 @@ after_success: - java -cp ccr.jar com.codacy.CodacyCoverageReporter -l Java -r ./butterfly-metrics-couchdb/target/site/cobertura/coverage.xml --projectToken $CODACY_PROJECT_TOKEN - java -cp ccr.jar com.codacy.CodacyCoverageReporter -l Java -r ./butterfly-metrics-file/target/site/cobertura/coverage.xml --projectToken $CODACY_PROJECT_TOKEN - java -cp ccr.jar com.codacy.CodacyCoverageReporter -l Java -r ./butterfly-utilities/target/site/cobertura/coverage.xml --projectToken $CODACY_PROJECT_TOKEN - # Deploying artifacts to Maven Central - - mvn -B -s settings.xml -DskipTests=true -Dcobertura.skip deploy -Possrh \ No newline at end of file diff --git a/butterfly-cli-package/pom.xml b/butterfly-cli-package/pom.xml index d9adac4a..f41e3836 100644 --- a/butterfly-cli-package/pom.xml +++ b/butterfly-cli-package/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-cli/pom.xml b/butterfly-cli/pom.xml index 4c98dba1..c568eead 100644 --- a/butterfly-cli/pom.xml +++ b/butterfly-cli/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliApp.java b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliApp.java index d7599822..f401c709 100644 --- a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliApp.java +++ b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliApp.java @@ -31,6 +31,7 @@ public class ButterflyCliApp extends ButterflyCliOption { private static Logger logger; + @SuppressWarnings("PMD.DoNotCallSystemExit") public static void main(String... arguments) throws IOException { setButterflyHome(); setEnvironment(arguments); @@ -59,6 +60,7 @@ private static void setButterflyHome() { butterflyHome = new File(butterflyHomePath); } + @SuppressWarnings("PMD.DoNotCallSystemExit") private static void setEnvironment(String[] arguments) { if(arguments.length != 0){ try { @@ -108,6 +110,8 @@ public static File getButterflyHome() { return butterflyHome; } + // This method's visibility is intentionally being set to package + @SuppressWarnings("PMD.DefaultPackage") static String getBanner() { return banner; } diff --git a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliRunner.java b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliRunner.java index d0678726..621a29fd 100644 --- a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliRunner.java +++ b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/ButterflyCliRunner.java @@ -57,12 +57,12 @@ public ButterflyCliRun run() throws IOException { } if (optionSet.has(CLI_OPTION_VERBOSE)) { - logConfigurator.verboseMode(true); + logConfigurator.setVerboseMode(true); logger.info("Verbose mode is ON"); } if (optionSet.has(CLI_OPTION_DEBUG)) { - logConfigurator.debugMode(true); + logConfigurator.setDebugMode(true); logger.info("Debug mode is ON"); logger.info("Butterfly home: {}", ButterflyCliApp.getButterflyHome()); logger.info("JAVA_HOME: {}", System.getenv("JAVA_HOME")); diff --git a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogConfigurator.java b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogConfigurator.java index a47cd362..be0b93f7 100644 --- a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogConfigurator.java +++ b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogConfigurator.java @@ -9,7 +9,7 @@ * SLF4J implementation, but the API doesn't allow * changing the log level in runtime, so here we * are doing it behind the scenes. - *
+ *
* At least we are providing this interface * to isolate these concerns, which will make it * easier to maintain this code if we ever replace @@ -19,15 +19,15 @@ */ public abstract class LogConfigurator { - LogConfigurator() { + public LogConfigurator() { setLoggerLevel("com.paypal.butterfly", Level.INFO); } public abstract void setLoggerLevel(String logger, Level level); - abstract void setLoggerLevel(Class logger, Level level); + public abstract void setLoggerLevel(Class logger, Level level); - public void debugMode(boolean on) { + public void setDebugMode(boolean on) { if(on) { setLoggerLevel("com.paypal.butterfly", Level.DEBUG); } else { @@ -35,8 +35,8 @@ public void debugMode(boolean on) { } } - public abstract void verboseMode(boolean on); + public abstract void setVerboseMode(boolean on); - public abstract void logToFile(boolean on); + public abstract void setLogToFile(boolean on); } diff --git a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogFileDefiner.java b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogFileDefiner.java index 4126e522..11cab54b 100644 --- a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogFileDefiner.java +++ b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogFileDefiner.java @@ -49,24 +49,42 @@ public String getPropertyValue() { } @Override - public void setContext(Context context) {} + public void setContext(Context context) { + // Nothing to be done here + } @Override public Context getContext() { + // Nothing to be done here return null; } @Override - public void addStatus(Status status) {} + public void addStatus(Status status) { + // Nothing to be done here + } @Override - public void addInfo(String s) {} + public void addInfo(String s) { + // Nothing to be done here + } @Override - public void addInfo(String s, Throwable throwable) {} + public void addInfo(String s, Throwable throwable) { + // Nothing to be done here + } @Override - public void addWarn(String s) {} + public void addWarn(String s) { + // Nothing to be done here + } @Override - public void addWarn(String s, Throwable throwable) {} + public void addWarn(String s, Throwable throwable) { + // Nothing to be done here + } + @Override - public void addError(String s) {} + public void addError(String s) { + // Nothing to be done here + } @Override - public void addError(String s, Throwable throwable) {} + public void addError(String s, Throwable throwable) { + // Nothing to be done here + } } \ No newline at end of file diff --git a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogbackLogConfigurator.java b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogbackLogConfigurator.java index c493cd5e..22d10312 100644 --- a/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogbackLogConfigurator.java +++ b/butterfly-cli/src/main/java/com/paypal/butterfly/cli/logging/LogbackLogConfigurator.java @@ -29,7 +29,7 @@ public void setLoggerLevel(String logger, org.slf4j.event.Level level) { } @Override - void setLoggerLevel(Class logger, org.slf4j.event.Level level) { + public void setLoggerLevel(Class logger, org.slf4j.event.Level level) { if(level == null) { throw new IllegalArgumentException("level argument cannot be null"); } @@ -46,7 +46,7 @@ private Level getLogbackLogLevel(org.slf4j.event.Level slf4jLevel) { } @Override - public void verboseMode(boolean on) { + public void setVerboseMode(boolean on) { PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.setPattern("[%d{HH:mm:ss.SSS}] [%highlight(%level)] %msg%n"); patternLayoutEncoder.setContext(loggerContext); @@ -62,7 +62,7 @@ public void verboseMode(boolean on) { } @Override - public void logToFile(boolean on) { + public void setLogToFile(boolean on) { loggerContext.getLogger("ROOT").detachAppender("FILE"); } diff --git a/butterfly-cli/src/test/java/com/paypal/butterfly/cli/ButterflyCliTest.java b/butterfly-cli/src/test/java/com/paypal/butterfly/cli/ButterflyCliTest.java index c68abd48..9bf77a97 100644 --- a/butterfly-cli/src/test/java/com/paypal/butterfly/cli/ButterflyCliTest.java +++ b/butterfly-cli/src/test/java/com/paypal/butterfly/cli/ButterflyCliTest.java @@ -1,16 +1,15 @@ package com.paypal.butterfly.cli; -import com.test.SampleExtension; -import com.test.SampleTransformationTemplate; import com.paypal.butterfly.cli.logging.LogConfigurator; import com.paypal.butterfly.extensions.api.exception.ButterflyException; import com.paypal.butterfly.extensions.api.upgrade.UpgradePath; import com.paypal.butterfly.facade.ButterflyFacade; import com.paypal.butterfly.facade.Configuration; import com.paypal.butterfly.facade.TransformationResult; +import com.test.SampleExtension; +import com.test.SampleTransformationTemplate; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.Mockito; import org.powermock.modules.testng.PowerMockTestCase; import org.testng.Assert; import org.testng.annotations.BeforeMethod; @@ -34,6 +33,10 @@ public class ButterflyCliTest extends PowerMockTestCase { @Mock private ButterflyFacade facade; + // Even though this variable is not used explicitly in this class, + // it is necessary to its proper execution, since the mock initialization + // is happening regardless of it + @SuppressWarnings("PMD.UnusedPrivateField") @Mock private LogConfigurator logConfigurator; @@ -41,18 +44,18 @@ public class ButterflyCliTest extends PowerMockTestCase { @BeforeMethod public void beforeTest() throws ButterflyException { - TransformationResult mockResult = Mockito.mock(TransformationResult.class); + TransformationResult mockResult = mock(TransformationResult.class); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(String.class))).thenReturn(mockResult); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(String.class), Mockito.any(Configuration.class))).thenReturn(mockResult); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(Class.class))).thenReturn(mockResult); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(Class.class), Mockito.any(Configuration.class))).thenReturn(mockResult); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(UpgradePath.class))).thenReturn(mockResult); - Mockito.when(facade.transform(Mockito.any(File.class), Mockito.any(UpgradePath.class), Mockito.any(Configuration.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(String.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(String.class), any(Configuration.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(Class.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(Class.class), any(Configuration.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(UpgradePath.class))).thenReturn(mockResult); + when(facade.transform(any(File.class), any(UpgradePath.class), any(Configuration.class))).thenReturn(mockResult); File file = new File(""); - Mockito.when(mockResult.getTransformedApplicationLocation()).thenReturn(file); - Mockito.when(mockResult.getManualInstructionsFile()).thenReturn(file); + when(mockResult.getTransformedApplicationLocation()).thenReturn(file); + when(mockResult.getManualInstructionsFile()).thenReturn(file); sampleAppFolder = new File(this.getClass().getResource("/sample_app").getFile()); } @@ -69,7 +72,7 @@ public void testListingExtensions() throws IOException { String[] arguments = {"-l", "-v"}; butterflyCli.setOptionSet(arguments); - + int status = butterflyCli.run().getExitStatus(); Assert.assertEquals(status, 0); @@ -100,7 +103,7 @@ public void testTransformation() throws IOException, ButterflyException { */ @Test public void testTransformationWithShortcut() throws IOException, ButterflyException { - Mockito.when(facade.getRegisteredExtension()).thenReturn(new SampleExtension()); + when(facade.getRegisteredExtension()).thenReturn(new SampleExtension()); String arguments[] = {sampleAppFolder.getAbsolutePath(), "-s", "2"}; butterflyCli.setOptionSet(arguments); @@ -119,7 +122,7 @@ public void testTransformationWithShortcut() throws IOException, ButterflyExcept */ @Test public void testTransformationWithShortcutButIgnoringIt() throws IOException, ButterflyException { - Mockito.when(facade.getRegisteredExtension()).thenReturn(new SampleExtension()); + when(facade.getRegisteredExtension()).thenReturn(new SampleExtension()); String arguments[] = {sampleAppFolder.getAbsolutePath(), "-t", "com.test.SampleTransformationTemplate", "-z", "-s", "2"}; butterflyCli.setOptionSet(arguments); @@ -173,7 +176,7 @@ public void testTransformationWithValidOutPutDir() throws IOException, Butterfly @Test public void testAutomaticResolution() throws IOException, ButterflyException { - Mockito.doReturn(SampleTransformationTemplate.class).when(facade).automaticResolution(Mockito.any(File.class)); + doReturn(SampleTransformationTemplate.class).when(facade).automaticResolution(any(File.class)); String arguments[] = {sampleAppFolder.getAbsolutePath()}; butterflyCli.setOptionSet(arguments); int status = butterflyCli.run().getExitStatus(); diff --git a/butterfly-cli/src/test/java/com/paypal/butterfly/cli/logging/LogbackLogConfiguratorTest.java b/butterfly-cli/src/test/java/com/paypal/butterfly/cli/logging/LogbackLogConfiguratorTest.java index 3448c9ca..ac849140 100644 --- a/butterfly-cli/src/test/java/com/paypal/butterfly/cli/logging/LogbackLogConfiguratorTest.java +++ b/butterfly-cli/src/test/java/com/paypal/butterfly/cli/logging/LogbackLogConfiguratorTest.java @@ -26,7 +26,7 @@ public class LogbackLogConfiguratorTest extends PowerMockTestCase { public void testVerboseOn() { Assert.assertNotNull(logbackVerboseConfigurator); Assert.assertNotNull(loggerContext); - logbackVerboseConfigurator.debugMode(true); + logbackVerboseConfigurator.setDebugMode(true); Assert.assertTrue(loggerContext.getLogger("com.paypal.butterfly").getLevel() == ch.qos.logback.classic.Level.DEBUG); } @@ -35,7 +35,7 @@ public void testVerboseOn() { public void testVerboseOff() { Assert.assertNotNull(logbackVerboseConfigurator); Assert.assertNotNull(loggerContext); - logbackVerboseConfigurator.debugMode(false); + logbackVerboseConfigurator.setDebugMode(false); Assert.assertTrue(loggerContext.getLogger("com.paypal.butterfly").getLevel() == ch.qos.logback.classic.Level.INFO); } diff --git a/butterfly-core/pom.xml b/butterfly-core/pom.xml index 60d9146d..f9689133 100644 --- a/butterfly-core/pom.xml +++ b/butterfly-core/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/InternalTransformationException.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/InternalTransformationException.java index 2132454b..afb7c723 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/InternalTransformationException.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/InternalTransformationException.java @@ -11,7 +11,7 @@ */ class InternalTransformationException extends TransformationException { - TransformationContextImpl transformationContext; + private TransformationContextImpl transformationContext; InternalTransformationException(String exceptionMessage, TransformationContextImpl transformationContext) { super(exceptionMessage); @@ -27,6 +27,8 @@ class InternalTransformationException extends TransformationException { this(e.getMessage(), e, transformationContext); } + // This method's visibility is intentionally being set to package + @SuppressWarnings("PMD.DefaultPackage") TransformationContextImpl getTransformationContext() { return transformationContext; } diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/MdFileManualInstructionsHandler.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/MdFileManualInstructionsHandler.java index 345d850b..bdf78f28 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/MdFileManualInstructionsHandler.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/MdFileManualInstructionsHandler.java @@ -17,7 +17,7 @@ /** * This class processes all {@link com.paypal.butterfly.extensions.api.utilities.ManualInstruction} - * objects present in a {@link TransformationContextImpl] object and persist them in a set of MD files, + * objects present in a {@link TransformationContextImpl} object and persist them in a set of MD files, * to be placed in the transformed application folder * * @author facarvalho diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/TemplateTransformation.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/TemplateTransformation.java index d89b928d..bfeb8e82 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/TemplateTransformation.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/TemplateTransformation.java @@ -9,6 +9,7 @@ * * @author facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") public class TemplateTransformation extends Transformation { private static final String TO_STRING_SYNTAX = "{ \"application\" : %s, \"template\" : %s, \"templateClass\" : %s }"; @@ -39,7 +40,7 @@ String getExtensionVersion() { } @Override - String getTemplatetName() { + String getTemplateName() { return template.getName(); } diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/Transformation.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/Transformation.java index 02efd4da..ebf2568f 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/Transformation.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/Transformation.java @@ -13,6 +13,7 @@ * * @author facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") public abstract class Transformation { private static final Logger logger = LoggerFactory.getLogger(Transformation.class); @@ -73,7 +74,7 @@ File getManualInstructionsDir() { abstract String getExtensionVersion(); - abstract String getTemplatetName(); + abstract String getTemplateName(); protected String getExtensionName(Class extension) { return extension.getName(); diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationContextImpl.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationContextImpl.java index fc95030e..ce37dc05 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationContextImpl.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationContextImpl.java @@ -18,6 +18,7 @@ * * @author facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") @SuppressFBWarnings("URF_UNREAD_FIELD") class TransformationContextImpl implements TransformationContext { diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationEngine.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationEngine.java index 2603edef..90f1f198 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationEngine.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationEngine.java @@ -11,7 +11,6 @@ import com.paypal.butterfly.facade.TransformationResult; import com.paypal.butterfly.facade.exception.TransformationException; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +55,7 @@ public void setupListeners() { * * @param transformation the transformation object * @throws TransformationException if the transformation is aborted for any reason + * @return the result after performing this transformation */ public TransformationResult perform(Transformation transformation) throws TransformationException { if(logger.isDebugEnabled()) { @@ -63,7 +63,7 @@ public TransformationResult perform(Transformation transformation) throws Transf } logger.info("Extension name:\t\t\t\t\t{}", transformation.getExtensionName()); logger.info("Extension version:\t\t\t\t{}", transformation.getExtensionVersion()); - logger.info("Transformation template:\t\t\t{}", transformation.getTemplatetName()); + logger.info("Transformation template:\t\t\t{}", transformation.getTemplateName()); File transformedAppFolder = prepareOutputFolder(transformation); List transformationContexts = new ArrayList<>(); @@ -463,7 +463,7 @@ private void processUtilityExecutionResult(TransformationUtility utility, Perfor } break; case VALUE: - logger.debug("\t-\t - [{}][Result: {}][Utility: {}]", StringUtils.abbreviate(utility.toString(), 240), StringUtils.abbreviate(executionResult.getValue().toString(), 120), utility.getName()); + logger.debug("\t-\t - [{}][Result: {}][Utility: {}]", utility.toString(), executionResult.getValue().toString(), utility.getName()); break; case WARNING: processExecutionResultWarningType(utility, executionResult, "-"); diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationStatisticsImpl.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationStatisticsImpl.java index 0d19b5b5..9a40fc0d 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationStatisticsImpl.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/TransformationStatisticsImpl.java @@ -2,14 +2,19 @@ import com.paypal.butterfly.extensions.api.*; import com.paypal.butterfly.extensions.api.metrics.TransformationStatistics; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * POJO to hold transformation statistics * * @author facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") class TransformationStatisticsImpl implements TransformationStatistics { + private static Logger logger = LoggerFactory.getLogger(TransformationStatisticsImpl.class); + // Number of utilities performed private int utilitiesCount = 0; @@ -43,6 +48,9 @@ void registerResult(PerformResult result) { case SKIPPED_DEPENDENCY: performResults.skippedDependencyCount++; break; + default: + logger.error("Unknown result type {}", result.getType()); + break; } TransformationUtility source = result.getSource(); @@ -64,6 +72,9 @@ void registerResult(PerformResult result) { case ERROR: executionResults.operations.errorCount++; break; + default: + logger.error("Unknown result type {}", result.getType()); + break; } } } else { @@ -83,6 +94,9 @@ void registerResult(PerformResult result) { case ERROR: executionResults.utilities.errorCount++; break; + default: + logger.error("Unknown result type {}", result.getType()); + break; } } } diff --git a/butterfly-core/src/main/java/com/paypal/butterfly/core/UpgradePathTransformation.java b/butterfly-core/src/main/java/com/paypal/butterfly/core/UpgradePathTransformation.java index 0faf2e21..7d87bbdf 100644 --- a/butterfly-core/src/main/java/com/paypal/butterfly/core/UpgradePathTransformation.java +++ b/butterfly-core/src/main/java/com/paypal/butterfly/core/UpgradePathTransformation.java @@ -10,6 +10,7 @@ * * @author facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") public class UpgradePathTransformation extends Transformation { private static final String TO_STRING_SYNTAX = "{ \"application\" : %s, \"upgrade from version\" : %s, \"to version\" : %s }"; @@ -40,7 +41,7 @@ String getExtensionVersion() { } @Override - String getTemplatetName() { + String getTemplateName() { return upgradePath.getFirstStepTemplateName(); } diff --git a/butterfly-core/src/test/java/com/paypal/butterfly/core/ButteflyFacadeImplTest.java b/butterfly-core/src/test/java/com/paypal/butterfly/core/ButteflyFacadeImplTest.java index 62785d73..ddff6f23 100644 --- a/butterfly-core/src/test/java/com/paypal/butterfly/core/ButteflyFacadeImplTest.java +++ b/butterfly-core/src/test/java/com/paypal/butterfly/core/ButteflyFacadeImplTest.java @@ -6,9 +6,8 @@ import com.paypal.butterfly.core.sample.SampleUpgradeStep; import com.paypal.butterfly.extensions.api.Extension; import com.paypal.butterfly.extensions.api.exception.ButterflyException; -import com.paypal.butterfly.extensions.api.upgrade.UpgradePath; -import com.paypal.butterfly.facade.Configuration; import com.paypal.butterfly.extensions.api.exception.TemplateResolutionException; +import com.paypal.butterfly.extensions.api.upgrade.UpgradePath; import org.mockito.InjectMocks; import org.mockito.Mock; import org.powermock.modules.testng.PowerMockTestCase; @@ -16,7 +15,6 @@ import org.testng.annotations.Test; import java.io.File; -import java.util.List; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.times; @@ -25,7 +23,7 @@ /** * ButteflyFacadeImplTest - * + *

* Created by vkuncham on 11/7/2016. */ public class ButteflyFacadeImplTest extends PowerMockTestCase { @@ -53,76 +51,66 @@ public void testGetRegisteredExtension() { @Test(expectedExceptions = TemplateResolutionException.class, expectedExceptionsMessageRegExp = "No transformation template applies") public void testAutomaticResolutionNoTemplate() throws TemplateResolutionException { - when(extensionRegistry.getExtension()).thenReturn(extensionRegistry_test.getExtension()); - Assert.assertEquals(butterflyFacadeImpl.automaticResolution(new File("testTransformation1")),null); + when(extensionRegistry.getExtension()).thenReturn(extensionRegistry_test.getExtension()); + Assert.assertEquals(butterflyFacadeImpl.automaticResolution(new File("testTransformation1")), null); } @Test public void testAutomaticResolutionTemplate() throws TemplateResolutionException { when(extensionRegistry.getExtension()).thenReturn(extensionRegistry_test.getExtension()); - Assert.assertEquals(butterflyFacadeImpl.automaticResolution(applicationFolder),SampleTransformationTemplate.class); + Assert.assertEquals(butterflyFacadeImpl.automaticResolution(applicationFolder), SampleTransformationTemplate.class); } - @Test(expectedExceptions = IllegalArgumentException.class, - expectedExceptionsMessageRegExp = "Template class name cannot be blank") + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Template class name cannot be blank") public void testTransformWithTemplateClassAsEmptyString() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder,""); + butterflyFacadeImpl.transform(applicationFolder, ""); } - @Test(expectedExceptions = IllegalArgumentException.class, - expectedExceptionsMessageRegExp = "Template class name cannot be blank") + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Template class name cannot be blank") public void testTransformWithTemplateAsNull() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder,(String) null); + butterflyFacadeImpl.transform(applicationFolder, (String) null); } - @Test(expectedExceptions = InternalException.class, - expectedExceptionsMessageRegExp = "Template class TestTemplate not found.*") + @Test(expectedExceptions = InternalException.class, expectedExceptionsMessageRegExp = "Template class TestTemplate not found.*") public void testTransformWithInValidTemplate() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder,"TestTemplate"); + butterflyFacadeImpl.transform(applicationFolder, "TestTemplate"); } @Test public void testTransformWithValidTemplate() throws ButterflyException { - - TemplateTransformation templateTransformation = new TemplateTransformation(new Application(applicationFolder), - new SampleTransformationTemplate(),new Configuration()); butterflyFacadeImpl.transform(applicationFolder, "com.paypal.butterfly.core.sample.SampleTransformationTemplate"); - verify(transformationEngine,times(1)).perform((TemplateTransformation) anyObject()); + verify(transformationEngine, times(1)).perform((TemplateTransformation) anyObject()); } - @Test(expectedExceptions = InternalException.class, - expectedExceptionsMessageRegExp = "Template class class com.paypal.butterfly.core.sample." + - "SampleAbstractTransformationTemplate could not be instantiated.*") + @Test(expectedExceptions = InternalException.class, expectedExceptionsMessageRegExp = "Template class class com.paypal.butterfly.core.sample.SampleAbstractTransformationTemplate could not be instantiated.*") public void testTransformWithAbstractTemplate() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder,"com.paypal.butterfly.core.sample.SampleAbstractTransformationTemplate"); + butterflyFacadeImpl.transform(applicationFolder, "com.paypal.butterfly.core.sample.SampleAbstractTransformationTemplate"); } @Test public void testTransformWithValidTemplateAsClass() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder,SampleTransformationTemplate.class); - verify(transformationEngine,times(1)).perform((TemplateTransformation) anyObject()); + butterflyFacadeImpl.transform(applicationFolder, SampleTransformationTemplate.class); + verify(transformationEngine, times(1)).perform((TemplateTransformation) anyObject()); } - @Test(expectedExceptions = IllegalArgumentException.class, - expectedExceptionsMessageRegExp ="Invalid application folder testTransformation1" + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Invalid application folder testTransformation1" ) public void testTransformWithValidUpgradePathInvalidAppFolder() throws ButterflyException { - UpgradePath upgradePath = new UpgradePath(SampleUpgradeStep.class); - butterflyFacadeImpl.transform(new File("testTransformation1"),upgradePath); + UpgradePath upgradePath = new UpgradePath(SampleUpgradeStep.class); + butterflyFacadeImpl.transform(new File("testTransformation1"), upgradePath); } - @Test(expectedExceptions = IllegalArgumentException.class, - expectedExceptionsMessageRegExp ="Upgrade path cannot be null" + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Upgrade path cannot be null" ) public void testTransformWithInValidUpgradePath() throws ButterflyException { - butterflyFacadeImpl.transform(applicationFolder, (UpgradePath) null); + butterflyFacadeImpl.transform(applicationFolder, (UpgradePath) null); } @Test public void testTransformWithValidUpgradePath() throws ButterflyException { - UpgradePath upgradePath = new UpgradePath(SampleUpgradeStep.class); - butterflyFacadeImpl.transform(applicationFolder,upgradePath); - verify(transformationEngine,times(1)).perform((UpgradePathTransformation)anyObject()); + UpgradePath upgradePath = new UpgradePath(SampleUpgradeStep.class); + butterflyFacadeImpl.transform(applicationFolder, upgradePath); + verify(transformationEngine, times(1)).perform((UpgradePathTransformation) anyObject()); } } diff --git a/butterfly-extensions-api/pom.xml b/butterfly-extensions-api/pom.xml index eeb22aa6..e7169198 100644 --- a/butterfly-extensions-api/pom.xml +++ b/butterfly-extensions-api/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.java index e508d523..e77228ae 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.java @@ -18,12 +18,12 @@ * * @author facarvalho */ -public class ContextAttributeRetriever extends TransformationUtility { +public class ContextAttributeRetriever extends TransformationUtility { private static final String DESCRIPTION = "Retrieves value of transformation context attribute '%s'"; private String attributeName; - private VT attributeValue; + private T attributeValue; private boolean executed = false; public ContextAttributeRetriever() { @@ -49,7 +49,7 @@ public String getDescription() { protected ExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { executed = true; try { - attributeValue = (VT) transformationContext.get(attributeName); + attributeValue = (T) transformationContext.get(attributeName); return TUExecutionResult.nullResult(this); } catch (IllegalArgumentException | ClassCastException ex) { return TUExecutionResult.error(this, ex); @@ -64,7 +64,7 @@ protected ExecutionResult execution(File transformedAppFolder, TransformationCon * * @return the value of the transformation context attribute specified earlier */ - public VT getAttributeValue() { + public T getAttributeValue() { if (!executed) { throw new IllegalStateException(getName() + " has not had a chance to be executed yet"); } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/DoubleCondition.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/DoubleCondition.java index e407779c..37eb91c0 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/DoubleCondition.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/DoubleCondition.java @@ -14,18 +14,28 @@ * for example). For conditions * based on evaluating a single file see {@link SingleCondition}. * For conditions based on multiple files see {@link MultipleConditions} + *
+ * Important: it returns true if both files don't exist, + * and it returns false if only one of them exists. * + * @author facarvalho * @see SingleCondition * @see MultipleConditions - * - * @author facarvalho */ -public abstract class DoubleCondition extends UtilityCondition { +public abstract class DoubleCondition extends UtilityCondition { // The name of the transformation context attribute // that refers to the file to be compared against the baseline file private String attribute; + // TODO + // Rename attribute to compareAttribute + + // TODO + // Add a new instance variable called compareRelative, to be used as an alternative to compareAttribute, + // pointing directly to the comparison file, relative to the transformed application folder, + // and without the need for a transformation context attribute. + /** * Condition to determine if a transformation utility * should be executed or not. Every @@ -34,23 +44,22 @@ public abstract class DoubleCondition extends Utili * is based on two files (when comparing if two XML files are equal * for example) */ - public DoubleCondition() { + public DoubleCondition() { } /** - * Set the name of the transformation context attribute - * that refers to the file to be compared against the - * baseline file, which is set by regular {@link com.paypal.butterfly.extensions.api.TransformationUtility} - * methods, like {@link #relative(String)} or {@link #absolute(String)} + * Condition to determine if a transformation utility + * should be executed or not. Every + * DoubleUtilityCondition subclass result type must always + * be boolean. The criteria to this type of condition + * is based on two files (when comparing if two XML files are equal + * for example) * * @param attribute the name of the transformation context attribute * that refers to the file to be compared against the baseline file - * @return this utility condition instance */ - public DUC setAttribute(String attribute) { - checkForBlankString("attribute", attribute); - this.attribute = attribute; - return (DUC) this; + public DoubleCondition(String attribute) { + setAttribute(attribute); } /** @@ -66,13 +75,34 @@ public String getAttribute() { return attribute; } + /** + * Set the name of the transformation context attribute + * that refers to the file to be compared against the + * baseline file, which is set by regular {@link com.paypal.butterfly.extensions.api.TransformationUtility} + * methods, like {@link #relative(String)} or {@link #absolute(String)} + * + * @param attribute the name of the transformation context attribute + * that refers to the file to be compared against the baseline file + * @return this utility condition instance + */ + public T setAttribute(String attribute) { + checkForBlankString("attribute", attribute); + this.attribute = attribute; + return (T) this; + } + @Override - protected ExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { try { File baselineFile = getAbsoluteFile(transformedAppFolder, transformationContext); File comparisonFile = getComparisonFile(transformationContext); - boolean result = compare(baselineFile, comparisonFile); + boolean result = false; + if (baselineFile.exists() && comparisonFile.exists()) { + result = compare(baselineFile, comparisonFile); + } else if (!baselineFile.exists() && !comparisonFile.exists()) { + result = true; + } return TUExecutionResult.value(this, result); } catch (TransformationUtilityException e) { @@ -84,7 +114,7 @@ protected ExecutionResult execution(File transformedAppFolder, TransformationCon * Returns true only if the compared files meet the comparison * criteria established and implemented by the subclass * - * @param baselineFile the baseline file used for comparison + * @param baselineFile the baseline file used for comparison * @param comparisonFile the file to be compared against the baseline file * @return this utility condition instance */ diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ExecutionResult.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ExecutionResult.java index 7f420ac9..a4ff5c37 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ExecutionResult.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/ExecutionResult.java @@ -10,7 +10,7 @@ * * @author facarvalho */ -public abstract class ExecutionResult extends Result { +public abstract class ExecutionResult extends Result { ExecutionResult(S source) { super(source); diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/FilterFiles.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/FilterFiles.java index 33480251..6fcf4ca4 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/FilterFiles.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/FilterFiles.java @@ -150,19 +150,14 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC * @return this transformation utility instance */ public SingleCondition newConditionInstance(File transformedAppFolder, File file) { - try { - SingleCondition condition = (SingleCondition) conditionTemplate.copy(); - condition.relative(TransformationUtility.getRelativePath(transformedAppFolder, file)); - condition.setSaveResult(false); - - conditionInstanceCounter++; - condition.setName(String.format("%s-%d", conditionTemplate.getName(), conditionInstanceCounter)); - - return condition; - } catch (CloneNotSupportedException e) { - String exceptionMessage = String.format("Error when preparing single condition instance for %s", getName()); - throw new TransformationUtilityException(exceptionMessage, e); - } + SingleCondition condition = (SingleCondition) conditionTemplate.copy(); + condition.relative(TransformationUtility.getRelativePath(transformedAppFolder, file)); + condition.setSaveResult(false); + + conditionInstanceCounter++; + condition.setName(String.format("%s-%d", conditionTemplate.getName(), conditionInstanceCounter)); + + return condition; } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleConditions.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleConditions.java index c0fa59ec..36d07a75 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleConditions.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleConditions.java @@ -211,19 +211,14 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC * @return the new utility condition created based on this instance */ public UtilityCondition newConditionInstance(File transformedAppFolder, File file) { - try { - UtilityCondition condition = (UtilityCondition) conditionTemplate.copy(); - condition.relative(TransformationUtility.getRelativePath(transformedAppFolder, file)); - condition.setSaveResult(false); - - conditionInstanceCounter++; - condition.setName(String.format("%s-%d", conditionTemplate.getName(), conditionInstanceCounter)); - - return condition; - } catch (CloneNotSupportedException e) { - String exceptionMessage = String.format("Error when preparing condition instance for %s", getName()); - throw new TransformationUtilityException(exceptionMessage, e); - } + UtilityCondition condition = (UtilityCondition) conditionTemplate.copy(); + condition.relative(TransformationUtility.getRelativePath(transformedAppFolder, file)); + condition.setSaveResult(false); + + conditionInstanceCounter++; + condition.setName(String.format("%s-%d", conditionTemplate.getName(), conditionInstanceCounter)); + + return condition; } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleOperations.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleOperations.java index 9570e0be..c5de1d25 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleOperations.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/MultipleOperations.java @@ -320,6 +320,9 @@ private TransformationOperation createClone(int order, File transformedAppFolder @Override public List getChildren() { + if (operations == null) { + return Collections.emptyList(); + } return Collections.unmodifiableList(operations); } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/Result.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/Result.java index 94b784b4..c47fa91b 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/Result.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/Result.java @@ -9,7 +9,7 @@ * * @author facarvalho */ -abstract class Result { +abstract class Result { // The source of this result, which could be for example // a transformation utility instance or a transformation @@ -38,25 +38,25 @@ abstract class Result { setType(type); } - private RT setSource(S source) { + private R setSource(S source) { if(source == null) { throw new IllegalArgumentException("Result source cannot be null"); } this.source = source; - return (RT) this; + return (R) this; } - protected RT setType(T type) { + protected R setType(T type) { if(type == null) { throw new IllegalArgumentException("Result type cannot be null"); } this.type = type; - return (RT) this; + return (R) this; } - public RT setDetails(String details) { + public R setDetails(String details) { this.details = details; - return (RT) this; + return (R) this; } /** @@ -68,7 +68,7 @@ public RT setDetails(String details) { * @param exception associated with the execution result * @return this object */ - protected RT setException(Exception exception) { + protected R setException(Exception exception) { if(exception == null) { throw new IllegalArgumentException("Exception object cannot be null"); } @@ -76,7 +76,7 @@ protected RT setException(Exception exception) { throw new IllegalArgumentException("Exception cannot be assigned to " + type); } this.exception = exception; - return (RT) this; + return (R) this; } /** @@ -87,10 +87,10 @@ protected RT setException(Exception exception) { * @param warning the warning to be added * @return this object */ - public RT addWarning(Exception warning) { + public R addWarning(Exception warning) { warnings.add(warning); changeTypeOnWarning(); - return (RT) this; + return (R) this; } /** diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/SingleCondition.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/SingleCondition.java index d8da65cc..6ba9bd6b 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/SingleCondition.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/SingleCondition.java @@ -16,5 +16,5 @@ * * @author facarvalho */ -public abstract class SingleCondition extends UtilityCondition { +public abstract class SingleCondition extends UtilityCondition { } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationOperation.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationOperation.java index 6853a8e1..b8c339bf 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationOperation.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationOperation.java @@ -1,6 +1,12 @@ package com.paypal.butterfly.extensions.api; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; + /** * Special type of {@link TransformationUtility} that applies a modification to the project. *
@@ -17,17 +23,17 @@ * The default value for {@link #relative(String)} is {@code null}, which means * it must be set explicitly, unless an absolute path is set via {@link #absolute(String)} * or {@link #absolute(String, String)} - *
- * Every transformation operation subclass must override {@link #clone()} and every operation - * specific property defined in the operation subclass must be copied from the original - * object to the clone object. Properties inherited from this class and its super classes - * MUST NOT be copied from original object to cloned object, since that is all already taken - * care of properly by the framework. Notice that name, parent and path (absolute and relative) - * are NECESSARILY NOT assigned to the clone object * * @author facarvalho */ -public abstract class TransformationOperation extends TransformationUtility { +public abstract class TransformationOperation extends TransformationUtility { + + // An optional temporary read-only copy of the file to be modified + // This file gets automatically deleted after the transformation operation execution + private File readFile; + + // A prefix used to name the temporary read-only file + private static final String READ_FILE_PREFIX = "butterfly_"; public TransformationOperation() { // Different than regular Transformation Utilities, the default value here is null, which means @@ -36,8 +42,52 @@ public TransformationOperation() { } @Override - protected final TO setSaveResult(boolean saveResult) { + protected final T setSaveResult(boolean saveResult) { throw new UnsupportedOperationException("Transformation operations must always save results"); } + /** + * Creates and returns a temporary read-only copy of the file to be modified. + *
+ * The file to be modified by any transformation operation is set via + * {@link #relative(String)}, {@link #absolute(String)} or {@link #absolute(String, String)}). + * Some transformation operations though might need to read the file to be modified + * as a stream, and modify it by writing to an output stream as that same file + * is read. Since it is impossible to modify a file at the same time it is being read, + * this utility method offers an convenient way to create a temporary read-only + * copy of the file to be modified. This copy should be used to be read, while the original + * file can be modified. + *
+ * Important notes: + *

    + *
  1. At the first time this method is called, the temporary file will be created and returned. If called again, the same temporary file created at the first time will be returned.
  2. + *
  3. The read-only file will not reflect the changes performed in the original file at any moment, always keeping its original state.
  4. + *
  5. There is no need to delete the temporary file after using it. Butterfly automatically deletes it when the JVM terminates.
  6. + *
+ * + * @param transformedAppFolder the folder where the transformed application code is + * @param transformationContext the transformation context object + * @return a temporary read-only copy of the file to be modified + * @throws IOException if the temporary file could not be created + */ + protected final File getOrCreateReadFile(File transformedAppFolder, TransformationContext transformationContext) throws IOException { + if (readFile == null) { + File originalFile = getAbsoluteFile(transformedAppFolder, transformationContext); + readFile = File.createTempFile(READ_FILE_PREFIX, null); + FileUtils.copyFile(originalFile, readFile); + readFile.setReadOnly(); + } + + return readFile; + } + + @Override + public PerformResult perform(File transformedAppFolder, TransformationContext transformationContext) throws TransformationUtilityException { + PerformResult performResult = super.perform(transformedAppFolder, transformationContext); + if (readFile != null) { + readFile.deleteOnExit(); + } + + return performResult; + } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationTemplate.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationTemplate.java index 0fb9688c..5bc702f6 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationTemplate.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationTemplate.java @@ -170,9 +170,20 @@ public final String loop(TransformationUtility utility, UtilityCondition conditi return add(new TransformationUtilityLoop(utility).setCondition(condition)); } + @Deprecated @Override public final void log(String logMessage) { - add(new Log().setLogMessage(logMessage)); + info(logMessage); + } + + @Override + public final void info(String infoMessage) { + add(new Log().setLogMessage(infoMessage)); + } + + @Override + public final void debug(String debugMessage) { + add(new Log().setLogMessage(debugMessage).setLogLevel(Level.DEBUG)); } @Override @@ -180,9 +191,20 @@ public final void log(Level logLevel, String logMessage) { add(new Log().setLogLevel(logLevel).setLogMessage(logMessage)); } + @Deprecated @Override public final void log(String logMessage, String... attributeNames) { - add(new Log().setLogMessage(logMessage).setAttributeNames(attributeNames)); + info(logMessage, attributeNames); + } + + @Override + public final void info(String infoMessage, String... attributeNames) { + add(new Log().setLogMessage(infoMessage).setAttributeNames(attributeNames)); + } + + @Override + public final void debug(String debugMessage, String... attributeNames) { + add(new Log().setLogMessage(debugMessage).setAttributeNames(attributeNames).setLogLevel(Level.DEBUG)); } @Override diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtility.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtility.java index 0d95de5d..934b6f9c 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtility.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtility.java @@ -35,20 +35,13 @@ * Every TransformationUtility subclass MUST have a public no arguments default constructor, * and also public setters and getters for all properties they want to expose via {@link #set(String, String)}. * In addition to that, every setter must return the TransformationUtility instance. - *
- * Also, every TransformationUtility subclass must override {@link #clone()} and every utility - * specific property defined in the subclass must be copied from the original - * object to the clone object. Properties inherited from this class and its super classes - * MUST NOT be copied from original object to cloned object, since that is all already taken - * care of properly by the framework. Notice that name, parent and path (absolute and relative) - * are NECESSARILY NOT assigned to the clone object * * @author facarvalho */ // TODO create another type to be parent of TO and TU, this way the result type will be better organized // How to name it? transformation node? // This type should be the one to be added to a template -public abstract class TransformationUtility implements Cloneable { +public abstract class TransformationUtility implements Cloneable { private static final Logger logger = LoggerFactory.getLogger(TransformationUtility.class); @@ -59,10 +52,6 @@ public abstract class TransformationUtility im // 1 means first private int order = -1; - public int getOrder() { - return order; - } - // The parent this utility instance has been registered to private TransformationUtilityParent parent; @@ -98,12 +87,12 @@ public int getOrder() { // Map of properties to be set later, during transformation time. // The keys must be utility Java property names, and the values // must be transformation context attribute names - private Map latePropertiesAttributes = new HashMap(); + private Map latePropertiesAttributes = new HashMap<>(); // Map of properties to be set later, during transformation time. // The keys must be utility Java property names, and the values // must be the setter methods - private Map latePropertiesSetters = new HashMap(); + private Map latePropertiesSetters = new HashMap<>(); // Abort the whole transformation if this operation fails private boolean abortOnFailure = false; @@ -131,7 +120,7 @@ public int getOrder() { // Optional condition to let this operation be executed (if true) // This is the actual UtilityCondition object to be executed // right before this TU is executed. Its result is then evaluated - // and, based on that, this TU is executed or not + // and, based on that, this T is executed or not private UtilityCondition utilityCondition = null; // Indicates whether or not this utility has already been @@ -143,11 +132,13 @@ public int getOrder() { // in the TCA private AtomicBoolean hasBeenPerformed = new AtomicBoolean(false); - /** - * The public default constructor should always be available by any transformation - * utility because in many cases all of its properties will be set during - * transformation time, using the transformation context - */ + // Even though it is redundant to have this default constructor here, since it is + // the only one (the compiler would have added it implicitly), this is being explicitly + // set here to emphasize that the public default constructor should always be + // available by any transformation utility even when additional constructors are present. + // The reason for that is the fact that one or more of its properties might be set + // during transformation time, using the TransformationUtility set method + @SuppressWarnings("PMD.UnnecessaryConstructor") public TransformationUtility() { } @@ -159,12 +150,12 @@ public TransformationUtility() { * @param name transformation utility instance name * @return this transformation utility instance */ - protected TU setName(String name) { + protected T setName(String name) { if(StringUtils.isBlank(name)) { throw new TransformationDefinitionException(name + " cannot be blank"); } this.name = name; - return (TU) this; + return (T) this; } public final String getName() { @@ -180,9 +171,9 @@ public final String getName() { * when saved into the transformation context. * @return this transformation utility instance */ - public TU setContextAttributeName(String contextAttributeName) { + public T setContextAttributeName(String contextAttributeName) { this.contextAttributeName = contextAttributeName; - return (TU) this; + return (T) this; } /** @@ -207,15 +198,15 @@ public String getContextAttributeName() { * @param order the order of execution of this utility * @return this transformation utility instance */ - public final TU setParent(TransformationUtilityParent parent, int order) { + public final T setParent(TransformationUtilityParent parent, int order) { this.parent = parent; this.order = order; if(name == null) { - setName(String.format(UTILITY_NAME_SYNTAX, parent.getName(), order, ((TU) this).getClass().getSimpleName())); + setName(String.format(UTILITY_NAME_SYNTAX, parent.getName(), order, ((T) this).getClass().getSimpleName())); } - return (TU) this; + return (T) this; } /** @@ -252,6 +243,17 @@ public TransformationTemplate getTransformationTemplate() { */ public abstract String getDescription(); + /** + * Returns the execution order for this utility on its parent. + * Value -1 means it has not been registered to any parent yet, + * while 1 means first. + * + * @return the execution order for this utility on its parent + */ + public int getOrder() { + return order; + } + /** * Sets the relative path from the application root folder * to the file or folder the transformation utility should perform against. @@ -270,21 +272,23 @@ public TransformationTemplate getTransformationTemplate() { * to the file or folder the transformation utility should be performed against * @return this transformation utility instance */ - public final TU relative(String relativePath) { + public final T relative(String relativePath) { this.relativePath = normalizeRelativePathSeparator(relativePath); - return (TU) this; + return (T) this; } /* - * Returns a relative path that is in compliance with the current OS in terms of file separator + * Returns a relative path that is in compliance with the current OS in terms of file separator, + * or null, if the passed relative path is null */ - protected static String normalizeRelativePathSeparator(String _relativePath) { - if(_relativePath != null) { - _relativePath = _relativePath.replace('/', File.separatorChar).replace('\\', File.separatorChar); + protected static String normalizeRelativePathSeparator(String relativePath) { + String normalizedRelativePath = null; + if(relativePath != null) { + normalizedRelativePath = relativePath.replace('/', File.separatorChar).replace('\\', File.separatorChar); } - return _relativePath; + return normalizedRelativePath; } /** @@ -321,8 +325,7 @@ private void setAbsoluteFile(File transformedAppFolder, TransformationContext tr if(absoluteFile == null) { String exceptionMessage = String.format("Context attribute %s, which is supposed to define absolute file for %s, is null", absoluteFileFromContextAttribute, name); // FIXME a better exception is necessary here for cases when the absolute path transformation context attribute value is null - TransformationUtilityException exception = new TransformationUtilityException(exceptionMessage); - throw exception; + throw new TransformationUtilityException(exceptionMessage); } if(additionalRelativePath != null) { absoluteFile = new File(absoluteFile, additionalRelativePath); @@ -337,8 +340,7 @@ private void setAbsoluteFile(File transformedAppFolder, TransformationContext tr } else { if (relativePath == null) { String exceptionMessage = String.format("Neither absolute nor relative path has been set for transformation utility %s", name); - TransformationUtilityException exception = new TransformationUtilityException(exceptionMessage); - throw exception; + throw new TransformationUtilityException(exceptionMessage); } absoluteFile = new File(transformedAppFolder, relativePath); } @@ -394,17 +396,17 @@ public static String getRelativePath(File baselineFile, File targetFile) { * execution * @return this transformation utility instance */ - public final TU set(String propertyName, String contextAttributeName) { + public final T set(String propertyName, String contextAttributeName) { Method method = getMethod(propertyName); latePropertiesAttributes.put(propertyName, contextAttributeName); latePropertiesSetters.put(propertyName, method); - return (TU) this; + return (T) this; } private Method getMethod(String propertyName) { String methodName = getMethodName(propertyName); - Class clazz = ((TU) this).getClass(); + Class clazz = ((T) this).getClass(); for(Method method : clazz.getMethods()) { if(method.getName().equals(methodName)) { @@ -431,7 +433,7 @@ protected final void applyPropertiesFromContext(TransformationContext transforma Method method; Object value = null; for (final Iterator itr = latePropertiesAttributes.entrySet().iterator(); itr.hasNext();) { - Map.Entry entry = (Map.Entry)itr.next(); + Map.Entry entry = (Map.Entry) itr.next(); String propertyName = entry.getKey(); attributeName = latePropertiesAttributes.get(propertyName); try { @@ -488,9 +490,9 @@ private String getMethodName(String propertyName) { * execution * @return this transformation utility instance */ - public TU absolute(String contextAttributeName) { + public T absolute(String contextAttributeName) { absoluteFileFromContextAttribute = contextAttributeName; - return (TU) this; + return (T) this; } /** @@ -513,14 +515,14 @@ public TU absolute(String contextAttributeName) { * in {@link #relative(String)} * @return this transformation utility instance */ - public TU absolute(String contextAttributeName, String additionalRelativePath) { + public T absolute(String contextAttributeName, String additionalRelativePath) { absoluteFileFromContextAttribute = contextAttributeName; this.additionalRelativePath = normalizeRelativePathSeparator(additionalRelativePath); - return (TU) this; + return (T) this; } - final String getAbsoluteFileFromContextAttribute() { + private final String getAbsoluteFileFromContextAttribute() { return absoluteFileFromContextAttribute; } @@ -572,22 +574,21 @@ public PerformResult perform(File transformedAppFolder, TransformationContext tr // Checking for UtilityCondition condition if(utilityCondition != null) { - try { - TransformationUtility utilityCondition = this.utilityCondition.clone(); - utilityCondition.relative(this.getRelativePath()); - TUExecutionResult conditionExecutionResult = (TUExecutionResult) utilityCondition.execution(transformedAppFolder, transformationContext); - Object conditionResult = conditionExecutionResult.getValue(); - if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean) conditionResult).booleanValue()) { - String utilityConditionName = (utilityCondition.getName() == null ? utilityCondition.toString() : utilityCondition.getName()); - String details = String.format("%s was skipped due to failing UtilityCondition '%s'", getName(), utilityConditionName); - return PerformResult.skippedCondition(this, details); - } - } catch (CloneNotSupportedException e) { - String exceptionMessage = String.format("%s can't be executed because the UtilityCondition object associated with it can't be cloned", getName()); - TransformationUtilityException ex = new TransformationUtilityException(exceptionMessage, e); - return PerformResult.error(this, ex); - } + TransformationUtility utilityCondition = this.utilityCondition.copy(); + + // Setting the condition to execute against the exact same file this TU is set to execute against + utilityCondition.relativePath = this.relativePath; + utilityCondition.absoluteFile = this.absoluteFile; + utilityCondition.absoluteFileFromContextAttribute = this.absoluteFileFromContextAttribute; + utilityCondition.additionalRelativePath = this.additionalRelativePath; + TUExecutionResult conditionExecutionResult = (TUExecutionResult) utilityCondition.execution(transformedAppFolder, transformationContext); + Object conditionResult = conditionExecutionResult.getValue(); + if (conditionResult == null || conditionResult instanceof Boolean && !((Boolean) conditionResult).booleanValue()) { + String utilityConditionName = (utilityCondition.getName() == null ? utilityCondition.toString() : utilityCondition.getName()); + String details = String.format("%s was skipped due to failing UtilityCondition '%s'", getName(), utilityConditionName); + return PerformResult.skippedCondition(this, details); + } } // Checking for dependencies @@ -639,9 +640,9 @@ public PerformResult perform(File transformedAppFolder, TransformationContext tr * If not, just state a warning, aborts the operation execution only * @return this transformation utility instance */ - public final TU abortOnFailure(boolean abort) { + public final T abortOnFailure(boolean abort) { abortOnFailure = abort; - return (TU) this; + return (T) this; } /** @@ -657,10 +658,10 @@ public final TU abortOnFailure(boolean abort) { * has to be aborted * @return this transformation utility instance */ - public final TU abortOnFailure(boolean abort, String abortionMessage) { + public final T abortOnFailure(boolean abort, String abortionMessage) { abortOnFailure = abort; this.abortionMessage = abortionMessage; - return (TU) this; + return (T) this; } /** @@ -716,9 +717,9 @@ public boolean isSaveResult() { * context object * @return this transformation utility instance */ - protected TU setSaveResult(boolean saveResult) { + protected T setSaveResult(boolean saveResult) { this.saveResult = saveResult; - return (TU) this; + return (T) this; } /** @@ -739,7 +740,7 @@ public final boolean hasBeenPerformed() { *
    *
  1. If TU B depends on TU A, and if TU A "fails" * but doesn't abort transformation, then TU B would be skipped
  2. - *
  3. If TU B depends on TU A, then that means TU A is necessary supposed to be executed first, + *
  4. If TU B depends on TU A, then that means TU A is necessarily supposed to be executed first, * if not, TU B will be skipped
  5. *
* The term "fails" in this context means the perform result is of one of these types: @@ -758,24 +759,24 @@ public final boolean hasBeenPerformed() { *
* See also: *
    - *
  • {@link #checkDependencies(TransformationContext)}
  • - *
  • {@link Result#dependencyFailureCheck()}
  • - *
  • {@link TUExecutionResult#dependencyFailureCheck()}
  • - *
  • {@link TOExecutionResult#dependencyFailureCheck()}
  • - *
  • {@link PerformResult#dependencyFailureCheck()}
  • + *
  • {@link #checkDependencies(TransformationContext)}
  • + *
  • {@link Result#dependencyFailureCheck()}
  • + *
  • {@link TUExecutionResult#dependencyFailureCheck()}
  • + *
  • {@link TOExecutionResult#dependencyFailureCheck()}
  • + *
  • {@link PerformResult#dependencyFailureCheck()}
  • *
* * @param dependencies the names of all transformation utilities this utility depends on * @return this transformation utility instance */ - public final TU dependsOn(String... dependencies) { + public final T dependsOn(String... dependencies) { if (dependencies != null) { for (String dependency : dependencies) { if (StringUtils.isBlank(dependency)) throw new IllegalArgumentException("Dependencies cannot be null nor blank"); } } this.dependencies = dependencies; - return (TU) this; + return (T) this; } /** @@ -847,9 +848,9 @@ protected Result checkDependencies(TransformationContext transformationContext) * utility should be executed or not * @return this transformation utility instance */ - public final TU executeIf(String conditionAttributeName) { + public final T executeIf(String conditionAttributeName) { this.ifConditionAttributeName = conditionAttributeName; - return (TU) this; + return (T) this; } /** @@ -859,19 +860,18 @@ public final TU executeIf(String conditionAttributeName) { * Differences between this approach and {@link #executeIf(String)}: *
    *
  1. Instead of relying on a TCA ({@link TransformationContext attribute}) with the condition result, this method is based on the direct execution of the {@link UtilityCondition} object
  2. - *
  3. The {@link UtilityCondition} object is always executed necessarily against the same file. Because of that, any value set on it via {@link #relative(String)} or {@link #absolute(String)} is ignored.
  4. + *
  5. The {@link UtilityCondition} object is always executed necessarily against the same file set in the transformation utility it is being used. Because of that, any value set in the condition itself via {@link #relative(String)} or {@link #absolute(String)} is ignored.
  6. *
  7. The {@link UtilityCondition} object does not produce any TCA, neither its result value or result object. Instead, it hands its result directly to the TU, so that the condition can be evaluated just before the TU executes (or not, if it fails).
  8. *
  9. The {@link UtilityCondition} object does not exist from a transformation template point of view. That means this method is totally different than adding a new {@link UtilityCondition} object by calling {@link TransformationTemplate#add(TransformationUtility)}.
  10. - *
  11. No TU can {@link #dependsOn(String...)} this {@link UtilityCondition} object.
  12. *
- * The actual {@link UtilityCondition} object is not the one used, but a clone of it + * The actual {@link UtilityCondition} object is not the one used, but a copy of it * * @param utilityCondition the condition to be executed and evaluated right before this TU * @return this transformation utility instance */ - public final TU executeIf(UtilityCondition utilityCondition) { + public final T executeIf(UtilityCondition utilityCondition) { this.utilityCondition = utilityCondition; - return (TU) this; + return (T) this; } /** @@ -884,9 +884,9 @@ public final TU executeIf(UtilityCondition utilityCondition) { * utility should be executed or not * @return this transformation utility instance */ - public final TU executeUnless(String conditionAttributeName) { + public final T executeUnless(String conditionAttributeName) { this.unlessConditionAttributeName = conditionAttributeName; - return (TU) this; + return (T) this; } /** @@ -953,77 +953,65 @@ public String toString() { return getDescription(); } + + /** + * Creates and returns a clone object identical to the original object, + * except for the "has been performed" flag, which is set to {@code false} + * in the clone object to be returned. See {@link #hasBeenPerformed()}. + * + * @return the new object created as result of the clone operation + */ @Override - public TransformationUtility clone() throws CloneNotSupportedException { - TransformationUtility clone = (TransformationUtility) super.clone(); + public T clone() { + TransformationUtility clone = null; + try { + clone = (TransformationUtility) super.clone(); + } catch (CloneNotSupportedException e) { + // This should never happen though, since this class DOES support clone operations + throw new TransformationUtilityException("Unexpected exception happened when cloning the transformation utility instance", e); + } - // Properties we do NOT want to be in the clone (they are being initialized) + // Properties we do NOT want to be cloned (they are being initialized) clone.hasBeenPerformed = new AtomicBoolean(false); - // Properties we want to be in the clone (they are being copied from original object) - clone.order = this.order; - clone.parent = this.parent; - clone.name = this.name; - clone.relativePath = this.relativePath; - clone.absoluteFile = this.absoluteFile; - clone.absoluteFileFromContextAttribute = this.absoluteFileFromContextAttribute; - clone.additionalRelativePath = this.additionalRelativePath; - clone.contextAttributeName = this.contextAttributeName; + // Non-primitive and mutable object properties that need to be manually cloned from original object + if (absoluteFile != null) clone.absoluteFile = new File(this.absoluteFile.getAbsolutePath()); clone.latePropertiesAttributes = new HashMap(); clone.latePropertiesSetters = new HashMap(); clone.latePropertiesAttributes.putAll(this.latePropertiesAttributes); clone.latePropertiesSetters.putAll(this.latePropertiesSetters); - clone.abortOnFailure = this.abortOnFailure; - clone.saveResult = this.saveResult; - clone.ifConditionAttributeName = this.ifConditionAttributeName; - clone.unlessConditionAttributeName = this.unlessConditionAttributeName; - clone.utilityCondition = this.utilityCondition; - return clone; + return (T) clone; } /** - * Creates and returns a brand new utility object using the original as a template, - * and setting to the copy most of the attributes of the original one. - * It will not copy though all attributes that define the identity of the original one, which are: + * Creates and returns a copy object similar to the original object. + * All attributes are the same, except for the following ones, which are reset: *
    *
  1. parent
  2. *
  3. name
  4. *
  5. order
  6. - *
  7. file relative and absolute path
  8. *
  9. context attribute name
  10. + *
  11. file relative and absolute path
  12. + *
  13. has been performed flag
  14. *
* - * @return this transformation utility instance - * @throws CloneNotSupportedException in case the concrete transformation utility - * does not support being cloned + * @return the new object created as result of the copy operation */ - public TransformationUtility copy() throws CloneNotSupportedException { - TransformationUtility copy = (TransformationUtility) super.clone(); + public T copy() { + TransformationUtility copy = clone(); - // Properties we do NOT want to be in the copy (they are being initialized) - copy.order = -1; + // Properties we do NOT want to be copied (they are being initialized) copy.parent = null; copy.name = null; + copy.order = -1; + copy.contextAttributeName = null; copy.relativePath = ""; copy.absoluteFile = null; copy.absoluteFileFromContextAttribute = null; copy.additionalRelativePath = null; - copy.contextAttributeName = null; - copy.hasBeenPerformed = new AtomicBoolean(false); - - // Properties we want to be in the copy (they are being copied from original object) - copy.latePropertiesAttributes = new HashMap(); - copy.latePropertiesSetters = new HashMap(); - copy.latePropertiesAttributes.putAll(this.latePropertiesAttributes); - copy.latePropertiesSetters.putAll(this.latePropertiesSetters); - copy.abortOnFailure = this.abortOnFailure; - copy.saveResult = this.saveResult; - copy.ifConditionAttributeName = this.ifConditionAttributeName; - copy.unlessConditionAttributeName = this.unlessConditionAttributeName; - copy.utilityCondition = this.utilityCondition; - - return copy; + + return (T) copy; } /** @@ -1087,6 +1075,7 @@ protected static void checkForNull(String name, Object value) throws Transformat * @return true only if they are equal */ @Override + @SuppressWarnings("PMD.SimplifyBooleanReturns") public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof TransformationUtility)) return false; diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.java index 9a574815..3f97e57e 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.java @@ -21,6 +21,13 @@ public class TransformationUtilityGroup extends TransformationUtility clone() throws CloneNotSupportedException { - TransformationUtilityGroup groupClone = (TransformationUtilityGroup) super.clone(); + public TransformationUtilityGroup clone() { + TransformationUtilityGroup groupClone = super.clone(); groupClone.utilityList = new ArrayList<>(); groupClone.utilityNames = new HashSet<>(); for (TransformationUtility utility : utilityList) { diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityList.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityList.java index 28485058..467a2467 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityList.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityList.java @@ -49,12 +49,30 @@ interface TransformationUtilityList extends TransformationUtilityParent { String addMultiple(TransformationOperation templateOperation, String... attributes); /** + * This method has been deprecated. Use {@link #info(String)} instead. + * * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list * * @param logMessage the message to be logged */ + @Deprecated void log(String logMessage); + /** + * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list, + * setting its log level to INFO + * + * @param infoMessage the info message to be logged + */ + void info(String infoMessage); + + /** + * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list, + * setting its log level to DEBUG + * + * @param debugMessage the debug message to be logged + */ + void debug(String debugMessage); /** * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list @@ -65,6 +83,8 @@ interface TransformationUtilityList extends TransformationUtilityParent { void log(Level logLevel, String logMessage); /** + * This method has been deprecated. Use {@link #info(String, String...)} instead. + * * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list. * The log messages may contain placeholders to be replaced by transformation context * attribute values. Use {@code {}} as placeholder marker. @@ -74,8 +94,35 @@ interface TransformationUtilityList extends TransformationUtilityParent { * @param attributeNames an array of names of transformation context attributes, whose values * are going to be used in the log message */ + @Deprecated void log(String logMessage, String... attributeNames); + /** + * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list, + * setting its log level to INFO. + * The log messages may contain placeholders to be replaced by transformation context + * attribute values. Use {@code {}} as placeholder marker. + * + * @param infoMessage the info message to be logged, containing {@code {}} placeholders to be replaced by + * transformation context attribute values + * @param attributeNames an array of names of transformation context attributes, whose values + * are going to be used in the log message + */ + void info(String infoMessage, String... attributeNames); + + /** + * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list, + * setting its log level to DEBUG. + * The log messages may contain placeholders to be replaced by transformation context + * attribute values. Use {@code {}} as placeholder marker. + * + * @param debugMessage the debug message to be logged, containing {@code {}} placeholders to be replaced by + * transformation context attribute values + * @param attributeNames an array of names of transformation context attributes, whose values + * are going to be used in the log message + */ + void debug(String debugMessage, String... attributeNames); + /** * Adds a new {@link com.paypal.butterfly.extensions.api.utilities.Log} TU to the list. * The log messages may contain placeholders to be replaced by transformation context diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.java index 1a9fc5aa..77c29404 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.java @@ -1,7 +1,6 @@ package com.paypal.butterfly.extensions.api; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import java.io.File; import java.util.ArrayList; @@ -9,12 +8,13 @@ import java.util.List; /** - * Allows the execution of a transformation utility instance, created from a template, multiple times in a loop. - * The number of iterations is defined by one of these options, and in this order of precedence: + * Allows the execution of any transformation utility instance, + * including a {@link TransformationUtilityGroup}, multiple times in a loop. + * The number of iterations is defined by one of these options: *
    - *
  1. Specifying the number of iterations
  2. - *
  3. Specifying a {@link TransformationContext} attribute (by its name) whose value is true or false. If not a boolean, or if non-existent, it will be treated as false
  4. - *
  5. Specifying a {@link TransformationUtility} object whose result is true or false. In this case, the TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false
  6. + *
  7. Specifying the number of iterations.
  8. + *
  9. Specifying a {@link TransformationContext} attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
  10. + *
  11. Specifying a {@link UtilityCondition} object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
  12. *
* * @author facarvalho @@ -22,6 +22,8 @@ public class TransformationUtilityLoop extends TransformationUtility implements TransformationUtilityParent { private static final String DESCRIPTION = "Transformation template loop, executing %s"; + private static final String TEMPLATE_NAME_FORMAT = "%s_%s_template"; + private static final String CONDITION_NAME_FORMAT = "%s_%s_condition"; // Possible ways to define the condition private int iterations = -1; @@ -35,16 +37,51 @@ public class TransformationUtilityLoop extends TransformationUtility childrenList = new ArrayList<>(); + /** + * Allows the execution of any transformation utility instance, + * including a {@link TransformationUtilityGroup}, multiple times in a loop. + * The number of iterations is defined by one of these options: + *
    + *
  1. Specifying the number of iterations.
  2. + *
  3. Specifying a {@link TransformationContext} attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
  4. + *
  5. Specifying a {@link UtilityCondition} object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
  6. + *
+ */ public TransformationUtilityLoop() { } + /** + * Allows the execution of any transformation utility instance, + * including a {@link TransformationUtilityGroup}, multiple times in a loop. + * The number of iterations is defined by one of these options: + *
    + *
  1. Specifying the number of iterations.
  2. + *
  3. Specifying a {@link TransformationContext} attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
  4. + *
  5. Specifying a {@link UtilityCondition} object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
  6. + *
+ * + * @param template the transformation utility instance to be used a template. + * A clone utility instance will be created out of the template + * for each iteration. See {@link #clone()} for further information + * about the clone object. + */ public TransformationUtilityLoop(TransformationUtility template) { setTemplate(template); } + /** + * Sets the transformation utility instance to be used as a template. + * A clone utility instance will be created out of the template + * for each iteration. See {@link #clone()} for further information + * about the clone object. + * + * @param template the transformation utility instance to be used as template. + * @return this transformation utility instance + */ public TransformationUtilityLoop setTemplate(TransformationUtility template) { checkForNull("template", template); @@ -52,17 +89,29 @@ public TransformationUtilityLoop setTemplate(TransformationUtility template) { String exceptionMessage = String.format("Invalid attempt to add already registered transformation utility %s to transformation utility loop %s", template.getName(), getName()); throw new TransformationDefinitionException(exceptionMessage); } + + // Why is this check necessary? What if the TU template is not based on a file? if (!template.isFileSet()) { String exceptionMessage = String.format("Neither absolute, nor relative path, have been set for transformation utility %s", template.getName()); throw new TransformationDefinitionException(exceptionMessage); } - template.setParent(this, 1); + + // Even though the template have the loop TU set as its parent, the order is set to 0, and it is not added a child of the loop, + // since it is not in fact executed (only the instances cloned out of the template are) + template.setParent(this, 0); this.template = template; - childrenList.add(template); return this; } + /** + * In this case the condition to execute the next iteration is based on + * a pre-defined number of iterations to be executed. Each execution + * decrease the remaining number of iterations. + * + * @param iterations the total number of iterations to be executed + * @return this transformation utility instance + */ public TransformationUtilityLoop setCondition(int iterations) { if (iterations < 2) { throw new TransformationDefinitionException("The number of iterations should be equal or greater than 2"); @@ -71,12 +120,37 @@ public TransformationUtilityLoop setCondition(int iterations) { return this; } + /** + * In this case the condition to execute the next iteration is based on + * a {@link TransformationContext} attribute (specified by its name) whose + * value is true or false. If that is not a boolean, or if non-existent, + * it will be treated as false. If that is false, the loop is interrupted. + * + * @param attribute the name of the transformation context attribute + * holding the boolean to be used as the condition + * to execute the next iteration. If that is false, + * the loop is interrupted. + * @return this transformation utility instance + */ public TransformationUtilityLoop setCondition(String attribute) { checkForBlankString("attribute", attribute); this.attribute = attribute; return this; } + /** + * In this case the condition to execute the next iteration is based on + * a {@link UtilityCondition} object whose result is true or false. + * The result of this TU condition object won't be saved to the TC, + * it will be executed exclusively to the scope of this loop execution. + * Any result other than a boolean true value, including failures, will be treated as false. + * If that is false, the loop is interrupted. + * + * @param condition the {@link UtilityCondition} object whose result + * will be used as the condition to execute the next iteration. + * If that is false, the loop is interrupted. + * @return this transformation utility instance + */ public TransformationUtilityLoop setCondition(UtilityCondition condition) { checkForNull("condition", condition); if (condition.getName() == null && getName() != null) { @@ -86,9 +160,6 @@ public TransformationUtilityLoop setCondition(UtilityCondition condition) { return this; } - private static final String TEMPLATE_NAME_FORMAT = "%s_%s_template"; - private static final String CONDITION_NAME_FORMAT = "%s_%s_condition"; - @Override protected TransformationUtilityLoop setName(String name) { super.setName(name); @@ -152,12 +223,7 @@ protected ExecutionResult execution(File transformedAppFolder, TransformationCon iterateAgain = attributeValue instanceof Boolean && ((Boolean) attributeValue).booleanValue(); } else if (condition != null) { TUExecutionResult executionResult = null; - try { - executionResult = (TUExecutionResult) condition.clone().execution(transformedAppFolder, transformationContext); - } catch (CloneNotSupportedException e) { - TransformationUtilityException tue = new TransformationUtilityException("The condition transformation utility is not cloneable", e); - return TUExecutionResult.error(this, tue); - } + executionResult = (TUExecutionResult) condition.clone().execution(transformedAppFolder, transformationContext); if (executionResult.getType().equals(TUExecutionResult.Type.VALUE)) { Object executionValue = executionResult.getValue(); iterateAgain = executionValue instanceof Boolean && ((Boolean) executionValue).booleanValue(); @@ -183,11 +249,11 @@ protected ExecutionResult execution(File transformedAppFolder, TransformationCon * @return the TU instance to be run in this iteration */ public TransformationUtility run() { - try { - return template.clone(); - } catch (CloneNotSupportedException e) { - throw new TransformationUtilityException("The template transformation template is not cloneable", e); - } + TransformationUtility iterationClone = template.clone(); + iterationClone.setParent(this, nextIteration); + childrenList.add(iterationClone); + + return iterationClone; } /** @@ -197,11 +263,7 @@ public TransformationUtility run() { */ public TransformationUtility iterate() { nextIteration++; - try { - return clone(); - } catch (CloneNotSupportedException e) { - throw new TransformationUtilityException("This transformation utility loop is not cloneable", e); - } + return clone(); } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/UtilityCondition.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/UtilityCondition.java index e81d1442..82b601fb 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/UtilityCondition.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/UtilityCondition.java @@ -19,5 +19,5 @@ * * @author facarvalho */ -public abstract class UtilityCondition extends TransformationUtility { +public abstract class UtilityCondition extends TransformationUtility { } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/metrics/AbortDetails.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/metrics/AbortDetails.java index d1fe1865..b8275f7f 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/metrics/AbortDetails.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/metrics/AbortDetails.java @@ -9,11 +9,11 @@ */ public class AbortDetails { - String utilityName; - String abortMessage; - String exceptionClass; - String exceptionMessage; - String exceptionStackTrace; + private String utilityName; + private String abortMessage; + private String exceptionClass; + private String exceptionMessage; + private String exceptionStackTrace; public AbortDetails(Exception ex, String abortMessage, String utilityName) { if (ex == null) { diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElement.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElement.java index 164a0f6d..31c6d3fb 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElement.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElement.java @@ -22,7 +22,7 @@ * * @author facarvalho */ -public interface AddElement { +public interface AddElement { /** * Possible behaviors in case the element to be added already exists. @@ -63,7 +63,7 @@ enum IfPresent { * * @return the transformation operation instance */ - TO failIfPresent(); + T failIfPresent(); /** * Warn and do not add ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#WARNING}) @@ -71,7 +71,7 @@ enum IfPresent { * * @return the transformation operation instance */ - TO warnNotAddIfPresent(); + T warnNotAddIfPresent(); /** * Warn, but add, ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#WARNING}) @@ -79,7 +79,7 @@ enum IfPresent { * * @return the transformation operation instance */ - TO warnButAddIfPresent(); + T warnButAddIfPresent(); /** * Do nothing, not add, not warn neither fail, ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#NO_OP}) @@ -87,7 +87,7 @@ enum IfPresent { * * @return the transformation operation instance */ - TO noOpIfPresent(); + T noOpIfPresent(); /** * Overwrite and not warn ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#SUCCESS}) @@ -95,6 +95,6 @@ enum IfPresent { * * @return the transformation operation instance */ - TO overwriteIfPresent(); + T overwriteIfPresent(); } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElementTO.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElementTO.java index 083d1cd7..db83c92d 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElementTO.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/AddElementTO.java @@ -9,39 +9,39 @@ * * @author facarvalho */ -public abstract class AddElementTO extends TransformationOperation implements AddElement { +public abstract class AddElementTO extends TransformationOperation implements AddElement { @edu.umd.cs.findbugs.annotations.SuppressFBWarnings (value="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification="This property will be used by sub-classes") protected IfPresent ifPresent = IfPresent.Fail; @Override - public TO failIfPresent() { + public T failIfPresent() { ifPresent = IfPresent.Fail; - return (TO) this; + return (T) this; } @Override - public TO warnNotAddIfPresent() { + public T warnNotAddIfPresent() { ifPresent = IfPresent.WarnNotAdd; - return (TO) this; + return (T) this; } @Override - public TO warnButAddIfPresent() { + public T warnButAddIfPresent() { ifPresent = IfPresent.WarnButAdd; - return (TO) this; + return (T) this; } @Override - public TO noOpIfPresent() { + public T noOpIfPresent() { ifPresent = IfPresent.NoOp; - return (TO) this; + return (T) this; } @Override - public TO overwriteIfPresent() { + public T overwriteIfPresent() { ifPresent = IfPresent.Overwrite; - return (TO) this; + return (T) this; } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.java index 706ec745..ede110e7 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.java @@ -22,7 +22,7 @@ * * @author facarvalho */ -public interface ChangeOrRemoveElement { +public interface ChangeOrRemoveElement { /** * Possible behaviors in case the element to be changed or removed is not present. @@ -53,7 +53,7 @@ enum IfNotPresent { * * @return the transformation operation instance */ - TO failIfNotPresent(); + T failIfNotPresent(); /** * Warn ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#WARNING}) @@ -61,7 +61,7 @@ enum IfNotPresent { * * @return the transformation operation instance */ - TO warnIfNotPresent(); + T warnIfNotPresent(); /** * Do nothing, not warn neither fail, ({@link com.paypal.butterfly.extensions.api.TOExecutionResult.Type#NO_OP}) @@ -69,6 +69,6 @@ enum IfNotPresent { * * @return the transformation operation instance */ - TO noOpIfNotPresent(); + T noOpIfNotPresent(); } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.java index e50c918c..b4438a51 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.java @@ -9,27 +9,27 @@ * * @author facarvalho */ -public abstract class ChangeOrRemoveElementTO extends TransformationOperation implements ChangeOrRemoveElement { +public abstract class ChangeOrRemoveElementTO extends TransformationOperation implements ChangeOrRemoveElement { @edu.umd.cs.findbugs.annotations.SuppressFBWarnings (value="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification="This property will be used by sub-classes") protected IfNotPresent ifNotPresent = IfNotPresent.Fail; @Override - public TO failIfNotPresent() { + public T failIfNotPresent() { ifNotPresent = IfNotPresent.Fail; - return (TO) this; + return (T) this; } @Override - public TO warnIfNotPresent() { + public T warnIfNotPresent() { ifNotPresent = IfNotPresent.Warn; - return (TO) this; + return (T) this; } @Override - public TO noOpIfNotPresent() { + public T noOpIfNotPresent() { ifNotPresent = IfNotPresent.NoOp; - return (TO) this; + return (T) this; } } diff --git a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/upgrade/UpgradePath.java b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/upgrade/UpgradePath.java index fd948300..6f2ad27f 100644 --- a/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/upgrade/UpgradePath.java +++ b/butterfly-extensions-api/src/main/java/com/paypal/butterfly/extensions/api/upgrade/UpgradePath.java @@ -40,6 +40,7 @@ public UpgradePath(Class firstStepClass) { this(firstStepClass, null); } + @SuppressWarnings("PMD.AvoidReassigningParameters") public UpgradePath(Class firstStepClass, String upgradeVersion) { if (firstStepClass == null) { throw new IllegalArgumentException("First step class cannot be null"); diff --git a/butterfly-extensions-api/src/main/resources/stylesheet.css b/butterfly-extensions-api/src/main/resources/stylesheet.css index fcd03174..c4f6312c 100644 --- a/butterfly-extensions-api/src/main/resources/stylesheet.css +++ b/butterfly-extensions-api/src/main/resources/stylesheet.css @@ -394,10 +394,7 @@ Table styles .overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, .useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - padding-bottom:7px; + padding:5px 12px 7px 12px; display:inline-block; float:left; background-color:#F8981D; diff --git a/butterfly-facade/pom.xml b/butterfly-facade/pom.xml index dc60199c..8f9516ca 100644 --- a/butterfly-facade/pom.xml +++ b/butterfly-facade/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-facade/src/main/java/com/paypal/butterfly/facade/ButterflyFacade.java b/butterfly-facade/src/main/java/com/paypal/butterfly/facade/ButterflyFacade.java index 4bde5fda..cf903b68 100644 --- a/butterfly-facade/src/main/java/com/paypal/butterfly/facade/ButterflyFacade.java +++ b/butterfly-facade/src/main/java/com/paypal/butterfly/facade/ButterflyFacade.java @@ -53,6 +53,7 @@ public interface ButterflyFacade { * @param applicationFolder application folder * @param templateClassName transformation template class name * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, String templateClassName) throws ButterflyException; @@ -64,6 +65,7 @@ public interface ButterflyFacade { * @param templateClassName transformation template class name * @param configuration Butterfly configuration object * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, String templateClassName, Configuration configuration) throws ButterflyException; @@ -73,6 +75,7 @@ public interface ButterflyFacade { * @param applicationFolder application folder * @param templateClass transformation template class * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, Class templateClass) throws ButterflyException; @@ -84,6 +87,7 @@ public interface ButterflyFacade { * @param templateClass transformation template class * @param configuration Butterfly configuration object * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, Class templateClass, Configuration configuration) throws ButterflyException; @@ -93,6 +97,7 @@ public interface ButterflyFacade { * @param applicationFolder application folder * @param upgradePath upgrade path object used to upgrade this application * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, UpgradePath upgradePath) throws ButterflyException; @@ -104,6 +109,7 @@ public interface ButterflyFacade { * @param upgradePath upgrade path object used to upgrade this application * @param configuration Butterfly configuration object * @return the transformation result object + * @throws ButterflyException in case the transformation did not succeed */ TransformationResult transform(File applicationFolder, UpgradePath upgradePath, Configuration configuration) throws ButterflyException; diff --git a/butterfly-facade/src/main/java/com/paypal/butterfly/facade/Configuration.java b/butterfly-facade/src/main/java/com/paypal/butterfly/facade/Configuration.java index dcf4f4ba..0828b68f 100644 --- a/butterfly-facade/src/main/java/com/paypal/butterfly/facade/Configuration.java +++ b/butterfly-facade/src/main/java/com/paypal/butterfly/facade/Configuration.java @@ -25,12 +25,11 @@ public Configuration() { } /** - * @see {@link Configuration} - * @see {@link #setOutputFolder(File)} - * @see {@link #setZipOutput(boolean)} + * Butterfly default configuration * - * @param outputFolder - * @param zipOutput + * @param outputFolder the output folder where the transformed application is + * supposed to be placed + * @param zipOutput if true, the transformed application folder will be compressed into a zip file */ public Configuration(File outputFolder, boolean zipOutput) { setOutputFolder(outputFolder); @@ -40,7 +39,7 @@ public Configuration(File outputFolder, boolean zipOutput) { /** * The folder location in the file system where the transformed application * should be placed. - *
+ *
* If null, it defaults to same location where original application is. * n this case the transformed application is placed under a new folder * whose named is same as original folder, plus a "-transformed-yyyyMMddHHmmssSSS" @@ -58,42 +57,41 @@ public void setOutputFolder(File outputFolder) { /** * If set to true, the transformed application folder will be compressed - * to a zip file, and the transformed folder will be removed. The zip + * into a zip file, and the transformed folder will be removed. The zip * file will be named as the transformed application folder, * plus the zip extension * - * @param zipOutput + * @param zipOutput if true, the transformed application folder will be compressed into a zip file */ public void setZipOutput(boolean zipOutput) { this.zipOutput = zipOutput; } /** - * @see {@link #setOutputFolder(File)} + * Return the folder where the transformed application is supposed to be placed * - * @return + * @return the folder where the transformed application is supposed to be placed */ public File getOutputFolder() { return outputFolder; } /** - * @see {@link #setZipOutput(boolean)} + * Returns whether the transformed application folder will be compressed into a zip file or not * - * @return + * @return whether the transformed application folder will be compressed into a zip file or not */ public boolean isZipOutput() { return zipOutput; } - private static final String TO_STRING_FORMAT = "{ outputFolder: %s , zipOutput: %s }"; - @Override public String toString() { - return String.format(TO_STRING_FORMAT, outputFolder, zipOutput); + return String.format("{ outputFolder: %s , zipOutput: %s }", outputFolder, zipOutput); } @Override + @SuppressWarnings("PMD.SimplifyBooleanReturns") public boolean equals(Object obj) { if (obj == this) { return true; @@ -108,7 +106,7 @@ public boolean equals(Object obj) { return false; } final Configuration configuration = (Configuration)obj; - if(!(this.zipOutput == configuration.isZipOutput())) { + if(this.zipOutput != configuration.isZipOutput()) { return false; } if (this.outputFolder == null && configuration.getOutputFolder() != null) { diff --git a/butterfly-metrics-couchdb/pom.xml b/butterfly-metrics-couchdb/pom.xml index 2f6a81a9..c2ca096d 100644 --- a/butterfly-metrics-couchdb/pom.xml +++ b/butterfly-metrics-couchdb/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-metrics-file/pom.xml b/butterfly-metrics-file/pom.xml index ba30c8ee..302fb9ae 100644 --- a/butterfly-metrics-file/pom.xml +++ b/butterfly-metrics-file/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-utilities/pom.xml b/butterfly-utilities/pom.xml index 71b2ecbc..7124898b 100644 --- a/butterfly-utilities/pom.xml +++ b/butterfly-utilities/pom.xml @@ -5,7 +5,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 .. diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareFiles.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareFiles.java index 17a4c8eb..b5c68ad7 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareFiles.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareFiles.java @@ -1,6 +1,8 @@ package com.paypal.butterfly.utilities.conditions; import com.paypal.butterfly.extensions.api.DoubleCondition; +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import org.apache.commons.io.FileUtils; @@ -8,7 +10,8 @@ import java.io.IOException; /** - * Compares two files and returns true only if their contents are identical. + * Compares two files and returns true if the content of the files are equal, + * or if they both don't exist. Returns false otherwise. *
* See {@link com.paypal.butterfly.extensions.api.DoubleCondition} to find out how to set the baseline and the comparison files * @@ -18,6 +21,28 @@ public class CompareFiles extends DoubleCondition { private static final String DESCRIPTION = "Compare file %s to another one, return true only if their contents are equal"; + /** + * Compares two files and returns true if the content of the files are equal, + * or if they both don't exist. Returns false otherwise. + *
+ * See {@link com.paypal.butterfly.extensions.api.DoubleCondition} to find out how to set the baseline and the comparison files + */ + public CompareFiles(){ + } + + /** + * Compares two files and returns true if the content of the files are equal, + * or if they both don't exist. Returns false otherwise. + *
+ * See {@link com.paypal.butterfly.extensions.api.DoubleCondition} to find out how to set the baseline and the comparison files + * + * @param attribute the name of the transformation context attribute + * that refers to the file to be compared against the baseline file + */ + public CompareFiles(String attribute){ + super(attribute); + } + @Override protected boolean compare(File baselineFile, File comparisonFile) { try { @@ -32,4 +57,9 @@ public String getDescription() { return String.format(DESCRIPTION, getRelativePath()); } + @Override + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + return super.execution(transformedAppFolder, transformationContext); + } + } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.java index ba341245..3b19798d 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.java @@ -1,6 +1,8 @@ package com.paypal.butterfly.utilities.conditions; import com.paypal.butterfly.extensions.api.DoubleCondition; +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import org.custommonkey.xmlunit.XMLUnit; import org.w3c.dom.Document; @@ -13,9 +15,10 @@ import java.io.IOException; /** - * Compares two XML files and returns true only -if their contents are equal. Attribute orders, comments and white - * spaces are ignored during the comparison. + * Compares two XML files and returns true if their contents are equal, + * or if both files don't exist. Returns false otherwise. + * Attribute orders, comments and white spaces are ignored during the comparison. + * It results in error if any of the two files is not a well formed XML file. *
* See {@link DoubleCondition} * to find out how to set the baseline and the comparison files @@ -26,6 +29,34 @@ public class CompareXMLFiles extends DoubleCondition { private static final String DESCRIPTION = "Compare XML file %s to another one, return true only if their contents are equal"; + /** + * Compares two XML files and returns true if their contents are equal, + * or if both files don't exist. Returns false otherwise. + * Attribute orders, comments and white spaces are ignored during the comparison. + * It results in error if any of the two files is not a well formed XML file. + *
+ * See {@link DoubleCondition} + * to find out how to set the baseline and the comparison files + */ + public CompareXMLFiles() { + } + + /** + * Compares two XML files and returns true if their contents are equal, + * or if both files don't exist. Returns false otherwise. + * Attribute orders, comments and white spaces are ignored during the comparison. + * It results in error if any of the two files is not a well formed XML file. + *
+ * See {@link DoubleCondition} + * to find out how to set the baseline and the comparison files + * + * @param attribute the name of the transformation context attribute + * that refers to the file to be compared against the baseline file + */ + public CompareXMLFiles(String attribute) { + setAttribute(attribute); + } + @Override protected boolean compare(File baselineFile, File comparisonFile) { try { @@ -49,10 +80,15 @@ protected boolean compare(File baselineFile, File comparisonFile) { return XMLUnit.compareXML(baselineXml, comparisonXml).similar(); } catch (SAXException | IOException | ParserConfigurationException e) { - throw new TransformationUtilityException("An exception has happened when comparing the two XML files", e); + throw new TransformationUtilityException("An exception happened when comparing the two XML files", e); } } + @Override + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + return super.execution(transformedAppFolder, transformationContext); + } + @Override public String getDescription() { return String.format(DESCRIPTION, getRelativePath()); diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/FileExists.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/FileExists.java index 5838d54a..f9d24693 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/FileExists.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/FileExists.java @@ -16,6 +16,13 @@ public class FileExists extends SingleCondition { private static final String DESCRIPTION = "Check if file or folder '%s' exists"; + // Even though it is redundant to have this default constructor here, since it is + // the only one (the compiler would have added it implicitly), this is being explicitly + // set here to emphasize that the public default constructor should always be + // available by any transformation utility even when additional constructors are present. + // The reason for that is the fact that one or more of its properties might be set + // during transformation time, using the TransformationUtility set method + @SuppressWarnings("PMD.UnnecessaryConstructor") public FileExists() { } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.java index 7a3ee03b..77ef5343 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.java @@ -90,6 +90,7 @@ public boolean eval(CompilationUnit compilationUnit) { * 2- {@code typeSimpleName} is implicitly imported for being part of java.lang * 3- {@code typeSimpleName} is at the same package where {@code compilationUnit} Java class is. */ + @SuppressWarnings("PMD.SimplifyBooleanReturns") private boolean isImported(CompilationUnit compilationUnit, String typeSimpleName) { if (StringUtils.isBlank(typeSimpleName) || typeSimpleName.contains(".")) { throw new IllegalArgumentException("Invalid type simple name"); diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaCondition.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaCondition.java index 86f83047..8a687216 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaCondition.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaCondition.java @@ -34,6 +34,8 @@ public abstract class JavaCondition { * the Java class to be evaluated * @return the evaluation result including negation (if applicable) */ + // This method's visibility is intentionally being set to package + @SuppressWarnings("PMD.DefaultPackage") final boolean evaluate(CompilationUnit compilationUnit) { boolean evalResult = eval(compilationUnit); return negate ? !evalResult : evalResult; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaMatch.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaMatch.java index dc587049..428c2a10 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaMatch.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/conditions/java/JavaMatch.java @@ -2,7 +2,6 @@ import com.github.javaparser.JavaParser; import com.github.javaparser.ast.CompilationUnit; -import com.paypal.butterfly.extensions.api.ExecutionResult; import com.paypal.butterfly.extensions.api.SingleCondition; import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; @@ -19,7 +18,8 @@ * based on a set of {@link JavaCondition}. It returns true only * if they all are true. If the specified Java class file contains * more than one type, only the outer one will be considered - * during evaluation. If it has none, an error will be returned. + * during evaluation. If it has none, the evaluation will result + * in false and a warning be returned. * * @author facarvalho */ @@ -34,7 +34,8 @@ public class JavaMatch extends SingleCondition { * based on a set of {@link JavaCondition}. It returns true only * if they all are true. If the specified Java class file contains * more than one type, only the outer one will be considered - * during evaluation. If it has none, an error will be returned. + * during evaluation. If it has none, the evaluation will result + * in false and a warning be returned. */ public JavaMatch() {} @@ -43,7 +44,8 @@ public JavaMatch() {} * based on a set of {@link JavaCondition}. It returns true only * if they all are true. If the specified Java class file contains * more than one type, only the outer one will be considered - * during evaluation. If it has none, an error will be returned. + * during evaluation. If it has none, the evaluation will result + * in false and a warning be returned. * * @param condition one condition to be evaluated. More can be added with * {@link #addCondition(JavaCondition)} @@ -95,7 +97,7 @@ public String getDescription() { } @Override - protected ExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { File javaClassFile = getAbsoluteFile(transformedAppFolder, transformationContext); FileInputStream fileInputStream = null; TUExecutionResult result = null; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFile.java index 00e3a67f..101df6a2 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFile.java @@ -1,6 +1,5 @@ package com.paypal.butterfly.utilities.file; -import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; @@ -8,7 +7,6 @@ import org.apache.commons.lang3.StringUtils; import java.io.File; -import java.io.FileNotFoundException; import java.util.List; /** @@ -87,7 +85,7 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC File searchRootFolder = getAbsoluteFile(transformedAppFolder, transformationContext); if (!searchRootFolder.exists()) { - String details = String.format("No file named '%s' has been found by %s", fileName, getName()); + String details = String.format("The specified search root folder does not exist"); if (failIfNotFound) { TransformationUtilityException e = new TransformationUtilityException(details); return TUExecutionResult.error(this, e); diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFiles.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFiles.java index d7ac6aca..8df82209 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFiles.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/FindFiles.java @@ -1,12 +1,11 @@ package com.paypal.butterfly.utilities.file; +import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; -import com.paypal.butterfly.extensions.api.TUExecutionResult; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.filefilter.AbstractFileFilter; -import org.apache.commons.io.filefilter.IOFileFilter; -import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.commons.io.filefilter.*; +import org.apache.commons.lang3.StringUtils; import java.io.File; import java.util.ArrayList; @@ -15,11 +14,16 @@ /** * Finds files based on a regular expression * against the file name and/or the file path. The search might be - * recursive (including sub-folders) or not. If a file path regular + * recursive (searching also in sub-folders) or not. If a file path regular * expression is set, then the search will be automatically recursive. * If no file path regular expression is set, then the search * is not recursive by default, but it may be set to as well. *
+ * The term "file" here might refer to folders as well, and + * {@link #includeFiles} and {@link #includeFolders} can be used + * to specialize the search criteria in that regard. If none of them + * are explicitly set, only files will be searched. + *
* The root directory from where the search should take place * can be defined by {@link #relative(String)}, * {@link #absolute(String)} or {@link #absolute(String, String)}. @@ -34,23 +38,24 @@ */ public class FindFiles extends TransformationUtility { - private static final String DESCRIPTION = "Find files whose name and/or path match regular expression and are under folder %s%s"; + private static final String DESCRIPTION = "Find files whose name and/or path match regular expression and are under %s%s"; private String nameRegex; private String pathRegex; private boolean recursive; + private boolean includeFiles = true; + private boolean includeFolders = false; public FindFiles() { } /** * Utility to find files based on a regular expression - * against the file name and/or the file path. The search might be - * recursive (including sub-folders) or not. If a file path regular - * expression is set, then the search will be automatically and - * necessarily recursive. - * If no file path regular expression is set, then the search - * is not recursive by default, but it may be set to as well. + * against the file name. The search might be + * recursive (searching also in sub-folders) or not. + *
+ * This search does not include folders, only files, unless + * {@link #setIncludeFolders(boolean)} is set to {@code true}. *
* The root directory from where the search should take place * can be defined by {@link #relative(String)}, @@ -69,12 +74,50 @@ public FindFiles(String nameRegex, boolean recursive) { /** * Utility to find files based on a regular expression - * against the file name and/or the file path. The search might be - * recursive (including sub-folders) or not. If a file path regular + * against the file name. The search might be + * recursive (searching also in sub-folders) or not. + *
+ * This search might include files only, folders only, or both, + * depending on how {@code includeFiles} and {@code includeFolders} + * are configured. + *
+ * The root directory from where the search should take place + * can be defined by {@link #relative(String)}, + * {@link #absolute(String)} or {@link #absolute(String, String)}. + * If not set explicitly, then the search will happen from the root + * of the transformed application, which is equivalent to setting + * {@link #relative(String)} to {@code "."} + * + * @param nameRegex regular expression to be applied against file name during search + * @param recursive if true, sub-folders will also be searched + * @param includeFiles whether files should be included in the search or not + * @param includeFolders whether folders should be included in the search or not + */ + public FindFiles(String nameRegex, boolean recursive, boolean includeFiles, boolean includeFolders) { + setNameRegex(nameRegex); + setRecursive(recursive); + setIncludeFiles(includeFiles); + setIncludeFolders(includeFolders); + } + + /** + * Utility to find files based on a regular expression + * against the file name and the file path. Because a file path regular * expression is set, then the search will be automatically and * necessarily recursive. - * If no file path regular expression is set, then the search - * is not recursive by default, but it may be set to as well. + *
+ * Important notes: + *
    + *
  • Use forward slash as file separator. If the OS + * used during transformation execution uses another character + * as file separator, that will be automatically converted + * by this utility
  • + *
  • Setting this to a non null value automatically sets + * recursive property to true
  • + *
  • This regular expression will be evaluated against + * the file path starting from the search root + * directory
  • + *
*
* The root directory from where the search should take place * can be defined by {@link #relative(String)}, @@ -153,6 +196,32 @@ public FindFiles setRecursive(boolean recursive) { return this; } + /** + * Set whether folders should be included in the search or not. + * If not set, the default is {@code false}. + * + * @param includeFolders whether folders should be included in the search or not + * @return this transformation utility instance + * @since 2.2.0 + */ + public FindFiles setIncludeFolders(boolean includeFolders) { + this.includeFolders = includeFolders; + return this; + } + + /** + * Set whether files should be included in the search or not. + * If not set, the default is {@code true}. + * + * @param includeFiles whether files should be included in the search or not + * @return this transformation utility instance + * @since 2.2.0 + */ + public FindFiles setIncludeFiles(boolean includeFiles) { + this.includeFiles = includeFiles; + return this; + } + /** * Returns the file name regular expression * @@ -180,9 +249,31 @@ public boolean isRecursive() { return recursive; } + /** + * Returns whether folders should be included in the search or not + * + * @return whether folders should be included in the search or not + */ + public boolean isIncludeFolders() { + return includeFolders; + } + + /** + * Returns whether files should be included in the search or not + * + * @return whether files should be included in the search or not + */ + public boolean isIncludeFiles() { + return includeFiles; + } + @Override public String getDescription() { - return String.format(DESCRIPTION, getRelativePath(), (recursive ? " and sub-folders" : " only (not including sub-folders)")); + String folder = getRelativePath(); + if (StringUtils.isBlank(folder) || ".".equals(folder)) { + folder = "the root folder"; + } + return String.format(DESCRIPTION, folder, (recursive ? " and sub-folders" : " only (not including sub-folders)")); } @Override @@ -195,9 +286,9 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC } final String normalizedPathRegex = _pathRegex; - IOFileFilter fileFilter = new AbstractFileFilter() { + IOFileFilter filter = new AbstractFileFilter() { public boolean accept(File file) { - if (!file.isFile()) { + if ((file.isFile() && !includeFiles) || (file.isDirectory() && !includeFolders)) { return false; } if (nameRegex != null && !file.getName().matches(nameRegex)) { @@ -212,7 +303,26 @@ public boolean accept(File file) { return true; } }; - Collection files = FileUtils.listFiles(searchRootFolder, fileFilter, (recursive ? TrueFileFilter.INSTANCE : null)); + + Collection files = new ArrayList<>(); + if (includeFiles) { + files = FileUtils.listFiles(searchRootFolder, filter, (recursive ? TrueFileFilter.INSTANCE : null)); + } + if (includeFolders) { + Collection folders = new ArrayList<>(); + Collection allFolders = FileUtils.listFilesAndDirs(searchRootFolder, new NotFileFilter(TrueFileFilter.INSTANCE), (recursive ? TrueFileFilter.INSTANCE : DirectoryFileFilter.DIRECTORY)); + allFolders.remove(searchRootFolder); + for (File folder : allFolders) { + if (!recursive && !folder.getParentFile().equals(searchRootFolder)) { + continue; + } + if (filter.accept(folder)) { + folders.add(folder); + } + } + files.addAll(folders); + } + TUExecutionResult result = null; if(files.size() == 0) { diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LoadFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LoadFile.java index fac00ebb..3367dc0b 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LoadFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LoadFile.java @@ -1,6 +1,5 @@ package com.paypal.butterfly.utilities.file; -import com.paypal.butterfly.extensions.api.ExecutionResult; import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; @@ -16,6 +15,7 @@ * Loads a resource from the classpath, writes it to a temporary file, * and then returns a {@link File} reference to it, which is saved in the transformation * context. The file is written to a temporary folder to be defined by the OS. + * If no resource file is found, an error is returned. * * @author facarvalho */ @@ -25,9 +25,27 @@ public class LoadFile extends TransformationUtility { private String resource; + /** + * Loads a resource from the classpath, writes it to a temporary file, + * and then returns a {@link File} reference to it, which is saved in the transformation + * context. The file is written to a temporary folder to be defined by the OS. + * If no resource file is found, an error is returned. + */ public LoadFile() { } + /** + * Loads a resource from the classpath, writes it to a temporary file, + * and then returns a {@link File} reference to it, which is saved in the transformation + * context. The file is written to a temporary folder to be defined by the OS. + * If no resource file is found, an error is returned. + * + * @param resource the name of the resource in the classpath + */ + public LoadFile(String resource) { + setResource(resource); + } + /** * Sets the name of the resource in the classpath. The syntax * here is the same as the one used in {@link ClassLoader#getResource(String)} @@ -57,7 +75,7 @@ public String getDescription() { @SuppressFBWarnings("NP_ALWAYS_NULL_EXCEPTION") @Override - protected ExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { TUExecutionResult result = null; InputStream inputStream = null; IOException ioException = null; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LocateFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LocateFile.java index af939c67..37fc587e 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LocateFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/file/LocateFile.java @@ -1,10 +1,10 @@ package com.paypal.butterfly.utilities.file; +import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; -import com.paypal.butterfly.extensions.api.TUExecutionResult; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import org.apache.commons.lang3.StringUtils; import java.io.File; @@ -15,19 +15,50 @@ * This utility also allows to locate a file going up in parent * levels from the specified file. If the specified file does * not exist, or if the coordinates don't make sense, an error - * is returned + * is returned. + *
+ * Note: the term "file" here might refer to a folder as well * * @author facarvalho */ public class LocateFile extends TransformationUtility { - private static final String DESCRIPTION = "Locate file under %s"; + private static final String DESCRIPTION_PARENT_ZERO = "Locate file %s"; + private static final String DESCRIPTION_PARENT = "Locate file %d levels above %s"; private int parentLevel = 0; + /** + * Locates a file based on the relative or absolute + * location specified. It does not find files, it just results + * to a {@link File} object based on the input information. + * This utility also allows to locate a file going up in parent + * levels from the specified file. If the specified file does + * not exist, or if the coordinates don't make sense, an error + * is returned + *
+ * Note: the term "file" here might refer to a folder as well + */ public LocateFile() { } + /** + * Locates a file based on the relative or absolute + * location specified. It does not find files, it just results + * to a {@link File} object based on the input information. + * This utility also allows to locate a file going up in parent + * levels from the specified file. If the specified file does + * not exist, or if the coordinates don't make sense, an error + * is returned + *
+ * Note: the term "file" here might refer to a folder as well + * + * @param parentLevel how many parent levels to be located + */ + public LocateFile(int parentLevel) { + setParentLevel(parentLevel); + } + /** * Set how many parent levels up the location process should * go through. If not set, the actual specified file will be @@ -52,7 +83,22 @@ public int getParentLevel() { @Override public String getDescription() { - return String.format(DESCRIPTION, getRelativePath()); + String location = getRelativePath(); + if (StringUtils.isBlank(location)) { + location = "root folder"; + } + + // FIXME + // An usage like the one below results in a wrong description. + // Instead of resulting in something like "Locate file '/foo/bar/init'" it results in "Locate file root folder" + // + // add(new LocateFile().absolute(APP_PACKAGE_LOCATION, "init"); + + if (parentLevel == 0) { + return String.format(DESCRIPTION_PARENT_ZERO, location); + } else { + return String.format(DESCRIPTION_PARENT, parentLevel, location); + } } @Override @@ -70,11 +116,11 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC } if (locatedFile == null) { String message = String.format("File to be located reached limit of files hierarchy, parent level %d is too deep", parentLevel); - TransformationOperationException e = new TransformationOperationException(message); + TransformationUtilityException e = new TransformationUtilityException(message); result = TUExecutionResult.error(this, e); } else if (!locatedFile.exists()) { String message = String.format("File to be located does not exist"); - TransformationOperationException e = new TransformationOperationException(message); + TransformationUtilityException e = new TransformationUtilityException(message); result = TUExecutionResult.error(this, e); } else { result = TUExecutionResult.value(this, locatedFile); @@ -82,7 +128,7 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC // FIXME a better exception is necessary here for cases when the absolute path transformation context attribute value is null } catch(TransformationUtilityException exception) { String details = String.format("No file has been located by %s because its baseline relative or absolute location could not be resolved", getName()); - result = TUExecutionResult.error(this, exception, details); + result = TUExecutionResult.error(this, null, exception, details); } return result; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/java/JavaPackage.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/java/JavaPackage.java index f913ac94..5feb6b57 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/java/JavaPackage.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/java/JavaPackage.java @@ -6,6 +6,7 @@ import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import java.io.File; import java.io.FileInputStream; @@ -22,6 +23,13 @@ public class JavaPackage extends TransformationUtility { private static final String DESCRIPTION = "Retrieve the package of a Java class file %s"; + // Even though it is redundant to have this default constructor here, since it is + // the only one (the compiler would have added it implicitly), this is being explicitly + // set here to emphasize that the public default constructor should always be + // available by any transformation utility even when additional constructors are present. + // The reason for that is the fact that one or more of its properties might be set + // during transformation time, using the TransformationUtility set method + @SuppressWarnings("PMD.UnnecessaryConstructor") public JavaPackage() { } @@ -37,13 +45,17 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC FileInputStream fileInputStream = null; TUExecutionResult result = null; + // TODO + // Add a validation here simply checking if the file name ends with .java + try { fileInputStream = new FileInputStream(javaClassFile); CompilationUnit compilationUnit = JavaParser.parse(fileInputStream); Optional packageDeclaration = compilationUnit.getPackageDeclaration(); result = TUExecutionResult.value(this, packageDeclaration.get().getNameAsString()); } catch (Exception e) { - result = TUExecutionResult.error(this, e); + TransformationUtilityException tue = new TransformationUtilityException("An error happened when trying to read and parse the specified Java file " + getRelativePath(transformedAppFolder, javaClassFile), e); + result = TUExecutionResult.error(this, tue); } finally { try { if (fileInputStream != null) { diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.java index 7d337cb1..c8bf8101 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.java @@ -34,7 +34,7 @@ private static String createMessage(String summary, String details) { @Override public void consumeLine(String line) { executionStarted = true; - if (true == RULE_WARNING_LINE_MATCH_REGEX.matcher(line).matches()) { + if (RULE_WARNING_LINE_MATCH_REGEX.matcher(line).matches()) { int ruleLocation = line.indexOf(RULE_BEGINNING_PHRASE); message = line.substring(ruleLocation); @@ -46,7 +46,7 @@ public void consumeLine(String line) { @Override public Set getResult() { - if (false == executionStarted) { + if (!executionStarted) { throw new IllegalStateException("Execution has not started. No results to return."); } else { return Collections.unmodifiableSet(errorMessages); diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.java index 01f34b75..96fe829d 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.java @@ -43,21 +43,21 @@ private static String removeLogLevel(String line) { @Override public void consumeLine(String line) { executionStarted = true; - if (true == GOAL_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { + if (GOAL_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { message = removeLogLevel(line); - } else if (true == PROJECT_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { + } else if (PROJECT_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { message = removeLogLevel(line); isProjectError = true; - } else if (true == isProjectError) { + } else if (isProjectError) { message = createMessage(message, removeLogLevel(line)); - } else if (true == GENERIC_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { + } else if (GENERIC_ERROR_LINE_MATCH_REGEX.matcher(line).matches()) { message = message.concat(line); } } @Override public String getResult() { - if (false == executionStarted) { + if (!executionStarted) { throw new IllegalStateException("Execution has not started. No results to return."); } else { return message; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenGoal.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenGoal.java index ae8b76e5..4d0ca187 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenGoal.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenGoal.java @@ -32,8 +32,6 @@ public class MavenGoal extends TransformationUtility { private InvocationRequest request = new DefaultInvocationRequest(); - private InvocationResult invocationResult = null; - private Invoker invoker = new DefaultInvoker(); private boolean warnOnError = false; @@ -161,6 +159,7 @@ public String getDescription() { protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { File pomFile = getAbsoluteFile(transformedAppFolder, transformationContext); TUExecutionResult result = null; + InvocationResult invocationResult = null; try { for (MavenInvocationOutputHandler outputHandler : outputHandlers) { @@ -175,7 +174,7 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC request.setFailureBehavior(mavenFailureBehavior); } - if (null != properties && false == properties.isEmpty()) { + if (null != properties && !properties.isEmpty()) { request.setProperties(properties); } @@ -214,8 +213,8 @@ protected TUExecutionResult execution(File transformedAppFolder, TransformationC } @Override - public TransformationUtility clone() throws CloneNotSupportedException { - MavenGoal clone = (MavenGoal) super.clone(); + public MavenGoal clone() { + MavenGoal clone = super.clone(); clone.multipleOutputHandler = new MultipleOutputHandler(); clone.request = new DefaultInvocationRequest(); clone.outputHandlers = new MavenInvocationOutputHandler[outputHandlers.length]; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.java index 8cc6a5c8..d9c24aa8 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.java @@ -7,14 +7,14 @@ * * @author mcrockett, facarvalho */ -public interface MavenInvocationOutputHandler extends InvocationOutputHandler { +public interface MavenInvocationOutputHandler extends InvocationOutputHandler { /** * Returns the desired result from parsing the console output * * @return the desired result from parsing the console output */ - RT getResult(); + R getResult(); /** * Returns a copy of this object, but with its internal state reset, diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/ModelTree.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/ModelTree.java index 85a048ef..da82a770 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/ModelTree.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/ModelTree.java @@ -3,7 +3,6 @@ import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileInputStream; @@ -135,7 +134,8 @@ private boolean add(Model model) { return false; } } -// TODO we can comment this out in the future if we need this feature +// TODO +// We can comment this out in the future if we need this feature // modelsInTree.add(model); if (model.getPomFile() != null) { pomFilesInTree.add(model.getPomFile()); @@ -173,6 +173,7 @@ private void addChild(ModelNode child) { children.add(child); } + @SuppressWarnings("PMD.SimplifyBooleanReturns") private boolean isParentOf(Model model) { if (model.getParent() == null) { return false; @@ -184,16 +185,19 @@ private boolean isParentOf(Model model) { return true; } - private boolean isChildOf(Model model) { - if (this.model.getParent() == null) { - return false; - } - - if (!model.getGroupId().equals(this.model.getParent().getGroupId())) return false; - if (!model.getArtifactId().equals(this.model.getParent().getArtifactId())) return false; - if (!model.getVersion().equals(this.model.getParent().getVersion())) return false; - return true; - } +// TODO +// We can comment this out in the future if we want to allow +// @SuppressWarnings("PMD.SimplifyBooleanReturns") +// private boolean isChildOf(Model model) { +// if (this.model.getParent() == null) { +// return false; +// } +// +// if (!model.getGroupId().equals(this.model.getParent().getGroupId())) return false; +// if (!model.getArtifactId().equals(this.model.getParent().getArtifactId())) return false; +// if (!model.getVersion().equals(this.model.getParent().getVersion())) return false; +// return true; +// } } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandler.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandler.java index 6f14c0bc..cdd27883 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandler.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandler.java @@ -17,6 +17,7 @@ * * @author mcrockett, facarvalho */ +@SuppressWarnings("PMD.DefaultPackage") class MultipleOutputHandler implements MavenInvocationOutputHandler, Object>> { private static final Logger logger = LoggerFactory.getLogger(MultipleOutputHandler.class); @@ -38,11 +39,11 @@ class MultipleOutputHandler implements MavenInvocationOutputHandler, Object> getResult() { - if (false == executionStarted) { + if (!executionStarted) { throw new IllegalStateException("Execution has not started. No results to return."); } Map, Object> results = new HashMap, Object>(); for (MavenInvocationOutputHandler handler : handlers) { - if (false == failedHandlers.containsKey(handler)) { + if (!failedHandlers.containsKey(handler)) { results.put(handler.getClass(), handler.getResult()); } else { results.put(handler.getClass(), failedHandlers.get(handler)); @@ -88,7 +89,7 @@ public Map, Object> getResult() { * handler cannot be added. */ void register(MavenInvocationOutputHandler handler) throws IllegalStateException { - if (true == executionStarted) { + if (executionStarted) { throw new IllegalStateException("Execution has started. Not allowed to register new handlers."); } else if (null != handler) { handlers.add(handler); diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/RelatedArtifacts.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/RelatedArtifacts.java index cfdc07af..3be0481b 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/RelatedArtifacts.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/maven/RelatedArtifacts.java @@ -3,6 +3,7 @@ import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import java.io.File; import java.util.List; @@ -91,11 +92,18 @@ public String getDescription() { @Override protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { - List pomFiles = (List) transformationContext.get(pomFilesAttribute); - ModelTree modelTree = new ModelTree(parentGroupId, parentArtifactId, parentVersion, pomFiles); - List pomFilesInTree = modelTree.getPomFilesInTree(); - - return TUExecutionResult.value(this, pomFilesInTree); + try { + List pomFiles = (List) transformationContext.get(pomFilesAttribute); + ModelTree modelTree = new ModelTree(parentGroupId, parentArtifactId, parentVersion, pomFiles); + List pomFilesInTree = modelTree.getPomFilesInTree(); + + return TUExecutionResult.value(this, pomFilesInTree); + } catch(TransformationUtilityException e) { + return TUExecutionResult.error(this, e); + } catch (Exception e) { + TransformationUtilityException tue = new TransformationUtilityException("Error happened when trying to parse and evaluate pom files", e); + return TUExecutionResult.error(this, tue); + } } } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/RunScript.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/RunScript.java index 30da5f1f..89b8685a 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/RunScript.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/RunScript.java @@ -1,6 +1,5 @@ package com.paypal.butterfly.utilities.misc; -import com.paypal.butterfly.extensions.api.ExecutionResult; import com.paypal.butterfly.extensions.api.TUExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationUtility; @@ -15,11 +14,10 @@ import java.util.Map; /** - * Executes a script and saves the result after evaluating. - * The scripting language can be chosen, and Java is the default one. - * Additionally, one or more transformation context attributes can be set in the script - * during transformation time. Transformation context attributes placeholders can be put - * in the script using "{}". + * Executes a script and saves the result after evaluating it. + * The scripting language can be chosen, and "js" is the default one. + * Additionally, one or more objects, and/or transformation context attributes, + * can be used in the script during transformation time. * * @author facarvalho */ @@ -32,13 +30,33 @@ public class RunScript extends TransformationUtility { private Map attributes = new HashMap<>(); private Map objects = new HashMap<>(); + /** + * Executes a script and saves the result after evaluating it. + * The scripting language can be chosen, and "js" is the default one. + * Additionally, one or more objects, and/or transformation context attributes, + * can be used in the script during transformation time. + */ public RunScript() { } + /** + * Executes a script and saves the result after evaluating it. + * The scripting language can be chosen, and "js" is the default one. + * Additionally, one or more objects, and/or transformation context attributes, + * can be used in the script during transformation time. + * + * @param script the script to be executed and evaluated + */ public RunScript(String script) { setScript(script); } + /** + * Sets the script to be executed and evaluated + * + * @param script the script to be executed and evaluated + * @return this utility instance + */ public RunScript setScript(String script) { checkForBlankString("script", script); this.script = script; @@ -87,7 +105,7 @@ public String getDescription() { } @Override - protected ExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { + protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { TUExecutionResult result = null; try { diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/WebXmlContextParams.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/WebXmlContextParams.java index 643fc263..052b2b25 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/WebXmlContextParams.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/misc/WebXmlContextParams.java @@ -33,6 +33,13 @@ public class WebXmlContextParams extends TransformationUtility extends TransformationOperation { +abstract class AbstractToOperation extends TransformationOperation { protected String description; @@ -47,9 +47,10 @@ protected AbstractToOperation(String description) { setDescription(description); } - public void setDescription(String description) { + public A setDescription(String description) { checkForBlankString("Description", description); this.description = description; + return (A) this; } /** @@ -66,11 +67,11 @@ public void setDescription(String description) { * @param toRelative relative destination location * @return this transformation operation instance */ - public TO setToRelative(String toRelative) { + public A setToRelative(String toRelative) { checkForBlankString("Relative Location", toRelative); this.toRelative = toRelative; this.toAbsoluteAttribute = null; - return (TO) this; + return (A) this; } /** @@ -86,11 +87,11 @@ public TO setToRelative(String toRelative) { * the absolute destination location * @return this transformation operation instance */ - public TO setToAbsolute(String attributeName) { + public A setToAbsolute(String attributeName) { checkForBlankString("Absolute Location", attributeName); this.toAbsoluteAttribute = attributeName; this.toRelative = null; - return (TO) this; + return (A) this; } /** @@ -110,13 +111,13 @@ public TO setToAbsolute(String attributeName) { * in {@link #relative(String)} * @return this transformation operation instance */ - public TO setToAbsolute(String attributeName, String additionalRelativePath) { + public A setToAbsolute(String attributeName, String additionalRelativePath) { checkForBlankString("attributeName", attributeName); checkForBlankString("additionalRelativePath", additionalRelativePath); this.toAbsoluteAttribute = attributeName; this.additionalRelativePath = normalizeRelativePathSeparator(additionalRelativePath); this.toRelative = null; - return (TO) this; + return (A) this; } public String getToRelative() { @@ -147,10 +148,4 @@ public String getDescription() { return String.format(description, getRelativePath(), (toRelative != null ? toRelative : "the location defined by transformation context attribute " + toAbsoluteAttribute)); } - @Override - public AbstractToOperation clone() throws CloneNotSupportedException { - AbstractToOperation clone = (AbstractToOperation) super.clone(); - return clone; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyFile.java index 3f7e9014..dda21e45 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyFile.java @@ -4,10 +4,6 @@ import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; -import net.lingala.zip4j.core.ZipFile; -import net.lingala.zip4j.exception.ZipException; -import org.apache.commons.io.FileUtils; import java.io.File; import java.io.FileOutputStream; @@ -80,8 +76,9 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC FileOutputStream fileOutputStream = null; TOExecutionResult result = null; File fileDescriptor = null; + ReadableByteChannel readableByteChannel = null; try { - ReadableByteChannel readableByteChannel = Channels.newChannel(fileUrl.openStream()); + readableByteChannel = Channels.newChannel(fileUrl.openStream()); int p = fileUrl.getPath().lastIndexOf("/") + 1; String fileName = fileUrl.getPath().substring(p); @@ -102,20 +99,15 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC result.addWarning(e); } } + if (readableByteChannel != null) { + try { + readableByteChannel.close(); + } catch (IOException e) { + result.addWarning(e); + } + } } return result; } - @Override - public ApplyFile clone() throws CloneNotSupportedException { - try { - ApplyFile clone = (ApplyFile) super.clone(); - clone.fileUrl = new URL(this.fileUrl.toString()); - return clone; - } catch (MalformedURLException e) { - String exceptionMessage = String.format("Error when cloning %s", getName()); - throw new TransformationUtilityException(exceptionMessage, e); - } - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyZip.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyZip.java index 1007c4cf..f52a2b09 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyZip.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/ApplyZip.java @@ -4,7 +4,6 @@ import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import net.lingala.zip4j.core.ZipFile; import net.lingala.zip4j.exception.ZipException; import org.apache.commons.io.FileUtils; @@ -83,8 +82,9 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC FileOutputStream fileOutputStream = null; TOExecutionResult result = null; File zipFileDescriptor = null; + ReadableByteChannel readableByteChannel = null; try { - ReadableByteChannel readableByteChannel = Channels.newChannel(zipFileUrl.openStream()); + readableByteChannel = Channels.newChannel(zipFileUrl.openStream()); int p = zipFileUrl.getPath().lastIndexOf("/") + 1; String fileName = zipFileUrl.getPath().substring(p); @@ -108,6 +108,13 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC result.addWarning(e); } } + if (readableByteChannel != null) { + try { + readableByteChannel.close(); + } catch (IOException e) { + result.addWarning(e); + } + } if(zipFileDescriptor!=null) { FileUtils.deleteQuietly(zipFileDescriptor); } @@ -115,16 +122,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public ApplyZip clone() throws CloneNotSupportedException { - try { - ApplyZip clone = (ApplyZip) super.clone(); - clone.zipFileUrl = new URL(this.zipFileUrl.toString()); - return clone; - } catch (MalformedURLException e) { - String exceptionMessage = String.format("Error when cloning %s", getName()); - throw new TransformationUtilityException(exceptionMessage, e); - } - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyDirectory.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyDirectory.java index 98714ae4..77f21baa 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyDirectory.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyDirectory.java @@ -36,8 +36,6 @@ public class CopyDirectory extends AbstractToOperation { * folders are also copied to the destination location. If the destination directory * does not exist, it is created. But, if it does, then the content to be copied is * merged with the destination content, with the source taking precedence. - * - * @author facarvalho */ public CopyDirectory() { super(DESCRIPTION); @@ -61,10 +59,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public CopyDirectory clone() throws CloneNotSupportedException { - CopyDirectory clonedCopyDirectory = (CopyDirectory)super.clone(); - return clonedCopyDirectory; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyFile.java index b0b63fbe..b084f6a8 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/CopyFile.java @@ -57,10 +57,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public CopyFile clone() throws CloneNotSupportedException { - CopyFile clonedCopyFile = (CopyFile) super.clone(); - return clonedCopyFile; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/DeleteFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/DeleteFile.java index 1ffcd5d8..9ceb7d28 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/DeleteFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/DeleteFile.java @@ -18,6 +18,13 @@ public class DeleteFile extends TransformationOperation { private static final String DESCRIPTION = "Delete file %s"; + // Even though it is redundant to have this default constructor here, since it is + // the only one (the compiler would have added it implicitly), this is being explicitly + // set here to emphasize that the public default constructor should always be + // available by any transformation utility even when additional constructors are present. + // The reason for that is the fact that one or more of its properties might be set + // during transformation time, using the TransformationUtility set method + @SuppressWarnings("PMD.UnnecessaryConstructor") /** * Deletes a single file or folder (empty or not). */ @@ -56,10 +63,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public DeleteFile clone() throws CloneNotSupportedException { - DeleteFile clonedDeleteFile = (DeleteFile) super.clone(); - return clonedDeleteFile; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveDirectory.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveDirectory.java index 611b1099..8010550c 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveDirectory.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveDirectory.java @@ -28,8 +28,6 @@ public class MoveDirectory extends AbstractToOperation { * The directory to be moved is specified from relative * or absolute location. If the destination directory * does not exist, it is created. - * - * @author facarvalho */ public MoveDirectory() { super(DESCRIPTION); @@ -53,10 +51,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public MoveDirectory clone() throws CloneNotSupportedException { - MoveDirectory clone = (MoveDirectory) super.clone(); - return clone; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveFile.java index b840c8d1..013cb1d9 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/MoveFile.java @@ -61,10 +61,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public MoveFile clone() throws CloneNotSupportedException { - MoveFile clone = (MoveFile) super.clone(); - return clone; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/RenameFile.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/RenameFile.java index 8335a074..822628cf 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/RenameFile.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/file/RenameFile.java @@ -64,10 +64,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public RenameFile clone() throws CloneNotSupportedException { - RenameFile clonedRenameFile = (RenameFile) super.clone(); - return clonedRenameFile; - } - } \ No newline at end of file diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractArtifactPomOperation.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractArtifactPomOperation.java index 9fbb0158..75ff4b11 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractArtifactPomOperation.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractArtifactPomOperation.java @@ -13,21 +13,21 @@ * * @author facarvalho */ -public abstract class AbstractArtifactPomOperation extends AbstractPomOperation { +public abstract class AbstractArtifactPomOperation extends AbstractPomOperation { protected String groupId; protected String artifactId; - public TO setGroupId(String groupId) { + public T setGroupId(String groupId) { checkForBlankString("GroupId", groupId); this.groupId = groupId; - return (TO) this; + return (T) this; } - public TO setArtifactId(String artifactId) { + public T setArtifactId(String artifactId) { checkForBlankString("ArtifactId",artifactId); this.artifactId = artifactId; - return (TO) this; + return (T) this; } /** @@ -39,7 +39,7 @@ public TO setArtifactId(String artifactId) { * @param artifact the artifact formatted String * @return this operation instance */ - public TO setArtifact(String artifact) { + public T setArtifact(String artifact) { checkForBlankString("artifact", artifact); String[] split = artifact.split(":"); if (split.length != 2) { @@ -47,7 +47,7 @@ public TO setArtifact(String artifact) { } groupId = split[0]; artifactId = split[1]; - return (TO) this; + return (T) this; } public String getGroupId() { diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractPomOperation.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractPomOperation.java index 60bae374..7c803bde 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractPomOperation.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/AbstractPomOperation.java @@ -18,7 +18,7 @@ * * @author facarvalho */ -abstract class AbstractPomOperation extends TransformationOperation { +abstract class AbstractPomOperation extends TransformationOperation { @Override protected TOExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.java index f5faa710..04fc8883 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.java @@ -168,10 +168,4 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomAddDependency clone() throws CloneNotSupportedException { - PomAddDependency clone = (PomAddDependency) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddParent.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddParent.java index b79cacc9..b77e7adb 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddParent.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddParent.java @@ -128,10 +128,4 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { } } - @Override - public PomAddParent clone() throws CloneNotSupportedException { - PomAddParent clone = (PomAddParent) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.java index d6134282..70558b5c 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.java @@ -147,12 +147,6 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomAddPlugin clone() throws CloneNotSupportedException{ - PomAddPlugin clone = (PomAddPlugin) super.clone(); - return clone; - } - @Override public boolean equals(Object obj) { if (this == obj) return true; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.java index 232fcfb2..a7229663 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.java @@ -196,10 +196,4 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomChangeDependency clone() throws CloneNotSupportedException { - PomChangeDependency clone = (PomChangeDependency) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.java index b7c1d5e7..7074d444 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.java @@ -51,12 +51,6 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return TOExecutionResult.success(this, details); } - @Override - public PomChangePackaging clone() throws CloneNotSupportedException { - PomChangePackaging clone = (PomChangePackaging) super.clone(); - return clone; - } - @Override public boolean equals(Object obj) { if (this == obj) return true; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.java index cc720e96..ceec1e8c 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.java @@ -125,16 +125,10 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { details = String.format("Parent's version for POM file (%s) has been changed from %s to %s", relativePomFile, oldVersion, version); } else { // FIXME this should be in a pre-validation - throw new IllegalStateException("Invalid POM parent transformation operation"); + return TOExecutionResult.error(this, new TransformationOperationException("Invalid POM parent transformation operation")); } return TOExecutionResult.success(this, details); } - @Override - public PomChangeParent clone() throws CloneNotSupportedException { - PomChangeParent clone = (PomChangeParent) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.java index 9074426e..bd156b76 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.java @@ -86,12 +86,6 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomRemoveDependency clone() throws CloneNotSupportedException { - PomRemoveDependency clone = (PomRemoveDependency) super.clone(); - return clone; - } - @Override public boolean equals(Object obj) { if (this == obj) return true; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.java index 51c96bf6..a08e5360 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.java @@ -84,10 +84,4 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomRemoveManagedDependency clone() throws CloneNotSupportedException { - PomRemoveManagedDependency clone = (PomRemoveManagedDependency) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.java index 49d62652..2a4d20b3 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.java @@ -86,12 +86,6 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomRemovePlugin clone() throws CloneNotSupportedException { - PomRemovePlugin clone = (PomRemovePlugin) super.clone(); - return clone; - } - @Override public boolean equals(Object obj) { if (this == obj) return true; diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.java index eac8c4d0..4fc1d3a5 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.java @@ -90,11 +90,5 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomRemoveProperty clone() throws CloneNotSupportedException { - PomRemoveProperty clone = (PomRemoveProperty) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.java index 33078cd6..06c75560 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.java @@ -179,10 +179,4 @@ protected TOExecutionResult pomExecution(String relativePomFile, Model model) { return result; } - @Override - public PomReplaceDependency clone() throws CloneNotSupportedException { - PomReplaceDependency clone = (PomReplaceDependency) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/AddProperty.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/AddProperty.java index a6f1bfd6..7ea0b1a4 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/AddProperty.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/AddProperty.java @@ -3,7 +3,6 @@ import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import com.paypal.butterfly.utilities.operations.EolHelper; import org.codehaus.plexus.util.FileUtils; @@ -78,9 +77,8 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC Properties properties = new Properties(); fileInputStream = new FileInputStream(fileToBeChanged); properties.load(fileInputStream); - if(fileInputStream != null) { - fileInputStream.close(); - } + fileInputStream.close(); + //Add Property if(!properties.containsKey(propertyName)) { result = addProperty(transformedAppFolder, transformationContext); @@ -100,20 +98,8 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public AddProperty clone() throws CloneNotSupportedException { - AddProperty clonedAddProperty = (AddProperty) super.clone(); - return clonedAddProperty; - } - - /** + /* * Replace the text based on regex. - * @param reader - * @param writer - * @param regex - * @param replacement - * @return String - * @throws IOException */ private String replace(BufferedReader reader, BufferedWriter writer, String regex, String replacement) throws IOException { String currentLine; @@ -132,23 +118,19 @@ private String replace(BufferedReader reader, BufferedWriter writer, String rege return String.format("Property '%s' value replaced with %s' at '%s'", propertyName, propertyValue, getRelativePath()); } - /** + /* * To add a new property to the property file. - * @param transformedAppFolder - * @param transformationContext - * @return TOExecutionResult */ private TOExecutionResult addProperty(File transformedAppFolder, TransformationContext transformationContext) { File fileToBeChanged = getAbsoluteFile(transformedAppFolder, transformationContext); - String details = null; - TOExecutionResult result = null; + TOExecutionResult result; try { String[] propArray = {propertyName, propertyValue}; String propertyKeyValue = "%s = %s"; String propertyToBeAdded = String.format(propertyKeyValue, propArray); FileUtils.fileAppend(fileToBeChanged.getAbsolutePath(), EolHelper.findEolDefaultToOs(fileToBeChanged)); FileUtils.fileAppend(fileToBeChanged.getAbsolutePath(), propertyToBeAdded); - details = String.format("Property '%s' has been added and set to '%s' at '%s'", propertyName, propertyValue, getRelativePath()); + String details = String.format("Property '%s' has been added and set to '%s' at '%s'", propertyName, propertyValue, getRelativePath()); result = TOExecutionResult.success(this, details); } catch (IOException e) { result = TOExecutionResult.error(this, e); @@ -158,26 +140,21 @@ private TOExecutionResult addProperty(File transformedAppFolder, TransformationC /** * To Set (Replace) the property value. - * @param transformedAppFolder - * @param transformationContext - * @return TOExecutionResult */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings (value="NP_ALWAYS_NULL_EXCEPTION") private TOExecutionResult setProperty(File transformedAppFolder, TransformationContext transformationContext) { File fileToBeChanged = getAbsoluteFile(transformedAppFolder, transformationContext); TOExecutionResult result = null; - String details = null; BufferedReader reader = null; BufferedWriter writer = null; - File tempFile = null; try { - tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); - reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); String[] propArray = {propertyName, propertyValue}; String propertyKeyValue = "%s = %s"; String propertyToBeAdded = String.format(propertyKeyValue, propArray); - details = replace(reader, writer, "("+propertyName+")", propertyToBeAdded); + String details = replace(reader, writer, "(" + propertyName + ")", propertyToBeAdded); result = TOExecutionResult.success(this, details); } catch (IOException e) { result = TOExecutionResult.error(this, e); @@ -196,18 +173,6 @@ private TOExecutionResult setProperty(File transformedAppFolder, TransformationC } } } - boolean bDeleted = fileToBeChanged.delete(); - if(bDeleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - }else { - details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } return result; } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.java index d0a24e40..e882ef84 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.java @@ -3,7 +3,6 @@ import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import java.io.*; @@ -59,18 +58,18 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC BufferedWriter writer = null; TOExecutionResult result = null; File fileToBeChanged = getAbsoluteFile(transformedAppFolder, transformationContext); - File tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); try { if (!fileToBeChanged.exists()) { // TODO Should this be done as pre-validation? details = String.format("Operation '%s' hasn't transformed the application because file '%s', where the property removal should happen, does not exist", getName(), getRelativePath(transformedAppFolder, fileToBeChanged)); return TOExecutionResult.noOp(this, details); } - reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); String currentLine; boolean foundFirstMatch = false; - String regex = "("+propertyName+".*)"; + String regex = "(" + propertyName + ".*)"; final Pattern pattern = Pattern.compile(regex); EolBufferedReader eolReader = new EolBufferedReader(reader); while((currentLine = eolReader.readLineKeepStartEol()) != null) { @@ -80,7 +79,7 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC } writer.write(currentLine); } - //If it founds first match means, then it would be removed + if (foundFirstMatch) { details = String.format("Property '%s' has been removed from '%s'", propertyName, getRelativePath()); result = TOExecutionResult.success(this, details); @@ -106,27 +105,7 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC } } - boolean deleted = fileToBeChanged.delete(); - if(deleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - } else { - details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } return result; } - @Override - public RemoveProperty clone() throws CloneNotSupportedException { - RemoveProperty clonedRemoveProperty = (RemoveProperty) super.clone(); - return clonedRemoveProperty; - } - - - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AbstractLineOperation.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AbstractLineOperation.java index 6c94bc13..7e3c9eda 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AbstractLineOperation.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AbstractLineOperation.java @@ -4,7 +4,6 @@ import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import java.io.*; @@ -185,22 +184,20 @@ public Integer getLineNumber() { protected TOExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { File fileToBeChanged = getAbsoluteFile(transformedAppFolder, transformationContext); - String details; - if (!fileToBeChanged.exists()) { // TODO Should this be done as pre-validation? - details = String.format("Operation '%s' hasn't transformed the application because file '%s', where the change should happen, does not exist", getName(), getRelativePath(transformedAppFolder, fileToBeChanged)); + String details = String.format("Operation '%s' hasn't transformed the application because file '%s', where the change should happen, does not exist", getName(), getRelativePath(transformedAppFolder, fileToBeChanged)); return TOExecutionResult.noOp(this, details); } - File tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); BufferedReader reader = null; BufferedWriter writer = null; TOExecutionResult result = null; try { - reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); if (lineNumber != null) { result = manipulateBasedOnLineNumber(reader, writer); @@ -224,19 +221,6 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC } } } - // TODO Refactor the delete code after introducing working directory - boolean deleted = fileToBeChanged.delete(); - if(deleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - } else { - details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } return result; } @@ -314,10 +298,4 @@ private TOExecutionResult manipulateBasedOnRegex(BufferedReader reader, Buffered */ protected abstract boolean manipulateLine(String lineToBeManipulated, Writer writer) throws IOException; - @Override - public AbstractLineOperation clone() throws CloneNotSupportedException { - AbstractLineOperation clone = (AbstractLineOperation) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AddLine.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AddLine.java index 5b0a1054..132ec67f 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AddLine.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/AddLine.java @@ -78,10 +78,4 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return result; } - @Override - public AddLine clone() throws CloneNotSupportedException { - AddLine clonedAddLine = (AddLine) super.clone(); - return clonedAddLine; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertLine.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertLine.java index 0c81b924..4f2dc19d 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertLine.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertLine.java @@ -4,7 +4,6 @@ import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import com.paypal.butterfly.utilities.operations.EolHelper; @@ -63,7 +62,6 @@ public enum InsertionMode { * See {@link #setInsertionMode(InsertionMode)}. * * @see InsertionMode - * @author facarvalho */ public InsertLine() { } @@ -195,29 +193,29 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return TOExecutionResult.error(this, ex); } - File tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); - BufferedReader readerOriginalFile = null; + BufferedReader reader = null; BufferedWriter writer = null; TOExecutionResult result = null; try { final String eol = EolHelper.findEolDefaultToOs(fileToBeChanged); - readerOriginalFile = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); switch (insertionMode) { case LINE_NUMBER: - result = insertAtSpecificLine(readerOriginalFile, writer, eol); + result = insertAtSpecificLine(reader, writer, eol); break; case REGEX_FIRST: - result = insertAfterRegex(readerOriginalFile, writer, true, eol); + result = insertAfterRegex(reader, writer, true, eol); break; case REGEX_ALL: - result = insertAfterRegex(readerOriginalFile, writer, false, eol); + result = insertAfterRegex(reader, writer, false, eol); break; default: case CONCAT: - result = concat(readerOriginalFile, writer, eol); + result = concat(reader, writer, eol); break; } } catch (IOException e) { @@ -230,28 +228,14 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC result.addWarning(e); } } finally { - if(readerOriginalFile != null) try { - readerOriginalFile.close(); + if(reader != null) try { + reader.close(); } catch (IOException e) { result.addWarning(e); } } } - String details; - boolean bDeleted = fileToBeChanged.delete(); - if(bDeleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - }else { - details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - return result; } @@ -326,10 +310,4 @@ private TOExecutionResult concat(BufferedReader reader, BufferedWriter writer, S return TOExecutionResult.success(this, details); } - @Override - public InsertLine clone() throws CloneNotSupportedException { - InsertLine clonedInsertLine = (InsertLine) super.clone(); - return clonedInsertLine; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertText.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertText.java index 40342f6f..ae4d145a 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertText.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/InsertText.java @@ -4,13 +4,10 @@ import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; -import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import com.paypal.butterfly.utilities.operations.EolHelper; import java.io.*; -import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.regex.Pattern; @@ -70,7 +67,6 @@ public enum InsertionMode { * See {@link #setInsertionMode(InsertionMode)} * * @see InsertionMode - * @author facarvalho */ public InsertText() { } @@ -192,8 +188,7 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return TOExecutionResult.error(this, ex); } - File tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); - BufferedReader readerOriginalFile = null; + BufferedReader reader = null; BufferedReader readerText = null; BufferedWriter writer = null; TOExecutionResult result = null; @@ -201,23 +196,24 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC try { final String eol = EolHelper.findEolDefaultToOs(fileToBeChanged); - readerOriginalFile = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); readerText = new BufferedReader(new InputStreamReader(textFileUrl.openStream(), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); switch (insertionMode) { case LINE_NUMBER: - result = insertAtSpecificLine(readerText, readerOriginalFile, writer, eol); + result = insertAtSpecificLine(readerText, reader, writer, eol); break; case REGEX_FIRST: - result = insertAfterRegex(readerText, readerOriginalFile, writer, true, eol); + result = insertAfterRegex(readerText, reader, writer, true, eol); break; case REGEX_ALL: - result = insertAfterRegex(readerText, readerOriginalFile, writer, false, eol); + result = insertAfterRegex(readerText, reader, writer, false, eol); break; default: case CONCAT: - result = concat(readerText, readerOriginalFile, writer, eol); + result = concat(readerText, reader, writer, eol); break; } } catch (IOException e) { @@ -230,8 +226,8 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC result.addWarning(e); } } finally { - if(readerOriginalFile != null) try { - readerOriginalFile.close(); + if(reader != null) try { + reader.close(); } catch (IOException e) { result.addWarning(e); } finally { @@ -243,19 +239,6 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC } } } - // TODO Refactor the delete code after introducing working directory - boolean deleted = fileToBeChanged.delete(); - if(deleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - String details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - } else { - String details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } return result; } @@ -357,16 +340,4 @@ private TOExecutionResult concat(BufferedReader readerText, BufferedReader reade return TOExecutionResult.success(this, details); } - @Override - public InsertText clone() throws CloneNotSupportedException { - try { - InsertText clone = (InsertText) super.clone(); - clone.textFileUrl = new URL(this.textFileUrl.toString()); - return clone; - } catch (MalformedURLException e) { - String exceptionMessage = String.format("Error when cloning %s", getName()); - throw new TransformationUtilityException(exceptionMessage, e); - } - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/RemoveLine.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/RemoveLine.java index 9568f78f..0b5b289e 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/RemoveLine.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/RemoveLine.java @@ -108,10 +108,4 @@ public String getDescription() { return String.format(DESCRIPTION, getRelativePath()); } - @Override - public RemoveLine clone() throws CloneNotSupportedException { - RemoveLine clonedRemoveLine = (RemoveLine) super.clone(); - return clonedRemoveLine; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceLine.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceLine.java index 7c242706..7b842aea 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceLine.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceLine.java @@ -167,10 +167,4 @@ protected boolean manipulateLine(String lineToBeManipulated, Writer writer) thro return written; } - @Override - public ReplaceLine clone() throws CloneNotSupportedException { - ReplaceLine clone = (ReplaceLine) super.clone(); - return clone; - } - } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceText.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceText.java index aba8590d..bd912ef7 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceText.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/operations/text/ReplaceText.java @@ -3,7 +3,6 @@ import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; import com.paypal.butterfly.extensions.api.TransformationOperation; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; import com.paypal.butterfly.utilities.operations.EolBufferedReader; import java.io.*; @@ -38,8 +37,6 @@ public class ReplaceText extends TransformationOperation { /** * Operation to replace text in a text file * based on a regular expression. - * - * @author facarvalho */ public ReplaceText() { } @@ -49,8 +46,6 @@ public ReplaceText() { * based on a regular expression. * * @param regex the regular expression to find replacement points - * - * @author facarvalho */ public ReplaceText(String regex) { setRegex(regex); @@ -62,8 +57,6 @@ public ReplaceText(String regex) { * * @param regex the regular expression to find replacement points * @param replacement the replacement text - * - * @author facarvalho */ public ReplaceText(String regex, String replacement) { setRegex(regex); @@ -135,14 +128,14 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC return TOExecutionResult.error(this, ex); } - File tempFile = new File(fileToBeChanged.getAbsolutePath() + "_temp_" + System.currentTimeMillis()); BufferedReader reader = null; BufferedWriter writer = null; TOExecutionResult result = null; try { - reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged), StandardCharsets.UTF_8)); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), StandardCharsets.UTF_8)); + File readFile = getOrCreateReadFile(transformedAppFolder, transformationContext); + reader = new BufferedReader(new InputStreamReader(new FileInputStream(readFile), StandardCharsets.UTF_8)); + writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileToBeChanged), StandardCharsets.UTF_8)); result = replace(reader, writer); } catch (IOException e) { result = TOExecutionResult.error(this, e); @@ -162,20 +155,6 @@ protected TOExecutionResult execution(File transformedAppFolder, TransformationC } } - boolean bDeleted = fileToBeChanged.delete(); - String details; - if(bDeleted) { - if (!tempFile.renameTo(fileToBeChanged)) { - details = String.format("Error when renaming temporary file %s to %s", getRelativePath(transformedAppFolder, tempFile), getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - } else { - details = String.format("Error when deleting %s", getRelativePath(transformedAppFolder, fileToBeChanged)); - TransformationOperationException e = new TransformationOperationException(details); - result = TOExecutionResult.error(this, e); - } - return result; } @@ -195,7 +174,7 @@ private TOExecutionResult replace(BufferedReader reader, BufferedWriter writer) } String details = String.format("File %s has had %d line(s) where text replacement was applied based on regular expression '%s'", getRelativePath(), n, regex); - TOExecutionResult result = null; + TOExecutionResult result; if (n > 0) { result = TOExecutionResult.success(this, details); } else { @@ -205,10 +184,5 @@ private TOExecutionResult replace(BufferedReader reader, BufferedWriter writer) return result; } - @Override - public ReplaceText clone() throws CloneNotSupportedException{ - ReplaceText clonedReplaceText = (ReplaceText) super.clone(); - return clonedReplaceText; - } } diff --git a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/xml/XmlElement.java b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/xml/XmlElement.java index 9b375091..692d45f3 100644 --- a/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/xml/XmlElement.java +++ b/butterfly-utilities/src/main/java/com/paypal/butterfly/utilities/xml/XmlElement.java @@ -23,24 +23,62 @@ * Note: if more than one element match * the specified XML element, the very first * one will be used + *
+ * If no element, nor attribute, is found, + * {@link com.paypal.butterfly.extensions.api.TUExecutionResult.Type#NULL} is returned. + * If the file is not a well formed XML file, an error is returned. * * @author facarvalho */ public class XmlElement extends TransformationUtility { - private static final String DESCRIPTION = "Retrieve the value of element %s in XML file %s"; - private String xmlElement; private String attribute; + private static final String DESCRIPTION = "Retrieve the value of element %s in XML file %s"; + + private static final Pattern XML_ELEMENT_SPLIT_REGEX_PATTERN = Pattern.compile("\\."); + + /** + * Retrieves the value of an element, + * or one of its attributes, in a XML file. + *
+ * Note: if more than one element match + * the specified XML element, the very first + * one will be used + */ public XmlElement() { } /** - * Result in the value of an element in a XML file. - * See also {@link #setXmlElement(String)}. + * Retrieves the value of an element, + * or one of its attributes, in a XML file. + *
+ * Note: if more than one element match + * the specified XML element, the very first + * one will be used + *
+ * Specify in {@code xmlElement} the XML element whose value, or an attribute, should be + * the result of this transformation utility. The element specified + * here should be set based on a path containing all its + * parent elements separated by '.'. See the example bellow. + *
+ * To retrieve the value of the child name, set {@code xmlElement} + * to {@code person.child.name}. In this example, + * that would return {@code Gabriela} + *
+ * {@code + * + * + * Bruna + * + * Gabriela + * + * + * } * - * @param xmlElement the XML element + * @param xmlElement the XML element whose value, or an attribute, should be + * the result of this transformation utility */ public XmlElement(String xmlElement) { setXmlElement(xmlElement); @@ -53,7 +91,8 @@ public XmlElement(String xmlElement) { * parent elements separated by '.'. See the example bellow. *
* To retrieve the value of the child name, set {@code xmlElement} - * to {@code person.child.name}. + * to {@code person.child.name}. In this example, + * that would return {@code Gabriela} *
* {@code * @@ -65,7 +104,9 @@ public XmlElement(String xmlElement) { * * } * - * @param xmlElement the XML element + * @param xmlElement the XML element whose value, or an attribute, should be + * the result of this transformation utility + * * @return this instance */ public XmlElement setXmlElement(String xmlElement) { @@ -94,31 +135,43 @@ public String getDescription() { return String.format(DESCRIPTION, xmlElement, getRelativePath()); } - private static final Pattern XML_ELEMENT_SPLIT_REGEX_PATTERN = Pattern.compile("\\."); - @Override protected TUExecutionResult execution(File transformedAppFolder, TransformationContext transformationContext) { File xmlFile = getAbsoluteFile(transformedAppFolder, transformationContext); - TUExecutionResult result = null; + TUExecutionResult result; try { Node node; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = null; + DocumentBuilder builder; builder = factory.newDocumentBuilder(); Document doc = builder.parse(xmlFile); node = findNode(doc.getChildNodes(), XML_ELEMENT_SPLIT_REGEX_PATTERN.split(xmlElement), 0); - String value; - if(attribute == null) { - value = node.getTextContent(); + + if (node == null) { + result = TUExecutionResult.nullResult(this); } else { - value = node.getAttributes().getNamedItem(attribute).getTextContent(); + String value; + if(attribute == null) { + value = node.getTextContent(); + result = TUExecutionResult.value(this, value); + } else { + Node attributeNode = node.getAttributes().getNamedItem(attribute); + if (attributeNode == null) { + result = TUExecutionResult.nullResult(this); + } else { + value = node.getAttributes().getNamedItem(attribute).getTextContent(); + result = TUExecutionResult.value(this, value); + } + } } - result = TUExecutionResult.value(this, value); - } catch (TransformationUtilityException|ParserConfigurationException|SAXException|IOException e) { + } catch (ParserConfigurationException|SAXException|IOException e) { + result = TUExecutionResult.error(this, new TransformationUtilityException("File content could not be parsed properly in XML format", e)); + } catch (TransformationUtilityException e) { result = TUExecutionResult.error(this, e); } + return result; } @@ -127,21 +180,21 @@ private Node findNode(NodeList nodeList, String[] xmlElementPath, int i) throws Node node = null; for(int j = 0; j < nodeList.getLength(); j++) { - node = nodeList.item(j); - if(node.getNodeName().equals(nextElement)) { + if(nodeList.item(j).getNodeName().equals(nextElement)) { + node = nodeList.item(j); break; } } if(node == null) { - throw new TransformationUtilityException("Element " + xmlElement + " could not be found in XML file"); + return null; } - i++; - if(i == xmlElementPath.length) { + int next = i + 1; + if(xmlElementPath.length == next) { return node; } - return findNode(node.getChildNodes(), xmlElementPath, i); + return findNode(node.getChildNodes(), xmlElementPath, next); } } diff --git a/butterfly-utilities/src/main/resources/stylesheet.css b/butterfly-utilities/src/main/resources/stylesheet.css index fcd03174..c4f6312c 100644 --- a/butterfly-utilities/src/main/resources/stylesheet.css +++ b/butterfly-utilities/src/main/resources/stylesheet.css @@ -394,10 +394,7 @@ Table styles .overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, .useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { white-space:nowrap; - padding-top:5px; - padding-left:12px; - padding-right:12px; - padding-bottom:7px; + padding:5px 12px 7px 12px; display:inline-block; float:left; background-color:#F8981D; diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/TransformationUtilityTestHelper.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/TransformationUtilityTestHelper.java index e217a383..b4598944 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/TransformationUtilityTestHelper.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/TransformationUtilityTestHelper.java @@ -2,9 +2,7 @@ import com.esotericsoftware.yamlbeans.YamlReader; import com.google.common.io.Files; -import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.extensions.api.TransformationContext; -import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import org.apache.commons.io.FileUtils; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; @@ -36,7 +34,7 @@ public abstract class TransformationUtilityTestHelper { protected File appFolder; protected File transformedAppFolder; - protected TransformationContext transformationContext = Mockito.mock(TransformationContext.class); + protected TransformationContext transformationContext; @BeforeClass public void beforeClass() throws URISyntaxException, IOException { @@ -48,6 +46,7 @@ public void beforeMethod(Method method) throws URISyntaxException, IOException { transformedAppFolder = new File(appFolder.getParentFile(), String.format("test-app_%s_%s_%s", method.getDeclaringClass().getSimpleName(), method.getName(), System.currentTimeMillis())); FileUtils.copyDirectory(appFolder, transformedAppFolder); System.out.printf("Transformed app folder: %s\n", transformedAppFolder.getAbsolutePath()); + transformationContext = Mockito.mock(TransformationContext.class); } /** @@ -134,7 +133,9 @@ protected void assertLineCount(String relativeFilePath, int difference) throws I * @throws IOException */ protected int getLineCountDifference(String relativeFilePath) throws IOException { - BufferedReader reader1 = null, reader2 = null; + BufferedReader reader1 = null; + BufferedReader reader2 = null; + try { reader1 = new BufferedReader(new FileReader(new File(appFolder, relativeFilePath))); int originalNumberOfLines = 0; diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareFilesTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareFilesTest.java new file mode 100644 index 00000000..b82642bd --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareFilesTest.java @@ -0,0 +1,72 @@ +package com.paypal.butterfly.utilities.conditions; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; + +/** + * Unit tests for {@link CompareFiles} + * + * @author facarvalho + */ +public class CompareFilesTest extends TransformationUtilityTestHelper { + + @Test + public void compareFilesEqualSameFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/application.properties")); + CompareFiles compareFiles = new CompareFiles("ATR").relative("/src/main/resources/application.properties"); + TUExecutionResult executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(compareFiles.getDescription(), "Compare file /src/main/resources/application.properties to another one, return true only if their contents are equal"); + } + + @Test + public void compareFilesEqualDifferentFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/more_yaml/dogs.yaml")); + CompareFiles compareFiles = new CompareFiles().setAttribute("ATR").relative("/src/main/resources/dogs.yaml"); + TUExecutionResult executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(compareFiles.getDescription(), "Compare file /src/main/resources/dogs.yaml to another one, return true only if their contents are equal"); + } + + @Test + public void compareFilesDifferentFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/application.properties")); + CompareFiles compareFiles = new CompareFiles().setAttribute("ATR").relative("/src/main/resources/dogs.yaml"); + TUExecutionResult executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + Assert.assertEquals(compareFiles.getDescription(), "Compare file /src/main/resources/dogs.yaml to another one, return true only if their contents are equal"); + } + + @Test + public void compareFilesInexistentFilesTest() { + CompareFiles compareFiles; + TUExecutionResult executionResult; + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/inexistent_file")); + compareFiles = new CompareFiles().setAttribute("ATR").relative("/src/main/resources/dogs.yaml"); + executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/inexistent_file")); + compareFiles = new CompareFiles().setAttribute("ATR").relative("/src/main/resources/another_inexistent_file.yaml"); + executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/dogs.yaml")); + compareFiles = new CompareFiles().setAttribute("ATR").relative("/src/main/resources/another_inexistent_file.yaml"); + executionResult = compareFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareXMLFilesTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareXMLFilesTest.java new file mode 100644 index 00000000..fc21278b --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/CompareXMLFilesTest.java @@ -0,0 +1,106 @@ +package com.paypal.butterfly.utilities.conditions; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; + +/** + * Unit tests for {@link CompareXMLFiles} + * + * @author facarvalho + */ +public class CompareXMLFilesTest extends TransformationUtilityTestHelper { + + @Test + public void compareXMLEqualSameFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "pom.xml")); + CompareXMLFiles compareXML = new CompareXMLFiles("ATR").relative("pom.xml"); + TUExecutionResult executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file pom.xml to another one, return true only if their contents are equal"); + } + + @Test + public void compareXMLEqualDifferentFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/copy_of_web.xml")); + CompareXMLFiles compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/webapp/WEB-INF/web.xml"); + TUExecutionResult executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file /src/main/webapp/WEB-INF/web.xml to another one, return true only if their contents are equal"); + } + + @Test + public void compareXMLDifferentFilesTest() { + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "pom.xml")); + CompareXMLFiles compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/webapp/WEB-INF/web.xml"); + TUExecutionResult executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file /src/main/webapp/WEB-INF/web.xml to another one, return true only if their contents are equal"); + } + + @Test + public void compareXMLInexistentFilesTest() { + CompareXMLFiles compareXML; + TUExecutionResult executionResult; + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/inexistent_file.xml")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("pom.xml"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/inexistent_file.xml")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/resources/another_inexistent_file.yaml"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertTrue((Boolean) executionResult.getValue()); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "pom.xml")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/resources/another_inexistent_file.xml"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertFalse((Boolean) executionResult.getValue()); + } + + @Test + public void errorInvalidXMLFileTest() { + CompareXMLFiles compareXML; + TUExecutionResult executionResult; + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "pom.xml")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/resources/application.properties"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "An exception happened when comparing the two XML files"); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file /src/main/resources/application.properties to another one, return true only if their contents are equal"); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/application.properties")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("pom.xml"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "An exception happened when comparing the two XML files"); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file pom.xml to another one, return true only if their contents are equal"); + + Mockito.when(transformationContext.get("ATR")).thenReturn(new File(transformedAppFolder, "/src/main/resources/application.properties")); + compareXML = new CompareXMLFiles().setAttribute("ATR").relative("/src/main/resources/dogs.yaml"); + executionResult = compareXML.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "An exception happened when comparing the two XML files"); + Assert.assertEquals(compareXML.getDescription(), "Compare XML file /src/main/resources/dogs.yaml to another one, return true only if their contents are equal"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/FileExistsTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/FileExistsTest.java new file mode 100644 index 00000000..eae326a2 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/FileExistsTest.java @@ -0,0 +1,35 @@ +package com.paypal.butterfly.utilities.conditions; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * Unit tests for {@link FileExists} + * + * @author facarvalho + */ +public class FileExistsTest extends TransformationUtilityTestHelper { + + @Test + public void fileExistsTest() { + FileExists fileExists = new FileExists().relative("/src/main/resources/application.properties"); + TUExecutionResult executionResult = fileExists.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(fileExists.getDescription(), "Check if file or folder '/src/main/resources/application.properties' exists"); + } + + @Test + public void fileDoesntExistTest() { + FileExists fileExists = new FileExists().relative("/src/main/coco/notes.txt"); + TUExecutionResult executionResult = fileExists.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertFalse((Boolean) executionResult.getValue()); + Assert.assertEquals(fileExists.getDescription(), "Check if file or folder '/src/main/coco/notes.txt' exists"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/AnnotatedWithTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/AnnotatedWithTest.java index 056b4f03..3602e740 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/AnnotatedWithTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/AnnotatedWithTest.java @@ -84,12 +84,14 @@ public void fqdnStringTest() throws ParseException { @Test public void negativeStringTest() throws ParseException { AnnotatedWith annotatedWith = new AnnotatedWith("org.springframework.stereotype.Component"); + Assert.assertFalse(annotatedWith.isNegate()); Assert.assertFalse(annotatedWith.evaluate(compilationUnit)); } @Test public void negateTest() throws ParseException { AnnotatedWith annotatedWith = new AnnotatedWith(SuppressWarnings.class).setNegate(true); + Assert.assertTrue(annotatedWith.isNegate()); Assert.assertFalse(annotatedWith.evaluate(compilationUnit)); } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/JavaMatchTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/JavaMatchTest.java new file mode 100644 index 00000000..7f2ebfe5 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/conditions/java/JavaMatchTest.java @@ -0,0 +1,68 @@ +package com.paypal.butterfly.utilities.conditions.java; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +/** + * Unit test class for {@link JavaMatch} + * + * @author facarvalho + */ +public class JavaMatchTest extends TransformationUtilityTestHelper { + + private Extends ext = new Extends(Throwable.class); + + @Test + public void singleTest() { + JavaMatch javaMatch = new JavaMatch(ext).relative("/src/main/java/com/testapp/JavaLangSubclass.java"); + TUExecutionResult executionResult = javaMatch.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertTrue((Boolean) executionResult.getValue()); + Assert.assertEquals(javaMatch.getDescription(), "Check if Java class in '/src/main/java/com/testapp/JavaLangSubclass.java' matches all specified criteria"); + Assert.assertEquals(javaMatch.getConditions().size(), 1); + Assert.assertTrue(javaMatch.getConditions().contains(ext)); + } + + @Test + public void multipleTest() { + JavaMatch javaMatch = new JavaMatch().relative("/src/main/java/com/testapp/JavaLangSubclass.java"); + javaMatch.addCondition(ext); + javaMatch.addCondition(new AnnotatedWith(SuppressWarnings.class)); + TUExecutionResult executionResult = javaMatch.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertFalse((Boolean) executionResult.getValue()); + Assert.assertEquals(javaMatch.getDescription(), "Check if Java class in '/src/main/java/com/testapp/JavaLangSubclass.java' matches all specified criteria"); + Assert.assertEquals(javaMatch.getConditions().size(), 2); + Assert.assertTrue(javaMatch.getConditions().contains(ext)); + } + + @Test + public void noCompilationUnitTest() { + JavaMatch javaMatch = new JavaMatch().relative("/src/main/java/com/testapp/NoCompilationUnits.java"); + Set conditions = new HashSet<>(); + conditions.add(ext); + conditions.add(new AnnotatedWith(SuppressWarnings.class)); + javaMatch.setConditions(conditions); + TUExecutionResult executionResult = javaMatch.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertFalse((Boolean) executionResult.getValue()); + Assert.assertEquals(javaMatch.getDescription(), "Check if Java class in '/src/main/java/com/testapp/NoCompilationUnits.java' matches all specified criteria"); + Assert.assertEquals(javaMatch.getConditions().size(), 2); + Assert.assertTrue(javaMatch.getConditions().contains(ext)); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getWarnings().size(), 1); + Assert.assertEquals(executionResult.getWarnings().get(0).getClass(), TransformationUtilityException.class); + File noCompilationUnitFile = new File(transformedAppFolder, "/src/main/java/com/testapp/NoCompilationUnits.java"); + Assert.assertEquals(executionResult.getWarnings().get(0).getMessage(), "This Java class file has no declared types: " + noCompilationUnitFile.getAbsolutePath()); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFileTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFileTest.java index ca32291e..b0687bb9 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFileTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFileTest.java @@ -7,7 +7,6 @@ import org.testng.annotations.Test; import java.io.File; -import java.net.URISyntaxException; /** * Unit tests for {@link FindFile} @@ -17,19 +16,19 @@ public class FindFileTest extends TransformationUtilityTestHelper { @Test - public void fileFoundTest() throws URISyntaxException { - FindFile findFile = new FindFile("dogs.yaml"); + public void fileFoundTest() { + FindFile findFile = new FindFile("dogs.yaml").relative("/src/main/resources/more_yaml"); TUExecutionResult executionResult = findFile.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); Assert.assertNotNull(executionResult.getValue()); File file = (File) executionResult.getValue(); - Assert.assertEquals(file, new File(transformedAppFolder, "/src/main/resources/dogs.yaml")); - Assert.assertEquals(findFile.getDescription(), "Find file named dogs.yaml under root of application"); + Assert.assertEquals(file, new File(transformedAppFolder, "/src/main/resources/more_yaml/dogs.yaml")); + Assert.assertEquals(findFile.getDescription(), "Find file named dogs.yaml under /src/main/resources/more_yaml"); Assert.assertNull(executionResult.getException()); } @Test - public void fileNotFoundNullTest() throws URISyntaxException { + public void fileNotFoundNullTest() { FindFile findFile = new FindFile().setFileName("cats.yaml"); TUExecutionResult executionResult = findFile.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.NULL); @@ -40,7 +39,7 @@ public void fileNotFoundNullTest() throws URISyntaxException { } @Test - public void fileNotFoundErrorTest() throws URISyntaxException { + public void fileNotFoundErrorTest() { FindFile findFile = new FindFile("cats.yaml").failIfNotFound(true); TUExecutionResult executionResult = findFile.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); @@ -54,11 +53,26 @@ public void fileNotFoundErrorTest() throws URISyntaxException { } @Test - public void errorTest() throws URISyntaxException { + public void multipleFilesFoundTest() { + FindFile findFile = new FindFile("dogs.yaml"); + TUExecutionResult executionResult = findFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(findFile.getDescription(), "Find file named dogs.yaml under root of application"); + Assert.assertFalse(findFile.isFailIfNotFound()); + Assert.assertEquals(findFile.getFileName(), "dogs.yaml"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "More than one file named dogs.yaml have been found"); + } + + @Test + public void noFileNameErrorTest() { FindFile findFile = new FindFile(); TUExecutionResult executionResult = findFile.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(findFile.getDescription(), "Find file named null under root of application"); Assert.assertFalse(findFile.isFailIfNotFound()); Assert.assertNull(findFile.getFileName()); @@ -67,4 +81,32 @@ public void errorTest() throws URISyntaxException { Assert.assertEquals(executionResult.getException().getMessage(), "File name has not been set"); } + @Test + public void noSearchFolderErrorTest() { + FindFile findFile; + TUExecutionResult executionResult; + + findFile = new FindFile("myfile.txt").relative("no_existent_folder").failIfNotFound(true); + executionResult = findFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + + Assert.assertEquals(findFile.getDescription(), "Find file named myfile.txt under no_existent_folder"); + Assert.assertTrue(findFile.isFailIfNotFound()); + Assert.assertEquals(findFile.getFileName(), "myfile.txt"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "The specified search root folder does not exist"); + + findFile = new FindFile("myfile.txt").relative("no_existent_folder"); + executionResult = findFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.NULL); + Assert.assertNull(executionResult.getValue()); + + Assert.assertEquals(findFile.getDescription(), "Find file named myfile.txt under no_existent_folder"); + Assert.assertFalse(findFile.isFailIfNotFound()); + Assert.assertEquals(findFile.getFileName(), "myfile.txt"); + Assert.assertNull(executionResult.getException()); + } + } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFilesTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFilesTest.java new file mode 100644 index 00000000..82340c86 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/FindFilesTest.java @@ -0,0 +1,469 @@ +package com.paypal.butterfly.utilities.file; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.util.List; + +/** + * Unit tests for {@link FindFiles} + * + * @author facarvalho + */ +public class FindFilesTest extends TransformationUtilityTestHelper { + + @Test + public void fileRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles("web.xml", true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/webapp/WEB-INF/web.xml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "web.xml"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void fileRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles("(.*\\.xml)", true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 5); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/pom.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/foo.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/webapp/WEB-INF/web.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/copy_of_web.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/no_parent_pom.xml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(.*\\.xml)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void fileNonRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles().relative(".").setIncludeFolders(false).setIncludeFiles(true); + findFiles.setNameRegex("pom.xml").setRecursive(false); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "./pom.xml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "pom.xml"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void fileNonRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles().setIncludeFolders(false).setIncludeFiles(true); + findFiles.setNameRegex("(.*\\.xml)").setRecursive(false); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 2); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "pom.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "foo.xml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(.*\\.xml)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void fileNoneFoundTest() { + FindFiles findFiles = new FindFiles("(.*\\.txt)", true).relative(""); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertNotNull(executionResult.getValue()); + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 0); + Assert.assertEquals(findFiles.getNameRegex(), "(.*\\.txt)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getDetails(), "No files have been found"); + } + + @Test + public void filePathRegexTest() { + FindFiles findFiles = new FindFiles().relative("src").setRecursive(false); + findFiles.setNameRegex("(Same.*\\.java)").setPathRegex("(.*\\/java\\/.*)"); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 3); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/java/com/testapp/SamePackageOtherSuperclass.java"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/java/com/testapp/SamePackageSubclass.java"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/java/com/testapp/SamePackageSuperclass.java"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(Same.*\\.java)"); + Assert.assertEquals(findFiles.getPathRegex(), "(.*\\/java\\/.*)"); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under src and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void filePathRegexNoneFoundTest() { + FindFiles findFiles = new FindFiles("(.*Impl\\.java)", "(.*\\/java\\/.*)"); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertNotNull(executionResult.getValue()); + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 0); + Assert.assertEquals(findFiles.getNameRegex(), "(.*Impl\\.java)"); + Assert.assertEquals(findFiles.getPathRegex(), "(.*\\/java\\/.*)"); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertFalse(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getDetails(), "No files have been found"); + } + + @Test + public void folderRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles("resources", true).setIncludeFiles(false).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources"))); + Assert.assertEquals(findFiles.getNameRegex(), "resources"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void folderRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles("(more_yaml|testapp)", true, false, true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 2); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/java/com/testapp"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(more_yaml|testapp)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void folderNonRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles("(sr.)", false).relative(".").setIncludeFolders(true).setIncludeFiles(false); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "./src"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(sr.)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void folderNonRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles().setRecursive(false).setIncludeFolders(true).setIncludeFiles(false); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 2); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "src"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "blah"))); + + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void folderNoneFoundTest() { + FindFiles findFiles = new FindFiles("manga", true).setIncludeFiles(false).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertNotNull(executionResult.getValue()); + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 0); + Assert.assertEquals(findFiles.getNameRegex(), "manga"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getDetails(), "No files have been found"); + } + + @Test + public void folderPathRegexTest() { + FindFiles findFiles = new FindFiles().setPathRegex("(.*\\/resources.*)").setRecursive(true); + findFiles.setIncludeFiles(false).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml"))); + + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertEquals(findFiles.getPathRegex(), "(.*\\/resources.*)"); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void folderPathRegexNoneFoundTest() { + FindFiles findFiles = new FindFiles().setPathRegex("(.*\\/yaba.*)").setRecursive(true); + findFiles.setIncludeFiles(false).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertNotNull(executionResult.getValue()); + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 0); + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertEquals(findFiles.getPathRegex(), "(.*\\/yaba.*)"); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertFalse(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getDetails(), "No files have been found"); + } + + @Test + public void bothRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles("web.xml", true).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/webapp/WEB-INF/web.xml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "web.xml"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles("(.*yaml)", true).setIncludeFolders(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 3); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/dogs.yaml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml/dogs.yaml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(.*yaml)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothNonRecursiveOneFoundTest() { + FindFiles findFiles = new FindFiles("(bla.)", false).relative(".").setIncludeFolders(true).setIncludeFiles(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 1); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "./blah"))); + + Assert.assertEquals(findFiles.getNameRegex(), "(bla.)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothNonRecursiveMultipleFoundTest() { + FindFiles findFiles = new FindFiles().setRecursive(false).setIncludeFolders(true).setIncludeFiles(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 4); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "src"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "blah"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "foo.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "pom.xml"))); + + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertFalse(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder only (not including sub-folders)"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothRecursiveAllFoundTest() { + FindFiles findFiles = new FindFiles().setRecursive(true).setIncludeFolders(true).setIncludeFiles(true); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 31); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "src"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "blah"))); + + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothPathRegexTest() { + FindFiles findFiles = new FindFiles().setRecursive(true).setIncludeFiles(true).setIncludeFolders(true); + findFiles.setPathRegex("(.*\\/resources.*)"); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 8); + + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml/dogs.yaml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/more_yaml/testapp"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/application.properties"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/copy_of_web.xml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/dogs.yaml"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/MANIFEST.MF"))); + Assert.assertTrue(files.contains(new File(transformedAppFolder, "/src/main/resources/no_parent_pom.xml"))); + + Assert.assertNull(findFiles.getNameRegex()); + Assert.assertEquals(findFiles.getPathRegex(), "(.*\\/resources.*)"); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void bothNoneFoundTest() { + FindFiles findFiles = new FindFiles("(.*casa.*)", true, true, true).relative(""); + TUExecutionResult executionResult = findFiles.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.WARNING); + Assert.assertNotNull(executionResult.getValue()); + List files = (List) executionResult.getValue(); + Assert.assertEquals(files.size(), 0); + Assert.assertEquals(findFiles.getNameRegex(), "(.*casa.*)"); + Assert.assertNull(findFiles.getPathRegex()); + Assert.assertTrue(findFiles.isRecursive()); + Assert.assertTrue(findFiles.isIncludeFiles()); + Assert.assertTrue(findFiles.isIncludeFolders()); + Assert.assertEquals(findFiles.getDescription(), "Find files whose name and/or path match regular expression and are under the root folder and sub-folders"); + Assert.assertNull(executionResult.getException()); + Assert.assertEquals(executionResult.getDetails(), "No files have been found"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LoadFileTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LoadFileTest.java new file mode 100644 index 00000000..5e9e7ea7 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LoadFileTest.java @@ -0,0 +1,51 @@ +package com.paypal.butterfly.utilities.file; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.apache.commons.io.FileUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; + +/** + * Unit tests for {@link LoadFile} + * + * @author facarvalho + */ +public class LoadFileTest extends TransformationUtilityTestHelper { + + @Test + public void loadFileTest() throws IOException, URISyntaxException { + LoadFile loadFile = new LoadFile("stylesheet.css"); + TUExecutionResult executionResult = loadFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertEquals(loadFile.getResource(), "stylesheet.css"); + Assert.assertNotNull(executionResult.getValue()); + File loadedFile = (File) executionResult.getValue(); + Assert.assertTrue(loadedFile.getName().endsWith("stylesheet.css")); + Assert.assertTrue(loadedFile.exists()); + Assert.assertTrue(loadedFile.isFile()); + Assert.assertEquals(loadFile.getDescription(), "Load resource stylesheet.css and writes it to a temporary file"); + Assert.assertNull(executionResult.getException()); + File originalFile = new File(getClass().getResource("/stylesheet.css").toURI()); + Assert.assertTrue(FileUtils.contentEquals(originalFile, loadedFile)); + } + + @Test + public void fileNotFoundTest() { + LoadFile loadFile = new LoadFile().setResource("non_existent_file.txt"); + TUExecutionResult executionResult = loadFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertEquals(loadFile.getResource(), "non_existent_file.txt"); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(loadFile.getDescription(), "Load resource non_existent_file.txt and writes it to a temporary file"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "Resource non_existent_file.txt could not be found in the classpath"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LocateFileTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LocateFileTest.java new file mode 100644 index 00000000..4ea2ce6e --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/file/LocateFileTest.java @@ -0,0 +1,86 @@ +package com.paypal.butterfly.utilities.file; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; + +/** + * Unit tests for {@link LocateFile} + * + * @author facarvalho + */ +public class LocateFileTest extends TransformationUtilityTestHelper { + + @Test + public void rootLocateFileTest() throws IOException { + LocateFile locateFile = new LocateFile(); + TUExecutionResult executionResult = locateFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + File rootFile = (File) executionResult.getValue(); + Assert.assertEquals(rootFile.getAbsolutePath(), transformedAppFolder.getAbsolutePath()); + Assert.assertEquals(locateFile.getParentLevel(), 0); + Assert.assertEquals(locateFile.getDescription(), "Locate file root folder"); + } + + @Test + public void locateFileTest() throws IOException { + LocateFile locateFile = new LocateFile().relative("pom.xml"); + TUExecutionResult executionResult = locateFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + File rootFile = (File) executionResult.getValue(); + Assert.assertEquals(rootFile, new File(transformedAppFolder, "pom.xml")); + Assert.assertEquals(locateFile.getParentLevel(), 0); + Assert.assertEquals(locateFile.getDescription(), "Locate file pom.xml"); + } + + @Test + public void locateParentFileTest() throws IOException { + LocateFile locateFile = new LocateFile(2).relative("/src/main/resources"); + TUExecutionResult executionResult = locateFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + File file = (File) executionResult.getValue(); + Assert.assertEquals(file, new File(transformedAppFolder, "/src")); + Assert.assertEquals(locateFile.getParentLevel(), 2); + Assert.assertEquals(locateFile.getDescription(), "Locate file 2 levels above /src/main/resources"); + } + + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Invalid parent level") + public void invalidParentTest() throws IOException { + new LocateFile(-2).relative("/src/main/resources"); + } + + @Test + public void locateInvalidParentFileTest() throws IOException { + LocateFile locateFile = new LocateFile(2000).relative("/src/main/resources"); + TUExecutionResult executionResult = locateFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(locateFile.getParentLevel(), 2000); + Assert.assertEquals(locateFile.getDescription(), "Locate file 2000 levels above /src/main/resources"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "File to be located reached limit of files hierarchy, parent level 2000 is too deep"); + } + + @Test + public void locateInvalidBaseFileTest() throws IOException { + LocateFile locateFile = new LocateFile().relative("/src/main/resources/non_existent_folder"); + TUExecutionResult executionResult = locateFile.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(locateFile.getParentLevel(), 0); + Assert.assertEquals(locateFile.getDescription(), "Locate file /src/main/resources/non_existent_folder"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "File to be located does not exist"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/java/JavaPackageTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/java/JavaPackageTest.java index 068583fc..58d386e7 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/java/JavaPackageTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/java/JavaPackageTest.java @@ -1,6 +1,7 @@ package com.paypal.butterfly.utilities.java; import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; import org.testng.Assert; import org.testng.annotations.Test; @@ -13,11 +14,24 @@ public class JavaPackageTest extends TransformationUtilityTestHelper { @Test - public void javaLangTest() { + public void simpleTest() { JavaPackage javaPackage = new JavaPackage().relative("src/main/java/com/testapp/Application.java"); TUExecutionResult executionResult = javaPackage.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); Assert.assertEquals(executionResult.getValue(), "com.testapp"); + Assert.assertEquals(javaPackage.getDescription(), "Retrieve the package of a Java class file src/main/java/com/testapp/Application.java"); + } + + @Test + public void emptyJavaFileTest() { + JavaPackage javaPackage = new JavaPackage().relative("src/main/java/com/testapp/NoCompilationUnits.java"); + TUExecutionResult executionResult = javaPackage.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "An error happened when trying to read and parse the specified Java file /src/main/java/com/testapp/NoCompilationUnits.java"); + Assert.assertEquals(javaPackage.getDescription(), "Retrieve the package of a Java class file src/main/java/com/testapp/NoCompilationUnits.java"); } } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MavenGoalTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MavenGoalTest.java index 7063b278..6737dba2 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MavenGoalTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MavenGoalTest.java @@ -1,22 +1,8 @@ package com.paypal.butterfly.utilities.maven; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyList; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.apache.maven.shared.invoker.DefaultInvocationRequest; -import org.apache.maven.shared.invoker.DefaultInvoker; -import org.apache.maven.shared.invoker.InvocationRequest; -import org.apache.maven.shared.invoker.InvocationResult; -import org.apache.maven.shared.invoker.Invoker; -import org.apache.maven.shared.invoker.MavenInvocationException; +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; +import org.apache.maven.shared.invoker.*; import org.codehaus.plexus.util.cli.CommandLineException; import org.mockito.InjectMocks; import org.mockito.Mock; @@ -26,18 +12,22 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import com.paypal.butterfly.extensions.api.TUExecutionResult; -import com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException; +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; /** * @author mcrockett */ public class MavenGoalTest { - @Mock - InvocationRequest request = new DefaultInvocationRequest(); @Mock - InvocationResult invocationResult = null; + private InvocationRequest request = new DefaultInvocationRequest(); @Mock private Invoker invoker = new DefaultInvoker(); @@ -46,13 +36,13 @@ public class MavenGoalTest { private MultipleOutputHandler multipleOutputHandler = new MultipleOutputHandler(); @Mock - File absoluteFile = new File("absolute_path"); + private File absoluteFile = new File("absolute_path"); @InjectMocks - MavenGoal mavenGoal = new MavenGoal(); + private MavenGoal mavenGoal = new MavenGoal(); @BeforeMethod - public void setup() { + public void setUp() { MockitoAnnotations.initMocks(this); String[] goals = {"a", "b", "c"}; mavenGoal.setGoals(goals); diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandlerTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandlerTest.java index 8d151338..2e9ec24e 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandlerTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/MultipleOutputHandlerTest.java @@ -20,14 +20,14 @@ */ public class MultipleOutputHandlerTest { - private abstract class BogusMavenInvocationOutputHandler implements MavenInvocationOutputHandler { - } + private MultipleOutputHandler multiHandler; - private MultipleOutputHandler multiHandler = null; - @Mock private MavenInvocationOutputHandler mockHandler; + private abstract class BogusMavenInvocationOutputHandler implements MavenInvocationOutputHandler { + } + @BeforeClass public void classSetup() throws Exception { MockitoAnnotations.initMocks(this); diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/RelatedArtifactsTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/RelatedArtifactsTest.java index 44cfe5ae..2a344fee 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/RelatedArtifactsTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/maven/RelatedArtifactsTest.java @@ -1,6 +1,7 @@ package com.paypal.butterfly.utilities.maven; import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; import org.mockito.Mockito; import org.testng.Assert; @@ -23,9 +24,14 @@ public void test() throws URISyntaxException { File file = new File(getClass().getResource("/test-app/pom.xml").toURI()); Mockito.when(transformationContext.get("pomsList")).thenReturn(Arrays.asList(file)); - RelatedArtifacts relatedArtifacts = new RelatedArtifacts("com.test", "foo-parent", "1.0", "pomsList"); + RelatedArtifacts relatedArtifacts = new RelatedArtifacts(); + relatedArtifacts.setParentGroupId("com.test").setParentArtifactId("foo-parent").setParentVersion("1.0").setPomFilesAttribute("pomsList"); TUExecutionResult executionResult = relatedArtifacts.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertEquals(relatedArtifacts.getParentGroupId(), "com.test"); + Assert.assertEquals(relatedArtifacts.getParentArtifactId(), "foo-parent"); + Assert.assertEquals(relatedArtifacts.getParentVersion(), "1.0"); + Assert.assertEquals(relatedArtifacts.getPomFilesAttribute(), "pomsList"); Assert.assertNotNull(executionResult.getValue()); List pomFiles = (List) executionResult.getValue(); Assert.assertEquals(pomFiles.size(), 1); @@ -46,4 +52,19 @@ public void noChildrenTest() throws URISyntaxException { Assert.assertEquals(relatedArtifacts.getDescription(), "Identifies all pom files whose parent is com.test:bar-parent:1.0, directly or indirectly"); } + @Test + public void noPomFileTest() throws URISyntaxException { + File file = new File(getClass().getResource("/test-app/src/main/resources/application.properties").toURI()); + Mockito.when(transformationContext.get("pomsList")).thenReturn(Arrays.asList(file)); + + RelatedArtifacts relatedArtifacts = new RelatedArtifacts("com.test", "bar-parent", "1.0", "pomsList"); + TUExecutionResult executionResult = relatedArtifacts.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(relatedArtifacts.getDescription(), "Identifies all pom files whose parent is com.test:bar-parent:1.0, directly or indirectly"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "Error when trying to create Maven pom file model, double check if this file has a valid Maven structure: " + file.getAbsolutePath()); + } + } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/misc/RunScriptTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/misc/RunScriptTest.java new file mode 100644 index 00000000..8ffd2b51 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/misc/RunScriptTest.java @@ -0,0 +1,87 @@ +package com.paypal.butterfly.utilities.misc; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.Test; + +import javax.script.ScriptException; + +/** + * Unit tests for {@link RunScript} + * + * @author facarvalho + */ +public class RunScriptTest extends TransformationUtilityTestHelper { + + @Test + public void simpleScriptTest() { + RunScript runScript = new RunScript("4 + 6"); + TUExecutionResult executionResult = runScript.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getValue(), 10); + Assert.assertEquals(runScript.getDescription(), "Executes script '4 + 6' and saves its evaluation result"); + Assert.assertEquals(runScript.getScript(), "4 + 6"); + Assert.assertEquals(runScript.getLanguage(), "js"); + } + + @Test + public void objectsDynamicScriptTest() { + RunScript runScript = new RunScript().setScript("a / b").addObject("a", new Integer(27)).addObject("b", new Integer(9)); + TUExecutionResult executionResult = runScript.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getValue(), 3d); + Assert.assertEquals(runScript.getDescription(), "Executes script 'a / b' and saves its evaluation result"); + Assert.assertEquals(runScript.getScript(), "a / b"); + Assert.assertEquals(runScript.getAttributes().size(), 0); + Assert.assertEquals(runScript.getObjects().size(), 2); + Assert.assertTrue(runScript.getObjects().containsKey("a")); + Assert.assertTrue(runScript.getObjects().containsKey("b")); + Assert.assertEquals(runScript.getObjects().get("a"), 27); + Assert.assertEquals(runScript.getObjects().get("b"), 9); + Assert.assertEquals(runScript.getLanguage(), "js"); + } + + @Test + public void attributesDynamicScriptTest() { + Mockito.when(transformationContext.get("ATRA")).thenReturn("casa"); + Mockito.when(transformationContext.get("ATRB")).thenReturn("azul"); + + RunScript runScript = new RunScript().setScript("a + ' ' + b").addAttribute("a", "ATRA").addAttribute("b", "ATRB"); + runScript.setLanguage("javascript"); + + TUExecutionResult executionResult = runScript.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getValue(), "casa azul"); + Assert.assertEquals(runScript.getDescription(), "Executes script 'a + ' ' + b' and saves its evaluation result"); + Assert.assertEquals(runScript.getScript(), "a + ' ' + b"); + Assert.assertEquals(runScript.getObjects().size(), 0); + Assert.assertEquals(runScript.getAttributes().size(), 2); + Assert.assertTrue(runScript.getAttributes().containsKey("a")); + Assert.assertTrue(runScript.getAttributes().containsKey("b")); + Assert.assertEquals(runScript.getAttributes().get("a"), "ATRA"); + Assert.assertEquals(runScript.getAttributes().get("b"), "ATRB"); + Assert.assertEquals(runScript.getLanguage(), "javascript"); + } + + @Test + public void invalidScriptTest() { + RunScript runScript = new RunScript("++++"); + TUExecutionResult executionResult = runScript.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(runScript.getDescription(), "Executes script '++++' and saves its evaluation result"); + Assert.assertEquals(runScript.getScript(), "++++"); + Assert.assertEquals(runScript.getObjects().size(), 0); + Assert.assertEquals(runScript.getAttributes().size(), 0); + Assert.assertEquals(runScript.getLanguage(), "js"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), ScriptException.class); + Assert.assertEquals(executionResult.getException().getMessage(), ":1:2 Expected l-value but found ++\n++++\n ^ in at line number 1 at column number 2"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/EolBufferedReaderTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/EolBufferedReaderTest.java index 70c2dabf..9aacfcaf 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/EolBufferedReaderTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/EolBufferedReaderTest.java @@ -45,12 +45,11 @@ public void readLineKeepEndEOLTest() throws IOException { try { reader = new EolBufferedReader(new BufferedReader(new StringReader(TEST_STRING))); - String line1, line2, line3, line4, line5; - line1 = reader.readLineKeepEol(); - line2 = reader.readLineKeepEol(); - line3 = reader.readLineKeepEol(); - line4 = reader.readLineKeepEol(); - line5 = reader.readLineKeepEol(); + String line1 = reader.readLineKeepEol(); + String line2 = reader.readLineKeepEol(); + String line3 = reader.readLineKeepEol(); + String line4 = reader.readLineKeepEol(); + String line5 = reader.readLineKeepEol(); Assert.assertFalse(startsWithEol(line1)); Assert.assertTrue(endsWithEol(line1)); @@ -104,13 +103,12 @@ public void readLineKeepStartEOLTest() throws IOException { try { reader = new EolBufferedReader(new BufferedReader(new StringReader(TEST_STRING))); - String line1, line2, line3, line4, line5, line6; - line1 = reader.readLineKeepStartEol(); - line2 = reader.readLineKeepStartEol(); - line3 = reader.readLineKeepStartEol(); - line4 = reader.readLineKeepStartEol(); - line5 = reader.readLineKeepStartEol(); - line6 = reader.readLineKeepStartEol(); + String line1 = reader.readLineKeepStartEol(); + String line2 = reader.readLineKeepStartEol(); + String line3 = reader.readLineKeepStartEol(); + String line4 = reader.readLineKeepStartEol(); + String line5 = reader.readLineKeepStartEol(); + String line6 = reader.readLineKeepStartEol(); Assert.assertFalse(startsWithEol(line1)); Assert.assertFalse(endsWithEol(line1)); diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependencyTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependencyTest.java index d7c584ff..4a8b5440 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependencyTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomAddDependencyTest.java @@ -1,211 +1,186 @@ package com.paypal.butterfly.utilities.operations.pom; -import java.io.IOException; -import java.util.List; - +import com.paypal.butterfly.extensions.api.TOExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; import org.apache.maven.model.Dependency; import org.apache.maven.model.Model; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.testng.Assert; import org.testng.annotations.Test; -import com.paypal.butterfly.extensions.api.TOExecutionResult; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; -import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import java.io.IOException; +import java.util.List; public class PomAddDependencyTest extends TransformationUtilityTestHelper { - @Test - public void addDependencyWithVersionTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core", "3.0.7.RELEASE") - .relative("pom.xml"); - - Assert.assertNull(getDependencyBeforeChange(uut)); - executeAndAssertSuccess(uut); - Dependency dependencyAfterChange = getDependencyAfterChange(uut); - Assert.assertNotNull(dependencyAfterChange); - Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); - Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); - Assert.assertEquals(dependencyAfterChange.getVersion(), "3.0.7.RELEASE"); - Assert.assertEquals(dependencyAfterChange.getScope(), null); - - } - - @Test - public void addDependencyWithoutVersionTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core") - .relative("pom.xml"); - - Assert.assertNull(getDependencyBeforeChange(uut)); - executeAndAssertSuccess(uut); - Dependency dependencyAfterChange = getDependencyAfterChange(uut); - Assert.assertNotNull(dependencyAfterChange); - Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); - Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); - Assert.assertEquals(dependencyAfterChange.getVersion(), null); - Assert.assertEquals(dependencyAfterChange.getScope(), null); - - } - - @Test - public void addDependencyWithScopeTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core", "3.0.7.RELEASE") - .relative("pom.xml").setScope("provided"); - - Assert.assertNull(getDependencyBeforeChange(uut)); - executeAndAssertSuccess(uut); - Dependency dependencyAfterChange = getDependencyAfterChange(uut); - Assert.assertNotNull(dependencyAfterChange); - Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); - Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); - Assert.assertEquals(dependencyAfterChange.getVersion(), "3.0.7.RELEASE"); - Assert.assertEquals(dependencyAfterChange.getScope(), "provided"); - - } - - @Test - public void defaultIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit").relative("pom.xml"); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); - Assert.assertNotNull(executionResult.getException()); - Assert.assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNull(dependencyAfterChange); - - } - - @Test - public void warnNotAddIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml") - .warnNotAddIfPresent(); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); - Assert.assertNull(executionResult.getException()); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNull(dependencyAfterChange); - - } - - @Test - public void warnButAddIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml") - .warnButAddIfPresent(); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); - Assert.assertNull(executionResult.getException()); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNotNull(dependencyAfterChange); - - } - - @Test - public void noOpIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").noOpIfPresent(); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); - Assert.assertNull(executionResult.getException()); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNull(dependencyAfterChange); - - } - - @Test - public void failIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit").relative("pom.xml").failIfPresent(); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); - Assert.assertNotNull(executionResult.getException()); - Assert.assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNull(dependencyAfterChange); - - } - - @Test - public void overwriteIfPresentTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml") - .overwriteIfPresent().setScope("test"); - - TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); - Assert.assertNull(executionResult.getException()); - Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", - "1.7"); - Assert.assertNotNull(dependencyAfterChange); - Assert.assertEquals(dependencyAfterChange.getScope(), "test"); - - } - - @Test - public void getDescriptionTest() throws IOException, XmlPullParserException { - - PomAddDependency uut = new PomAddDependency("org.testng", "testng", "1.1").relative("pom.xml"); - - String description = uut.getDescription(); - Assert.assertEquals(description, "Add dependency org.testng:testng:1.1 to POM file pom.xml"); - - } - - private Dependency getDependencyBeforeChange(PomAddDependency pomAddDependency) - throws IOException, XmlPullParserException { - Model pomModelBeforeChange = getOriginalPomModel("pom.xml"); - Dependency dependencyBeforeChange = pomAddDependency.getDependency(pomModelBeforeChange); - return dependencyBeforeChange; - } - - private Dependency getDependencyAfterChange(PomAddDependency pomAddDependency) - throws IOException, XmlPullParserException { - Model pomModelAfterChange = getTransformedPomModel("pom.xml"); - Dependency dependencyAfterChange = pomAddDependency.getDependency(pomModelAfterChange); - return dependencyAfterChange; - } - - private void executeAndAssertSuccess(AbstractPomOperation pomOperation) { - TOExecutionResult executionResult = pomOperation.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); - } - - /** - * Get dependency list from a maven model. Note: This is needed because - * {@link AbstractArtifactPomOperation#getDependencyInList(List, String, String)} - * does not accept a version as argument. - */ - private Dependency getDependencyInList(Model model, String groupId, String artifactId, String version) { - List dependencyList = model.getDependencies(); - if (dependencyList == null || dependencyList.size() == 0) { - return null; - } - - Dependency dependency = null; - for (Dependency d : dependencyList) { - if (d.getArtifactId().equals(artifactId) && d.getGroupId().equals(groupId) - && d.getVersion().equals(version)) { - dependency = d; - break; - } - } - - return dependency; - } + @Test + public void addDependencyWithVersionTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core", "3.0.7.RELEASE").relative("pom.xml"); + + Assert.assertNull(getDependencyBeforeChange(uut)); + executeAndAssertSuccess(uut); + Dependency dependencyAfterChange = getDependencyAfterChange(uut); + Assert.assertNotNull(dependencyAfterChange); + Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); + Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); + Assert.assertEquals(dependencyAfterChange.getVersion(), "3.0.7.RELEASE"); + Assert.assertEquals(dependencyAfterChange.getScope(), null); + + } + + @Test + public void addDependencyWithoutVersionTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core").relative("pom.xml"); + + Assert.assertNull(getDependencyBeforeChange(uut)); + executeAndAssertSuccess(uut); + Dependency dependencyAfterChange = getDependencyAfterChange(uut); + Assert.assertNotNull(dependencyAfterChange); + Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); + Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); + Assert.assertEquals(dependencyAfterChange.getVersion(), null); + Assert.assertEquals(dependencyAfterChange.getScope(), null); + + } + + @Test + public void addDependencyWithScopeTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("org.springframework.batch", "spring-batch-core", "3.0.7.RELEASE").relative("pom.xml").setScope("provided"); + + Assert.assertNull(getDependencyBeforeChange(uut)); + executeAndAssertSuccess(uut); + Dependency dependencyAfterChange = getDependencyAfterChange(uut); + Assert.assertNotNull(dependencyAfterChange); + Assert.assertEquals(dependencyAfterChange.getGroupId(), "org.springframework.batch"); + Assert.assertEquals(dependencyAfterChange.getArtifactId(), "spring-batch-core"); + Assert.assertEquals(dependencyAfterChange.getVersion(), "3.0.7.RELEASE"); + Assert.assertEquals(dependencyAfterChange.getScope(), "provided"); + + } + + @Test + public void defaultIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit").relative("pom.xml"); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNull(dependencyAfterChange); + + } + + @Test + public void warnNotAddIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").warnNotAddIfPresent(); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); + Assert.assertNull(executionResult.getException()); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNull(dependencyAfterChange); + + } + + @Test + public void warnButAddIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").warnButAddIfPresent(); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); + Assert.assertNull(executionResult.getException()); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNotNull(dependencyAfterChange); + + } + + @Test + public void noOpIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").noOpIfPresent(); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); + Assert.assertNull(executionResult.getException()); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNull(dependencyAfterChange); + + } + + @Test + public void failIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit").relative("pom.xml").failIfPresent(); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNull(dependencyAfterChange); + + } + + @Test + public void overwriteIfPresentTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").overwriteIfPresent().setScope("test"); + + TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + Assert.assertNull(executionResult.getException()); + Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); + Assert.assertNotNull(dependencyAfterChange); + Assert.assertEquals(dependencyAfterChange.getScope(), "test"); + + } + + @Test + public void getDescriptionTest() throws IOException, XmlPullParserException { + PomAddDependency uut = new PomAddDependency("org.testng", "testng", "1.1").relative("pom.xml"); + + String description = uut.getDescription(); + Assert.assertEquals(description, "Add dependency org.testng:testng:1.1 to POM file pom.xml"); + + } + + private Dependency getDependencyBeforeChange(PomAddDependency pomAddDependency) throws IOException, XmlPullParserException { + Model pomModelBeforeChange = getOriginalPomModel("pom.xml"); + Dependency dependencyBeforeChange = pomAddDependency.getDependency(pomModelBeforeChange); + return dependencyBeforeChange; + } + + private Dependency getDependencyAfterChange(PomAddDependency pomAddDependency) throws IOException, XmlPullParserException { + Model pomModelAfterChange = getTransformedPomModel("pom.xml"); + Dependency dependencyAfterChange = pomAddDependency.getDependency(pomModelAfterChange); + return dependencyAfterChange; + } + + private void executeAndAssertSuccess(AbstractPomOperation pomOperation) { + TOExecutionResult executionResult = pomOperation.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + } + + /** + * Get dependency list from a maven model. Note: This is needed because + * {@link AbstractArtifactPomOperation#getDependencyInList(List, String, String)} + * does not accept a version as argument. + */ + private Dependency getDependencyInList(Model model, String groupId, String artifactId, String version) { + List dependencyList = model.getDependencies(); + if (dependencyList == null || dependencyList.size() == 0) { + return null; + } + + Dependency dependency = null; + for (Dependency d : dependencyList) { + if (d.getArtifactId().equals(artifactId) && d.getGroupId().equals(groupId) + && d.getVersion().equals(version)) { + dependency = d; + break; + } + } + + return dependency; + } } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependencyTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependencyTest.java index d212902f..b02cd263 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependencyTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeDependencyTest.java @@ -1,16 +1,14 @@ package com.paypal.butterfly.utilities.operations.pom; -import java.io.IOException; - +import com.paypal.butterfly.extensions.api.TOExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; import org.apache.maven.model.Dependency; import org.apache.maven.model.Model; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.testng.Assert; import org.testng.annotations.Test; -import com.paypal.butterfly.extensions.api.TOExecutionResult; -import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; -import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import java.io.IOException; import static org.testng.Assert.*; diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParentTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParentTest.java new file mode 100644 index 00000000..9ba3bcba --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomChangeParentTest.java @@ -0,0 +1,157 @@ +package com.paypal.butterfly.utilities.operations.pom; + +import com.paypal.butterfly.extensions.api.TOExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationOperationException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.apache.maven.model.Model; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.testng.annotations.Test; + +import java.io.IOException; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; + +/** + * Unit test class for {@link PomChangeParentTest} + * + * @author facarvalho + */ +public class PomChangeParentTest extends TransformationUtilityTestHelper { + + @Test + public void changeVersionTest() throws IOException, XmlPullParserException { + Model pomModelBeforeChange = getOriginalPomModel("pom.xml"); + assertEquals(pomModelBeforeChange.getParent().getVersion(), "1.0"); + + PomChangeParent pomChangeParent = new PomChangeParent("2.0").relative("pom.xml"); + + assertNull(pomChangeParent.getGroupId()); + assertNull(pomChangeParent.getArtifactId()); + assertEquals(pomChangeParent.getVersion(), "2.0"); + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file pom.xml"); + assertNull(executionResult.getException()); + + Model pomModelAfterChange = getTransformedPomModel("pom.xml"); + assertEquals(pomModelAfterChange.getParent().getVersion(), "2.0"); + } + + @Test + public void changeParentTest() throws IOException, XmlPullParserException { + Model pomModelBeforeChange = getOriginalPomModel("pom.xml"); + + assertEquals(pomModelBeforeChange.getParent().getGroupId(), "com.test"); + assertEquals(pomModelBeforeChange.getParent().getArtifactId(), "foo-parent"); + assertEquals(pomModelBeforeChange.getParent().getVersion(), "1.0"); + + PomChangeParent pomChangeParent = new PomChangeParent().setGroupId("com.newgroupid").setArtifactId("newartifactid").setVersion("2.0").relative("pom.xml"); + + assertEquals(pomChangeParent.getGroupId(), "com.newgroupid"); + assertEquals(pomChangeParent.getArtifactId(), "newartifactid"); + assertEquals(pomChangeParent.getVersion(), "2.0"); + + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file pom.xml"); + assertNull(executionResult.getException()); + + Model pomModelAfterChange = getTransformedPomModel("pom.xml"); + assertEquals(pomModelAfterChange.getParent().getGroupId(), "com.newgroupid"); + assertEquals(pomModelAfterChange.getParent().getArtifactId(), "newartifactid"); + assertEquals(pomModelAfterChange.getParent().getVersion(), "2.0"); + } + + @Test + public void failTest() throws IOException, XmlPullParserException, CloneNotSupportedException { + Model pomModelBeforeChange = getOriginalPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelBeforeChange.getParent()); + + PomChangeParent pomChangeParent = new PomChangeParent("2.0").relative("/src/main/resources/no_parent_pom.xml"); + + assertNull(pomChangeParent.getGroupId()); + assertNull(pomChangeParent.getArtifactId()); + assertEquals(pomChangeParent.getVersion(), "2.0"); + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file /src/main/resources/no_parent_pom.xml"); + assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); + assertEquals(executionResult.getException().getMessage(), "Pom file /src/main/resources/no_parent_pom.xml does not have a parent"); + + Model pomModelAfterChange = getTransformedPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelAfterChange.getParent()); + + executionResult = pomChangeParent.clone().failIfNotPresent().execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + } + + @Test + public void noOpTest() throws IOException, XmlPullParserException { + Model pomModelBeforeChange = getOriginalPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelBeforeChange.getParent()); + + PomChangeParent pomChangeParent = new PomChangeParent("2.0").relative("/src/main/resources/no_parent_pom.xml").noOpIfNotPresent(); + + assertNull(pomChangeParent.getGroupId()); + assertNull(pomChangeParent.getArtifactId()); + assertEquals(pomChangeParent.getVersion(), "2.0"); + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file /src/main/resources/no_parent_pom.xml"); + assertNull(executionResult.getException()); + + Model pomModelAfterChange = getTransformedPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelAfterChange.getParent()); + } + + @Test + public void warnTest() throws IOException, XmlPullParserException { + Model pomModelBeforeChange = getOriginalPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelBeforeChange.getParent()); + + PomChangeParent pomChangeParent = new PomChangeParent("2.0").relative("/src/main/resources/no_parent_pom.xml").warnIfNotPresent(); + + assertNull(pomChangeParent.getGroupId()); + assertNull(pomChangeParent.getArtifactId()); + assertEquals(pomChangeParent.getVersion(), "2.0"); + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file /src/main/resources/no_parent_pom.xml"); + assertNull(executionResult.getException()); + assertEquals(executionResult.getWarnings().size(), 1); + assertEquals(executionResult.getWarnings().get(0).getClass(), TransformationOperationException.class); + assertEquals(executionResult.getWarnings().get(0).getMessage(), "Pom file /src/main/resources/no_parent_pom.xml does not have a parent"); + + Model pomModelAfterChange = getTransformedPomModel("/src/main/resources/no_parent_pom.xml"); + assertNull(pomModelAfterChange.getParent()); + } + + @Test + public void invalidOperationTest() throws IOException, XmlPullParserException { + // You have to either set the version only, or the group id AND artifact id AND version. + // Here only the group id is being set + PomChangeParent pomChangeParent = new PomChangeParent().setGroupId("com.test").relative("pom.xml"); + + assertEquals(pomChangeParent.getGroupId(), "com.test"); + assertNull(pomChangeParent.getArtifactId()); + assertNull(pomChangeParent.getVersion()); + + TOExecutionResult executionResult = pomChangeParent.execution(transformedAppFolder, transformationContext); + assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + assertEquals(pomChangeParent.getDescription(), "Change parent artifact in POM file pom.xml"); + assertEquals(executionResult.getException().getClass(), TransformationOperationException.class); + assertEquals(executionResult.getException().getMessage(), "Invalid POM parent transformation operation"); + + Model pomModelAfterChange = getTransformedPomModel("pom.xml"); + assertEquals(pomModelAfterChange.getParent().getGroupId(), "com.test"); + assertEquals(pomModelAfterChange.getParent().getArtifactId(), "foo-parent"); + assertEquals(pomModelAfterChange.getParent().getVersion(), "1.0"); + } + +} diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePluginTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePluginTest.java index 77188ae3..76931d00 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePluginTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/pom/PomRemovePluginTest.java @@ -4,7 +4,6 @@ import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; import org.apache.maven.model.Model; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.testng.Assert; import org.testng.annotations.Test; import org.xml.sax.SAXException; @@ -32,23 +31,23 @@ public void miscTest() throws CloneNotSupportedException { @Test public void pluginRemovedTest() throws IOException, XmlPullParserException { Model pomModelBeforeChange = getOriginalPomModel("pom.xml"); - Assert.assertEquals(pomModelBeforeChange.getBuild().getPlugins().size(), 1); - Assert.assertEquals(pomModelBeforeChange.getBuild().getPlugins().get(0).getGroupId(), "org.codehaus.mojo"); - Assert.assertEquals(pomModelBeforeChange.getBuild().getPlugins().get(0).getArtifactId(), "cobertura-maven-plugin"); + assertEquals(pomModelBeforeChange.getBuild().getPlugins().size(), 1); + assertEquals(pomModelBeforeChange.getBuild().getPlugins().get(0).getGroupId(), "org.codehaus.mojo"); + assertEquals(pomModelBeforeChange.getBuild().getPlugins().get(0).getArtifactId(), "cobertura-maven-plugin"); PomRemovePlugin pomRemovePlugin = new PomRemovePlugin("org.codehaus.mojo", "cobertura-maven-plugin").relative("pom.xml"); TOExecutionResult executionResult = pomRemovePlugin.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); Model pomModelAfterChange = getTransformedPomModel("pom.xml"); - Assert.assertEquals(pomModelAfterChange.getBuild().getPlugins().size(), 0); + assertEquals(pomModelAfterChange.getBuild().getPlugins().size(), 0); } @Test public void pluginNotPresentErrorTest() throws IOException { PomRemovePlugin pomRemovePlugin = new PomRemovePlugin("com.zoo", "zoo").relative("pom.xml"); TOExecutionResult executionResult = pomRemovePlugin.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); assertNotChangedFile("pom.xml"); } @@ -57,7 +56,7 @@ public void pluginNotPresentErrorTest() throws IOException { public void pluginNotPresentNoOpTest() throws IOException { PomRemovePlugin pomRemovePlugin = new PomRemovePlugin("com.zoo", "zoo").relative("pom.xml").noOpIfNotPresent(); TOExecutionResult executionResult = pomRemovePlugin.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); + assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); assertNotChangedFile("pom.xml"); } @@ -66,7 +65,7 @@ public void pluginNotPresentNoOpTest() throws IOException { public void pluginNotPresentWarnTest() throws IOException, XmlPullParserException, ParserConfigurationException, SAXException { PomRemovePlugin pomRemovePlugin = new PomRemovePlugin("com.zoo", "zoo").relative("pom.xml").warnIfNotPresent(); TOExecutionResult executionResult = pomRemovePlugin.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); + assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); assertEqualsXml("pom.xml"); } @@ -75,8 +74,8 @@ public void pluginNotPresentWarnTest() throws IOException, XmlPullParserExceptio public void fileDoesNotExistTest() { PomRemovePlugin pomRemovePlugin = new PomRemovePlugin("com.foo", "boo").relative("application_zeta.properties"); TOExecutionResult executionResult = pomRemovePlugin.execution(transformedAppFolder, transformationContext); - Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); - Assert.assertEquals(executionResult.getException().getClass(), FileNotFoundException.class); + assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); + assertEquals(executionResult.getException().getClass(), FileNotFoundException.class); } } \ No newline at end of file diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/InsertTextTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/InsertTextTest.java index 6f689d42..2501d2d5 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/InsertTextTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/InsertTextTest.java @@ -18,12 +18,12 @@ */ public class InsertTextTest extends TransformationUtilityTestHelper { - private URL billy = getClass().getResource("/billy.yaml"); + private URL billyURL = getClass().getResource("/billy.yaml"); @Test public void noOpRegexTest() throws IOException { - InsertText insertText = new InsertText(billy).relative("src/main/resources/dogs.yaml") - .setRegex(" breed: vira-lata").setInsertionMode(InsertText.InsertionMode.REGEX_FIRST); + InsertText insertText = new InsertText(billyURL).relative("src/main/resources/dogs.yaml").setRegex(" breed: vira-lata").setInsertionMode(InsertText.InsertionMode.REGEX_FIRST); + Assert.assertEquals(insertText.getDescription(), "Insert text from " + billyURL.getFile() + " to src/main/resources/dogs.yaml"); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); @@ -32,8 +32,7 @@ public void noOpRegexTest() throws IOException { @Test public void noOpLineNumberTest() throws IOException { - InsertText insertText = new InsertText(billy).relative("src/main/resources/dogs.yaml") - .setLineNumber(123).setInsertionMode(InsertText.InsertionMode.LINE_NUMBER); + InsertText insertText = new InsertText().setTextFileUrl(billyURL).relative("src/main/resources/dogs.yaml").setLineNumber(123).setInsertionMode(InsertText.InsertionMode.LINE_NUMBER); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.NO_OP); @@ -42,8 +41,7 @@ public void noOpLineNumberTest() throws IOException { @Test public void insertLineNumberTest() throws IOException { - InsertText insertText = new InsertText(billy).relative("src/main/resources/dogs.yaml") - .setInsertionMode(InsertText.InsertionMode.LINE_NUMBER).setLineNumber(1); + InsertText insertText = new InsertText(billyURL, 1).relative("src/main/resources/dogs.yaml").setInsertionMode(InsertText.InsertionMode.LINE_NUMBER); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); @@ -61,8 +59,7 @@ public void insertLineNumberTest() throws IOException { @Test public void insertFirstRegexTest() throws IOException { - InsertText insertText = new InsertText(billy).relative("src/main/resources/dogs.yaml") - .setRegex(" breed: poodle").setInsertionMode(InsertText.InsertionMode.REGEX_FIRST); + InsertText insertText = new InsertText(billyURL, " breed: poodle").relative("src/main/resources/dogs.yaml").setInsertionMode(InsertText.InsertionMode.REGEX_FIRST); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); @@ -82,8 +79,7 @@ public void insertFirstRegexTest() throws IOException { public void insertAllRegexTest() throws IOException { URL changeDogs = getClass().getResource("/changeDogs.yaml"); - InsertText insertText = new InsertText(changeDogs).relative("src/main/resources/dogs.yaml") - .setRegex(" breed: .*").setInsertionMode(InsertText.InsertionMode.REGEX_ALL); + InsertText insertText = new InsertText(changeDogs).relative("src/main/resources/dogs.yaml").setRegex(" breed: .*").setInsertionMode(InsertText.InsertionMode.REGEX_ALL); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); @@ -111,7 +107,7 @@ public void insertAllRegexTest() throws IOException { @Test public void insertConcatTest() throws IOException { - InsertText insertText = new InsertText(billy).relative("src/main/resources/dogs.yaml"); + InsertText insertText = new InsertText(billyURL).relative("src/main/resources/dogs.yaml"); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); @@ -129,10 +125,34 @@ public void insertConcatTest() throws IOException { @Test public void fileDoesNotExistTest() { - InsertText insertText = new InsertText(billy).relative("caes.yaml"); + InsertText insertText = new InsertText(billyURL).relative("caes.yaml"); TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR); Assert.assertEquals(executionResult.getException().getClass(), FileNotFoundException.class); } + @Test + public void cloneTest() throws IOException { + InsertText insertText = new InsertText(billyURL, " breed: poodle").relative("src/main/resources/dogs.yaml").setInsertionMode(InsertText.InsertionMode.REGEX_FIRST); + TOExecutionResult executionResult = insertText.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + assertChangedFile("src/main/resources/dogs.yaml"); + assertLineCount("src/main/resources/dogs.yaml", 3); + Map dogs = (Map) getObjectFromYaml("src/main/resources/dogs.yaml"); + Assert.assertEquals(dogs.size(), 3); + Dog dog = dogs.get("Billy"); + Assert.assertEquals(dog.getName(), "Billy"); + Assert.assertEquals(dog.getBreed(), "lab"); + + executionResult = insertText.clone().execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); + assertChangedFile("src/main/resources/dogs.yaml"); + assertLineCount("src/main/resources/dogs.yaml", 3); + dogs = (Map) getObjectFromYaml("src/main/resources/dogs.yaml"); + Assert.assertEquals(dogs.size(), 3); + dog = dogs.get("Billy"); + Assert.assertEquals(dog.getName(), "Billy"); + Assert.assertEquals(dog.getBreed(), "lab"); + } + } diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/RemoveLineTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/RemoveLineTest.java index ae2f5bcd..99ba85f7 100644 --- a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/RemoveLineTest.java +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/operations/text/RemoveLineTest.java @@ -2,12 +2,10 @@ import com.paypal.butterfly.extensions.api.TOExecutionResult; import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; -import com.paypal.butterfly.utilities.operations.properties.RemoveProperty; import org.testng.Assert; import org.testng.annotations.Test; import java.io.IOException; -import java.net.URISyntaxException; import java.util.Properties; /** diff --git a/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/xml/XmlElementTest.java b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/xml/XmlElementTest.java new file mode 100644 index 00000000..14e2e4b6 --- /dev/null +++ b/butterfly-utilities/src/test/java/com/paypal/butterfly/utilities/xml/XmlElementTest.java @@ -0,0 +1,68 @@ +package com.paypal.butterfly.utilities.xml; + +import com.paypal.butterfly.extensions.api.TUExecutionResult; +import com.paypal.butterfly.extensions.api.exception.TransformationUtilityException; +import com.paypal.butterfly.utilities.TransformationUtilityTestHelper; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * Unit tests for {@link XmlElement} + * + * @author facarvalho + */ +public class XmlElementTest extends TransformationUtilityTestHelper { + + @Test + public void elementTest() { + XmlElement xmlElement = new XmlElement("project.modelVersion").relative("pom.xml"); + TUExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getValue(), "4.0.0"); + Assert.assertEquals(xmlElement.getDescription(), "Retrieve the value of element project.modelVersion in XML file pom.xml"); + } + + @Test + public void attributeTest() { + XmlElement xmlElement = new XmlElement().setXmlElement("project").setAttribute("xmlns").relative("pom.xml"); + TUExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.VALUE); + Assert.assertNotNull(executionResult.getValue()); + Assert.assertEquals(executionResult.getValue(), "http://maven.apache.org/POM/4.0.0"); + Assert.assertEquals(xmlElement.getDescription(), "Retrieve the value of element project in XML file pom.xml"); + } + + @Test + public void inexistentElementTest() { + XmlElement xmlElement = new XmlElement("project.blah").relative("pom.xml"); + TUExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.NULL); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(xmlElement.getDescription(), "Retrieve the value of element project.blah in XML file pom.xml"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void inexistentAttributeTest() { + XmlElement xmlElement = new XmlElement("project").setAttribute("blah").relative("pom.xml"); + TUExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.NULL); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(xmlElement.getDescription(), "Retrieve the value of element project in XML file pom.xml"); + Assert.assertNull(executionResult.getException()); + } + + @Test + public void noXmlTest() { + XmlElement xmlElement = new XmlElement().setXmlElement("project").relative("src/main/resources/dogs.yaml"); + TUExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext); + Assert.assertEquals(executionResult.getType(), TUExecutionResult.Type.ERROR); + Assert.assertNull(executionResult.getValue()); + Assert.assertEquals(xmlElement.getDescription(), "Retrieve the value of element project in XML file src/main/resources/dogs.yaml"); + Assert.assertNotNull(executionResult.getException()); + Assert.assertEquals(executionResult.getException().getClass(), TransformationUtilityException.class); + Assert.assertEquals(executionResult.getException().getMessage(), "File content could not be parsed properly in XML format"); + } + +} diff --git a/butterfly-utilities/src/test/resources/test-app/blah/bli b/butterfly-utilities/src/test/resources/test-app/blah/bli new file mode 100644 index 00000000..7a2c6675 --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/blah/bli @@ -0,0 +1 @@ +bli \ No newline at end of file diff --git a/butterfly-utilities/src/test/resources/test-app/foo.xml b/butterfly-utilities/src/test/resources/test-app/foo.xml new file mode 100644 index 00000000..65fc81e3 --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/foo.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/butterfly-utilities/src/test/resources/test-app/src/main/java/com/testapp/NoCompilationUnits.java b/butterfly-utilities/src/test/resources/test-app/src/main/java/com/testapp/NoCompilationUnits.java new file mode 100644 index 00000000..e69de29b diff --git a/butterfly-utilities/src/test/resources/test-app/src/main/resources/copy_of_web.xml b/butterfly-utilities/src/test/resources/test-app/src/main/resources/copy_of_web.xml new file mode 100644 index 00000000..739f20df --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/src/main/resources/copy_of_web.xml @@ -0,0 +1,31 @@ + + + ${artifactId} + + + + + requestContextFilter + org.springframework.web.filter.RequestContextFilter + + + + contextConfigLocation + /WEB-INF/spring/context.xml + + + + contextClass + org.springframework.web.context.support.XmlWebApplicationContext + + + + requestContextFilter + * + REQUEST + INCLUDE + FORWARD + + diff --git a/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/dogs.yaml b/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/dogs.yaml new file mode 100644 index 00000000..46499d0d --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/dogs.yaml @@ -0,0 +1,6 @@ +Toby: !sample.code.Dog + name: Toby + breed: poodle +Mustache: !sample.code.Dog + name: Mustache + breed: pit bull diff --git a/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/testapp b/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/testapp new file mode 100644 index 00000000..e877b85d --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/src/main/resources/more_yaml/testapp @@ -0,0 +1,2 @@ +// This file was included to intentionally be named the same as an existent folder (src/main/java/com/testapp) to test +// searching folders based on a specific name. This file should not be found in that test, but the folder of same name should. \ No newline at end of file diff --git a/butterfly-utilities/src/test/resources/test-app/src/main/resources/no_parent_pom.xml b/butterfly-utilities/src/test/resources/test-app/src/main/resources/no_parent_pom.xml new file mode 100644 index 00000000..89106bb5 --- /dev/null +++ b/butterfly-utilities/src/test/resources/test-app/src/main/resources/no_parent_pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + + + + foo + + + + xmlunit + xmlunit + 1.5 + + + org.apache.commons + commons-lang3 + 3.4 + + + org.testng + testng + test + + + org.springframework.boot + spring-boot-dependencies + pom + + + junit + junit + false + + + commons-io + commons-io + true + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + + + diff --git a/docs/Extension-development-guide.md b/docs/Extension-development-guide.md index cdb65e5e..7139681d 100644 --- a/docs/Extension-development-guide.md +++ b/docs/Extension-development-guide.md @@ -74,5 +74,5 @@ When developing a Butterfly extension, it is very helpful to be be able to run i Refer to the following javadocs to develop your own Butterfly extension: -1. [butterfly-extensions-api](https://paypal.github.io/butterfly/javadocs/2.0.0/butterfly-extensions-api/index.html): API component to be used by Butterfly extensions when providing their transformation and upgrade templates. -1. [butterfly-utilities](https://paypal.github.io/butterfly/javadocs/2.0.0/butterfly-utilities/index.html): multiple types of ready-to-use transformation utilities. +1. [butterfly-extensions-api](https://paypal.github.io/butterfly/javadocs/2.2.0/butterfly-extensions-api/index.html): API component to be used by Butterfly extensions when providing their transformation and upgrade templates. +1. [butterfly-utilities](https://paypal.github.io/butterfly/javadocs/2.2.0/butterfly-utilities/index.html): multiple types of ready-to-use transformation utilities. diff --git a/docs/Installing-Butterfly.md b/docs/Installing-Butterfly.md index 09f0158d..4035d176 100644 --- a/docs/Installing-Butterfly.md +++ b/docs/Installing-Butterfly.md @@ -7,7 +7,7 @@ Before installing Butterfly, make sure you have Java 7, or newer, installed (run ## Installing Butterfly -1. Download and extract [butterfly-cli-package.zip](https://repo1.maven.org/maven2/com/paypal/butterfly/butterfly-cli-package/2.0.0/butterfly-cli-package-2.0.0.zip) file +1. Download and extract [butterfly-cli-package.zip](https://repo1.maven.org/maven2/com/paypal/butterfly/butterfly-cli-package/2.2.0/butterfly-cli-package-2.2.0.zip) file 1. Cd to the `butterfly` folder and run `butterfly`. If you see its help, Butterfly has been installed properly 1. Run `butterfly –l` and notice that you have no Butterfly extensions at this point diff --git a/docs/README.md b/docs/README.md index b904a491..a67caf9d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,20 +10,20 @@ Butterfly is an application code transformation tool, and commonly it is used to Application changes, upgrades and migrations are usually complex, time-consuming and error prone. Therefore, they are also extremely expensive in the short term, and might even cause worse problems (and much more expensive) in long term. -# The benefits of transformation automation +# Transformation automation By automating application source code transformations, upgrades and migrations, overall development experience and software maintenance are improved. In addition to that, for a given organization, the number of applications in the latest version of a particular framework is increased, and the upgrade and migration processes are simplified. # Common use cases -#### Automated application framework migrations +## Automated application framework migrations An organization has multiple applications developed using a particular framework as foundation. One day that framework becomes obsolete, and it is replaced by a brand new one, more modern. At this point, it is difficult and expensive to ensure all applications will **migrate** to the new framework. This organization could use Butterfly, combined with its own Butterfly extension, to automate application migrations. -#### Automated application framework upgrades +## Automated application framework upgrades An organization has multiple applications developed using a particular framework as foundation. As newer framework versions are available, it is difficult and expensive to ensure all applications will **upgrade** to the latest framework version. @@ -31,7 +31,7 @@ This organization could use Butterfly, combined with its own Butterfly extension ![](img/transformation_templates_simple.png) -#### Automated application changes +## Automated application changes An organization has multiple applications developed using a particular framework as foundation. One day, a security issue is found affecting all applications, and the solution demands a code or configuration change in each application. In this situation it would be difficult and expensive to ensure all applications **apply those changes** correctly. diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 0affc58e..2025fb96 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,19 +1,37 @@ # Release notes -## 2.1.0-RELEASE +## 2.2.0 + +#### Release date +January 3rd, 2018. + +#### New features and enhancements +* [73 - Include support to search folders as well in FindFiles](https://github.com/paypal/butterfly/issues/73) +* [68 - Improve TU and TO clone operations](https://github.com/paypal/butterfly/issues/68) +* [64 - Improve logging](https://github.com/paypal/butterfly/issues/64) +* [53 - Implement continuous delivery through automated deployment via Travis CI](https://github.com/paypal/butterfly/issues/53) +* [37 - Leverage File.createTempFile to create temporary files](https://github.com/paypal/butterfly/issues/37) +* [24 - Address Codacy static code analysis issues](https://github.com/paypal/butterfly/issues/24) +* [15 - Add unit tests to utilities project to make sure at least 70% code coverage](https://github.com/paypal/butterfly/issues/15) + +#### Bug fixes +* [67 - ReadableByteChannel in ApplyFile and ApplyZip TOs needs to be closed](https://github.com/paypal/butterfly/issues/67) +* [70 - TransformationUtility condition object doesn't refer to the correct execution file](https://github.com/paypal/butterfly/issues/70) + +## 2.1.0 #### Release date December 2nd, 2017. #### New features and enhancements -1. [49 - Add condition that checks if a regex matches any line in a file](https://github.com/paypal/butterfly/issues/49) -1. [27 - Print extension name and version during Butterfly execution](https://github.com/paypal/butterfly/issues/27) +* [49 - Add condition that checks if a regex matches any line in a file](https://github.com/paypal/butterfly/issues/49) +* [27 - Print extension name and version during Butterfly execution](https://github.com/paypal/butterfly/issues/27) #### Bug fixes -1. [2 - RelatedArtifacts TU fails to report accurately an error when a pom file is not well formed](https://github.com/paypal/butterfly/issues/2) +* [2 - RelatedArtifacts TU fails to report accurately an error when a pom file is not well formed](https://github.com/paypal/butterfly/issues/2) -## 2.0.0-RELEASE +## 2.0.0 #### Release date October 17th, 2017. diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-frame.html new file mode 100644 index 00000000..faef9a44 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-frame.html @@ -0,0 +1,64 @@ + + + + + + +All Classes (butterfly-extensions-api 2.2.0 API) + + + + + +

All Classes

+
+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-noframe.html b/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-noframe.html new file mode 100644 index 00000000..e14cdecd --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/allclasses-noframe.html @@ -0,0 +1,64 @@ + + + + + + +All Classes (butterfly-extensions-api 2.2.0 API) + + + + + +

All Classes

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.html new file mode 100644 index 00000000..20527706 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ContextAttributeRetriever.html @@ -0,0 +1,420 @@ + + + + + + +ContextAttributeRetriever (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class ContextAttributeRetriever<T>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ContextAttributeRetriever<T>
    +extends TransformationUtility
    +
    Transformation utility to fetch transformation context attributes post + transformation time, since they are always set + during transformation time. +
    + An example of usage of this feature would be implementing + TransformationTemplate.getApplicationName(). The + application name mostly will only be known after the transformation + has began, but it might be necessary to know it outside of transformation + time (after it). For example, the metrics system needs to know it, as + seen in TransformationMetrics.getApplicationName().
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ContextAttributeRetriever

        +
        public ContextAttributeRetriever()
        +
      • +
      + + + +
        +
      • +

        ContextAttributeRetriever

        +
        public ContextAttributeRetriever(String attributeName)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setAttributeName

        +
        public void setAttributeName(String attributeName)
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        getAttributeValue

        +
        public T getAttributeValue()
        +
        Returns the value of the transformation context attribute + specified earlier. If the attribute value is null, null is returned. + If this method is called prior to the execution of this transformation + utility, an IllegalStateException is thrown.
        +
        +
        Returns:
        +
        the value of the transformation context attribute specified earlier
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/DoubleCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/DoubleCondition.html new file mode 100644 index 00000000..56ecdece --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/DoubleCondition.html @@ -0,0 +1,467 @@ + + + + + + +DoubleCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class DoubleCondition<T extends DoubleCondition>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public abstract class DoubleCondition<T extends DoubleCondition>
    +extends UtilityCondition<T>
    +
    Transformation utility condition to determine if a transformation utility + should be executed or not, based on a two files criteria. Every + DoubleUtilityCondition subclass result type must always + be boolean. The criteria to this type of condition + is based on two files (when comparing if two XML files are equal + for example). For conditions + based on evaluating a single file see SingleCondition. + For conditions based on multiple files see MultipleConditions +
    + Important: it returns true if both files don't exist, + and it returns false if only one of them exists.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    SingleCondition, +MultipleConditions
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DoubleCondition

        +
        public DoubleCondition()
        +
        Condition to determine if a transformation utility + should be executed or not. Every + DoubleUtilityCondition subclass result type must always + be boolean. The criteria to this type of condition + is based on two files (when comparing if two XML files are equal + for example)
        +
      • +
      + + + +
        +
      • +

        DoubleCondition

        +
        public DoubleCondition(String attribute)
        +
        Condition to determine if a transformation utility + should be executed or not. Every + DoubleUtilityCondition subclass result type must always + be boolean. The criteria to this type of condition + is based on two files (when comparing if two XML files are equal + for example)
        +
        +
        Parameters:
        +
        attribute - the name of the transformation context attribute + that refers to the file to be compared against the baseline file
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAttribute

        +
        public String getAttribute()
        +
        Return the name of the transformation context attribute + that refers to the file to be compared against the + baseline file
        +
        +
        Returns:
        +
        the name of the transformation context attribute + that refers to the file to be compared against the + baseline file
        +
        +
      • +
      + + + +
        +
      • +

        setAttribute

        +
        public T setAttribute(String attribute)
        +
        Set the name of the transformation context attribute + that refers to the file to be compared against the + baseline file, which is set by regular TransformationUtility + methods, like TransformationUtility.relative(String) or TransformationUtility.absolute(String)
        +
        +
        Parameters:
        +
        attribute - the name of the transformation context attribute + that refers to the file to be compared against the baseline file
        +
        Returns:
        +
        this utility condition instance
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<T extends DoubleCondition>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        compare

        +
        protected abstract boolean compare(File baselineFile,
        +                                   File comparisonFile)
        +
        Returns true only if the compared files meet the comparison + criteria established and implemented by the subclass
        +
        +
        Parameters:
        +
        baselineFile - the baseline file used for comparison
        +
        comparisonFile - the file to be compared against the baseline file
        +
        Returns:
        +
        this utility condition instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ExecutionResult.html new file mode 100644 index 00000000..f6d899af --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/ExecutionResult.html @@ -0,0 +1,490 @@ + + + + + + +ExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class ExecutionResult<S,R,T>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.ExecutionResult<S,R,T>
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + +
        +
      • +

        setType

        +
        protected R setType(T type)
        +
      • +
      + + + +
        +
      • +

        setDetails

        +
        public R setDetails(String details)
        +
      • +
      + + + +
        +
      • +

        setException

        +
        protected R setException(Exception exception)
        +
        Set the exception associated with this result. + This exception can only be set if the result type allows it. + If that is not the case, an IllegalArgumentException + will be thrown
        +
        +
        Parameters:
        +
        exception - associated with the execution result
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        addWarning

        +
        public R addWarning(Exception warning)
        +
        Add a new warning associated with this result. + Warnings never imply the result is non-successful, + only errors do
        +
        +
        Parameters:
        +
        warning - the warning to be added
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        changeTypeOnWarning

        +
        protected abstract void changeTypeOnWarning()
        +
        This method is used to notify subclasses that + the result type might have to change due to the + addition of a warning. +
        + Usually it should change from a successful type to a + warning type. In case the result is an error kind of + type, then it should remain as is.
        +
      • +
      + + + +
        +
      • +

        isExceptionType

        +
        protected abstract boolean isExceptionType()
        +
        Returns true if this result type is supposed to contain an exception, + such ERROR
        +
        +
        Returns:
        +
        true only if this result type is supposed to contain an exception
        +
        +
      • +
      + + + +
        +
      • +

        dependencyFailureCheck

        +
        protected abstract boolean dependencyFailureCheck()
        +
        Returns true if this result type falls to the dependency failure criteria, + which is stated in TransformationUtility.dependsOn(String...)
        +
        +
        Returns:
        +
        true only if this result type falls to the dependency failure criteria
        +
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        public S getSource()
        +
        Returns the source of this result, which could be for example + a transformation utility instance or a transformation + operation instance
        +
        +
        Returns:
        +
        the source of this result
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public T getType()
        +
        Returns the result type
        +
        +
        Returns:
        +
        the result type
        +
        +
      • +
      + + + +
        +
      • +

        getDetails

        +
        public String getDetails()
        +
        Return the result details
        +
        +
        Returns:
        +
        the result details
        +
        +
      • +
      + + + +
        +
      • +

        getException

        +
        public Exception getException()
        +
        Return the exception object in case of types such as ERROR
        +
        +
        Returns:
        +
        the exception object in case of types such as ERROR
        +
        +
      • +
      + + + +
        +
      • +

        getWarnings

        +
        public List<Exception> getWarnings()
        +
        Return a list of warnings associated with this result. + Warnings never imply the result is non-successful, only errors do
        +
        +
        Returns:
        +
        a list of warnings associated with this result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/Extension.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/Extension.html new file mode 100644 index 00000000..c3ed45d0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/Extension.html @@ -0,0 +1,419 @@ + + + + + + +Extension (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class Extension<E>

+
+
+ +
+
    +
  • +
    +
    +
    public abstract class Extension<E>
    +extends Object
    +
    A Butterfly third-party extension. It provides custom + transformation templates and validations
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Extension

        +
        public Extension()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        protected final E add(Class<? extends TransformationTemplate> templateClass)
        +
        Adds a new transformation template class to the set
        +
        +
        Parameters:
        +
        templateClass - the transformation template class to be added to the extension
        +
        Returns:
        +
        this extension
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public abstract String getDescription()
        +
        Returns the extension description
        +
        +
        Returns:
        +
        the extension description
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public abstract String getVersion()
        +
        Returns the extension version
        +
        +
        Returns:
        +
        the extension version
        +
        +
      • +
      + + + +
        +
      • +

        getTemplateClasses

        +
        public final List<Class<? extends TransformationTemplate>> getTemplateClasses()
        +
        Returns a read-only set containing all transformation template classes
        +
        +
        Returns:
        +
        a read-only set containing all transformation template classes
        +
        +
      • +
      + + + +
        +
      • +

        automaticResolution

        +
        public Class<? extends TransformationTemplate> automaticResolution(File applicationFolder)
        +                                                            throws TemplateResolutionException
        +
        Butterfly might be able to automatically identify, based on the application + content, the most applicable transformation template to transform it. + If no template applies to the application content, a TemplateResolutionException + is thrown explaining the reason why no template could be chosen.
        +
        +
        Parameters:
        +
        applicationFolder - the folder where the code of the application to be transformed is
        +
        Returns:
        +
        the chosen transformation template
        +
        Throws:
        +
        TemplateResolutionException - if no template applies
        +
        +
      • +
      + + + +
        +
      • +

        getRootPomFile

        +
        protected org.apache.maven.model.Model getRootPomFile(File folder)
        +
        This is a convenience method in case the Extension subclass wants to implement its + automaticResolution(File) method based on one or more Maven pom files
        +
        +
        Parameters:
        +
        folder - the folder where the pom.xml file would be
        +
        Returns:
        +
        the Model object related to the pom.xml file under folder, or null, if that file does + not exist, or any error happens when trying to read and parse it
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/FilterFiles.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/FilterFiles.html new file mode 100644 index 00000000..eb49168c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/FilterFiles.html @@ -0,0 +1,542 @@ + + + + + + +FilterFiles (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class FilterFiles

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FilterFiles

        +
        public FilterFiles()
        +
        Utility to filter a list of files based on a given + SingleCondition, + returning in a sub-list of files
        +
      • +
      + + + +
        +
      • +

        FilterFiles

        +
        public FilterFiles(SingleCondition conditionTemplate)
        +
        Utility to filter a list of files based on a given + SingleCondition, + returning in a sub-list of files
        +
        +
        Parameters:
        +
        conditionTemplate - the single condition template to be evaluated against all files
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setFiles

        +
        public FilterFiles setFiles(String... filesAttributes)
        +
        Sets one or more transformation context attributes that hold list of Files + which the single condition should be evaluated against. + If more than one attribute is specified, all list of files will be + combined into a single one
        +
        +
        Parameters:
        +
        filesAttributes - one or more transformation context attributes that hold list + of Files which the condition should be evaluated against
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setConditionTemplate

        +
        public FilterFiles setConditionTemplate(SingleCondition conditionTemplate)
        +
        Set the single condition template to be evaluated against all files
        +
        +
        Parameters:
        +
        conditionTemplate - the single condition template to be evaluated against all files
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setName

        +
        protected FilterFiles setName(String name)
        +
        Description copied from class: TransformationUtility
        +
        Set this transformation utility instance name. + If not set, a default name will be assigned at the + time it is added to a parent.
        +
        +
        Overrides:
        +
        setName in class TransformationUtility<FilterFiles>
        +
        Parameters:
        +
        name - transformation utility instance name
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<FilterFiles>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        getFilesAttributes

        +
        public String[] getFilesAttributes()
        +
        Return an array containing the name of transformation context attributes + that hold the list of files to be filtered
        +
        +
        Returns:
        +
        an array containing the name of transformation context attributes + that hold the list of files to be filtered
        +
        +
      • +
      + + + +
        +
      • +

        getConditionTemplate

        +
        public SingleCondition getConditionTemplate()
        +
        Return the single condition template to be evaluated against all files
        +
        +
        Returns:
        +
        the single condition template to be evaluated against all files
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<FilterFiles>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        newConditionInstance

        +
        public SingleCondition newConditionInstance(File transformedAppFolder,
        +                                            File file)
        +
        Creates a new single condition instance copying from this current + object, but setting the file it should perform against based + on the input parameters
        +
        +
        Parameters:
        +
        transformedAppFolder - the transformed application folder
        +
        file - the actual file to be performed against
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.Mode.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.Mode.html new file mode 100644 index 00000000..d8922909 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.Mode.html @@ -0,0 +1,355 @@ + + + + + + +MultipleConditions.Mode (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Enum MultipleConditions.Mode

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static MultipleConditions.Mode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (MultipleConditions.Mode c : MultipleConditions.Mode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static MultipleConditions.Mode valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.html new file mode 100644 index 00000000..bcc57d47 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleConditions.html @@ -0,0 +1,616 @@ + + + + + + +MultipleConditions (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class MultipleConditions

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class MultipleConditions
    +extends UtilityCondition<MultipleConditions>
    +
    Transformation utility condition to determine if a transformation utility should be executed or not, + based on a multiple files criteria. + It performs condition instances based on a SingleCondition template against multiple files, + returning true if at least one file meets the condition (default mode). + There is an alternative mode where all files need to meet the + evaluation condition to result in true. For conditions + based on comparing two files see DoubleCondition. + For conditions based on evaluating a single file see SingleCondition +
    + Note 1: if an evaluation against a specific file fails for any reason, then the + overall evaluation will be interrupted and result also in a failure. + Note 2: if the utility condition object (to be executed against the specified files) + has conditions, they will be ignored.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    setMode(Mode), +SingleCondition, +DoubleCondition
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MultipleConditions

        +
        public MultipleConditions(SingleCondition conditionTemplate)
        +
        Perform one transformation utility condition against multiple files, + returning true if at least one file meets the condition (default mode). + There is an alternative mode where all files need to meet the + evaluation condition to result in true. For conditions + based on comparing two files see DoubleCondition. + For conditions based on evaluating a single file see MultipleConditions
        +
        +
        Parameters:
        +
        conditionTemplate - the utility condition template used to create conditions, + used to be evaluated against the list of files
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setMode

        +
        public MultipleConditions setMode(MultipleConditions.Mode mode)
        +
        Set the evaluation mode. The default mode is "at least one", + which means the result will be true if at least one file + meets the condition. The alternative mode is "all", which + requires all files to meet the evaluation condition to result + in true.
        +
        +
        Parameters:
        +
        mode - the evaluation mode
        +
        Returns:
        +
        this utility condition instance
        +
        +
      • +
      + + + +
        +
      • +

        setFiles

        +
        public MultipleConditions setFiles(String... filesAttributes)
        +
        Sets one or more transformation context attributes that hold list of Files + which the condition should perform against. + If more than one attribute is specified, all list of files will be + combined into a single one.
        +
        +
        Parameters:
        +
        filesAttributes - one or more transformation context attributes that hold list + of Files which the condition should perform + against
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setConditionTemplate

        +
        public MultipleConditions setConditionTemplate(SingleCondition conditionTemplate)
        +
        Set the utility condition template used to create conditions + to be evaluated against the list of files
        +
        +
        Parameters:
        +
        conditionTemplate - the utility condition template used to create conditions + to be evaluated against the list of files
        +
        Returns:
        +
        this utility condition instance
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getMode

        +
        public MultipleConditions.Mode getMode()
        +
        Return the evaluation mode
        +
        +
        Returns:
        +
        the evaluation mode
        +
        +
      • +
      + + + +
        +
      • +

        getFilesAttributes

        +
        public String[] getFilesAttributes()
        +
        A copy of the array of transformation context attributes that hold list of Files + which the condition should perform against.
        +
        +
        Returns:
        +
        a copy of the array of transformation context attributes that hold list of Files + which the condition should perform against
        +
        +
      • +
      + + + +
        +
      • +

        getConditionTemplate

        +
        public SingleCondition getConditionTemplate()
        +
        Return the condition template
        +
        +
        Returns:
        +
        the condition template
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<MultipleConditions>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<MultipleConditions>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        newConditionInstance

        +
        public UtilityCondition newConditionInstance(File transformedAppFolder,
        +                                             File file)
        +
        Creates a new condition instance copying from this current + object, but setting the file it should perform against based + on the input parameters
        +
        +
        Parameters:
        +
        transformedAppFolder - the transformed application folder
        +
        file - the actual file to be performed against
        +
        Returns:
        +
        the new utility condition created based on this instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleOperations.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleOperations.html new file mode 100644 index 00000000..75beba90 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/MultipleOperations.html @@ -0,0 +1,639 @@ + + + + + + +MultipleOperations (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class MultipleOperations

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.TransformationUtilityParent, Cloneable
    +
    +
    +
    +
    public class MultipleOperations
    +extends TransformationUtility<MultipleOperations>
    +implements com.paypal.butterfly.extensions.api.TransformationUtilityParent
    +
    Transformation utility to perform multiple transformation operations. Multiple transformation operations + are defined based on an operation template and two other factors, that could be applied + exclusively or together. They are: +
      +
    1. Multiple files: multiple operations are defined based on multiple files specified as a + list, held as one or more transformation context attribute, and set via setFiles(String...)
    2. +
    3. Multiple configurations: multiple operations are defined based on different configurations, + set via setProperties(String, String)
    4. +
    +
    + In other words, there are two possible ways to define multiple operations: multiple + files, or multiple configurations (different property values). It is also possible + to combine both, resulting in multiple operations to be executed against multiple files and + with multiple configurations. +
    + Important: when running against multiple files, any path set to this operation, + either relative or absolute, will be ignored, and set later at transformation time based on + the dynamically set multiple files. When running with multiple configurations, the properties set + during transformation time will override any value that could have been set during definition time
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MultipleOperations

        +
        public MultipleOperations()
        +
        Utility to perform multiple transformation operations. Multiple transformation operations + are defined based on an operation template and two other factors, that could be applied + exclusively or together. They are: +
          +
        1. Multiple files: multiple operations are defined based on multiple files specified as a + list, held as one or more transformation context attribute, and set via setFiles(String...)
        2. +
        3. Multiple configurations: multiple operations are defined based on different configurations, + set via setProperties(String, String)
        4. +
        +
        + In other words, there are two possible ways to define multiple operations: multiple + files, or multiple configurations (different property values). It is also possible + to combine both, resulting in multiple operations to be executed against multiple files and + with multiple configurations. +
        + Important: when running against multiple files, any path set to this operation, + either relative or absolute, will be ignored, and set later at transformation time based on + the dynamically set multiple files. When running with multiple configurations, the properties set + during transformation time will override any value that could have been set during definition time
        +
      • +
      + + + +
        +
      • +

        MultipleOperations

        +
        public MultipleOperations(TransformationOperation templateOperation)
        +
        Utility to perform multiple transformation operations. Multiple transformation operations + are defined based on an operation template and two other factors, that could be applied + exclusively or together. They are: +
          +
        1. Multiple files: multiple operations are defined based on multiple files specified as a + list, held as one or more transformation context attribute, and set via setFiles(String...)
        2. +
        3. Multiple configurations: multiple operations are defined based on different configurations, + set via setProperties(String, String)
        4. +
        +
        + In other words, there are two possible ways to define multiple operations: multiple + files, or multiple configurations (different property values). It is also possible + to combine both, resulting in multiple operations to be executed against multiple files and + with multiple configurations. +
        + Important: when running against multiple files, any path set to this operation, + either relative or absolute, will be ignored, and set later at transformation time based on + the dynamically set multiple files. When running with multiple configurations, the properties set + during transformation time will override any value that could have been set during definition time
        +
        +
        Parameters:
        +
        templateOperation - a template of transformation operation to be performed + against all specified files
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setFiles

        +
        public MultipleOperations setFiles(String... filesAttributes)
        +
        Sets one or more transformation context attributes that hold list of Files + which the transformation operations should perform against. + If more than one attribute is specified, all list of files will be + combined into a single one
        +
        +
        Parameters:
        +
        filesAttributes - one or more transformation context attributes that hold list + of Files which the transformation operation should perform + against
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setProperties

        +
        public final MultipleOperations setProperties(String propertyName,
        +                                              String propertyAttribute)
        +
        This setter is similar to TransformationUtility.set(String, String), however it is more powerful, because + it allows setting, during transformation time, different properties values for each operation of a + MultipleOperations. +
        + That being said, calling this method will only make a difference if this operation is executed as the + template operation for a multiple operations utility. That usually can be done by adding it to a + transformation template via TransformationTemplate.addMultiple(TransformationOperation, String...)
        +
        +
        Parameters:
        +
        propertyName - the operation Java bean property name to be set during transformation time
        +
        propertyAttribute - the name of the transformation context attribute that holds a Set of + values to be each set individually (as the property value) to each operation of + a set of multiple operations. These values are set right before execution. If + the transformation context attribute value is not a Set, then a + TransformationUtilityException + will be thrown right before execution
        +
        Returns:
        +
        this instance
        +
        +
      • +
      + + + +
        +
      • +

        setOperationTemplate

        +
        public MultipleOperations setOperationTemplate(TransformationOperation templateOperation)
        +
        Sets the template of transformation operation to be performed against all specified files. +
        + Important: any path set to this operation, either relative + or absolute, will be ignored, and set later at transformation time based on + the dynamically set multiple files
        +
        +
        Parameters:
        +
        templateOperation - the template of transformation operation to be performed against + all specified files
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getFilesAttributes

        +
        public String[] getFilesAttributes()
        +
        Return an array containing the name of transformation context attributes + that hold the list of files the operations should be performed against
        +
        +
        Returns:
        +
        an array containing the name of transformation context attributes + that hold the list of files the operations should be performed against
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<MultipleOperations>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        setPropertySetter

        +
        public void setPropertySetter()
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<MultipleOperations>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public List<TransformationUtility> getChildren()
        +
        Description copied from interface: com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Return an immutable list of all children
        +
        +
        Specified by:
        +
        getChildren in interface com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Returns:
        +
        an immutable list of all children
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.Type.html new file mode 100644 index 00000000..52c4d15f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.Type.html @@ -0,0 +1,386 @@ + + + + + + +PerformResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Enum PerformResult.Type

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        EXECUTION_RESULT

        +
        public static final PerformResult.Type EXECUTION_RESULT
        +
        The result type is defined based on the utility execution result type.
        +
      • +
      + + + + + + + +
        +
      • +

        SKIPPED_DEPENDENCY

        +
        public static final PerformResult.Type SKIPPED_DEPENDENCY
        +
        The TU depends on one or more TUs, and at least one of them didn't result in SUCCESS.
        +
      • +
      + + + +
        +
      • +

        ERROR

        +
        public static final PerformResult.Type ERROR
        +
        The TU failed, but not because of its utility execution itself, but because of an internal reason. + For example, when a TransformationUtilityException is thrown because the absolute file + the TU should execute against could not be resolved during transformation time.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static PerformResult.Type[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (PerformResult.Type c : PerformResult.Type.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static PerformResult.Type valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.html new file mode 100644 index 00000000..19777e88 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/PerformResult.html @@ -0,0 +1,661 @@ + + + + + + +PerformResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class PerformResult

+
+
+ +
+
    +
  • +
    +
    +
    public class PerformResult
    +extends Object
    +
    The meta-data object resulted after the TransformationUtility instance has been performed.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + +
        +
      • +

        error

        +
        public static PerformResult error(TransformationUtility transformationUtility,
        +                                  Exception exception,
        +                                  String details)
        +
        This means The TU failed, but not because of its utility execution itself, but because of an internal reason. + For example, when a TransformationOperationException is thrown because the absolute file the TU should execute + against could not be resolved during transformation time
        +
        +
        Parameters:
        +
        transformationUtility - the TransformationUtility object that produced this result
        +
        exception - the exception to be registered to the result object
        +
        details - details about the result
        +
        Returns:
        +
        the created PerformResult object of type PerformResult.Type.ERROR
        +
        +
      • +
      + + + +
        +
      • +

        error

        +
        public static PerformResult error(TransformationUtility transformationUtility,
        +                                  Exception exception)
        +
        This means The TU failed, but not because of its utility execution itself, but because of an internal reason. + For example, when a TransformationOperationException is thrown because the absolute file the TU should execute + against could not be resolved during transformation time
        +
        +
        Parameters:
        +
        transformationUtility - the TransformationUtility object that produced this result
        +
        exception - the exception to be registered to the result object
        +
        Returns:
        +
        the created PerformResult object of type PerformResult.Type.ERROR
        +
        +
      • +
      + + + +
        +
      • +

        changeTypeOnWarning

        +
        protected void changeTypeOnWarning()
        +
        This method is used to notify subclasses that + the result type might have to change due to the + addition of a warning. +
        + Usually it should change from a successful type to a + warning type. In case the result is an error kind of + type, then it should remain as is.
        +
      • +
      + + + + + + + +
        +
      • +

        isExceptionType

        +
        protected boolean isExceptionType()
        +
        Returns true if this result type is supposed to contain an exception, + such ERROR
        +
        +
        Returns:
        +
        true only if this result type is supposed to contain an exception
        +
        +
      • +
      + + + +
        +
      • +

        dependencyFailureCheck

        +
        protected boolean dependencyFailureCheck()
        +
        Returns true if this result type falls to the dependency failure criteria, + which is stated in TransformationUtility.dependsOn(String...)
        +
        +
        Returns:
        +
        true only if this result type falls to the dependency failure criteria
        +
        +
      • +
      + + + + + +
        +
      • +

        setType

        +
        protected R setType(T type)
        +
      • +
      + + + +
        +
      • +

        setDetails

        +
        public R setDetails(String details)
        +
      • +
      + + + +
        +
      • +

        setException

        +
        protected R setException(Exception exception)
        +
        Set the exception associated with this result. + This exception can only be set if the result type allows it. + If that is not the case, an IllegalArgumentException + will be thrown
        +
        +
        Parameters:
        +
        exception - associated with the execution result
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        addWarning

        +
        public R addWarning(Exception warning)
        +
        Add a new warning associated with this result. + Warnings never imply the result is non-successful, + only errors do
        +
        +
        Parameters:
        +
        warning - the warning to be added
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        public S getSource()
        +
        Returns the source of this result, which could be for example + a transformation utility instance or a transformation + operation instance
        +
        +
        Returns:
        +
        the source of this result
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public T getType()
        +
        Returns the result type
        +
        +
        Returns:
        +
        the result type
        +
        +
      • +
      + + + +
        +
      • +

        getDetails

        +
        public String getDetails()
        +
        Return the result details
        +
        +
        Returns:
        +
        the result details
        +
        +
      • +
      + + + +
        +
      • +

        getException

        +
        public Exception getException()
        +
        Return the exception object in case of types such as ERROR
        +
        +
        Returns:
        +
        the exception object in case of types such as ERROR
        +
        +
      • +
      + + + +
        +
      • +

        getWarnings

        +
        public List<Exception> getWarnings()
        +
        Return a list of warnings associated with this result. + Warnings never imply the result is non-successful, only errors do
        +
        +
        Returns:
        +
        a list of warnings associated with this result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/SingleCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/SingleCondition.html new file mode 100644 index 00000000..c20dad7e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/SingleCondition.html @@ -0,0 +1,290 @@ + + + + + + +SingleCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class SingleCondition<T extends SingleCondition>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public abstract class SingleCondition<T extends SingleCondition>
    +extends UtilityCondition<T>
    +
    Transformation utility condition to determine if a transformation utility + should be executed or not, based on an one file criteria. Every + SingleUtilityCondition subclass result type must always + be boolean. The criteria to this type of condition + is based on evaluating a single file (when checking if a particular + file contains a given word for example). For conditions + based on comparing two files see DoubleCondition. + For conditions based on multiple files see MultipleConditions
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    DoubleCondition, +MultipleConditions
    +
    +
  • +
+
+ +
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SingleCondition

        +
        public SingleCondition()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.Type.html new file mode 100644 index 00000000..679bfdea --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.Type.html @@ -0,0 +1,385 @@ + + + + + + +TOExecutionResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Enum TOExecutionResult.Type

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        NO_OP

        +
        public static final TOExecutionResult.Type NO_OP
        +
        No error happened, but for some reason the TO didn't apply any change. For example, when it was supposed to + delete lines in a text file based on a regular expression, but no lines were found to match the regular expression.
        +
      • +
      + + + +
        +
      • +

        SUCCESS

        +
        public static final TOExecutionResult.Type SUCCESS
        +
        The TO executed normally and a change was performed.
        +
      • +
      + + + +
        +
      • +

        WARNING

        +
        public static final TOExecutionResult.Type WARNING
        +
        The TO executed, a complete and valid change was performed, but a "non-fatal" unexpected situation happened.
        +
      • +
      + + + +
        +
      • +

        ERROR

        +
        public static final TOExecutionResult.Type ERROR
        +
        The TO failed to execute, no change or an incomplete change was made, and the transformed application might be now in a corrupted state.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static TOExecutionResult.Type[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (TOExecutionResult.Type c : TOExecutionResult.Type.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static TOExecutionResult.Type valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.html new file mode 100644 index 00000000..cae91998 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TOExecutionResult.html @@ -0,0 +1,712 @@ + + + + + + +TOExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TOExecutionResult

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        changeTypeOnWarning

        +
        protected void changeTypeOnWarning()
        +
        This method is used to notify subclasses that + the result type might have to change due to the + addition of a warning. +
        + Usually it should change from a successful type to a + warning type. In case the result is an error kind of + type, then it should remain as is.
        +
      • +
      + + + +
        +
      • +

        isExceptionType

        +
        protected boolean isExceptionType()
        +
        Returns true if this result type is supposed to contain an exception, + such ERROR
        +
        +
        Returns:
        +
        true only if this result type is supposed to contain an exception
        +
        +
      • +
      + + + +
        +
      • +

        dependencyFailureCheck

        +
        protected boolean dependencyFailureCheck()
        +
        Returns true if this result type falls to the dependency failure criteria, + which is stated in TransformationUtility.dependsOn(String...)
        +
        +
        Returns:
        +
        true only if this result type falls to the dependency failure criteria
        +
        +
      • +
      + + + + + +
        +
      • +

        setType

        +
        protected R setType(T type)
        +
      • +
      + + + +
        +
      • +

        setDetails

        +
        public R setDetails(String details)
        +
      • +
      + + + +
        +
      • +

        setException

        +
        protected R setException(Exception exception)
        +
        Set the exception associated with this result. + This exception can only be set if the result type allows it. + If that is not the case, an IllegalArgumentException + will be thrown
        +
        +
        Parameters:
        +
        exception - associated with the execution result
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        addWarning

        +
        public R addWarning(Exception warning)
        +
        Add a new warning associated with this result. + Warnings never imply the result is non-successful, + only errors do
        +
        +
        Parameters:
        +
        warning - the warning to be added
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        public S getSource()
        +
        Returns the source of this result, which could be for example + a transformation utility instance or a transformation + operation instance
        +
        +
        Returns:
        +
        the source of this result
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public T getType()
        +
        Returns the result type
        +
        +
        Returns:
        +
        the result type
        +
        +
      • +
      + + + +
        +
      • +

        getDetails

        +
        public String getDetails()
        +
        Return the result details
        +
        +
        Returns:
        +
        the result details
        +
        +
      • +
      + + + +
        +
      • +

        getException

        +
        public Exception getException()
        +
        Return the exception object in case of types such as ERROR
        +
        +
        Returns:
        +
        the exception object in case of types such as ERROR
        +
        +
      • +
      + + + +
        +
      • +

        getWarnings

        +
        public List<Exception> getWarnings()
        +
        Return a list of warnings associated with this result. + Warnings never imply the result is non-successful, only errors do
        +
        +
        Returns:
        +
        a list of warnings associated with this result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.Type.html new file mode 100644 index 00000000..d1b051fa --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.Type.html @@ -0,0 +1,372 @@ + + + + + + +TUExecutionResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Enum TUExecutionResult.Type

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static TUExecutionResult.Type[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (TUExecutionResult.Type c : TUExecutionResult.Type.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static TUExecutionResult.Type valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.html new file mode 100644 index 00000000..511ff456 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TUExecutionResult.html @@ -0,0 +1,693 @@ + + + + + + +TUExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TUExecutionResult

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        changeTypeOnWarning

        +
        protected void changeTypeOnWarning()
        +
        This method is used to notify subclasses that + the result type might have to change due to the + addition of a warning. +
        + Usually it should change from a successful type to a + warning type. In case the result is an error kind of + type, then it should remain as is.
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public Object getValue()
        +
        Returns the value returned by the transformation utility, which can be null
        +
        +
        Returns:
        +
        the value returned by the transformation utility, which can be null
        +
        +
      • +
      + + + +
        +
      • +

        isExceptionType

        +
        protected boolean isExceptionType()
        +
        Returns true if this result type is supposed to contain an exception, + such ERROR
        +
        +
        Returns:
        +
        true only if this result type is supposed to contain an exception
        +
        +
      • +
      + + + +
        +
      • +

        dependencyFailureCheck

        +
        protected boolean dependencyFailureCheck()
        +
        Returns true if this result type falls to the dependency failure criteria, + which is stated in TransformationUtility.dependsOn(String...)
        +
        +
        Returns:
        +
        true only if this result type falls to the dependency failure criteria
        +
        +
      • +
      + + + + + +
        +
      • +

        setType

        +
        protected R setType(T type)
        +
      • +
      + + + +
        +
      • +

        setDetails

        +
        public R setDetails(String details)
        +
      • +
      + + + +
        +
      • +

        setException

        +
        protected R setException(Exception exception)
        +
        Set the exception associated with this result. + This exception can only be set if the result type allows it. + If that is not the case, an IllegalArgumentException + will be thrown
        +
        +
        Parameters:
        +
        exception - associated with the execution result
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        addWarning

        +
        public R addWarning(Exception warning)
        +
        Add a new warning associated with this result. + Warnings never imply the result is non-successful, + only errors do
        +
        +
        Parameters:
        +
        warning - the warning to be added
        +
        Returns:
        +
        this object
        +
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        public S getSource()
        +
        Returns the source of this result, which could be for example + a transformation utility instance or a transformation + operation instance
        +
        +
        Returns:
        +
        the source of this result
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public T getType()
        +
        Returns the result type
        +
        +
        Returns:
        +
        the result type
        +
        +
      • +
      + + + +
        +
      • +

        getDetails

        +
        public String getDetails()
        +
        Return the result details
        +
        +
        Returns:
        +
        the result details
        +
        +
      • +
      + + + +
        +
      • +

        getException

        +
        public Exception getException()
        +
        Return the exception object in case of types such as ERROR
        +
        +
        Returns:
        +
        the exception object in case of types such as ERROR
        +
        +
      • +
      + + + +
        +
      • +

        getWarnings

        +
        public List<Exception> getWarnings()
        +
        Return a list of warnings associated with this result. + Warnings never imply the result is non-successful, only errors do
        +
        +
        Returns:
        +
        a list of warnings associated with this result
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationContext.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationContext.html new file mode 100644 index 00000000..3da2d5c0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationContext.html @@ -0,0 +1,268 @@ + + + + + + +TransformationContext (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Interface TransformationContext

+
+
+
+
    +
  • +
    +
    +
    public interface TransformationContext
    +
    Holds meta-data information + to be shared among transformation utility objects, + allowing communication among them, and helping the + transformation process.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        Object get(String name)
        +
        Returns the attribute object associated with the key + (which is the attribute name), or null, if there is none
        +
        +
        Parameters:
        +
        name - the transformation context attribute name
        +
        Returns:
        +
        the attribute object
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationOperation.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationOperation.html new file mode 100644 index 00000000..fb2de742 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationOperation.html @@ -0,0 +1,444 @@ + + + + + + +TransformationOperation (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TransformationOperation<T extends TransformationOperation>

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationOperation

        +
        public TransformationOperation()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setSaveResult

        +
        protected final T setSaveResult(boolean saveResult)
        +
        Description copied from class: TransformationUtility
        +
        Sets whether or not the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object. See also TransformationUtility.isSaveResult().
        +
        +
        Overrides:
        +
        setSaveResult in class TransformationUtility<T extends TransformationOperation>
        +
        Parameters:
        +
        saveResult - if the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getOrCreateReadFile

        +
        protected final File getOrCreateReadFile(File transformedAppFolder,
        +                                         TransformationContext transformationContext)
        +                                  throws IOException
        +
        Creates and returns a temporary read-only copy of the file to be modified. +
        + The file to be modified by any transformation operation is set via + TransformationUtility.relative(String), TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String)). + Some transformation operations though might need to read the file to be modified + as a stream, and modify it by writing to an output stream as that same file + is read. Since it is impossible to modify a file at the same time it is being read, + this utility method offers an convenient way to create a temporary read-only + copy of the file to be modified. This copy should be used to be read, while the original + file can be modified. +
        + Important notes: +
          +
        1. At the first time this method is called, the temporary file will be created and returned. If called again, the same temporary file created at the first time will be returned.
        2. +
        3. The read-only file will not reflect the changes performed in the original file at any moment, always keeping its original state.
        4. +
        5. There is no need to delete the temporary file after using it. Butterfly automatically deletes it when the JVM terminates.
        6. +
        +
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        a temporary read-only copy of the file to be modified
        +
        Throws:
        +
        IOException - if the temporary file could not be created
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationTemplate.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationTemplate.html new file mode 100644 index 00000000..849d2f03 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationTemplate.html @@ -0,0 +1,822 @@ + + + + + + +TransformationTemplate (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TransformationTemplate

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationTemplate
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    UpgradeStep
    +
    +
    +
    +
    public abstract class TransformationTemplate
    +extends Object
    +
    A template made of a set of transformation utilities to be applied against an application to be transformed.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationTemplate

        +
        public TransformationTemplate()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getExtensionClass

        +
        public abstract Class<? extends Extension> getExtensionClass()
        +
        Returns the class of the extension this transformation + template belongs to
        +
        +
        Returns:
        +
        the class of the extension this transformation + template belongs to
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public abstract String getDescription()
        +
        Returns the transformation template description
        +
        +
        Returns:
        +
        the transformation template description
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public final String add(TransformationUtility utility)
        +
        Adds a new transformation utility to the end of the list. + Also, if no name has been set for this utility yet, the template + names the utility based on this template's name and the order of + execution. +
        + This method also register the template within the utility, which + means a transformation utility instance can be registered to + ONLY ONE transformation template
        +
        +
        Parameters:
        +
        utility - the utility to be added
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public final String add(TransformationUtility utility,
        +                        String utilityName)
        +
        Adds a new transformation utility to the end of the list. + It sets the utility name before adding it though. +
        + This method also register the template within the utility, which + means a transformation utility instance can be registered to + ONLY ONE transformation template
        +
        +
        Parameters:
        +
        utility - the utility to be added
        +
        utilityName - the name to be set to the utility before adding it
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        addMultiple

        +
        public final String addMultiple(TransformationOperation templateOperation,
        +                                String... attributes)
        +
        Adds a special transformation utility to perform multiple transformation operations against + multiple files specified as a list, held as a transformation context attribute +
        +
        +
        Parameters:
        +
        templateOperation - a template of transformation operation to be performed + against all specified files
        +
        attributes - one or more transformation context attributes that hold list + of Files which the transformation operations should perform + against
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        loop

        +
        public final String loop(TransformationUtility utility,
        +                         int iterations)
        +
        Execute an utility in a loop a number times specified in iterations
        +
        +
        Parameters:
        +
        utility - the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
        +
        iterations - the number of iterations to be executed
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        loop

        +
        public final String loop(TransformationUtility utility,
        +                         String attribute)
        +
        Execute an utility in a loop while the value in TransformationContext attribute is true. + The defined is specified based on its name, specified in attribute. + If the attribute value is not a boolean, or if non-existent, it will be treated as false.
        +
        +
        Parameters:
        +
        utility - the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
        +
        attribute - the name of the transformation context attribute to hold the loop condition
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        loop

        +
        public final String loop(TransformationUtility utility,
        +                         UtilityCondition condition)
        +
        Execute an utility in a loop while the execution value resulted by condition is true. + The TransformationUtility object referenced by condition won't be saved to the TransformationContext, + it will be executed exclusively to the scope of this loop execution. + Any result other than a boolean true value, including failures, will be treated as false.
        +
        +
        Parameters:
        +
        utility - the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
        +
        condition - the UtilityCondition object whose execution result will be used as the loop condition
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        @Deprecated
        +public final void log(String logMessage)
        +
        Deprecated. 
        +
        This method has been deprecated. Use info(String) instead. + + Adds a new Log TU to the list
        +
        +
        Parameters:
        +
        logMessage - the message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        info

        +
        public final void info(String infoMessage)
        +
        Adds a new Log TU to the list, + setting its log level to INFO
        +
        +
        Parameters:
        +
        infoMessage - the info message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        debug

        +
        public final void debug(String debugMessage)
        +
        Adds a new Log TU to the list, + setting its log level to DEBUG
        +
        +
        Parameters:
        +
        debugMessage - the debug message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        public final void log(org.slf4j.event.Level logLevel,
        +                      String logMessage)
        +
        Adds a new Log TU to the list
        +
        +
        Parameters:
        +
        logLevel - the log level
        +
        logMessage - the message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        @Deprecated
        +public final void log(String logMessage,
        +                                  String... attributeNames)
        +
        Deprecated. 
        +
        This method has been deprecated. Use info(String, String...) instead. + + Adds a new Log TU to the list. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        logMessage - the message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        info

        +
        public final void info(String infoMessage,
        +                       String... attributeNames)
        +
        Adds a new Log TU to the list, + setting its log level to INFO. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        infoMessage - the info message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        debug

        +
        public final void debug(String debugMessage,
        +                        String... attributeNames)
        +
        Adds a new Log TU to the list, + setting its log level to DEBUG. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        debugMessage - the debug message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        public final void log(org.slf4j.event.Level logLevel,
        +                      String logMessage,
        +                      String... attributeNames)
        +
        Adds a new Log TU to the list. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        logLevel - the log level
        +
        logMessage - the message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        getUtilities

        +
        public final List<TransformationUtility> getUtilities()
        +
        Returns a read-only ordered list of transformation utilities to be executed, + which defines the actual transformation offered by this template
        +
        +
        Returns:
        +
        the list of utilities to transform the application,
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public List<TransformationUtility> getChildren()
        +
        Description copied from interface: com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Return an immutable list of all children
        +
        +
        Returns:
        +
        an immutable list of all children
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public final String getName()
        +
        Description copied from interface: com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Return the name of this transformation utility parent
        +
        +
        Returns:
        +
        the name of this transformation utility parent
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getApplicationType

        +
        public String getApplicationType()
        +
        Returns the type of the transformed application, + Returns null if the application type is unknown. + This method is used mostly for meta-data purposes, + such as when providing transformation metrics.
        +
        +
        Returns:
        +
        the type of the transformed application
        +
        +
      • +
      + + + +
        +
      • +

        getApplicationName

        +
        public String getApplicationName()
        +
        Returns the name of the transformed application, + Returns null if the application name is unknown. + This method is used mostly for meta-data purposes, + such as when providing transformation metrics.
        +
        +
        Returns:
        +
        the name of the transformed application
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtility.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtility.html new file mode 100644 index 00000000..49466b9f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtility.html @@ -0,0 +1,1597 @@ + + + + + + +TransformationUtility (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TransformationUtility<T extends TransformationUtility>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    Direct Known Subclasses:
    +
    Abort, ContextAttributeRetriever, FilterFiles, Log, ManualInstruction, MapValue, MultipleOperations, TransformationOperation, TransformationUtilityGroup, TransformationUtilityLoop, UtilityCondition
    +
    +
    +
    +
    public abstract class TransformationUtility<T extends TransformationUtility>
    +extends Object
    +implements Cloneable
    +
    Gathers information about the project to be transformed without applying any modification on it. + It is the key element of Butterfly transformation engine. The result information is saved in the + TransformationContext object, to be used later by other transformation utilities. +
    + Transformation utilities are executed against the to be transformed project, + based on the absolute project root folder defined in runtime, and a relative + path to a target file or folder, defined in compilation time. +
    + Transformation utilities are also known by TU. +
    + An example of a transformation operation utility would be to find recursively + a particular file based on its name and from a particular location (which would + be relative to the project root folder) + + See TransformationOperation for a specialized transformation utility that + does modify the project + + IMPORTANT: + Every TransformationUtility subclass MUST have a public no arguments default constructor, + and also public setters and getters for all properties they want to expose via set(String, String). + In addition to that, every setter must return the TransformationUtility instance.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + + + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanabortOnFailure() +
      Returns whether this operation aborts the transformation or not in + case of an operation failure.
      +
      TabortOnFailure(boolean abort) +
      If set to true, abort the whole transformation if validation or execution fails.
      +
      TabortOnFailure(boolean abort, + String abortionMessage) +
      If set to true, abort the whole transformation if validation or execution fails.
      +
      Tabsolute(String contextAttributeName) +
      There are two ways to specify the file, or folder, the transformation + utility is suppose to perform against.
      +
      Tabsolute(String contextAttributeName, + String additionalRelativePath) +
      Same as absolute(String, String), however, the absolute + file is set with an additional relative path, which is defined via parameter + additionalRelativePath.
      +
      protected voidapplyPropertiesFromContext(TransformationContext transformationContext) +
      Applies transformation utility properties during transformation time, but + prior to execution (right before it).
      +
      protected com.paypal.butterfly.extensions.api.ResultcheckDependencies(TransformationContext transformationContext) +
      Check if any of dependency of this TU failed.
      +
      protected static voidcheckForBlankString(String name, + String value) +
      Check if value is a blank String, if it is, then a + TransformationDefinitionException is thrown.
      +
      protected static voidcheckForEmptyString(String name, + String value) +
      Check if value is an empty String, if it is, then a + TransformationDefinitionException is thrown.
      +
      protected static voidcheckForNull(String name, + Object value) +
      Check if value is null, if it is, then a + TransformationDefinitionException is thrown.
      +
      Tclone() +
      Creates and returns a clone object identical to the original object, + except for the "has been performed" flag, which is set to false + in the clone object to be returned.
      +
      Tcopy() +
      Creates and returns a copy object similar to the original object.
      +
      TdependsOn(String... dependencies) +
      Add all transformation utilities this utility depends on.
      +
      booleanequals(Object obj) +
      Compare this instance against the specified object, and return + true only if they are equal.
      +
      TexecuteIf(String conditionAttributeName) +
      When set, this TU will only execute if this transformation context + attribute is existent and true.
      +
      TexecuteIf(UtilityCondition utilityCondition) +
      When set, this TU will only execute if this utilityCondition object, + executed right before this TU, result in true.
      +
      TexecuteUnless(String conditionAttributeName) +
      When set, this TU will execute, unless this transformation context + attribute is existent and true.
      +
      protected abstract ExecutionResultexecution(File transformedAppFolder, + TransformationContext transformationContext) +
      The implementation execution of this transformation utility.
      +
      StringgetAbortionMessage() +
      Returns a message to be logged if a fail happens and transformation has to be aborted
      +
      protected FilegetAbsoluteFile(File transformedAppFolder, + TransformationContext transformationContext) +
      Returns an absolute path to the file or folder the transformation + utility is supposed to perform against
      +
      StringgetContextAttributeName() +
      Return the name to be used as key for the result of this utility + when saved into the transformation context.
      +
      protected List<String>getDependencies() +
      Returns an unmodifiable list of names of utilities this utility instance depends on.
      +
      abstract StringgetDescription() +
      Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated.
      +
      StringgetIfConditionAttributeName() +
      Return the "if" condition attribute name associated with this transformation operation, + or null, if there is none
      +
      StringgetName() 
      intgetOrder() +
      Returns the execution order for this utility on its parent.
      +
      com.paypal.butterfly.extensions.api.TransformationUtilityParentgetParent() +
      Returns the transformation utility parent
      +
      protected StringgetRelativePath() +
      Returns relative path (from the application root folder) to the + file or folder the transformation utility is suppose to perform against
      +
      static StringgetRelativePath(File baselineFile, + File targetFile) +
      Returns a relative path from baselineFile to targetFile.
      +
      TransformationTemplategetTransformationTemplate() +
      Returns the transformation template this utility belongs to
      +
      StringgetUnlessConditionAttributeName() +
      Return the "unless" condition attribute name associated with this transformation operation, + or null, if there is none
      +
      booleanhasBeenPerformed() +
      Returns true only if this utility has already been performed
      +
      inthashCode() 
      protected inthashCode(int superHashCode, + Object... elements) +
      Calculates and return a hash code starting from the + hash code generated from superclass
      +
      booleanisFileSet() +
      Return true only if a file has been set.
      +
      booleanisSaveResult() +
      This flag indicates whether the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object.
      +
      protected static StringnormalizeRelativePathSeparator(String relativePath) 
      PerformResultperform(File transformedAppFolder, + TransformationContext transformationContext) +
      Performs the transformation utility against + the application to be transformed +
      + This is the one called by the transformation + engine, and regardless of any customization it + could have, it must always: + + 1- Call applyPropertiesFromContext(TransformationContext) + 2- Call execution(File, TransformationContext) + +
      + This method is NOT supposed to be overwritten, + unless you really know what you are doing.
      +
      Trelative(String relativePath) +
      Sets the relative path from the application root folder + to the file or folder the transformation utility should perform against.
      +
      Tset(String propertyName, + String contextAttributeName) +
      This method allows setting properties in this transformation + utility during transformation time, right before its execution.
      +
      TsetContextAttributeName(String contextAttributeName) +
      Set the name to be used as key for the result of this utility + when saved into the transformation context.
      +
      protected TsetName(String name) +
      Set this transformation utility instance name.
      +
      TsetParent(com.paypal.butterfly.extensions.api.TransformationUtilityParent parent, + int order) +
      Register this utility to its parent, and also assign it a name + based on the parent name and order of execution.
      +
      protected TsetSaveResult(boolean saveResult) +
      Sets whether or not the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object.
      +
      StringtoString() 
      booleanwasFileExplicitlySet() +
      Return true only if a file has been set explicitly either via relative(String) or absolute(String).
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationUtility

        +
        public TransformationUtility()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setName

        +
        protected T setName(String name)
        +
        Set this transformation utility instance name. + If not set, a default name will be assigned at the + time it is added to a parent.
        +
        +
        Parameters:
        +
        name - transformation utility instance name
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public final String getName()
        +
      • +
      + + + +
        +
      • +

        setContextAttributeName

        +
        public T setContextAttributeName(String contextAttributeName)
        +
        Set the name to be used as key for the result of this utility + when saved into the transformation context. + If this is not set, or null, then the utility name will be used instead
        +
        +
        Parameters:
        +
        contextAttributeName - the name to be used as key for the result of this utility + when saved into the transformation context.
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getContextAttributeName

        +
        public String getContextAttributeName()
        +
        Return the name to be used as key for the result of this utility + when saved into the transformation context. + If it is null, then the utility name will be used instead
        +
        +
        Returns:
        +
        the name to be used as key for the result of this utility + when saved into the transformation context
        +
        +
      • +
      + + + +
        +
      • +

        setParent

        +
        public final T setParent(com.paypal.butterfly.extensions.api.TransformationUtilityParent parent,
        +                         int order)
        +
        Register this utility to its parent, and also assign it a name + based on the parent name and order of execution. +
        + Usually the parent is a TransformationTemplate
        +
        +
        Parameters:
        +
        parent - the parent to be set to this utility
        +
        order - the order of execution of this utility
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getParent

        +
        public com.paypal.butterfly.extensions.api.TransformationUtilityParent getParent()
        +
        Returns the transformation utility parent
        +
        +
        Returns:
        +
        the transformation utility parent
        +
        +
      • +
      + + + +
        +
      • +

        getTransformationTemplate

        +
        public TransformationTemplate getTransformationTemplate()
        +
        Returns the transformation template this utility belongs to
        +
        +
        Returns:
        +
        the transformation template this utility belongs to
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public abstract String getDescription()
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        getOrder

        +
        public int getOrder()
        +
        Returns the execution order for this utility on its parent. + Value -1 means it has not been registered to any parent yet, + while 1 means first.
        +
        +
        Returns:
        +
        the execution order for this utility on its parent
        +
        +
      • +
      + + + +
        +
      • +

        relative

        +
        public final T relative(String relativePath)
        +
        Sets the relative path from the application root folder + to the file or folder the transformation utility should perform against. + The path separator is automatically normalized, so there are three valid + options when separating folders in the path: +
          +
        1. File.separatorChar (e.g. relative("myFolder" + File.separator + "file.txt")
        2. +
        3. Forward slash (e.g. relative("myFolder/file.txt")
        4. +
        5. Two backward slashes (e.g. relative("myFolder\\file.txt")
        6. +
        + The slashes are replaced by OS specific separator char in runtime. +
        + The default value is ".". which means the root of the transformed application
        +
        +
        Parameters:
        +
        relativePath - from the application root folder + to the file or folder the transformation utility should be performed against
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        normalizeRelativePathSeparator

        +
        protected static String normalizeRelativePathSeparator(String relativePath)
        +
      • +
      + + + +
        +
      • +

        getRelativePath

        +
        protected final String getRelativePath()
        +
        Returns relative path (from the application root folder) to the + file or folder the transformation utility is suppose to perform against
        +
        +
        Returns:
        +
        relative path (from the application root folder) to the + file or folder the transformation utility is suppose to perform against
        +
        +
      • +
      + + + +
        +
      • +

        getAbsoluteFile

        +
        protected final File getAbsoluteFile(File transformedAppFolder,
        +                                     TransformationContext transformationContext)
        +                              throws TransformationUtilityException
        +
        Returns an absolute path to the file or folder the transformation + utility is supposed to perform against
        +
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an absolute path to the file or folder the transformation + utility is suppose to perform against
        +
        Throws:
        +
        TransformationUtilityException
        +
        +
      • +
      + + + +
        +
      • +

        getRelativePath

        +
        public static String getRelativePath(File baselineFile,
        +                                     File targetFile)
        +
        Returns a relative path from baselineFile to targetFile. + The file separator used is specific to the current OS. If the baseline file + is not entirely within the path to target file, then the target file + absolute path is returned
        +
        +
        Parameters:
        +
        baselineFile - the file whose returned relative path should start from. + It must be aa direct or indirect parent file to targetFile
        +
        targetFile - the file whose returned relative path should take to
        +
        Returns:
        +
        a relative path from baselineFile to targetFile
        +
        +
      • +
      + + + +
        +
      • +

        set

        +
        public final T set(String propertyName,
        +                   String contextAttributeName)
        +
        This method allows setting properties in this transformation + utility during transformation time, right before its execution. + This is very useful when the property value is not known during + transformation definition. Any attribute stored in the + transformation context can be used as the value to be set to the + property. In most of the cases the result of a prior + transformation utility is used as property value. + Notice that, because this feature relies on reflection, it is not + cheap, especially because it happens during transformation time. + So, use it only when really necessary.
        +
        +
        Parameters:
        +
        propertyName - the transformation utility Java property name
        +
        contextAttributeName - the name of the transformation context attribute whose + value will be set as the property value right before + execution
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        applyPropertiesFromContext

        +
        protected final void applyPropertiesFromContext(TransformationContext transformationContext)
        +                                         throws TransformationUtilityException
        +
        Applies transformation utility properties during transformation time, but + prior to execution (right before it). The properties values are gotten from + the transformation context object.
        +
        +
        Parameters:
        +
        transformationContext - the transformation context object
        +
        Throws:
        +
        TransformationUtilityException
        +
        +
      • +
      + + + +
        +
      • +

        absolute

        +
        public T absolute(String contextAttributeName)
        +
        There are two ways to specify the file, or folder, the transformation + utility is suppose to perform against. The default and most commons one is + by setting the relative path to it, which is done usually via the constructor + or relative(String)). That should be the chosen option whenever + the relative location is known during transformation template definition time. +
        + However, sometimes that is not possible because that location will only be known + during transformation time. In cases like this, usually another utility is used to + find that location first, and then save it as transformation context attribute. In + this case, this setter here can be used to set the absolute file location based + on such context attribute. Whenever this is set, the relative path attribute is + ignored. +
        + See also getAbsoluteFile(File, TransformationContext), relative(String) + and getRelativePath()
        +
        +
        Parameters:
        +
        contextAttributeName - the name of the transformation context attribute whose + value will be set as the absolute file right before + execution
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        absolute

        +
        public T absolute(String contextAttributeName,
        +                  String additionalRelativePath)
        +
        Same as absolute(String, String), however, the absolute + file is set with an additional relative path, which is defined via parameter + additionalRelativePath. This method is powerful because it allows setting + the absolute file using a portion of the location (absolute) that is only known during + transformation time, plus also a second portion of the location (relative) that is + already known during definition time +
        + See also getAbsoluteFile(File, TransformationContext), relative(String) + and getRelativePath()
        +
        +
        Parameters:
        +
        contextAttributeName - the name of the transformation context attribute whose + value will be set as the absolute file right before + execution
        +
        additionalRelativePath - an additional relative path to be added to the absolute + file coming from the transformation context. The path + separator will be normalized, similar to what happens + in relative(String)
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + + + + + +
        +
      • +

        abortOnFailure

        +
        public final T abortOnFailure(boolean abort)
        +
        If set to true, abort the whole transformation if validation or execution fails. + If not, just state a warning, aborts the operation execution only. + Notice that abortion here means interrupting the transformation. + It does not mean rolling back the changes that have might already been done + by this transformation operation by the time it failed
        +
        +
        Parameters:
        +
        abort - if set to true, abort the whole transformation if validation or execution fails. + If not, just state a warning, aborts the operation execution only
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        abortOnFailure

        +
        public final T abortOnFailure(boolean abort,
        +                              String abortionMessage)
        +
        If set to true, abort the whole transformation if validation or execution fails. + If not, just state a warning, aborts the operation execution only. + Notice that abortion here means interrupting the transformation. + It does not mean rolling back the changes that have might already been done + by this transformation operation by the time it failed
        +
        +
        Parameters:
        +
        abort - if set to true, abort the whole transformation if validation or execution fails. + If not, just state a warning, aborts the operation execution only
        +
        abortionMessage - a message to be logged if a fail happens and transformation + has to be aborted
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getAbortionMessage

        +
        public String getAbortionMessage()
        +
        Returns a message to be logged if a fail happens and transformation has to be aborted
        +
        +
        Returns:
        +
        a message to be logged if a fail happens and transformation has to be aborted
        +
        +
      • +
      + + + +
        +
      • +

        abortOnFailure

        +
        public final boolean abortOnFailure()
        +
        Returns whether this operation aborts the transformation or not in + case of an operation failure. Notice that this method does NOT + change the state this object in any ways, it is just a getter.
        +
        +
        Returns:
        +
        true only if this operation aborts the transformation or not in + case of an operation failure
        +
        +
      • +
      + + + +
        +
      • +

        isSaveResult

        +
        public boolean isSaveResult()
        +
        This flag indicates whether the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object. +
        + In most cases it should do so, because that is the main purpose of + every transformation utility, to produce and share useful data with other + transformation utilities and operations. +
        + However, there are rare cases, + for example Log, + where no value will be produced and nothing should be saved to the + transformation context attribute
        +
        +
        Returns:
        +
        true only if the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object
        +
        +
      • +
      + + + +
        +
      • +

        setSaveResult

        +
        protected T setSaveResult(boolean saveResult)
        +
        Sets whether or not the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object. See also isSaveResult().
        +
        +
        Parameters:
        +
        saveResult - if the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        hasBeenPerformed

        +
        public final boolean hasBeenPerformed()
        +
        Returns true only if this utility has already been performed
        +
        +
        Returns:
        +
        true only if this utility has already been performed
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getDependencies

        +
        protected final List<String> getDependencies()
        +
        Returns an unmodifiable list of names of utilities this utility instance depends on. + See also dependsOn(String...).
        +
        +
        Returns:
        +
        an unmodifiable list of names of utilities this utility instance depends on
        +
        +
      • +
      + + + +
        +
      • +

        checkDependencies

        +
        protected com.paypal.butterfly.extensions.api.Result checkDependencies(TransformationContext transformationContext)
        +
        Check if any of dependency of this TU failed. If that is true, + returns a result object stating so. If not, returns null. If this TU + has no dependencies it also returns null. See dependsOn(String...) + to find out the dependency failure criteria
        +
        +
        Parameters:
        +
        transformationContext - the transformation context object, in this case used + to check all past executed utilities
        +
        Returns:
        +
        a result object if any of dependency of this utility failed, + or null, if that is not the case, or if this utility does not have dependencies
        +
        +
      • +
      + + + +
        +
      • +

        executeIf

        +
        public final T executeIf(String conditionAttributeName)
        +
        When set, this TU will only execute if this transformation context + attribute is existent and true. In other words, it will execute if + not null and, if of Boolean type, true
        +
        +
        Parameters:
        +
        conditionAttributeName - the name of the transformation context attribute which + holds a boolean value used to evaluate if this + utility should be executed or not
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        executeIf

        +
        public final T executeIf(UtilityCondition utilityCondition)
        +
        When set, this TU will only execute if this utilityCondition object, + executed right before this TU, result in true. +
        + Differences between this approach and executeIf(String): +
          +
        1. Instead of relying on a TCA (attribute) with the condition result, this method is based on the direct execution of the UtilityCondition object
        2. +
        3. The UtilityCondition object is always executed necessarily against the same file set in the transformation utility it is being used. Because of that, any value set in the condition itself via relative(String) or absolute(String) is ignored.
        4. +
        5. The UtilityCondition object does not produce any TCA, neither its result value or result object. Instead, it hands its result directly to the TU, so that the condition can be evaluated just before the TU executes (or not, if it fails).
        6. +
        7. The UtilityCondition object does not exist from a transformation template point of view. That means this method is totally different than adding a new UtilityCondition object by calling TransformationTemplate.add(TransformationUtility).
        8. +
        + The actual UtilityCondition object is not the one used, but a copy of it
        +
        +
        Parameters:
        +
        utilityCondition - the condition to be executed and evaluated right before this TU
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        executeUnless

        +
        public final T executeUnless(String conditionAttributeName)
        +
        When set, this TU will execute, unless this transformation context + attribute is existent and true. In other words, it will execute, unless if + not null and, if of Boolean type, true
        +
        +
        Parameters:
        +
        conditionAttributeName - the name of the transformation context attribute which + holds a boolean value used to evaluate if this + utility should be executed or not
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getIfConditionAttributeName

        +
        public String getIfConditionAttributeName()
        +
        Return the "if" condition attribute name associated with this transformation operation, + or null, if there is none
        +
        +
        Returns:
        +
        the "if" condition attribute name associated with this transformation operation
        +
        +
      • +
      + + + +
        +
      • +

        getUnlessConditionAttributeName

        +
        public String getUnlessConditionAttributeName()
        +
        Return the "unless" condition attribute name associated with this transformation operation, + or null, if there is none
        +
        +
        Returns:
        +
        the "unless" condition attribute name associated with this transformation operation
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected abstract ExecutionResult execution(File transformedAppFolder,
        +                                             TransformationContext transformationContext)
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + +
        +
      • +

        isFileSet

        +
        public final boolean isFileSet()
        +
        Return true only if a file has been set. Every TransformationUtility has its file set automatically by + default to "" which means the root of the application. That is NOT the case though for TransformationOperation + object, which must set them explicitly via relative(String) or absolute(String).
        +
        +
        Returns:
        +
        true only if a file has been set
        +
        +
      • +
      + + + +
        +
      • +

        wasFileExplicitlySet

        +
        public final boolean wasFileExplicitlySet()
        +
        Return true only if a file has been set explicitly either via relative(String) or absolute(String). + If set via relative(String) it will only return true if set to anything other than "", which would mean the root of the application.
        +
        +
        Returns:
        +
        true only if a file has been set explicitly either via relative(String) or absolute(String)
        +
        +
      • +
      + + + + + + + +
        +
      • +

        clone

        +
        public T clone()
        +
        Creates and returns a clone object identical to the original object, + except for the "has been performed" flag, which is set to false + in the clone object to be returned. See hasBeenPerformed().
        +
        +
        Overrides:
        +
        clone in class Object
        +
        Returns:
        +
        the new object created as result of the clone operation
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public T copy()
        +
        Creates and returns a copy object similar to the original object. + All attributes are the same, except for the following ones, which are reset: +
          +
        1. parent
        2. +
        3. name
        4. +
        5. order
        6. +
        7. context attribute name
        8. +
        9. file relative and absolute path
        10. +
        11. has been performed flag
        12. +
        +
        +
        Returns:
        +
        the new object created as result of the copy operation
        +
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        equals

        +
        public boolean equals(Object obj)
        +
        Compare this instance against the specified object, and return + true only if they are equal. Notice though that the fact that + the utility has been performed or not will NOT be used for this + comparison.
        +
        +
        Overrides:
        +
        equals in class Object
        +
        Parameters:
        +
        obj - the object to be compared against this instance
        +
        Returns:
        +
        true only if they are equal
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class Object
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        protected final int hashCode(int superHashCode,
        +                             Object... elements)
        +
        Calculates and return a hash code starting from the + hash code generated from superclass
        +
        +
        Parameters:
        +
        superHashCode - hash code generated from superclass
        +
        elements - array of Objects to be used to generate hashcode. + These elements should be the attributes used in + the equals method
        +
        Returns:
        +
        the generated hashcode
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.html new file mode 100644 index 00000000..5048fa72 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityGroup.html @@ -0,0 +1,730 @@ + + + + + + +TransformationUtilityGroup (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TransformationUtilityGroup

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationUtilityGroup

        +
        public TransformationUtilityGroup()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<TransformationUtilityGroup>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public String add(TransformationUtility utility)
        +
        Adds a new transformation utility to the end of the list. + Also, if no name has been set for this utility yet, a name + will be set to it.
        +
        +
        Parameters:
        +
        utility - the utility to be added
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public String add(TransformationUtility utility,
        +                  String utilityName)
        +
        Adds a new transformation utility to the end of the list. + It sets the utility name before adding it though.
        +
        +
        Parameters:
        +
        utility - the utility to be added
        +
        utilityName - the name to be set to the utility before adding it
        +
        Returns:
        +
        the utility name
        +
        +
      • +
      + + + +
        +
      • +

        addMultiple

        +
        public String addMultiple(TransformationOperation templateOperation,
        +                          String... attributes)
        +
        Adds a special transformation utility to perform multiple transformation operations against + multiple files specified as a list, held as a transformation context attribute +
        +
        +
        Parameters:
        +
        templateOperation - a template of transformation operation to be performed + against all specified files
        +
        attributes - one or more transformation context attributes that hold list + of Files which the transformation operations should perform + against
        +
        Returns:
        +
        the name of the special transformation utility that performs multiple transformation operations
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        @Deprecated
        +public final void log(String logMessage)
        +
        Deprecated. 
        +
        This method has been deprecated. Use info(String) instead. + + Adds a new Log TU to the list
        +
        +
        Parameters:
        +
        logMessage - the message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        info

        +
        public final void info(String infoMessage)
        +
        Adds a new Log TU to the list, + setting its log level to INFO
        +
        +
        Parameters:
        +
        infoMessage - the info message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        debug

        +
        public final void debug(String debugMessage)
        +
        Adds a new Log TU to the list, + setting its log level to DEBUG
        +
        +
        Parameters:
        +
        debugMessage - the debug message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        public final void log(org.slf4j.event.Level logLevel,
        +                      String logMessage)
        +
        Adds a new Log TU to the list
        +
        +
        Parameters:
        +
        logLevel - the log level
        +
        logMessage - the message to be logged
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        @Deprecated
        +public final void log(String logMessage,
        +                                  String... attributeNames)
        +
        Deprecated. 
        +
        This method has been deprecated. Use info(String, String...) instead. + + Adds a new Log TU to the list. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        logMessage - the message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        info

        +
        public final void info(String infoMessage,
        +                       String... attributeNames)
        +
        Adds a new Log TU to the list, + setting its log level to INFO. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        infoMessage - the info message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        debug

        +
        public final void debug(String debugMessage,
        +                        String... attributeNames)
        +
        Adds a new Log TU to the list, + setting its log level to DEBUG. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        debugMessage - the debug message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        log

        +
        public final void log(org.slf4j.event.Level logLevel,
        +                      String logMessage,
        +                      String... attributeNames)
        +
        Adds a new Log TU to the list. + The log messages may contain placeholders to be replaced by transformation context + attribute values. Use {} as placeholder marker.
        +
        +
        Parameters:
        +
        logLevel - the log level
        +
        logMessage - the message to be logged, containing {} placeholders to be replaced by + transformation context attribute values
        +
        attributeNames - an array of names of transformation context attributes, whose values + are going to be used in the log message
        +
        +
      • +
      + + + +
        +
      • +

        getUtilities

        +
        public List<TransformationUtility> getUtilities()
        +
        Returns an immutable ordered list of transformation utilities in this list
        +
        +
        Returns:
        +
        an immutable ordered list of transformation utilities in this list
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public List<TransformationUtility> getChildren()
        +
        Description copied from interface: com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Return an immutable list of all children
        +
        +
        Returns:
        +
        an immutable list of all children
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<TransformationUtilityGroup>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.html new file mode 100644 index 00000000..357fad9c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/TransformationUtilityLoop.html @@ -0,0 +1,675 @@ + + + + + + +TransformationUtilityLoop (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class TransformationUtilityLoop

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.TransformationUtilityParent, Cloneable
    +
    +
    +
    +
    public class TransformationUtilityLoop
    +extends TransformationUtility<TransformationUtilityLoop>
    +implements com.paypal.butterfly.extensions.api.TransformationUtilityParent
    +
    Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop. + The number of iterations is defined by one of these options: +
      +
    1. Specifying the number of iterations.
    2. +
    3. Specifying a TransformationContext attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
    4. +
    5. Specifying a UtilityCondition object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
    6. +
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationUtilityLoop

        +
        public TransformationUtilityLoop()
        +
        Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop. + The number of iterations is defined by one of these options: +
          +
        1. Specifying the number of iterations.
        2. +
        3. Specifying a TransformationContext attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
        4. +
        5. Specifying a UtilityCondition object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
        6. +
        +
      • +
      + + + +
        +
      • +

        TransformationUtilityLoop

        +
        public TransformationUtilityLoop(TransformationUtility template)
        +
        Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop. + The number of iterations is defined by one of these options: +
          +
        1. Specifying the number of iterations.
        2. +
        3. Specifying a TransformationContext attribute (by its name) whose value is true or false. If that is not a boolean, or if non-existent, it will be treated as false. If that is false, the loop is interrupted.
        4. +
        5. Specifying a UtilityCondition object whose result is true or false. The result of this TU condition object won't be saved to the TC, it will be executed exclusively to the scope of this loop execution. Any result other than a boolean true value, including failures, will be treated as false. If that is false, the loop is interrupted.
        6. +
        +
        +
        Parameters:
        +
        template - the transformation utility instance to be used a template. + A clone utility instance will be created out of the template + for each iteration. See TransformationUtility.clone() for further information + about the clone object.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setTemplate

        +
        public TransformationUtilityLoop setTemplate(TransformationUtility template)
        +
        Sets the transformation utility instance to be used as a template. + A clone utility instance will be created out of the template + for each iteration. See TransformationUtility.clone() for further information + about the clone object.
        +
        +
        Parameters:
        +
        template - the transformation utility instance to be used as template.
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setCondition

        +
        public TransformationUtilityLoop setCondition(int iterations)
        +
        In this case the condition to execute the next iteration is based on + a pre-defined number of iterations to be executed. Each execution + decrease the remaining number of iterations.
        +
        +
        Parameters:
        +
        iterations - the total number of iterations to be executed
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setCondition

        +
        public TransformationUtilityLoop setCondition(String attribute)
        +
        In this case the condition to execute the next iteration is based on + a TransformationContext attribute (specified by its name) whose + value is true or false. If that is not a boolean, or if non-existent, + it will be treated as false. If that is false, the loop is interrupted.
        +
        +
        Parameters:
        +
        attribute - the name of the transformation context attribute + holding the boolean to be used as the condition + to execute the next iteration. If that is false, + the loop is interrupted.
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setCondition

        +
        public TransformationUtilityLoop setCondition(UtilityCondition condition)
        +
        In this case the condition to execute the next iteration is based on + a UtilityCondition object whose result is true or false. + The result of this TU condition object won't be saved to the TC, + it will be executed exclusively to the scope of this loop execution. + Any result other than a boolean true value, including failures, will be treated as false. + If that is false, the loop is interrupted.
        +
        +
        Parameters:
        +
        condition - the UtilityCondition object whose result + will be used as the condition to execute the next iteration. + If that is false, the loop is interrupted.
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        getIterations

        +
        public int getIterations()
        +
      • +
      + + + +
        +
      • +

        getAttribute

        +
        public String getAttribute()
        +
      • +
      + + + + + + + +
        +
      • +

        getNextIteration

        +
        public int getNextIteration()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<TransformationUtilityLoop>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public List<TransformationUtility> getChildren()
        +
        Description copied from interface: com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Return an immutable list of all children
        +
        +
        Specified by:
        +
        getChildren in interface com.paypal.butterfly.extensions.api.TransformationUtilityParent
        +
        Returns:
        +
        an immutable list of all children
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Returns, as its value, the condition to keep iterating over this loop
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<TransformationUtilityLoop>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        a value execution result with the condition to keep iterating over this loop
        +
        +
      • +
      + + + +
        +
      • +

        run

        +
        public TransformationUtility run()
        +
        Returns the TU instance to be run in the this iteration. + This instance is created based on the template
        +
        +
        Returns:
        +
        the TU instance to be run in this iteration
        +
        +
      • +
      + + + +
        +
      • +

        iterate

        +
        public TransformationUtility iterate()
        +
        Returns a clone of this transformation utility loop ready for the next iteration
        +
        +
        Returns:
        +
        a clone of this transformation utility loop ready for the next iteration
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/UtilityCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/UtilityCondition.html new file mode 100644 index 00000000..c17908ae --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/UtilityCondition.html @@ -0,0 +1,293 @@ + + + + + + +UtilityCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api
+

Class UtilityCondition<U extends UtilityCondition>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    Direct Known Subclasses:
    +
    DoubleCondition, MultipleConditions, ResultCondition, SingleCondition
    +
    +
    +
    +
    public abstract class UtilityCondition<U extends UtilityCondition>
    +extends TransformationUtility<U>
    +
    Condition to determine if a transformation utility + should be executed or not. Although this type has no + explicitly defined structural additions to typical + TransformationUtility classes, every + UtilityCondition subclass result type must always + be boolean. The criteria to the condition can be + based on a single file (when checking if a particular + file contains a given word for example) or multiple files + (when comparing two files for example). + + IMPORTANT: + Every UtilityCondition subclass MUST be a Java bean, which means they must have + a public no arguments default constructor, and also public setters and getters for all + their properties. In addition to that, every setter must return the + UtilityCondition instance.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+ +
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UtilityCondition

        +
        public UtilityCondition()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ContextAttributeRetriever.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ContextAttributeRetriever.html new file mode 100644 index 00000000..d82f53fb --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ContextAttributeRetriever.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.ContextAttributeRetriever (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.ContextAttributeRetriever

+
+
No usage of com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/DoubleCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/DoubleCondition.html new file mode 100644 index 00000000..a2f0539e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/DoubleCondition.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.DoubleCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.DoubleCondition

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ExecutionResult.html new file mode 100644 index 00000000..0ea98ecc --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/ExecutionResult.html @@ -0,0 +1,268 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.ExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.ExecutionResult

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/Extension.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/Extension.html new file mode 100644 index 00000000..9ec98dca --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/Extension.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.Extension (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.Extension

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/FilterFiles.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/FilterFiles.html new file mode 100644 index 00000000..010978d0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/FilterFiles.html @@ -0,0 +1,182 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.FilterFiles (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.FilterFiles

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.Mode.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.Mode.html new file mode 100644 index 00000000..9c456d40 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.Mode.html @@ -0,0 +1,199 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.MultipleConditions.Mode (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.MultipleConditions.Mode

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.html new file mode 100644 index 00000000..27e4a86a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleConditions.html @@ -0,0 +1,189 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.MultipleConditions (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.MultipleConditions

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleOperations.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleOperations.html new file mode 100644 index 00000000..3397deb3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/MultipleOperations.html @@ -0,0 +1,191 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.MultipleOperations (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.MultipleOperations

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.Type.html new file mode 100644 index 00000000..13417848 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.Type.html @@ -0,0 +1,215 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.PerformResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.PerformResult.Type

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.html new file mode 100644 index 00000000..6bf42020 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/PerformResult.html @@ -0,0 +1,235 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.PerformResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.PerformResult

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/SingleCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/SingleCondition.html new file mode 100644 index 00000000..cc871df5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/SingleCondition.html @@ -0,0 +1,245 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.SingleCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.SingleCondition

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.Type.html new file mode 100644 index 00000000..1fb6d991 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.Type.html @@ -0,0 +1,215 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TOExecutionResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TOExecutionResult.Type

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.html new file mode 100644 index 00000000..36da7eec --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TOExecutionResult.html @@ -0,0 +1,222 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TOExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TOExecutionResult

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.Type.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.Type.html new file mode 100644 index 00000000..edfacffd --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.Type.html @@ -0,0 +1,215 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TUExecutionResult.Type (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TUExecutionResult.Type

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.html new file mode 100644 index 00000000..2ce3df90 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TUExecutionResult.html @@ -0,0 +1,272 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TUExecutionResult (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TUExecutionResult

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationContext.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationContext.html new file mode 100644 index 00000000..75600fda --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationContext.html @@ -0,0 +1,306 @@ + + + + + + +Uses of Interface com.paypal.butterfly.extensions.api.TransformationContext (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.paypal.butterfly.extensions.api.TransformationContext

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationOperation.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationOperation.html new file mode 100644 index 00000000..687b2968 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationOperation.html @@ -0,0 +1,340 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TransformationOperation (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TransformationOperation

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationTemplate.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationTemplate.html new file mode 100644 index 00000000..828a4d48 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationTemplate.html @@ -0,0 +1,235 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TransformationTemplate (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TransformationTemplate

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtility.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtility.html new file mode 100644 index 00000000..5688a87b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtility.html @@ -0,0 +1,566 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TransformationUtility (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TransformationUtility

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityGroup.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityGroup.html new file mode 100644 index 00000000..3f69288e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityGroup.html @@ -0,0 +1,169 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TransformationUtilityGroup (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TransformationUtilityGroup

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityLoop.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityLoop.html new file mode 100644 index 00000000..b6eb9c31 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/TransformationUtilityLoop.html @@ -0,0 +1,197 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.TransformationUtilityLoop (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.TransformationUtilityLoop

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/UtilityCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/UtilityCondition.html new file mode 100644 index 00000000..0ea68daf --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/class-use/UtilityCondition.html @@ -0,0 +1,276 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.UtilityCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.UtilityCondition

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ApplicationValidationException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ApplicationValidationException.html new file mode 100644 index 00000000..41229154 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ApplicationValidationException.html @@ -0,0 +1,291 @@ + + + + + + +ApplicationValidationException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class ApplicationValidationException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    +
    public class ApplicationValidationException
    +extends ButterflyRuntimeException
    +
    Thrown whenever the application to be transformed is not in a valid state.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ApplicationValidationException

        +
        public ApplicationValidationException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        ApplicationValidationException

        +
        public ApplicationValidationException(String exceptionMessage,
        +                                      Exception exception)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyException.html new file mode 100644 index 00000000..d82ebd90 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyException.html @@ -0,0 +1,285 @@ + + + + + + +ButterflyException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class ButterflyException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ButterflyException

        +
        public ButterflyException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        ButterflyException

        +
        public ButterflyException(String exceptionMessage,
        +                          Throwable throwable)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyRuntimeException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyRuntimeException.html new file mode 100644 index 00000000..ad1d5363 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/ButterflyRuntimeException.html @@ -0,0 +1,290 @@ + + + + + + +ButterflyRuntimeException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class ButterflyRuntimeException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ButterflyRuntimeException

        +
        public ButterflyRuntimeException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        ButterflyRuntimeException

        +
        public ButterflyRuntimeException(String exceptionMessage,
        +                                 Exception exception)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TemplateResolutionException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TemplateResolutionException.html new file mode 100644 index 00000000..8d8a8832 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TemplateResolutionException.html @@ -0,0 +1,306 @@ + + + + + + +TemplateResolutionException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class TemplateResolutionException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TemplateResolutionException

        +
        public TemplateResolutionException(String message)
        +
        This exception is thrown by Extension.automaticResolution(File) + whenever transformation template cannot be resolved
        +
        +
        Parameters:
        +
        message - explains why a transformation template could not be chosen
        +
        +
      • +
      + + + +
        +
      • +

        TemplateResolutionException

        +
        public TemplateResolutionException(String message,
        +                                   Exception exception)
        +
        This exception is thrown by Extension.automaticResolution(File) + whenever transformation template cannot be resolved
        +
        +
        Parameters:
        +
        message - explains why a transformation template could not be chosen
        +
        exception - reason why a transformation template could not be chosen
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationDefinitionException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationDefinitionException.html new file mode 100644 index 00000000..4e6f8cf1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationDefinitionException.html @@ -0,0 +1,291 @@ + + + + + + +TransformationDefinitionException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class TransformationDefinitionException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    +
    public class TransformationDefinitionException
    +extends ButterflyRuntimeException
    +
    Thrown whenever a transformation template definition is not well formed.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationDefinitionException

        +
        public TransformationDefinitionException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        TransformationDefinitionException

        +
        public TransformationDefinitionException(String exceptionMessage,
        +                                         Exception exception)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationOperationException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationOperationException.html new file mode 100644 index 00000000..dce0ce68 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationOperationException.html @@ -0,0 +1,299 @@ + + + + + + +TransformationOperationException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class TransformationOperationException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationOperationException

        +
        public TransformationOperationException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        TransformationOperationException

        +
        public TransformationOperationException(String exceptionMessage,
        +                                        Exception exception)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationUtilityException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationUtilityException.html new file mode 100644 index 00000000..fcf93f7e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/TransformationUtilityException.html @@ -0,0 +1,297 @@ + + + + + + +TransformationUtilityException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.exception
+

Class TransformationUtilityException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransformationUtilityException

        +
        public TransformationUtilityException(String exceptionMessage)
        +
      • +
      + + + +
        +
      • +

        TransformationUtilityException

        +
        public TransformationUtilityException(String exceptionMessage,
        +                                      Exception exception)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ApplicationValidationException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ApplicationValidationException.html new file mode 100644 index 00000000..3c7de13b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ApplicationValidationException.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.ApplicationValidationException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.ApplicationValidationException

+
+
No usage of com.paypal.butterfly.extensions.api.exception.ApplicationValidationException
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyException.html new file mode 100644 index 00000000..ee4369b5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyException.html @@ -0,0 +1,171 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.ButterflyException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.ButterflyException

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyRuntimeException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyRuntimeException.html new file mode 100644 index 00000000..0b156417 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/ButterflyRuntimeException.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.ButterflyRuntimeException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.ButterflyRuntimeException

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TemplateResolutionException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TemplateResolutionException.html new file mode 100644 index 00000000..7489484e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TemplateResolutionException.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.TemplateResolutionException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.TemplateResolutionException

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationDefinitionException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationDefinitionException.html new file mode 100644 index 00000000..add02206 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationDefinitionException.html @@ -0,0 +1,189 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationOperationException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationOperationException.html new file mode 100644 index 00000000..5b14b0c1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationOperationException.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.TransformationOperationException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.TransformationOperationException

+
+
No usage of com.paypal.butterfly.extensions.api.exception.TransformationOperationException
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationUtilityException.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationUtilityException.html new file mode 100644 index 00000000..ab11cafb --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/class-use/TransformationUtilityException.html @@ -0,0 +1,231 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.exception.TransformationUtilityException (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.exception.TransformationUtilityException

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-frame.html new file mode 100644 index 00000000..d76142b3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-frame.html @@ -0,0 +1,27 @@ + + + + + + +com.paypal.butterfly.extensions.api.exception (butterfly-extensions-api 2.2.0 API) + + + + + +

com.paypal.butterfly.extensions.api.exception

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-summary.html new file mode 100644 index 00000000..22165c6a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-summary.html @@ -0,0 +1,198 @@ + + + + + + +com.paypal.butterfly.extensions.api.exception (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.extensions.api.exception

+
+
Butterfly exceptions.
+
+

See: Description

+
+
+ + + + +

Package com.paypal.butterfly.extensions.api.exception Description

+
Butterfly exceptions.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-tree.html new file mode 100644 index 00000000..5c016200 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-tree.html @@ -0,0 +1,166 @@ + + + + + + +com.paypal.butterfly.extensions.api.exception Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.extensions.api.exception

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-use.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-use.html new file mode 100644 index 00000000..de4830a8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/exception/package-use.html @@ -0,0 +1,210 @@ + + + + + + +Uses of Package com.paypal.butterfly.extensions.api.exception (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.extensions.api.exception

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.IfPresent.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.IfPresent.html new file mode 100644 index 00000000..d49ba47e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.IfPresent.html @@ -0,0 +1,401 @@ + + + + + + +AddElement.IfPresent (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Enum AddElement.IfPresent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        Fail

        +
        public static final AddElement.IfPresent Fail
        +
        Fail if the element to be added is already present
        +
      • +
      + + + +
        +
      • +

        WarnNotAdd

        +
        public static final AddElement.IfPresent WarnNotAdd
        +
        Warn and do not add if the element to be added is already present
        +
      • +
      + + + +
        +
      • +

        WarnButAdd

        +
        public static final AddElement.IfPresent WarnButAdd
        +
        Warn, but add, if the element to be added is already present
        +
      • +
      + + + +
        +
      • +

        NoOp

        +
        public static final AddElement.IfPresent NoOp
        +
        Do nothing, not add, not warn neither fail, if the element to be added is already present
        +
      • +
      + + + +
        +
      • +

        Overwrite

        +
        public static final AddElement.IfPresent Overwrite
        +
        Overwrite and not warn if the element to be added is already present
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static AddElement.IfPresent[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (AddElement.IfPresent c : AddElement.IfPresent.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static AddElement.IfPresent valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.html new file mode 100644 index 00000000..e1ff0f35 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElement.html @@ -0,0 +1,365 @@ + + + + + + +AddElement (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Interface AddElement<T extends TransformationOperation>

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    AddElementTO
    +
    +
    +
    +
    public interface AddElement<T extends TransformationOperation>
    +
    This interface should be implemented by TransformationOperation + subclasses that intend to modify a project by adding elements to it, + standardizing the behavior and API if the element to be added already exists. +
    +
    + Examples: +
      +
    • files
    • +
    • folders
    • +
    • properties, in properties files
    • +
    • POM dependencies
    • +
    • POM managed dependencies
    • +
    • POM plugins
    • +
    • POM managed plugins
    • +
    • POM properties
    • +
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        failIfPresent

        +
        T failIfPresent()
        +
        Fail (TOExecutionResult.Type.ERROR) + if the element to be added is already present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        warnNotAddIfPresent

        +
        T warnNotAddIfPresent()
        +
        Warn and do not add (TOExecutionResult.Type.WARNING) + if the element to be added is already present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        warnButAddIfPresent

        +
        T warnButAddIfPresent()
        +
        Warn, but add, (TOExecutionResult.Type.WARNING) + if the element to be added is already present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfPresent

        +
        T noOpIfPresent()
        +
        Do nothing, not add, not warn neither fail, (TOExecutionResult.Type.NO_OP) + if the element to be added is already present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        overwriteIfPresent

        +
        T overwriteIfPresent()
        +
        Overwrite and not warn (TOExecutionResult.Type.SUCCESS) + if the element to be added is already present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElementTO.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElementTO.html new file mode 100644 index 00000000..4d18ae2c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/AddElementTO.html @@ -0,0 +1,479 @@ + + + + + + +AddElementTO (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Class AddElementTO<T extends AddElementTO>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    AddElement<T>, Cloneable
    +
    +
    +
    +
    public abstract class AddElementTO<T extends AddElementTO>
    +extends TransformationOperation<T>
    +implements AddElement<T>
    +
    Convenience class with AddElement implementation ready for TransformationOperation subclasses. + Protected instance variable ifPresent can be used when deciding the result type, + in case the element to be added is already present.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.IfNotPresent.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.IfNotPresent.html new file mode 100644 index 00000000..91bef15a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.IfNotPresent.html @@ -0,0 +1,371 @@ + + + + + + +ChangeOrRemoveElement.IfNotPresent (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Enum ChangeOrRemoveElement.IfNotPresent

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ChangeOrRemoveElement.IfNotPresent[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ChangeOrRemoveElement.IfNotPresent c : ChangeOrRemoveElement.IfNotPresent.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ChangeOrRemoveElement.IfNotPresent valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.html new file mode 100644 index 00000000..58da57ee --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElement.html @@ -0,0 +1,321 @@ + + + + + + +ChangeOrRemoveElement (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Interface ChangeOrRemoveElement<T extends TransformationOperation>

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    ChangeOrRemoveElementTO
    +
    +
    +
    +
    public interface ChangeOrRemoveElement<T extends TransformationOperation>
    +
    This interface should be implemented by TransformationOperation + subclasses that intend to modify a project by changing or modify elements, + standardizing the behavior and API in the absence of the element to be manipulated. +
    +
    + Examples: +
      +
    • files
    • +
    • folders
    • +
    • properties, in properties files
    • +
    • POM dependencies
    • +
    • POM managed dependencies
    • +
    • POM plugins
    • +
    • POM managed plugins
    • +
    • POM properties
    • +
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        failIfNotPresent

        +
        T failIfNotPresent()
        +
        Fail (TOExecutionResult.Type.ERROR) + if the element to be changed or removed is not present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        T warnIfNotPresent()
        +
        Warn (TOExecutionResult.Type.WARNING) + if the element to be changed or removed is not present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        T noOpIfNotPresent()
        +
        Do nothing, not warn neither fail, (TOExecutionResult.Type.NO_OP) + if the element to be changed or removed is not present
        +
        +
        Returns:
        +
        the transformation operation instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.html new file mode 100644 index 00000000..871de9d7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/ChangeOrRemoveElementTO.html @@ -0,0 +1,429 @@ + + + + + + +ChangeOrRemoveElementTO (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.operations
+

Class ChangeOrRemoveElementTO<T extends ChangeOrRemoveElementTO>

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.IfPresent.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.IfPresent.html new file mode 100644 index 00000000..2eb5a95b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.IfPresent.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.html new file mode 100644 index 00000000..367164d7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElement.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Interface com.paypal.butterfly.extensions.api.operations.AddElement (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.paypal.butterfly.extensions.api.operations.AddElement

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElementTO.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElementTO.html new file mode 100644 index 00000000..76c6cef0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/AddElementTO.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.operations.AddElementTO (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.operations.AddElementTO

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.IfNotPresent.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.IfNotPresent.html new file mode 100644 index 00000000..9f7ff875 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.IfNotPresent.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.html new file mode 100644 index 00000000..913f1666 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElement.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElementTO.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElementTO.html new file mode 100644 index 00000000..6b5a91f6 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/class-use/ChangeOrRemoveElementTO.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-frame.html new file mode 100644 index 00000000..32feaa6e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +com.paypal.butterfly.extensions.api.operations (butterfly-extensions-api 2.2.0 API) + + + + + +

com.paypal.butterfly.extensions.api.operations

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-summary.html new file mode 100644 index 00000000..7db7cd77 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-summary.html @@ -0,0 +1,215 @@ + + + + + + +com.paypal.butterfly.extensions.api.operations (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.extensions.api.operations

+
+
Basic transformation operations.
+
+

See: Description

+
+
+ + + + +

Package com.paypal.butterfly.extensions.api.operations Description

+
Basic transformation operations.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-tree.html new file mode 100644 index 00000000..dab45378 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-tree.html @@ -0,0 +1,166 @@ + + + + + + +com.paypal.butterfly.extensions.api.operations Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.extensions.api.operations

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-use.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-use.html new file mode 100644 index 00000000..5765d1a2 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/operations/package-use.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Package com.paypal.butterfly.extensions.api.operations (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.extensions.api.operations

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-frame.html new file mode 100644 index 00000000..9aa6cd89 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-frame.html @@ -0,0 +1,48 @@ + + + + + + +com.paypal.butterfly.extensions.api (butterfly-extensions-api 2.2.0 API) + + + + + +

com.paypal.butterfly.extensions.api

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-summary.html new file mode 100644 index 00000000..a3388d65 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-summary.html @@ -0,0 +1,321 @@ + + + + + + +com.paypal.butterfly.extensions.api (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.extensions.api

+
+
API component to be used by Butterfly extensions when providing their + transformation and upgrade templates.
+
+

See: Description

+
+
+ + + + +

Package com.paypal.butterfly.extensions.api Description

+
API component to be used by Butterfly extensions when providing their + transformation and upgrade templates.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-tree.html new file mode 100644 index 00000000..9acb8ff1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-tree.html @@ -0,0 +1,183 @@ + + + + + + +com.paypal.butterfly.extensions.api Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.extensions.api

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-use.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-use.html new file mode 100644 index 00000000..45f3d2ce --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/package-use.html @@ -0,0 +1,393 @@ + + + + + + +Uses of Package com.paypal.butterfly.extensions.api (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.extensions.api

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/UpgradeStep.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/UpgradeStep.html new file mode 100644 index 00000000..a2758736 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/UpgradeStep.html @@ -0,0 +1,344 @@ + + + + + + +UpgradeStep (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.upgrade
+

Class UpgradeStep

+
+
+ +
+
    +
  • +
    +
    +
    public abstract class UpgradeStep
    +extends TransformationTemplate
    +
    A special type of upgrade template that takes an application + from one minor version to the next subsequent available version.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UpgradeStep

        +
        public UpgradeStep()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getNextVersion

        +
        public abstract String getNextVersion()
        +
        Returns the version the application would be upgraded to
        +
        +
        Returns:
        +
        the version the application would be upgraded to
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getCurrentVersion

        +
        public abstract String getCurrentVersion()
        +
        Returns the current version of the application, in other words, the + version the application would be upgraded from when this upgrade + template is executed
        +
        +
        Returns:
        +
        the current version of the application
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/class-use/UpgradeStep.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/class-use/UpgradeStep.html new file mode 100644 index 00000000..c23f603b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/class-use/UpgradeStep.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.upgrade.UpgradeStep (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.upgrade.UpgradeStep

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-frame.html new file mode 100644 index 00000000..d5608491 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.paypal.butterfly.extensions.api.upgrade (butterfly-extensions-api 2.2.0 API) + + + + + +

com.paypal.butterfly.extensions.api.upgrade

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-summary.html new file mode 100644 index 00000000..b8e21ea4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-summary.html @@ -0,0 +1,160 @@ + + + + + + +com.paypal.butterfly.extensions.api.upgrade (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.extensions.api.upgrade

+
+
API to support defining upgrade transformation templates.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    UpgradeStep +
    A special type of upgrade template that takes an application + from one minor version to the next subsequent available version.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.extensions.api.upgrade Description

+
API to support defining upgrade transformation templates.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-tree.html new file mode 100644 index 00000000..3eaa1926 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.paypal.butterfly.extensions.api.upgrade Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.extensions.api.upgrade

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-use.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-use.html new file mode 100644 index 00000000..e1a06dce --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/upgrade/package-use.html @@ -0,0 +1,164 @@ + + + + + + +Uses of Package com.paypal.butterfly.extensions.api.upgrade (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.extensions.api.upgrade

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Abort.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Abort.html new file mode 100644 index 00000000..05f96c4c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Abort.html @@ -0,0 +1,415 @@ + + + + + + +Abort (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.utilities
+

Class Abort

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setAbortionMessage

        +
        public Abort setAbortionMessage(String abortionMessage)
        +
        Set the reason to abort the transformation
        +
        +
        Parameters:
        +
        abortionMessage - the reason to abort the transformation
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<Abort>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<Abort>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Log.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Log.html new file mode 100644 index 00000000..e0a83e80 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/Log.html @@ -0,0 +1,442 @@ + + + + + + +Log (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.utilities
+

Class Log

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class Log
    +extends TransformationUtility<Log>
    +
    Provides logging statements during transformation time. + Since all it does is logging, it always returns TUExecutionResult.Type.NULL as result of + execution. +
    + If no log level is defined, then it will be set to INFO, except + when there is only one attribute and it is null. In this case + it will be set to WARNING.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Log

        +
        public Log()
        +
        Utility to provide logging statements during transformation time. + Since all it does is logging, it returns as result of execution + the log message
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setLogLevel

        +
        public Log setLogLevel(org.slf4j.event.Level logLevel)
        +
        Sets the log level
        +
        +
        Parameters:
        +
        logLevel - log level
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setLogMessage

        +
        public Log setLogMessage(String logMessage)
        +
        Sets the log message
        +
        +
        Parameters:
        +
        logMessage - log message
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        setAttributeNames

        +
        public Log setAttributeNames(String... attributeNames)
        +
        Sets names of transformation context attributes to be used + as arguments for this log statement
        +
        +
        Parameters:
        +
        attributeNames - names of transformation context attributes to be + used as arguments for this log statement
        +
        Returns:
        +
        this transformation utility object
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<Log>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<Log>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ManualInstruction.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ManualInstruction.html new file mode 100644 index 00000000..8210d211 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ManualInstruction.html @@ -0,0 +1,413 @@ + + + + + + +ManualInstruction (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.utilities
+

Class ManualInstruction

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ManualInstruction
    +extends TransformationUtility<ManualInstruction>
    +
    Registers a manual instruction, also known as "post-upgrade instruction", which can be seen as + a transformation operation that is too complex to be automated, but that should at least be recognized and reported by Butterfly. +
    + In the end of the transformation, every manual instruction is reported in order of registration as Markdown (.md) files.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ManualInstruction

        +
        public ManualInstruction(String description,
        +                         String resourceName)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<ManualInstruction>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        getResourceName

        +
        public String getResourceName()
        +
        Returns the instruction resource name
        +
        +
        Returns:
        +
        the instruction resource name
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<ManualInstruction>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/MapValue.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/MapValue.html new file mode 100644 index 00000000..6b4333d7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/MapValue.html @@ -0,0 +1,488 @@ + + + + + + +MapValue (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.utilities
+

Class MapValue

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class MapValue
    +extends TransformationUtility<MapValue>
    +
    Obtains a specific entry from a Map object stored in the TransformationContext, + and store its value as a new attribute in the transformation context. The name of the transformation + context attribute that holds the map object, and the key used to get the map entry, have to be specified. +
    + The new attribute saved into the transformation context is named based on the utility name, unless + TransformationUtility.setContextAttributeName(String) is called, as usual, nothing new here.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MapValue

        +
        public MapValue()
        +
        This utility obtains a specific entry from a Map object stored in the transformation context, + and store its value as a new attribute in the transformation context. The name of the transformation + context attribute that holds the map object, and the key used to get the map entry, have to be specified. +
        + The new attribute saved into the transformation context is named based on the utility name, unless + TransformationUtility.setContextAttributeName(String) is called, as usual, nothing new here.
        +
      • +
      + + + +
        +
      • +

        MapValue

        +
        public MapValue(String mapName,
        +                Object key)
        +
        This utility obtains a specific entry from a Map object stored in the transformation context, + and store its value as a new attribute in the transformation context. The name of the transformation + context attribute that holds the map object, and the key used to get the map entry, have to be specified. +
        + The new attribute saved into the transformation context is named based on the utility name, unless + TransformationUtility.setContextAttributeName(String) is called, as usual, nothing new here.
        +
        +
        Parameters:
        +
        mapName - the name of the transformation context attribute that holds the map object
        +
        key - the key used to get the map entry
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setMapName

        +
        public MapValue setMapName(String mapName)
        +
        Set the name of the transformation context attribute that holds the map object
        +
        +
        Parameters:
        +
        mapName - the name of the transformation context attribute that holds the map object
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setKey

        +
        public MapValue setKey(Object key)
        +
        Set the key used to get the map entry
        +
        +
        Parameters:
        +
        key - the key used to get the map entry
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getMapName

        +
        public String getMapName()
        +
        Return the name of the transformation context attribute that holds the map object
        +
        +
        Returns:
        +
        the name of the transformation context attribute that holds the map object
        +
        +
      • +
      + + + +
        +
      • +

        getKey

        +
        public Object getKey()
        +
        Returns he key used to get the map entry
        +
        +
        Returns:
        +
        the key used to get the map entry
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<MapValue>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected ExecutionResult execution(File transformedAppFolder,
        +                                    TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<MapValue>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ResultCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ResultCondition.html new file mode 100644 index 00000000..2125e5b1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/ResultCondition.html @@ -0,0 +1,484 @@ + + + + + + +ResultCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.extensions.api.utilities
+

Class ResultCondition

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ResultCondition
    +extends UtilityCondition<ResultCondition>
    +
    Checks the perform result, and optionally execution result as well, of a TransformationUtility instance. + If a result for the specified utility name is not found, this condition returns false, but with a warning.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ResultCondition

        +
        public ResultCondition()
        +
      • +
      + + + +
        +
      • +

        ResultCondition

        +
        public ResultCondition(String utilityName)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        getUtilityName

        +
        public String getUtilityName()
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        Description copied from class: TransformationUtility
        +
        Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated. This is supposed to be an one line statement about the + specific transformation utility that was executed. This would be used for example in + log statements or user interfaces.
        +
        +
        Specified by:
        +
        getDescription in class TransformationUtility<ResultCondition>
        +
        Returns:
        +
        a short one line, but specific, description about the transformation + utility
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected TUExecutionResult execution(File transformedAppFolder,
        +                                      TransformationContext transformationContext)
        +
        Description copied from class: TransformationUtility
        +
        The implementation execution of this transformation utility. + The returned object is the result of the execution and is always + automatically saved in the transformation context as a new + attribute (whose key is the name of the transformation utility), unless + TransformationUtility.isSaveResult() returns false. +
        + Important: this method MUST NEVER return null, and it must catch its executions exceptions + and wrap them into a ExecutionResult error object.
        +
        +
        Specified by:
        +
        execution in class TransformationUtility<ResultCondition>
        +
        Parameters:
        +
        transformedAppFolder - the folder where the transformed application code is
        +
        transformationContext - the transformation context object
        +
        Returns:
        +
        an object with the result of this execution, to be better defined + by the concrete utility class, since its type is generic
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Abort.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Abort.html new file mode 100644 index 00000000..cb8af67d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Abort.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.utilities.Abort (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.utilities.Abort

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Log.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Log.html new file mode 100644 index 00000000..40f391a4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/Log.html @@ -0,0 +1,183 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.utilities.Log (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.utilities.Log

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ManualInstruction.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ManualInstruction.html new file mode 100644 index 00000000..10e0a161 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ManualInstruction.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.utilities.ManualInstruction (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.utilities.ManualInstruction

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/MapValue.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/MapValue.html new file mode 100644 index 00000000..4dbbf5f1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/MapValue.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.utilities.MapValue (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.utilities.MapValue

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ResultCondition.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ResultCondition.html new file mode 100644 index 00000000..35a824d0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/class-use/ResultCondition.html @@ -0,0 +1,180 @@ + + + + + + +Uses of Class com.paypal.butterfly.extensions.api.utilities.ResultCondition (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.extensions.api.utilities.ResultCondition

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-frame.html new file mode 100644 index 00000000..23383c0e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.paypal.butterfly.extensions.api.utilities (butterfly-extensions-api 2.2.0 API) + + + + + +

com.paypal.butterfly.extensions.api.utilities

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-summary.html new file mode 100644 index 00000000..1d3671e5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-summary.html @@ -0,0 +1,185 @@ + + + + + + +com.paypal.butterfly.extensions.api.utilities (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.extensions.api.utilities

+
+
Basic transformation utilities.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Abort +
    Aborts the transformation immediately.
    +
    Log +
    Provides logging statements during transformation time.
    +
    ManualInstruction +
    Registers a manual instruction, also known as "post-upgrade instruction", which can be seen as + a transformation operation that is too complex to be automated, but that should at least be recognized and reported by Butterfly.
    +
    MapValue +
    Obtains a specific entry from a Map object stored in the TransformationContext, + and store its value as a new attribute in the transformation context.
    +
    ResultCondition +
    Checks the perform result, and optionally execution result as well, of a TransformationUtility instance.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.extensions.api.utilities Description

+
Basic transformation utilities.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-tree.html new file mode 100644 index 00000000..bbcd0f13 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-tree.html @@ -0,0 +1,151 @@ + + + + + + +com.paypal.butterfly.extensions.api.utilities Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.extensions.api.utilities

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-use.html b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-use.html new file mode 100644 index 00000000..3935de9d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/com/paypal/butterfly/extensions/api/utilities/package-use.html @@ -0,0 +1,185 @@ + + + + + + +Uses of Package com.paypal.butterfly.extensions.api.utilities (butterfly-extensions-api 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.extensions.api.utilities

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/constant-values.html b/docs/javadocs/2.2.0/butterfly-extensions-api/constant-values.html new file mode 100644 index 00000000..2e5dc976 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/constant-values.html @@ -0,0 +1,155 @@ + + + + + + +Constant Field Values (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

com.paypal.*

+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/deprecated-list.html b/docs/javadocs/2.2.0/butterfly-extensions-api/deprecated-list.html new file mode 100644 index 00000000..b51a2a6d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/deprecated-list.html @@ -0,0 +1,157 @@ + + + + + + +Deprecated List (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+ +
+ + +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/help-doc.html b/docs/javadocs/2.2.0/butterfly-extensions-api/help-doc.html new file mode 100644 index 00000000..a4cc2073 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/help-doc.html @@ -0,0 +1,231 @@ + + + + + + +API Help (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/index-all.html b/docs/javadocs/2.2.0/butterfly-extensions-api/index-all.html new file mode 100644 index 00000000..3cb3f9b3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/index-all.html @@ -0,0 +1,1574 @@ + + + + + + +Index (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I L M N O P R S T U V W  + + +

A

+
+
Abort - Class in com.paypal.butterfly.extensions.api.utilities
+
+
Aborts the transformation immediately.
+
+
Abort() - Constructor for class com.paypal.butterfly.extensions.api.utilities.Abort
+
+
This transformation utility abort the transformation.
+
+
Abort(String) - Constructor for class com.paypal.butterfly.extensions.api.utilities.Abort
+
+
This transformation utility abort the transformation.
+
+
AbortDetails - Class in com.paypal.butterfly.extensions.api.metrics
+
+
POJO describing a transformation abort.
+
+
AbortDetails(Exception, String, String) - Constructor for class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
abortOnFailure(boolean) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
If set to true, abort the whole transformation if validation or execution fails.
+
+
abortOnFailure(boolean, String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
If set to true, abort the whole transformation if validation or execution fails.
+
+
abortOnFailure() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns whether this operation aborts the transformation or not in + case of an operation failure.
+
+
absolute(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
There are two ways to specify the file, or folder, the transformation + utility is suppose to perform against.
+
+
absolute(String, String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Same as TransformationUtility.absolute(String, String), however, the absolute + file is set with an additional relative path, which is defined via parameter + additionalRelativePath.
+
+
add(Class<? extends TransformationTemplate>) - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
Adds a new transformation template class to the set
+
+
add(TransformationUtility) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Adds a new transformation utility to the end of the list.
+
+
add(TransformationUtility, String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Adds a new transformation utility to the end of the list.
+
+
add(TransformationUtility) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
add(TransformationUtility, String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
AddElement<T extends TransformationOperation> - Interface in com.paypal.butterfly.extensions.api.operations
+
+
This interface should be implemented by TransformationOperation + subclasses that intend to modify a project by adding elements to it, + standardizing the behavior and API if the element to be added already exists.
+
+
AddElement.IfPresent - Enum in com.paypal.butterfly.extensions.api.operations
+
+
Possible behaviors in case the element to be added already exists.
+
+
AddElementTO<T extends AddElementTO> - Class in com.paypal.butterfly.extensions.api.operations
+
+
Convenience class with AddElement implementation ready for TransformationOperation subclasses.
+
+
AddElementTO() - Constructor for class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
addMultiple(TransformationOperation, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Adds a special transformation utility to perform multiple transformation operations against + multiple files specified as a list, held as a transformation context attribute +
+
+
addMultiple(TransformationOperation, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
ApplicationValidationException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Thrown whenever the application to be transformed is not in a valid state.
+
+
ApplicationValidationException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ApplicationValidationException
+
 
+
ApplicationValidationException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ApplicationValidationException
+
 
+
applyPropertiesFromContext(TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Applies transformation utility properties during transformation time, but + prior to execution (right before it).
+
+
automaticResolution(File) - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
Butterfly might be able to automatically identify, based on the application + content, the most applicable transformation template to transform it.
+
+
+ + + +

B

+
+
ButterflyException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Butterfly generic checked exception.
+
+
ButterflyException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ButterflyException
+
 
+
ButterflyException(String, Throwable) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ButterflyException
+
 
+
ButterflyRuntimeException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Butterfly generic runtime exception.
+
+
ButterflyRuntimeException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ButterflyRuntimeException
+
 
+
ButterflyRuntimeException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.ButterflyRuntimeException
+
 
+
+ + + +

C

+
+
ChangeOrRemoveElement<T extends TransformationOperation> - Interface in com.paypal.butterfly.extensions.api.operations
+
+
This interface should be implemented by TransformationOperation + subclasses that intend to modify a project by changing or modify elements, + standardizing the behavior and API in the absence of the element to be manipulated.
+
+
ChangeOrRemoveElement.IfNotPresent - Enum in com.paypal.butterfly.extensions.api.operations
+
+
Possible behaviors in case the element to be changed or removed is not present.
+
+
ChangeOrRemoveElementTO<T extends ChangeOrRemoveElementTO> - Class in com.paypal.butterfly.extensions.api.operations
+
+
Convenience class with ChangeOrRemoveElement implementation ready for TransformationOperation subclasses.
+
+
ChangeOrRemoveElementTO() - Constructor for class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO
+
 
+
changeTypeOnWarning() - Method in class com.paypal.butterfly.extensions.api.PerformResult
+
 
+
changeTypeOnWarning() - Method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
 
+
changeTypeOnWarning() - Method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
checkDependencies(TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Check if any of dependency of this TU failed.
+
+
checkForBlankString(String, String) - Static method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Check if value is a blank String, if it is, then a + TransformationDefinitionException is thrown.
+
+
checkForEmptyString(String, String) - Static method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Check if value is an empty String, if it is, then a + TransformationDefinitionException is thrown.
+
+
checkForNull(String, Object) - Static method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Check if value is null, if it is, then a + TransformationDefinitionException is thrown.
+
+
clone() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Creates and returns a clone object identical to the original object, + except for the "has been performed" flag, which is set to false + in the clone object to be returned.
+
+
clone() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
com.paypal.butterfly.extensions.api - package com.paypal.butterfly.extensions.api
+
+
API component to be used by Butterfly extensions when providing their + transformation and upgrade templates.
+
+
com.paypal.butterfly.extensions.api.exception - package com.paypal.butterfly.extensions.api.exception
+
+
Butterfly exceptions.
+
+
com.paypal.butterfly.extensions.api.metrics - package com.paypal.butterfly.extensions.api.metrics
+
+
API to provide transformation metrics and statistics.
+
+
com.paypal.butterfly.extensions.api.operations - package com.paypal.butterfly.extensions.api.operations
+
+
Basic transformation operations.
+
+
com.paypal.butterfly.extensions.api.upgrade - package com.paypal.butterfly.extensions.api.upgrade
+
+
API to support defining upgrade transformation templates.
+
+
com.paypal.butterfly.extensions.api.utilities - package com.paypal.butterfly.extensions.api.utilities
+
+
Basic transformation utilities.
+
+
compare(File, File) - Method in class com.paypal.butterfly.extensions.api.DoubleCondition
+
+
Returns true only if the compared files meet the comparison + criteria established and implemented by the subclass
+
+
ContextAttributeRetriever<T> - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility to fetch transformation context attributes post + transformation time, since they are always set + during transformation time.
+
+
ContextAttributeRetriever() - Constructor for class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
 
+
ContextAttributeRetriever(String) - Constructor for class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
 
+
copy() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Creates and returns a copy object similar to the original object.
+
+
+ + + +

D

+
+
debug(String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
debug(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
debug(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
debug(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
dependencyFailureCheck() - Method in class com.paypal.butterfly.extensions.api.PerformResult
+
 
+
dependencyFailureCheck() - Method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
 
+
dependencyFailureCheck() - Method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
dependsOn(String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Add all transformation utilities this utility depends on.
+
+
DoubleCondition<T extends DoubleCondition> - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility condition to determine if a transformation utility + should be executed or not, based on a two files criteria.
+
+
DoubleCondition() - Constructor for class com.paypal.butterfly.extensions.api.DoubleCondition
+
+
Condition to determine if a transformation utility + should be executed or not.
+
+
DoubleCondition(String) - Constructor for class com.paypal.butterfly.extensions.api.DoubleCondition
+
+
Condition to determine if a transformation utility + should be executed or not.
+
+
+ + + +

E

+
+
equals(Object) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Compare this instance against the specified object, and return + true only if they are equal.
+
+
error(TransformationUtility, Exception, String) - Static method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
This means The TU failed, but not because of its utility execution itself, but because of an internal reason.
+
+
error(TransformationUtility, Exception) - Static method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
This means The TU failed, but not because of its utility execution itself, but because of an internal reason.
+
+
error(TransformationOperation, Exception) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.ERROR result
+
+
error(TransformationOperation, Exception, String) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.ERROR result
+
+
error(TransformationUtility, Exception) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
error(TransformationUtility, Exception, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
error(TransformationUtility, Object, Exception, String) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
executeIf(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
When set, this TU will only execute if this transformation context + attribute is existent and true.
+
+
executeIf(UtilityCondition) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
When set, this TU will only execute if this utilityCondition object, + executed right before this TU, result in true.
+
+
executeUnless(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
When set, this TU will execute, unless this transformation context + attribute is existent and true.
+
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.DoubleCondition
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
The implementation execution of this transformation utility.
+
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Returns, as its value, the condition to keep iterating over this loop
+
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.utilities.Abort
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.utilities.Log
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
ExecutionResult<S,R,T> - Class in com.paypal.butterfly.extensions.api
+
+
The meta-data object resulted after the TransformationUtility instance has been executed.
+
+
executionResult(TransformationUtility, ExecutionResult) - Static method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
This means the utility has been executed, + and the result type is defined based on the utility execution result type.
+
+
Extension<E> - Class in com.paypal.butterfly.extensions.api
+
+
A Butterfly third-party extension.
+
+
Extension() - Constructor for class com.paypal.butterfly.extensions.api.Extension
+
 
+
+ + + +

F

+
+
failIfNotPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement
+
+
Fail (TOExecutionResult.Type.ERROR) + if the element to be changed or removed is not present
+
+
failIfNotPresent() - Method in class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO
+
 
+
failIfPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.AddElement
+
+
Fail (TOExecutionResult.Type.ERROR) + if the element to be added is already present
+
+
failIfPresent() - Method in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
FilterFiles - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility to filter a list of files based on a given + SingleCondition, + returning in a sub-list of files.
+
+
FilterFiles() - Constructor for class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Utility to filter a list of files based on a given + SingleCondition, + returning in a sub-list of files
+
+
FilterFiles(SingleCondition) - Constructor for class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Utility to filter a list of files based on a given + SingleCondition, + returning in a sub-list of files
+
+
+ + + +

G

+
+
get(String) - Method in interface com.paypal.butterfly.extensions.api.TransformationContext
+
+
Returns the attribute object associated with the key + (which is the attribute name), or null, if there is none
+
+
getAbortDetails() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns details about the reason why the transformation + associated with this metric record aborted.
+
+
getAbortionMessage() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns a message to be logged if a fail happens and transformation has to be aborted
+
+
getAbortMessage() - Method in class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
getAbsoluteFile(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns an absolute path to the file or folder the transformation + utility is supposed to perform against
+
+
getApplicationName() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the name of the transformed application
+
+
getApplicationName() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Returns the name of the transformed application, + Returns null if the application name is unknown.
+
+
getApplicationType() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the type of the transformed application
+
+
getApplicationType() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Returns the type of the transformed application, + Returns null if the application type is unknown.
+
+
getAttribute() - Method in class com.paypal.butterfly.extensions.api.DoubleCondition
+
+
Return the name of the transformation context attribute + that refers to the file to be compared against the + baseline file
+
+
getAttribute() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getAttributeValue() - Method in class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
+
Returns the value of the transformation context attribute + specified earlier.
+
+
getButterflyVersion() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns Butterfly version
+
+
getChildren() - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
getChildren() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
getChildren() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
getChildren() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getCondition() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getConditionTemplate() - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Return the single condition template to be evaluated against all files
+
+
getConditionTemplate() - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Return the condition template
+
+
getContextAttributeName() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Return the name to be used as key for the result of this utility + when saved into the transformation context.
+
+
getDateTime() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the transformation date in "yyyyy-mm-dd hh:mm:ss"
+
+
getDependencies() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns an unmodifiable list of names of utilities this utility instance depends on.
+
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
Returns the extension description
+
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Returns the transformation template description
+
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns a short one line, but SPECIFIC, description about the transformation + utility, including mentioning the files and/or folders + to be manipulated.
+
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.utilities.Abort
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.utilities.Log
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
 
+
getDescription() - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
getExceptionClass() - Method in class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
getExceptionMessage() - Method in class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
getExceptionStackTrace() - Method in class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
getExecutionResult() - Method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
Return the ExecutionResult object associated with this perform result
+
+
getExtensionClass() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Returns the class of the extension this transformation + template belongs to
+
+
getFilesAttributes() - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Return an array containing the name of transformation context attributes + that hold the list of files to be filtered
+
+
getFilesAttributes() - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
A copy of the array of transformation context attributes that hold list of Files + which the condition should perform against.
+
+
getFilesAttributes() - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
Return an array containing the name of transformation context attributes + that hold the list of files the operations should be performed against
+
+
getFromVersion() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the version the application was upgraded from.
+
+
getIfConditionAttributeName() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Return the "if" condition attribute name associated with this transformation operation, + or null, if there is none
+
+
getIterations() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getKey() - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
Returns he key used to get the map entry
+
+
getManualInstructionsCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getMapName() - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
Return the name of the transformation context attribute that holds the map object
+
+
getMetricsId() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns an identifier for this metrics record
+
+
getMode() - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Return the evaluation mode
+
+
getName() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
getName() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
getNextIteration() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getNextStep() - Method in class com.paypal.butterfly.extensions.api.upgrade.UpgradeStep
+
+
Returns the next UpgradeStep.
+
+
getNextVersion() - Method in class com.paypal.butterfly.extensions.api.upgrade.UpgradeStep
+
+
Returns the version the application would be upgraded to
+
+
getOperationsCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getOrCreateReadFile(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationOperation
+
+
Creates and returns a temporary read-only copy of the file to be modified.
+
+
getOrder() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns the execution order for this utility on its parent.
+
+
getOriginalApplicationLocation() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the absolute path to the original application code
+
+
getParent() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns the transformation utility parent
+
+
getPerformResultErrorCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getPerformResultExecutionResultCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getPerformResultSkippedConditionCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getPerformResultSkippedDependencyCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getPerformResultTypes() - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
getRelativePath() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns relative path (from the application root folder) to the + file or folder the transformation utility is suppose to perform against
+
+
getRelativePath(File, File) - Static method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns a relative path from baselineFile to targetFile.
+
+
getResourceName() - Method in class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
+
Returns the instruction resource name
+
+
getResult(String) - Method in interface com.paypal.butterfly.extensions.api.TransformationContext
+
+
Returns the performing result of the TransformationUtility + identified by the specified name.
+
+
getRootPomFile(File) - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
This is a convenience method in case the Extension subclass wants to implement its + Extension.automaticResolution(File) method based on one or more Maven pom files
+
+
getStatistics() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns transformation statistics
+
+
getTemplate() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
getTemplateClasses() - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
Returns a read-only set containing all transformation template classes
+
+
getTemplateName() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the transformation template name
+
+
getTemplateOperation() - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
getTimestamp() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the transformation date in milliseconds
+
+
getTOExecutionResultErrorCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getTOExecutionResultNoOpCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getTOExecutionResultSuccessCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getToExecutionResultTypes() - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
getTOExecutionResultWarningCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getToVersion() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the version the application was upgraded to.
+
+
getTransformationTemplate() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns the transformation template this utility belongs to
+
+
getTransformedApplicationLocation() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the absolute path to the transformed application code
+
+
getTUExecutionResultErrorCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getTUExecutionResultNullCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getTuExecutionResultTypes() - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
getTUExecutionResultValueCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getTUExecutionResultWarningCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getUnlessConditionAttributeName() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Return the "unless" condition attribute name associated with this transformation operation, + or null, if there is none
+
+
getUpgradeCorrelationId() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns an identifier used to correlate + all upgrade steps part of the same upgrade path.
+
+
getUserId() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns the OS id of the user who performed the transformation
+
+
getUtilities() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Returns a read-only ordered list of transformation utilities to be executed, + which defines the actual transformation offered by this template
+
+
getUtilities() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
getUtilitiesCount() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationStatistics
+
 
+
getUtilityName() - Method in class com.paypal.butterfly.extensions.api.metrics.AbortDetails
+
 
+
getUtilityName() - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
getValue() - Method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
+
Returns the value returned by the transformation utility, which can be null
+
+
getVersion() - Method in class com.paypal.butterfly.extensions.api.Extension
+
+
Returns the extension version
+
+
+ + + +

H

+
+
hasBeenPerformed() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Returns true only if this utility has already been performed
+
+
hashCode() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
hashCode(int, Object...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Calculates and return a hash code starting from the + hash code generated from superclass
+
+
+ + + +

I

+
+
ifNotPresent - Variable in class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO
+
 
+
ifPresent - Variable in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
info(String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
info(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
info(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
info(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
isExceptionType() - Method in class com.paypal.butterfly.extensions.api.PerformResult
+
 
+
isExceptionType() - Method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
 
+
isExceptionType() - Method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
isFileSet() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Return true only if a file has been set.
+
+
isRequiresManualInstructions() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
+
Returns true if the transformed application requires + manual instructions to complete the transformation
+
+
isSaveResult() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
This flag indicates whether the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object.
+
+
isSuccessfulTransformation() - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetrics
+
 
+
iterate() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Returns a clone of this transformation utility loop ready for the next iteration
+
+
+ + + +

L

+
+
log(String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Deprecated.
+
+
log(Level, String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
log(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Deprecated.
+
+
log(Level, String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
log(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
+
Deprecated.
+
+
log(Level, String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
log(String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
+
Deprecated.
+
+
log(Level, String, String...) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
Log - Class in com.paypal.butterfly.extensions.api.utilities
+
+
Provides logging statements during transformation time.
+
+
Log() - Constructor for class com.paypal.butterfly.extensions.api.utilities.Log
+
+
Utility to provide logging statements during transformation time.
+
+
loop(TransformationUtility, int) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Execute an utility in a loop a number times specified in iterations
+
+
loop(TransformationUtility, String) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Execute an utility in a loop while the value in TransformationContext attribute is true.
+
+
loop(TransformationUtility, UtilityCondition) - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
+
Execute an utility in a loop while the execution value resulted by condition is true.
+
+
+ + + +

M

+
+
ManualInstruction - Class in com.paypal.butterfly.extensions.api.utilities
+
+
Registers a manual instruction, also known as "post-upgrade instruction", which can be seen as + a transformation operation that is too complex to be automated, but that should at least be recognized and reported by Butterfly.
+
+
ManualInstruction(String, String) - Constructor for class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
 
+
MapValue - Class in com.paypal.butterfly.extensions.api.utilities
+
+
Obtains a specific entry from a Map object stored in the TransformationContext, + and store its value as a new attribute in the transformation context.
+
+
MapValue() - Constructor for class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
This utility obtains a specific entry from a Map object stored in the transformation context, + and store its value as a new attribute in the transformation context.
+
+
MapValue(String, Object) - Constructor for class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
This utility obtains a specific entry from a Map object stored in the transformation context, + and store its value as a new attribute in the transformation context.
+
+
MultipleConditions - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility condition to determine if a transformation utility should be executed or not, + based on a multiple files criteria.
+
+
MultipleConditions(SingleCondition) - Constructor for class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Perform one transformation utility condition against multiple files, + returning true if at least one file meets the condition (default mode).
+
+
MultipleConditions.Mode - Enum in com.paypal.butterfly.extensions.api
+
+
Execution mode for MultipleConditions.
+
+
MultipleOperations - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility to perform multiple transformation operations.
+
+
MultipleOperations() - Constructor for class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
Utility to perform multiple transformation operations.
+
+
MultipleOperations(TransformationOperation) - Constructor for class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
Utility to perform multiple transformation operations.
+
+
+ + + +

N

+
+
newConditionInstance(File, File) - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Creates a new single condition instance copying from this current + object, but setting the file it should perform against based + on the input parameters
+
+
newConditionInstance(File, File) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Creates a new condition instance copying from this current + object, but setting the file it should perform against based + on the input parameters
+
+
noOp(TransformationOperation, String) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.NO_OP result
+
+
noOpIfNotPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement
+
+
Do nothing, not warn neither fail, (TOExecutionResult.Type.NO_OP) + if the element to be changed or removed is not present
+
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO
+
 
+
noOpIfPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.AddElement
+
+
Do nothing, not add, not warn neither fail, (TOExecutionResult.Type.NO_OP) + if the element to be added is already present
+
+
noOpIfPresent() - Method in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
normalizeRelativePathSeparator(String) - Static method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
notify(List<TransformationMetrics>) - Method in interface com.paypal.butterfly.extensions.api.metrics.TransformationMetricsListener
+
 
+
nullResult(TransformationUtility) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
nullResult(TransformationUtility, String) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
+ + + +

O

+
+
overwriteIfPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.AddElement
+
+
Overwrite and not warn (TOExecutionResult.Type.SUCCESS) + if the element to be added is already present
+
+
overwriteIfPresent() - Method in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
+ + + +

P

+
+
perform(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationOperation
+
 
+
perform(File, TransformationContext) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Performs the transformation utility against + the application to be transformed +
+ This is the one called by the transformation + engine, and regardless of any customization it + could have, it must always: + + 1- Call TransformationUtility.applyPropertiesFromContext(TransformationContext) + 2- Call TransformationUtility.execution(File, TransformationContext) + +
+ This method is NOT supposed to be overwritten, + unless you really know what you are doing.
+
+
PerformResult - Class in com.paypal.butterfly.extensions.api
+
+
The meta-data object resulted after the TransformationUtility instance has been performed.
+
+
PerformResult.Type - Enum in com.paypal.butterfly.extensions.api
+
+
The type of result after the TransformationUtility instance has been performed.
+
+
+ + + +

R

+
+
relative(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Sets the relative path from the application root folder + to the file or folder the transformation utility should perform against.
+
+
ResultCondition - Class in com.paypal.butterfly.extensions.api.utilities
+
+
Checks the perform result, and optionally execution result as well, of a TransformationUtility instance.
+
+
ResultCondition() - Constructor for class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
ResultCondition(String) - Constructor for class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
run() - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Returns the TU instance to be run in the this iteration.
+
+
+ + + +

S

+
+
set(String, String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
This method allows setting properties in this transformation + utility during transformation time, right before its execution.
+
+
setAbortionMessage(String) - Method in class com.paypal.butterfly.extensions.api.utilities.Abort
+
+
Set the reason to abort the transformation
+
+
setAttribute(String) - Method in class com.paypal.butterfly.extensions.api.DoubleCondition
+
+
Set the name of the transformation context attribute + that refers to the file to be compared against the + baseline file, which is set by regular TransformationUtility + methods, like TransformationUtility.relative(String) or TransformationUtility.absolute(String)
+
+
setAttributeName(String) - Method in class com.paypal.butterfly.extensions.api.ContextAttributeRetriever
+
 
+
setAttributeNames(String...) - Method in class com.paypal.butterfly.extensions.api.utilities.Log
+
+
Sets names of transformation context attributes to be used + as arguments for this log statement
+
+
setCondition(int) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
In this case the condition to execute the next iteration is based on + a pre-defined number of iterations to be executed.
+
+
setCondition(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
In this case the condition to execute the next iteration is based on + a TransformationContext attribute (specified by its name) whose + value is true or false.
+
+
setCondition(UtilityCondition) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
In this case the condition to execute the next iteration is based on + a UtilityCondition object whose result is true or false.
+
+
setConditionTemplate(SingleCondition) - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Set the single condition template to be evaluated against all files
+
+
setConditionTemplate(SingleCondition) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Set the utility condition template used to create conditions + to be evaluated against the list of files
+
+
setContextAttributeName(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Set the name to be used as key for the result of this utility + when saved into the transformation context.
+
+
setDescription(String) - Method in class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
 
+
setFiles(String...) - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
+
Sets one or more transformation context attributes that hold list of Files + which the single condition should be evaluated against.
+
+
setFiles(String...) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Sets one or more transformation context attributes that hold list of Files + which the condition should perform against.
+
+
setFiles(String...) - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
Sets one or more transformation context attributes that hold list of Files + which the transformation operations should perform against.
+
+
setKey(Object) - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
Set the key used to get the map entry
+
+
setLogLevel(Level) - Method in class com.paypal.butterfly.extensions.api.utilities.Log
+
+
Sets the log level
+
+
setLogMessage(String) - Method in class com.paypal.butterfly.extensions.api.utilities.Log
+
+
Sets the log message
+
+
setMapName(String) - Method in class com.paypal.butterfly.extensions.api.utilities.MapValue
+
+
Set the name of the transformation context attribute that holds the map object
+
+
setMode(MultipleConditions.Mode) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
+
Set the evaluation mode.
+
+
setName(String) - Method in class com.paypal.butterfly.extensions.api.FilterFiles
+
 
+
setName(String) - Method in class com.paypal.butterfly.extensions.api.MultipleConditions
+
 
+
setName(String) - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
setName(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Set this transformation utility instance name.
+
+
setName(String) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
 
+
setOperationTemplate(TransformationOperation) - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
Sets the template of transformation operation to be performed against all specified files.
+
+
setParent(TransformationUtilityParent, int) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Register this utility to its parent, and also assign it a name + based on the parent name and order of execution.
+
+
setPerformResultTypes(PerformResult.Type...) - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
setProperties(String, String) - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
+
This setter is similar to TransformationUtility.set(String, String), however it is more powerful, because + it allows setting, during transformation time, different properties values for each operation of a + MultipleOperations.
+
+
setPropertySetter() - Method in class com.paypal.butterfly.extensions.api.MultipleOperations
+
 
+
setResourceName(String) - Method in class com.paypal.butterfly.extensions.api.utilities.ManualInstruction
+
 
+
setSaveResult(boolean) - Method in class com.paypal.butterfly.extensions.api.TransformationOperation
+
 
+
setSaveResult(boolean) - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Sets whether or not the value produced by the transformation utility execution, + and also its result object as a whole, should both be saved in the transformation + context object.
+
+
setTemplate(TransformationUtility) - Method in class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Sets the transformation utility instance to be used as a template.
+
+
setToExecutionResultTypes(TOExecutionResult.Type...) - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
setTuExecutionResultTypes(TUExecutionResult.Type...) - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
setUtilityName(String) - Method in class com.paypal.butterfly.extensions.api.utilities.ResultCondition
+
 
+
SingleCondition<T extends SingleCondition> - Class in com.paypal.butterfly.extensions.api
+
+
Transformation utility condition to determine if a transformation utility + should be executed or not, based on an one file criteria.
+
+
SingleCondition() - Constructor for class com.paypal.butterfly.extensions.api.SingleCondition
+
 
+
skippedCondition(TransformationUtility, String) - Static method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
This means the utility has not been executed + because its pre-requisite condition is not true
+
+
skippedDependency(TransformationUtility, String) - Static method in class com.paypal.butterfly.extensions.api.PerformResult
+
+
This means the utility has not been executed because one or more + of its dependencies "failed".
+
+
success(TransformationOperation, String) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.SUCCESS result
+
+
+ + + +

T

+
+
TemplateResolutionException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Thrown by Extension.automaticResolution(File) + whenever a transformation template cannot be resolved.
+
+
TemplateResolutionException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TemplateResolutionException
+
+
This exception is thrown by Extension.automaticResolution(File) + whenever transformation template cannot be resolved
+
+
TemplateResolutionException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TemplateResolutionException
+
+
This exception is thrown by Extension.automaticResolution(File) + whenever transformation template cannot be resolved
+
+
TOExecutionResult - Class in com.paypal.butterfly.extensions.api
+
+
The meta-data object resulted after the TransformationOperation instance has been executed.
+
+
TOExecutionResult.Type - Enum in com.paypal.butterfly.extensions.api
+
+
The type of result after the TransformationOperation instance has been executed.
+
+
toString() - Method in class com.paypal.butterfly.extensions.api.Extension
+
 
+
toString() - Method in class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
toString() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
TransformationContext - Interface in com.paypal.butterfly.extensions.api
+
+
Holds meta-data information + to be shared among transformation utility objects, + allowing communication among them, and helping the + transformation process.
+
+
TransformationDefinitionException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Thrown whenever a transformation template definition is not well formed.
+
+
TransformationDefinitionException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException
+
 
+
TransformationDefinitionException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationDefinitionException
+
 
+
TransformationMetrics - Interface in com.paypal.butterfly.extensions.api.metrics
+
+
POJO containing meta-data and statistics about + the result of a transformation execution.
+
+
TransformationMetricsListener - Interface in com.paypal.butterfly.extensions.api.metrics
+
+
Spring beans that implement this interface are notified + about metrics generated by any transformation.
+
+
TransformationOperation<T extends TransformationOperation> - Class in com.paypal.butterfly.extensions.api
+
+
Special type of TransformationUtility that applies a modification to the project.
+
+
TransformationOperation() - Constructor for class com.paypal.butterfly.extensions.api.TransformationOperation
+
 
+
TransformationOperationException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Thrown whenever an unexpected behavior or result + during execution of a TransformationOperation.
+
+
TransformationOperationException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationOperationException
+
 
+
TransformationOperationException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationOperationException
+
 
+
TransformationStatistics - Interface in com.paypal.butterfly.extensions.api.metrics
+
+
Transformation statistics.
+
+
TransformationTemplate - Class in com.paypal.butterfly.extensions.api
+
+
A template made of a set of transformation utilities to be applied against an application to be transformed.
+
+
TransformationTemplate() - Constructor for class com.paypal.butterfly.extensions.api.TransformationTemplate
+
 
+
TransformationUtility<T extends TransformationUtility> - Class in com.paypal.butterfly.extensions.api
+
+
Gathers information about the project to be transformed without applying any modification on it.
+
+
TransformationUtility() - Constructor for class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
TransformationUtilityException - Exception in com.paypal.butterfly.extensions.api.exception
+
+
Thrown whenever an unexpected behavior or result + during execution of a TransformationUtility.
+
+
TransformationUtilityException(String) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationUtilityException
+
 
+
TransformationUtilityException(String, Exception) - Constructor for exception com.paypal.butterfly.extensions.api.exception.TransformationUtilityException
+
 
+
TransformationUtilityGroup - Class in com.paypal.butterfly.extensions.api
+
+
Group of transformation utilities.
+
+
TransformationUtilityGroup() - Constructor for class com.paypal.butterfly.extensions.api.TransformationUtilityGroup
+
 
+
TransformationUtilityLoop - Class in com.paypal.butterfly.extensions.api
+
+
Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop.
+
+
TransformationUtilityLoop() - Constructor for class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop.
+
+
TransformationUtilityLoop(TransformationUtility) - Constructor for class com.paypal.butterfly.extensions.api.TransformationUtilityLoop
+
+
Allows the execution of any transformation utility instance, + including a TransformationUtilityGroup, multiple times in a loop.
+
+
TUExecutionResult - Class in com.paypal.butterfly.extensions.api
+
+
The meta-data object resulted after the TransformationUtility instance has been executed.
+
+
TUExecutionResult.Type - Enum in com.paypal.butterfly.extensions.api
+
+
The type of result after the TransformationUtility instance has been executed.
+
+
+ + + +

U

+
+
UpgradeStep - Class in com.paypal.butterfly.extensions.api.upgrade
+
+
A special type of upgrade template that takes an application + from one minor version to the next subsequent available version.
+
+
UpgradeStep() - Constructor for class com.paypal.butterfly.extensions.api.upgrade.UpgradeStep
+
 
+
UTILITY_NAME_SYNTAX - Static variable in class com.paypal.butterfly.extensions.api.TransformationUtility
+
 
+
UtilityCondition<U extends UtilityCondition> - Class in com.paypal.butterfly.extensions.api
+
+
Condition to determine if a transformation utility + should be executed or not.
+
+
UtilityCondition() - Constructor for class com.paypal.butterfly.extensions.api.UtilityCondition
+
 
+
+ + + +

V

+
+
value(TransformationUtility, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
value(TransformationUtility, String, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.MultipleConditions.Mode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.PerformResult.Type
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.TOExecutionResult.Type
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.extensions.api.TUExecutionResult.Type
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.MultipleConditions.Mode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.PerformResult.Type
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.TOExecutionResult.Type
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.extensions.api.TUExecutionResult.Type
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+ + + +

W

+
+
warnButAddIfPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.AddElement
+
+
Warn, but add, (TOExecutionResult.Type.WARNING) + if the element to be added is already present
+
+
warnButAddIfPresent() - Method in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
warnIfNotPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement
+
+
Warn (TOExecutionResult.Type.WARNING) + if the element to be changed or removed is not present
+
+
warnIfNotPresent() - Method in class com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElementTO
+
 
+
warning(TransformationOperation) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.WARNING result
+
+
warning(TransformationOperation, String) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.WARNING result
+
+
warning(TransformationOperation, Exception) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.WARNING result
+
+
warning(TransformationOperation, Exception, String) - Static method in class com.paypal.butterfly.extensions.api.TOExecutionResult
+
+
Creates and returns a new TOExecutionResult.Type.WARNING result
+
+
warning(TransformationUtility, String, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
warning(TransformationUtility, Exception, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
warning(TransformationUtility, Exception, String, Object) - Static method in class com.paypal.butterfly.extensions.api.TUExecutionResult
+
 
+
warnNotAddIfPresent() - Method in interface com.paypal.butterfly.extensions.api.operations.AddElement
+
+
Warn and do not add (TOExecutionResult.Type.WARNING) + if the element to be added is already present
+
+
warnNotAddIfPresent() - Method in class com.paypal.butterfly.extensions.api.operations.AddElementTO
+
 
+
wasFileExplicitlySet() - Method in class com.paypal.butterfly.extensions.api.TransformationUtility
+
+
Return true only if a file has been set explicitly either via TransformationUtility.relative(String) or TransformationUtility.absolute(String).
+
+
+A B C D E F G H I L M N O P R S T U V W 
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/index.html b/docs/javadocs/2.2.0/butterfly-extensions-api/index.html new file mode 100644 index 00000000..eaa3869b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/index.html @@ -0,0 +1,75 @@ + + + + + + +butterfly-extensions-api 2.2.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/overview-frame.html b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-frame.html new file mode 100644 index 00000000..1cd7b83e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-frame.html @@ -0,0 +1,27 @@ + + + + + + +Overview List (butterfly-extensions-api 2.2.0 API) + + + + + + + +

 

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/overview-summary.html b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-summary.html new file mode 100644 index 00000000..9a3b352b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-summary.html @@ -0,0 +1,173 @@ + + + + + + +Overview (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

butterfly-extensions-api 2.2.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.paypal.butterfly.extensions.api +
API component to be used by Butterfly extensions when providing their + transformation and upgrade templates.
+
com.paypal.butterfly.extensions.api.exception +
Butterfly exceptions.
+
com.paypal.butterfly.extensions.api.metrics +
API to provide transformation metrics and statistics.
+
com.paypal.butterfly.extensions.api.operations +
Basic transformation operations.
+
com.paypal.butterfly.extensions.api.upgrade +
API to support defining upgrade transformation templates.
+
com.paypal.butterfly.extensions.api.utilities +
Basic transformation utilities.
+
+
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/overview-tree.html b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-tree.html new file mode 100644 index 00000000..329d4f03 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/overview-tree.html @@ -0,0 +1,238 @@ + + + + + + +Class Hierarchy (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/package-list b/docs/javadocs/2.2.0/butterfly-extensions-api/package-list new file mode 100644 index 00000000..aafa7034 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/package-list @@ -0,0 +1,6 @@ +com.paypal.butterfly.extensions.api +com.paypal.butterfly.extensions.api.exception +com.paypal.butterfly.extensions.api.metrics +com.paypal.butterfly.extensions.api.operations +com.paypal.butterfly.extensions.api.upgrade +com.paypal.butterfly.extensions.api.utilities diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/script.js b/docs/javadocs/2.2.0/butterfly-extensions-api/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/serialized-form.html b/docs/javadocs/2.2.0/butterfly-extensions-api/serialized-form.html new file mode 100644 index 00000000..a009d171 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/serialized-form.html @@ -0,0 +1,169 @@ + + + + + + +Serialized Form (butterfly-extensions-api 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+ + +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-extensions-api/stylesheet.css b/docs/javadocs/2.2.0/butterfly-extensions-api/stylesheet.css new file mode 100644 index 00000000..c4f6312c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-extensions-api/stylesheet.css @@ -0,0 +1,571 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#0085DC; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#0085DC; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#0085DC; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding:5px 12px 7px 12px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#0085DC; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#0085DC; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/docs/javadocs/2.2.0/butterfly-utilities/allclasses-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/allclasses-frame.html new file mode 100644 index 00000000..0235889f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/allclasses-frame.html @@ -0,0 +1,73 @@ + + + + + + +All Classes (butterfly-utilities 2.2.0 API) + + + + + +

All Classes

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/allclasses-noframe.html b/docs/javadocs/2.2.0/butterfly-utilities/allclasses-noframe.html new file mode 100644 index 00000000..7d0a2c44 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/allclasses-noframe.html @@ -0,0 +1,73 @@ + + + + + + +All Classes (butterfly-utilities 2.2.0 API) + + + + + +

All Classes

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareFiles.html new file mode 100644 index 00000000..39e54e5d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareFiles.html @@ -0,0 +1,402 @@ + + + + + + +CompareFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions
+

Class CompareFiles

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.DoubleCondition<CompareFiles>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.CompareFiles
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class CompareFiles
    +extends com.paypal.butterfly.extensions.api.DoubleCondition<CompareFiles>
    +
    Compares two files and returns true if the content of the files are equal, + or if they both don't exist. Returns false otherwise. +
    + See DoubleCondition to find out how to set the baseline and the comparison files
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CompareFiles() +
      Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
      +
      CompareFiles(String attribute) +
      Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected booleancompare(File baselineFile, + File comparisonFile) 
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.DoubleCondition

        +getAttribute, setAttribute
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CompareFiles

        +
        public CompareFiles()
        +
        Compares two files and returns true if the content of the files are equal, + or if they both don't exist. Returns false otherwise. +
        + See DoubleCondition to find out how to set the baseline and the comparison files
        +
      • +
      + + + +
        +
      • +

        CompareFiles

        +
        public CompareFiles(String attribute)
        +
        Compares two files and returns true if the content of the files are equal, + or if they both don't exist. Returns false otherwise. +
        + See DoubleCondition to find out how to set the baseline and the comparison files
        +
        +
        Parameters:
        +
        attribute - the name of the transformation context attribute + that refers to the file to be compared against the baseline file
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        compare

        +
        protected boolean compare(File baselineFile,
        +                          File comparisonFile)
        +
        +
        Specified by:
        +
        compare in class com.paypal.butterfly.extensions.api.DoubleCondition<CompareFiles>
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<CompareFiles>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Overrides:
        +
        execution in class com.paypal.butterfly.extensions.api.DoubleCondition<CompareFiles>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.html new file mode 100644 index 00000000..4108d4ee --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/CompareXMLFiles.html @@ -0,0 +1,411 @@ + + + + + + +CompareXMLFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions
+

Class CompareXMLFiles

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.DoubleCondition<CompareXMLFiles>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.CompareXMLFiles
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class CompareXMLFiles
    +extends com.paypal.butterfly.extensions.api.DoubleCondition<CompareXMLFiles>
    +
    Compares two XML files and returns true if their contents are equal, + or if both files don't exist. Returns false otherwise. + Attribute orders, comments and white spaces are ignored during the comparison. + It results in error if any of the two files is not a well formed XML file. +
    + See DoubleCondition + to find out how to set the baseline and the comparison files
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      CompareXMLFiles() +
      Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
      +
      CompareXMLFiles(String attribute) +
      Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected booleancompare(File baselineFile, + File comparisonFile) 
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.DoubleCondition

        +getAttribute, setAttribute
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CompareXMLFiles

        +
        public CompareXMLFiles()
        +
        Compares two XML files and returns true if their contents are equal, + or if both files don't exist. Returns false otherwise. + Attribute orders, comments and white spaces are ignored during the comparison. + It results in error if any of the two files is not a well formed XML file. +
        + See DoubleCondition + to find out how to set the baseline and the comparison files
        +
      • +
      + + + +
        +
      • +

        CompareXMLFiles

        +
        public CompareXMLFiles(String attribute)
        +
        Compares two XML files and returns true if their contents are equal, + or if both files don't exist. Returns false otherwise. + Attribute orders, comments and white spaces are ignored during the comparison. + It results in error if any of the two files is not a well formed XML file. +
        + See DoubleCondition + to find out how to set the baseline and the comparison files
        +
        +
        Parameters:
        +
        attribute - the name of the transformation context attribute + that refers to the file to be compared against the baseline file
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        compare

        +
        protected boolean compare(File baselineFile,
        +                          File comparisonFile)
        +
        +
        Specified by:
        +
        compare in class com.paypal.butterfly.extensions.api.DoubleCondition<CompareXMLFiles>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Overrides:
        +
        execution in class com.paypal.butterfly.extensions.api.DoubleCondition<CompareXMLFiles>
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<CompareXMLFiles>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/FileExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/FileExists.html new file mode 100644 index 00000000..86677845 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/FileExists.html @@ -0,0 +1,342 @@ + + + + + + +FileExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions
+

Class FileExists

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<FileExists>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.FileExists
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class FileExists
    +extends com.paypal.butterfly.extensions.api.SingleCondition<FileExists>
    +
    Checks if a particular file or folder exists.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      FileExists() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FileExists

        +
        public FileExists()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<FileExists>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<FileExists>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/PropertyExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/PropertyExists.html new file mode 100644 index 00000000..7e01c120 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/PropertyExists.html @@ -0,0 +1,408 @@ + + + + + + +PropertyExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions
+

Class PropertyExists

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<PropertyExists>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.PropertyExists
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class PropertyExists
    +extends com.paypal.butterfly.extensions.api.SingleCondition<PropertyExists>
    +
    Checks if a particular property exists in a property file. + The property name can be defined explicitly, via setPropertyName(String), + or as a regular expression, via setPropertyNameRegex(String).
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetPropertyName() 
      StringgetPropertyNameRegex() 
      PropertyExistssetPropertyName(String propertyName) 
      PropertyExistssetPropertyNameRegex(String propertyNameRegex) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PropertyExists

        +
        public PropertyExists()
        +
      • +
      + + + +
        +
      • +

        PropertyExists

        +
        public PropertyExists(String propertyName)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setPropertyNameRegex

        +
        public PropertyExists setPropertyNameRegex(String propertyNameRegex)
        +
      • +
      + + + +
        +
      • +

        getPropertyName

        +
        public String getPropertyName()
        +
      • +
      + + + +
        +
      • +

        getPropertyNameRegex

        +
        public String getPropertyNameRegex()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PropertyExists>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<PropertyExists>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/RegexMatch.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/RegexMatch.html new file mode 100644 index 00000000..b026e038 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/RegexMatch.html @@ -0,0 +1,408 @@ + + + + + + +RegexMatch (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions
+

Class RegexMatch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<RegexMatch>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.RegexMatch
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RegexMatch
    +extends com.paypal.butterfly.extensions.api.SingleCondition<RegexMatch>
    +
    Checks if a regular expression matches any line in the specified text file. + It returns true only if the specified text file has one or more lines that match + the given regular expression.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RegexMatch() +
      Checks if a regular expression matches any line in the specified text file.
      +
      RegexMatch(String regex) +
      Checks if a regular expression matches any line in the specified text file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetRegex() +
      Returns the regular expression to be evaluated against the specified text file
      +
      RegexMatchsetRegex(String regex) +
      Sets the regular expression to be evaluated against the specified text file
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RegexMatch

        +
        public RegexMatch()
        +
        Checks if a regular expression matches any line in the specified text file.
        +
      • +
      + + + +
        +
      • +

        RegexMatch

        +
        public RegexMatch(String regex)
        +
        Checks if a regular expression matches any line in the specified text file.
        +
        +
        Parameters:
        +
        regex - the regular expression to be evaluated against the specified text file
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setRegex

        +
        public RegexMatch setRegex(String regex)
        +
        Sets the regular expression to be evaluated against the specified text file
        +
        +
        Parameters:
        +
        regex - the regular expression to be evaluated against the specified text file
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getRegex

        +
        public String getRegex()
        +
        Returns the regular expression to be evaluated against the specified text file
        +
        +
        Returns:
        +
        the regular expression to be evaluated against the specified text file
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RegexMatch>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<RegexMatch>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareFiles.html new file mode 100644 index 00000000..2488cb25 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareFiles.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.CompareFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.CompareFiles

+
+
No usage of com.paypal.butterfly.utilities.conditions.CompareFiles
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareXMLFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareXMLFiles.html new file mode 100644 index 00000000..4eb52299 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/CompareXMLFiles.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.CompareXMLFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.CompareXMLFiles

+
+
No usage of com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/FileExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/FileExists.html new file mode 100644 index 00000000..8dc66029 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/FileExists.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.FileExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.FileExists

+
+
No usage of com.paypal.butterfly.utilities.conditions.FileExists
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/PropertyExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/PropertyExists.html new file mode 100644 index 00000000..a0753b32 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/PropertyExists.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.PropertyExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.PropertyExists

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/RegexMatch.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/RegexMatch.html new file mode 100644 index 00000000..4950f974 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/class-use/RegexMatch.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.RegexMatch (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.RegexMatch

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.html new file mode 100644 index 00000000..13913887 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AbstractTypeCheck.html @@ -0,0 +1,353 @@ + + + + + + +AbstractTypeCheck (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.java
+

Class AbstractTypeCheck<T extends AbstractTypeCheck>

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    AnnotatedWith, Extends
    +
    +
    +
    +
    public abstract class AbstractTypeCheck<T extends AbstractTypeCheck>
    +extends JavaCondition<T>
    +
    Evaluates the specified + compilation unit based on an abstract check + against a specified type.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AbstractTypeCheck

        +
        public AbstractTypeCheck(Class specifiedType)
        +
      • +
      + + + +
        +
      • +

        AbstractTypeCheck

        +
        public AbstractTypeCheck(String specifiedTypeName)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        eval

        +
        public boolean eval(com.github.javaparser.ast.CompilationUnit compilationUnit)
        +
        Description copied from class: JavaCondition
        +
        Evaluates this condition against the specified compilation + unit and returns the evaluation result. This implementation + must ignore the negate property during this evaluation. + The negation behavior will be considered in JavaCondition.evaluate(CompilationUnit)
        +
        +
        Specified by:
        +
        eval in class JavaCondition<T extends AbstractTypeCheck>
        +
        Parameters:
        +
        compilationUnit - the CompilationUnit that represents + the Java class to be evaluated
        +
        Returns:
        +
        the evaluation result ignoring negation
        +
        +
      • +
      + + + +
        +
      • +

        getTypeName

        +
        protected abstract String getTypeName(com.github.javaparser.ast.CompilationUnit compilationUnit,
        +                                      int index)
        +
      • +
      + + + +
        +
      • +

        getNumberOfTypes

        +
        protected abstract int getNumberOfTypes(com.github.javaparser.ast.CompilationUnit compilationUnit)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AnnotatedWith.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AnnotatedWith.html new file mode 100644 index 00000000..8d5314ae --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/AnnotatedWith.html @@ -0,0 +1,339 @@ + + + + + + +AnnotatedWith (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.java
+

Class AnnotatedWith

+
+
+ +
+
    +
  • +
    +
    +
    public class AnnotatedWith
    +extends AbstractTypeCheck<AnnotatedWith>
    +
    Evaluates if the specified + Java class or interface is annotated with the + specified annotation.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/Extends.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/Extends.html new file mode 100644 index 00000000..c391b55b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/Extends.html @@ -0,0 +1,339 @@ + + + + + + +Extends (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.java
+

Class Extends

+
+
+ +
+
    +
  • +
    +
    +
    public class Extends
    +extends AbstractTypeCheck<Extends>
    +
    Evaluates if the specified + compilation unit directly extends the + specified class.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Extends

        +
        public Extends(Class specifiedType)
        +
      • +
      + + + +
        +
      • +

        Extends

        +
        public Extends(String specifiedTypeName)
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaCondition.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaCondition.html new file mode 100644 index 00000000..a80b3369 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaCondition.html @@ -0,0 +1,350 @@ + + + + + + +JavaCondition (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.java
+

Class JavaCondition<T extends JavaCondition>

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.utilities.conditions.java.JavaCondition<T>
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    AbstractTypeCheck
    +
    +
    +
    +
    public abstract class JavaCondition<T extends JavaCondition>
    +extends Object
    +
    Abstract class to specify a condition to be + evaluated against a Java class, which is + represented as a CompilationUnit.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      JavaCondition() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected abstract booleaneval(com.github.javaparser.ast.CompilationUnit compilationUnit) +
      Evaluates this condition against the specified compilation + unit and returns the evaluation result.
      +
      booleanisNegate() +
      Returns whether the evaluation result will be negated + or not.
      +
      TsetNegate(boolean negate) +
      Sets whether the result should be negated, meaning, + resulting true whenever its evaluation result would + normally results false, and vice-versa.
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JavaCondition

        +
        public JavaCondition()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        eval

        +
        protected abstract boolean eval(com.github.javaparser.ast.CompilationUnit compilationUnit)
        +
        Evaluates this condition against the specified compilation + unit and returns the evaluation result. This implementation + must ignore the negate property during this evaluation. + The negation behavior will be considered in evaluate(CompilationUnit)
        +
        +
        Parameters:
        +
        compilationUnit - the CompilationUnit that represents + the Java class to be evaluated
        +
        Returns:
        +
        the evaluation result ignoring negation
        +
        +
      • +
      + + + +
        +
      • +

        setNegate

        +
        public T setNegate(boolean negate)
        +
        Sets whether the result should be negated, meaning, + resulting true whenever its evaluation result would + normally results false, and vice-versa. The default + value is false.
        +
        +
        Parameters:
        +
        negate - the result should be negated or not
        +
        Returns:
        +
        this transformation utility condition instance
        +
        +
      • +
      + + + +
        +
      • +

        isNegate

        +
        public boolean isNegate()
        +
        Returns whether the evaluation result will be negated + or not.
        +
        +
        Returns:
        +
        whether the evaluation result will be negated + or not
        +
        See Also:
        +
        setNegate(boolean)
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaMatch.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaMatch.html new file mode 100644 index 00000000..2db1d42c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/JavaMatch.html @@ -0,0 +1,452 @@ + + + + + + +JavaMatch (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.java
+

Class JavaMatch

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<JavaMatch>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.java.JavaMatch
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class JavaMatch
    +extends com.paypal.butterfly.extensions.api.SingleCondition<JavaMatch>
    +
    Parses and evaluates the specified Java class file + based on a set of JavaCondition. It returns true only + if they all are true. If the specified Java class file contains + more than one type, only the outer one will be considered + during evaluation. If it has none, the evaluation will result + in false and a warning be returned.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      JavaMatch() +
      This utility parses and evaluates the specified Java class file + based on a set of JavaCondition.
      +
      JavaMatch(JavaCondition condition) +
      This utility parses and evaluates the specified Java class file + based on a set of JavaCondition.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      JavaMatchaddCondition(JavaCondition condition) +
      Add a new Java condition to be evaluated against the Java class.
      +
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      Set<JavaCondition>getConditions() +
      Returns the set of Java conditions to be used to + evaluate the specified class.
      +
      StringgetDescription() 
      JavaMatchsetConditions(Set<JavaCondition> conditions) +
      Sets the set of Java conditions to be used to + evaluate the specified class.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JavaMatch

        +
        public JavaMatch()
        +
        This utility parses and evaluates the specified Java class file + based on a set of JavaCondition. It returns true only + if they all are true. If the specified Java class file contains + more than one type, only the outer one will be considered + during evaluation. If it has none, the evaluation will result + in false and a warning be returned.
        +
      • +
      + + + +
        +
      • +

        JavaMatch

        +
        public JavaMatch(JavaCondition condition)
        +
        This utility parses and evaluates the specified Java class file + based on a set of JavaCondition. It returns true only + if they all are true. If the specified Java class file contains + more than one type, only the outer one will be considered + during evaluation. If it has none, the evaluation will result + in false and a warning be returned.
        +
        +
        Parameters:
        +
        condition - one condition to be evaluated. More can be added with + addCondition(JavaCondition)
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getConditions

        +
        public Set<JavaCondition> getConditions()
        +
        Returns the set of Java conditions to be used to + evaluate the specified class. The returned object + is not a copy and it is modifiable.
        +
        +
        Returns:
        +
        the set of Java conditions to be used to evaluate the specified class
        +
        +
      • +
      + + + +
        +
      • +

        setConditions

        +
        public JavaMatch setConditions(Set<JavaCondition> conditions)
        +
        Sets the set of Java conditions to be used to + evaluate the specified class. Any conditions + added previously will be discarded.
        +
        +
        Parameters:
        +
        conditions - the set of Java conditions to be used to evaluate the specified class
        +
        Returns:
        +
        this transformation utility condition instance
        +
        +
      • +
      + + + +
        +
      • +

        addCondition

        +
        public JavaMatch addCondition(JavaCondition condition)
        +
        Add a new Java condition to be evaluated against the Java class.
        +
        +
        Parameters:
        +
        condition - a Java condition to be used to evaluate the specified class
        +
        Returns:
        +
        this transformation utility condition instance
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<JavaMatch>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<JavaMatch>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AbstractTypeCheck.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AbstractTypeCheck.html new file mode 100644 index 00000000..a3165f6c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AbstractTypeCheck.html @@ -0,0 +1,197 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AnnotatedWith.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AnnotatedWith.html new file mode 100644 index 00000000..b155250b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/AnnotatedWith.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.java.AnnotatedWith (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.java.AnnotatedWith

+
+
No usage of com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/Extends.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/Extends.html new file mode 100644 index 00000000..c7ec8e90 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/Extends.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.java.Extends (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.java.Extends

+
+
No usage of com.paypal.butterfly.utilities.conditions.java.Extends
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaCondition.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaCondition.html new file mode 100644 index 00000000..9cc5a9e4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaCondition.html @@ -0,0 +1,266 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.java.JavaCondition (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.java.JavaCondition

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaMatch.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaMatch.html new file mode 100644 index 00000000..c420171e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/class-use/JavaMatch.html @@ -0,0 +1,177 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.java.JavaMatch (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.java.JavaMatch

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-frame.html new file mode 100644 index 00000000..00f29068 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.java (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.conditions.java

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-summary.html new file mode 100644 index 00000000..fbe4695a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-summary.html @@ -0,0 +1,192 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.java (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.conditions.java

+
+
Transformation utility conditions to analyze and evaluate Java class files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AbstractTypeCheck<T extends AbstractTypeCheck> +
    Evaluates the specified + compilation unit based on an abstract check + against a specified type.
    +
    AnnotatedWith +
    Evaluates if the specified + Java class or interface is annotated with the + specified annotation.
    +
    Extends +
    Evaluates if the specified + compilation unit directly extends the + specified class.
    +
    JavaCondition<T extends JavaCondition> +
    Abstract class to specify a condition to be + evaluated against a Java class, which is + represented as a CompilationUnit.
    +
    JavaMatch +
    Parses and evaluates the specified Java class file + based on a set of JavaCondition.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.conditions.java Description

+
Transformation utility conditions to analyze and evaluate Java class files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-tree.html new file mode 100644 index 00000000..ac9c9cf1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-tree.html @@ -0,0 +1,161 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.java Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.conditions.java

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.utilities.conditions.java.JavaCondition<T> +
        +
      • com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck<T> +
          +
        • com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
        • +
        • com.paypal.butterfly.utilities.conditions.java.Extends
        • +
        +
      • +
      +
    • +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<U> +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<T> +
            +
          • com.paypal.butterfly.utilities.conditions.java.JavaMatch
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-use.html new file mode 100644 index 00000000..ec031476 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/java/package-use.html @@ -0,0 +1,178 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.conditions.java (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.conditions.java

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-frame.html new file mode 100644 index 00000000..59eaf06a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-frame.html @@ -0,0 +1,25 @@ + + + + + + +com.paypal.butterfly.utilities.conditions (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.conditions

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-summary.html new file mode 100644 index 00000000..e23cb073 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-summary.html @@ -0,0 +1,192 @@ + + + + + + +com.paypal.butterfly.utilities.conditions (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.conditions

+
+
Multiple transformation utility conditions, organized by type, each one having its own subpackage.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    CompareFiles +
    Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
    +
    CompareXMLFiles +
    Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
    +
    FileExists +
    Checks if a particular file or folder exists.
    +
    PropertyExists +
    Checks if a particular property exists in a property file.
    +
    RegexMatch +
    Checks if a regular expression matches any line in the specified text file.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.conditions Description

+
Multiple transformation utility conditions, organized by type, each one having its own subpackage. + Transformation utility conditions are used to determine if a specific transformation utility + should be executed or not. Transformation utility condition is a special type of transformation utility that + always result in a boolean. The criteria to its condition can be based on a single file (when checking if a particular + file contains a given word for example) or multiple files (when comparing two files for example).
+
+
Since:
+
1.0.0
+
See Also:
+
SingleCondition, +DoubleCondition
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-tree.html new file mode 100644 index 00000000..63c5a6f2 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-tree.html @@ -0,0 +1,159 @@ + + + + + + +com.paypal.butterfly.utilities.conditions Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.conditions

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<U> +
          +
        • com.paypal.butterfly.extensions.api.DoubleCondition<T> + +
        • +
        • com.paypal.butterfly.extensions.api.SingleCondition<T> + +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-use.html new file mode 100644 index 00000000..28461ca1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/package-use.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.conditions (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.conditions

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/PomDependencyExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/PomDependencyExists.html new file mode 100644 index 00000000..0dc7a7a4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/PomDependencyExists.html @@ -0,0 +1,467 @@ + + + + + + +PomDependencyExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.conditions.pom
+

Class PomDependencyExists

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<U>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<T>
      • +
      • +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<PomDependencyExists>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class PomDependencyExists
    +extends com.paypal.butterfly.extensions.api.SingleCondition<PomDependencyExists>
    +
    Checks if a particular Maven dependency exists in a Maven pom file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetArtifactId() 
      StringgetDescription() 
      StringgetGroupId() 
      StringgetVersion() 
      PomDependencyExistssetArtifactId(String artifactId) 
      PomDependencyExistssetGroupId(String groupId) 
      PomDependencyExistssetVersion(String version) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomDependencyExists

        +
        public PomDependencyExists()
        +
      • +
      + + + +
        +
      • +

        PomDependencyExists

        +
        public PomDependencyExists(String groupId,
        +                           String artifactId)
        +
        Condition to check if a particular Maven dependency exists in a Maven pom files
        +
        +
        Parameters:
        +
        groupId - managed dependency group id
        +
        artifactId - managed dependency artifact id
        +
        +
      • +
      + + + +
        +
      • +

        PomDependencyExists

        +
        public PomDependencyExists(String groupId,
        +                           String artifactId,
        +                           String version)
        +
        Condition to check if a particular Maven dependency exists in a Maven pom files
        +
        +
        Parameters:
        +
        groupId - managed dependency group id
        +
        artifactId - managed dependency artifact id
        +
        version - managed dependency version
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + +
        +
      • +

        getGroupId

        +
        public String getGroupId()
        +
      • +
      + + + +
        +
      • +

        getArtifactId

        +
        public String getArtifactId()
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomDependencyExists>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<PomDependencyExists>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/class-use/PomDependencyExists.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/class-use/PomDependencyExists.html new file mode 100644 index 00000000..3e781514 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/class-use/PomDependencyExists.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-frame.html new file mode 100644 index 00000000..86f5d987 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.pom (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.conditions.pom

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-summary.html new file mode 100644 index 00000000..62b6e618 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-summary.html @@ -0,0 +1,159 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.pom (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.conditions.pom

+
+
Transformation utility conditions to analyze and evaluate Maven POM files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    PomDependencyExists +
    Checks if a particular Maven dependency exists in a Maven pom file.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.conditions.pom Description

+
Transformation utility conditions to analyze and evaluate Maven POM files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-tree.html new file mode 100644 index 00000000..0da66681 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-tree.html @@ -0,0 +1,151 @@ + + + + + + +com.paypal.butterfly.utilities.conditions.pom Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.conditions.pom

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.UtilityCondition<U> +
          +
        • com.paypal.butterfly.extensions.api.SingleCondition<T> + +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-use.html new file mode 100644 index 00000000..be3e17df --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/conditions/pom/package-use.html @@ -0,0 +1,163 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.conditions.pom (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.conditions.pom

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFile.html new file mode 100644 index 00000000..70d64453 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFile.html @@ -0,0 +1,418 @@ + + + + + + +FindFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.file
+

Class FindFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<FindFile>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.file.FindFile
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class FindFile
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<FindFile>
    +
    Finds a file based on its name. The search is + always recursive (includes sub-folders). If no file is + found, null is returned, unless failIfNotFound(boolean) is set to true. + If multiple files are found, an error is returned. +
    + The root directory from where the search should take place + can be defined by TransformationUtility.relative(String), + TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String). + If not set explicitly, then the search will happen from the root + of the transformed application, which is equivalent to setting + TransformationUtility.relative(String) to "." +
    + If no file is found, a TUExecutionResult.Type.NULL + is returned, unless failIfNotFound(boolean) is set to true +
    + See FindFiles for a better refined search and to find multiple files.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      FindFile() 
      FindFile(String fileName) +
      Utility to find a file based on its name
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      FindFilefailIfNotFound(boolean failIfNotFound) 
      StringgetDescription() 
      StringgetFileName() 
      booleanisFailIfNotFound() 
      FindFilesetFileName(String fileName) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FindFile

        +
        public FindFile()
        +
      • +
      + + + +
        +
      • +

        FindFile

        +
        public FindFile(String fileName)
        +
        Utility to find a file based on its name
        +
        +
        Parameters:
        +
        fileName - name of the file to be found
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        failIfNotFound

        +
        public FindFile failIfNotFound(boolean failIfNotFound)
        +
      • +
      + + + +
        +
      • +

        isFailIfNotFound

        +
        public boolean isFailIfNotFound()
        +
      • +
      + + + +
        +
      • +

        getFileName

        +
        public String getFileName()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<FindFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<FindFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFiles.html new file mode 100644 index 00000000..88c50251 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/FindFiles.html @@ -0,0 +1,717 @@ + + + + + + +FindFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.file
+

Class FindFiles

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<FindFiles>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.file.FindFiles
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class FindFiles
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<FindFiles>
    +
    Finds files based on a regular expression + against the file name and/or the file path. The search might be + recursive (searching also in sub-folders) or not. If a file path regular + expression is set, then the search will be automatically recursive. + If no file path regular expression is set, then the search + is not recursive by default, but it may be set to as well. +
    + The term "file" here might refer to folders as well, and + includeFiles and includeFolders can be used + to specialize the search criteria in that regard. If none of them + are explicitly set, only files will be searched. +
    + The root directory from where the search should take place + can be defined by TransformationUtility.relative(String), + TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String). + If not set explicitly, then the search will happen from the root + of the transformed application, which is equivalent to setting + TransformationUtility.relative(String) to "." +
    + If no files have been found, an empty list is returned and a + warning is stated in the result
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      FindFiles() 
      FindFiles(String nameRegex, + boolean recursive) +
      Utility to find files based on a regular expression + against the file name.
      +
      FindFiles(String nameRegex, + boolean recursive, + boolean includeFiles, + boolean includeFolders) +
      Utility to find files based on a regular expression + against the file name.
      +
      FindFiles(String nameRegex, + String pathRegex) +
      Utility to find files based on a regular expression + against the file name and the file path.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetNameRegex() +
      Returns the file name regular expression
      +
      StringgetPathRegex() +
      Returns the file path regular expression
      +
      booleanisIncludeFiles() +
      Returns whether files should be included in the search or not
      +
      booleanisIncludeFolders() +
      Returns whether folders should be included in the search or not
      +
      booleanisRecursive() +
      Returns whether the file search is recursive or not
      +
      FindFilessetIncludeFiles(boolean includeFiles) +
      Set whether files should be included in the search or not.
      +
      FindFilessetIncludeFolders(boolean includeFolders) +
      Set whether folders should be included in the search or not.
      +
      FindFilessetNameRegex(String nameRegex) +
      Set regular expression to be used to match the file name + during the search
      +
      FindFilessetPathRegex(String pathRegex) +
      Set regular expression to be used to match the file path + during the search
      + Important notes: + + Use forward slash as file separator.
      +
      FindFilessetRecursive(boolean recursive) +
      Set whether the search should be recursive or not.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        FindFiles

        +
        public FindFiles()
        +
      • +
      + + + +
        +
      • +

        FindFiles

        +
        public FindFiles(String nameRegex,
        +                 boolean recursive)
        +
        Utility to find files based on a regular expression + against the file name. The search might be + recursive (searching also in sub-folders) or not. +
        + This search does not include folders, only files, unless + setIncludeFolders(boolean) is set to true. +
        + The root directory from where the search should take place + can be defined by TransformationUtility.relative(String), + TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String). + If not set explicitly, then the search will happen from the root + of the transformed application, which is equivalent to setting + TransformationUtility.relative(String) to "."
        +
        +
        Parameters:
        +
        nameRegex - regular expression to be applied against file name during search
        +
        recursive - if true, sub-folders will also be searched
        +
        +
      • +
      + + + +
        +
      • +

        FindFiles

        +
        public FindFiles(String nameRegex,
        +                 boolean recursive,
        +                 boolean includeFiles,
        +                 boolean includeFolders)
        +
        Utility to find files based on a regular expression + against the file name. The search might be + recursive (searching also in sub-folders) or not. +
        + This search might include files only, folders only, or both, + depending on how includeFiles and includeFolders + are configured. +
        + The root directory from where the search should take place + can be defined by TransformationUtility.relative(String), + TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String). + If not set explicitly, then the search will happen from the root + of the transformed application, which is equivalent to setting + TransformationUtility.relative(String) to "."
        +
        +
        Parameters:
        +
        nameRegex - regular expression to be applied against file name during search
        +
        recursive - if true, sub-folders will also be searched
        +
        includeFiles - whether files should be included in the search or not
        +
        includeFolders - whether folders should be included in the search or not
        +
        +
      • +
      + + + +
        +
      • +

        FindFiles

        +
        public FindFiles(String nameRegex,
        +                 String pathRegex)
        +
        Utility to find files based on a regular expression + against the file name and the file path. Because a file path regular + expression is set, then the search will be automatically and + necessarily recursive. +
        + Important notes: +
          +
        • Use forward slash as file separator. If the OS + used during transformation execution uses another character + as file separator, that will be automatically converted + by this utility
        • +
        • Setting this to a non null value automatically sets + recursive property to true
        • +
        • This regular expression will be evaluated against + the file path starting from the search root + directory
        • +
        +
        + The root directory from where the search should take place + can be defined by TransformationUtility.relative(String), + TransformationUtility.absolute(String) or TransformationUtility.absolute(String, String). + If not set explicitly, then the search will happen from the root + of the transformed application, which is equivalent to setting + TransformationUtility.relative(String) to "."
        +
        +
        Parameters:
        +
        nameRegex - regular expression to be applied against file name during search
        +
        pathRegex - regular expression to be applied against file path during search
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNameRegex

        +
        public FindFiles setNameRegex(String nameRegex)
        +
        Set regular expression to be used to match the file name + during the search
        +
        +
        Parameters:
        +
        nameRegex - regular expression to be used to match the file name + during the search
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setPathRegex

        +
        public FindFiles setPathRegex(String pathRegex)
        +
        Set regular expression to be used to match the file path + during the search
        + Important notes: +
          +
        • Use forward slash as file separator. If the OS + used during transformation execution uses another character + as file separator, that will be automatically converted + by this utility
        • +
        • Setting this to a non null value automatically sets + recursive property to true
        • +
        • This regular expression will be evaluated against + the file path starting from the search root + directory
        • +
        +
        +
        Parameters:
        +
        pathRegex - regular expression to be used to match the file path + during the search
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setRecursive

        +
        public FindFiles setRecursive(boolean recursive)
        +
        Set whether the search should be recursive or not. + If a file path regular expression has been set, + then this property will be automatically set to + true.
        + Important: setting this to false automatically sets + the file path regular expression to null
        +
        +
        Parameters:
        +
        recursive - whether the search should be recursive
        +
        Returns:
        +
        this transformation utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setIncludeFolders

        +
        public FindFiles setIncludeFolders(boolean includeFolders)
        +
        Set whether folders should be included in the search or not. + If not set, the default is false.
        +
        +
        Parameters:
        +
        includeFolders - whether folders should be included in the search or not
        +
        Returns:
        +
        this transformation utility instance
        +
        Since:
        +
        2.2.0
        +
        +
      • +
      + + + +
        +
      • +

        setIncludeFiles

        +
        public FindFiles setIncludeFiles(boolean includeFiles)
        +
        Set whether files should be included in the search or not. + If not set, the default is true.
        +
        +
        Parameters:
        +
        includeFiles - whether files should be included in the search or not
        +
        Returns:
        +
        this transformation utility instance
        +
        Since:
        +
        2.2.0
        +
        +
      • +
      + + + +
        +
      • +

        getNameRegex

        +
        public String getNameRegex()
        +
        Returns the file name regular expression
        +
        +
        Returns:
        +
        the file name regular expression
        +
        +
      • +
      + + + +
        +
      • +

        getPathRegex

        +
        public String getPathRegex()
        +
        Returns the file path regular expression
        +
        +
        Returns:
        +
        the file path regular expression
        +
        +
      • +
      + + + +
        +
      • +

        isRecursive

        +
        public boolean isRecursive()
        +
        Returns whether the file search is recursive or not
        +
        +
        Returns:
        +
        whether the file search is recursive or not
        +
        +
      • +
      + + + +
        +
      • +

        isIncludeFolders

        +
        public boolean isIncludeFolders()
        +
        Returns whether folders should be included in the search or not
        +
        +
        Returns:
        +
        whether folders should be included in the search or not
        +
        +
      • +
      + + + +
        +
      • +

        isIncludeFiles

        +
        public boolean isIncludeFiles()
        +
        Returns whether files should be included in the search or not
        +
        +
        Returns:
        +
        whether files should be included in the search or not
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<FindFiles>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<FindFiles>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LoadFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LoadFile.html new file mode 100644 index 00000000..9cf28d85 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LoadFile.html @@ -0,0 +1,410 @@ + + + + + + +LoadFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.file
+

Class LoadFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<LoadFile>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.file.LoadFile
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class LoadFile
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<LoadFile>
    +
    Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context. The file is written to a temporary folder to be defined by the OS. + If no resource file is found, an error is returned.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      LoadFile() +
      Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
      +
      LoadFile(String resource) +
      Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetResource() +
      Returns the name of the resource in the classpath
      +
      LoadFilesetResource(String resource) +
      Sets the name of the resource in the classpath.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LoadFile

        +
        public LoadFile()
        +
        Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context. The file is written to a temporary folder to be defined by the OS. + If no resource file is found, an error is returned.
        +
      • +
      + + + +
        +
      • +

        LoadFile

        +
        public LoadFile(String resource)
        +
        Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context. The file is written to a temporary folder to be defined by the OS. + If no resource file is found, an error is returned.
        +
        +
        Parameters:
        +
        resource - the name of the resource in the classpath
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setResource

        +
        public LoadFile setResource(String resource)
        +
        Sets the name of the resource in the classpath. The syntax + here is the same as the one used in ClassLoader.getResource(String)
        +
        +
        Parameters:
        +
        resource - the name of the resource in the classpath
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getResource

        +
        public String getResource()
        +
        Returns the name of the resource in the classpath
        +
        +
        Returns:
        +
        the name of the resource in the classpath
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<LoadFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<LoadFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LocateFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LocateFile.html new file mode 100644 index 00000000..fc9b55aa --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/LocateFile.html @@ -0,0 +1,418 @@ + + + + + + +LocateFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.file
+

Class LocateFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<LocateFile>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.file.LocateFile
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class LocateFile
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<LocateFile>
    +
    Locates a file based on the relative or absolute + location specified. It does not find files, it just results + to a File object based on the input information. + This utility also allows to locate a file going up in parent + levels from the specified file. If the specified file does + not exist, or if the coordinates don't make sense, an error + is returned. +
    + Note: the term "file" here might refer to a folder as well
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      LocateFile() +
      Locates a file based on the relative or absolute + location specified.
      +
      LocateFile(int parentLevel) +
      Locates a file based on the relative or absolute + location specified.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      intgetParentLevel() 
      LocateFilesetParentLevel(int parentLevel) +
      Set how many parent levels up the location process should + go through.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LocateFile

        +
        public LocateFile()
        +
        Locates a file based on the relative or absolute + location specified. It does not find files, it just results + to a File object based on the input information. + This utility also allows to locate a file going up in parent + levels from the specified file. If the specified file does + not exist, or if the coordinates don't make sense, an error + is returned +
        + Note: the term "file" here might refer to a folder as well
        +
      • +
      + + + +
        +
      • +

        LocateFile

        +
        public LocateFile(int parentLevel)
        +
        Locates a file based on the relative or absolute + location specified. It does not find files, it just results + to a File object based on the input information. + This utility also allows to locate a file going up in parent + levels from the specified file. If the specified file does + not exist, or if the coordinates don't make sense, an error + is returned +
        + Note: the term "file" here might refer to a folder as well
        +
        +
        Parameters:
        +
        parentLevel - how many parent levels to be located
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setParentLevel

        +
        public LocateFile setParentLevel(int parentLevel)
        +
        Set how many parent levels up the location process should + go through. If not set, the actual specified file will be + the located one.
        +
        +
        Parameters:
        +
        parentLevel - how many parent levels to be located
        +
        Returns:
        +
        this instance
        +
        +
      • +
      + + + +
        +
      • +

        getParentLevel

        +
        public int getParentLevel()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<LocateFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<LocateFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFile.html new file mode 100644 index 00000000..6d9243c5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFile.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.file.FindFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.file.FindFile

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFiles.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFiles.html new file mode 100644 index 00000000..bce50486 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/FindFiles.html @@ -0,0 +1,199 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.file.FindFiles (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.file.FindFiles

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LoadFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LoadFile.html new file mode 100644 index 00000000..e6e470dd --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LoadFile.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.file.LoadFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.file.LoadFile

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LocateFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LocateFile.html new file mode 100644 index 00000000..47906c26 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/class-use/LocateFile.html @@ -0,0 +1,171 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.file.LocateFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.file.LocateFile

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-frame.html new file mode 100644 index 00000000..5241f5d8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-frame.html @@ -0,0 +1,24 @@ + + + + + + +com.paypal.butterfly.utilities.file (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.file

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-summary.html new file mode 100644 index 00000000..47d946b7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-summary.html @@ -0,0 +1,181 @@ + + + + + + +com.paypal.butterfly.utilities.file (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.file

+
+
Transformation utilities to gather meta-data, find and locate files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    FindFile +
    Finds a file based on its name.
    +
    FindFiles +
    Finds files based on a regular expression + against the file name and/or the file path.
    +
    LoadFile +
    Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
    +
    LocateFile +
    Locates a file based on the relative or absolute + location specified.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.file Description

+
Transformation utilities to gather meta-data, find and locate files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-tree.html new file mode 100644 index 00000000..f3df6180 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-tree.html @@ -0,0 +1,146 @@ + + + + + + +com.paypal.butterfly.utilities.file Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.file

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.utilities.file.FindFile
      • +
      • com.paypal.butterfly.utilities.file.FindFiles
      • +
      • com.paypal.butterfly.utilities.file.LoadFile
      • +
      • com.paypal.butterfly.utilities.file.LocateFile
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-use.html new file mode 100644 index 00000000..7ad98d26 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/file/package-use.html @@ -0,0 +1,182 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.file (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.file

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/JavaPackage.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/JavaPackage.html new file mode 100644 index 00000000..686d19ed --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/JavaPackage.html @@ -0,0 +1,333 @@ + + + + + + +JavaPackage (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.java
+

Class JavaPackage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<JavaPackage>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.java.JavaPackage
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class JavaPackage
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<JavaPackage>
    +
    Retrieves the package + of a given Java class.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      JavaPackage() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JavaPackage

        +
        public JavaPackage()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<JavaPackage>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<JavaPackage>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/class-use/JavaPackage.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/class-use/JavaPackage.html new file mode 100644 index 00000000..c59ea8e0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/class-use/JavaPackage.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.java.JavaPackage (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.java.JavaPackage

+
+
No usage of com.paypal.butterfly.utilities.java.JavaPackage
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-frame.html new file mode 100644 index 00000000..b9947fb4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.paypal.butterfly.utilities.java (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.java

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-summary.html new file mode 100644 index 00000000..92ba3d3d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-summary.html @@ -0,0 +1,160 @@ + + + + + + +com.paypal.butterfly.utilities.java (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.java

+
+
Transformation utilities to gather meta-data about Java class files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    JavaPackage +
    Retrieves the package + of a given Java class.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.java Description

+
Transformation utilities to gather meta-data about Java class files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-tree.html new file mode 100644 index 00000000..c2098a46 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.paypal.butterfly.utilities.java Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.java

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) + +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-use.html new file mode 100644 index 00000000..e68993f1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/java/package-use.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.java (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.java

+
+
No usage of com.paypal.butterfly.utilities.java
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.html new file mode 100644 index 00000000..5f551a45 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/EnforcerErrorsOutputHandler.html @@ -0,0 +1,335 @@ + + + + + + +EnforcerErrorsOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.maven
+

Class EnforcerErrorsOutputHandler

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.html new file mode 100644 index 00000000..afb907cd --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/GenericErrorsOutputHandler.html @@ -0,0 +1,335 @@ + + + + + + +GenericErrorsOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.maven
+

Class GenericErrorsOutputHandler

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler
    • +
    +
  • +
+
+ +
+
+ +
+
+ +
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenGoal.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenGoal.html new file mode 100644 index 00000000..fee797fb --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenGoal.html @@ -0,0 +1,567 @@ + + + + + + +MavenGoal (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.maven
+

Class MavenGoal

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<MavenGoal>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.maven.MavenGoal
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class MavenGoal
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<MavenGoal>
    +
    Runs one or more Maven goals against a specific Maven POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      MavenGoal() +
      Utility to run one or more Maven goals against a specific Maven POM file
      +
      MavenGoal(String... goals) +
      Utility to run one or more Maven goals against a specific Maven POM file
      +
      MavenGoal(String[] goals, + MavenInvocationOutputHandler[] outputHandlers) +
      Utility to run one or more Maven goals against a specific Maven POM file
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      MavenGoalclone() 
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      String[]getGoals() +
      Return the Maven goals to be executed
      +
      MavenInvocationOutputHandler[]getOutputHandlers() +
      Return the output handlers to be executed against the Maven goals execution result
      +
      PropertiesgetProperties() +
      Return the Maven properties for the goal
      +
      MavenGoalsetFailAtEnd() +
      Set the maven failure behavior to only fail at the end.
      +
      MavenGoalsetGoals(String... goals) +
      Set the Maven goals to be executed
      +
      MavenGoalsetOutputHandlers(MavenInvocationOutputHandler... outputHandlers) +
      Set the output handlers to be executed against the Maven goals execution result
      +
      MavenGoalsetProperties(Properties properties) +
      Set the Maven properties for the goal
      +
      MavenGoalsetWarnOnError(boolean warnOnError) +
      If this is set to true, then in case the maven goal command + does not succeed, then a warn result type will be returned, + instead of error.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MavenGoal

        +
        public MavenGoal()
        +
        Utility to run one or more Maven goals against a specific Maven POM file
        +
      • +
      + + + +
        +
      • +

        MavenGoal

        +
        public MavenGoal(String... goals)
        +
        Utility to run one or more Maven goals against a specific Maven POM file
        +
        +
        Parameters:
        +
        goals - Maven goals to be executed
        +
        +
      • +
      + + + +
        +
      • +

        MavenGoal

        +
        public MavenGoal(String[] goals,
        +                 MavenInvocationOutputHandler[] outputHandlers)
        +
        Utility to run one or more Maven goals against a specific Maven POM file
        +
        +
        Parameters:
        +
        goals - Maven goals to be executed
        +
        outputHandlers - output handlers to be executed against the Maven goals execution result
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setGoals

        +
        public MavenGoal setGoals(String... goals)
        +
        Set the Maven goals to be executed
        +
        +
        Parameters:
        +
        goals - Maven goals to be executed
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setOutputHandlers

        +
        public MavenGoal setOutputHandlers(MavenInvocationOutputHandler... outputHandlers)
        +
        Set the output handlers to be executed against the Maven goals execution result
        +
        +
        Parameters:
        +
        outputHandlers - output handlers to be executed against the Maven goals execution result
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setProperties

        +
        public MavenGoal setProperties(Properties properties)
        +
        Set the Maven properties for the goal
        +
        +
        Parameters:
        +
        properties - equivalent to '-D' options
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setFailAtEnd

        +
        public MavenGoal setFailAtEnd()
        +
        Set the maven failure behavior to only fail at the end.
        +
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        setWarnOnError

        +
        public MavenGoal setWarnOnError(boolean warnOnError)
        +
        If this is set to true, then in case the maven goal command + does not succeed, then a warn result type will be returned, + instead of error. The default value is error.
        +
        +
        Parameters:
        +
        warnOnError - whether, in case the maven goal command + does not succeed, a warn result type should be returned, + instead of error
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + +
        +
      • +

        getGoals

        +
        public String[] getGoals()
        +
        Return the Maven goals to be executed
        +
        +
        Returns:
        +
        the Maven goals to be executed
        +
        +
      • +
      + + + +
        +
      • +

        getProperties

        +
        public Properties getProperties()
        +
        Return the Maven properties for the goal
        +
        +
        Returns:
        +
        properties for the Maven invocation
        +
        +
      • +
      + + + +
        +
      • +

        getOutputHandlers

        +
        public MavenInvocationOutputHandler[] getOutputHandlers()
        +
        Return the output handlers to be executed against the Maven goals execution result
        +
        +
        Returns:
        +
        the output handlers to be executed against the Maven goals execution result
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<MavenGoal>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<MavenGoal>
        +
        +
      • +
      + + + +
        +
      • +

        clone

        +
        public MavenGoal clone()
        +
        +
        Overrides:
        +
        clone in class com.paypal.butterfly.extensions.api.TransformationUtility<MavenGoal>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.html new file mode 100644 index 00000000..f47ff41c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/MavenInvocationOutputHandler.html @@ -0,0 +1,273 @@ + + + + + + +MavenInvocationOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.maven
+

Interface MavenInvocationOutputHandler<T,R>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    org.apache.maven.shared.invoker.InvocationOutputHandler, org.codehaus.plexus.util.cli.StreamConsumer
    +
    +
    +
    All Known Implementing Classes:
    +
    EnforcerErrorsOutputHandler, GenericErrorsOutputHandler
    +
    +
    +
    +
    public interface MavenInvocationOutputHandler<T,R>
    +extends org.apache.maven.shared.invoker.InvocationOutputHandler
    +
    Reads lines from the Maven execution console output and return data after evaluating it.
    +
    +
    Author:
    +
    mcrockett, facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      Tcopy() +
      Returns a copy of this object, but with its internal state reset, + so it can be run in a brand new Maven invocation
      +
      RgetResult() +
      Returns the desired result from parsing the console output
      +
      +
        +
      • + + +

        Methods inherited from interface org.codehaus.plexus.util.cli.StreamConsumer

        +consumeLine
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getResult

        +
        R getResult()
        +
        Returns the desired result from parsing the console output
        +
        +
        Returns:
        +
        the desired result from parsing the console output
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        T copy()
        +
        Returns a copy of this object, but with its internal state reset, + so it can be run in a brand new Maven invocation
        +
        +
        Returns:
        +
        a copy of this object, but with its internal state reset
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/RelatedArtifacts.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/RelatedArtifacts.html new file mode 100644 index 00000000..4e217f22 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/RelatedArtifacts.html @@ -0,0 +1,471 @@ + + + + + + +RelatedArtifacts (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.maven
+

Class RelatedArtifacts

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<RelatedArtifacts>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.maven.RelatedArtifacts
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RelatedArtifacts
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<RelatedArtifacts>
    +
    Given a list of pom.xml File objects and + a parent artifact, this transformation utility results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RelatedArtifacts() 
      RelatedArtifacts(String parentGroupId, + String parentArtifactId, + String parentVersion, + String pomFilesAttribute) +
      This transformation utility, given a list of pom.xml File objects and + a parent artifact, results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
      +
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RelatedArtifacts

        +
        public RelatedArtifacts()
        +
      • +
      + + + +
        +
      • +

        RelatedArtifacts

        +
        public RelatedArtifacts(String parentGroupId,
        +                        String parentArtifactId,
        +                        String parentVersion,
        +                        String pomFilesAttribute)
        +
        This transformation utility, given a list of pom.xml File objects and + a parent artifact, results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
        +
        +
        Parameters:
        +
        parentGroupId - parent group id
        +
        parentArtifactId - parent artifact id
        +
        parentVersion - parent version
        +
        pomFilesAttribute - the name of the transformation context attribute that contains + a list of pom.xml files to be analyzed
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        getParentGroupId

        +
        public String getParentGroupId()
        +
      • +
      + + + +
        +
      • +

        getParentArtifactId

        +
        public String getParentArtifactId()
        +
      • +
      + + + +
        +
      • +

        getParentVersion

        +
        public String getParentVersion()
        +
      • +
      + + + +
        +
      • +

        getPomFilesAttribute

        +
        public String getPomFilesAttribute()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RelatedArtifacts>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<RelatedArtifacts>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/EnforcerErrorsOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/EnforcerErrorsOutputHandler.html new file mode 100644 index 00000000..ada29413 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/EnforcerErrorsOutputHandler.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/GenericErrorsOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/GenericErrorsOutputHandler.html new file mode 100644 index 00000000..b98cf95d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/GenericErrorsOutputHandler.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenGoal.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenGoal.html new file mode 100644 index 00000000..9abc3749 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenGoal.html @@ -0,0 +1,200 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.maven.MavenGoal (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.maven.MavenGoal

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenInvocationOutputHandler.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenInvocationOutputHandler.html new file mode 100644 index 00000000..aceb0014 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/MavenInvocationOutputHandler.html @@ -0,0 +1,220 @@ + + + + + + +Uses of Interface com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Interface
com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/RelatedArtifacts.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/RelatedArtifacts.html new file mode 100644 index 00000000..4fdffb78 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/class-use/RelatedArtifacts.html @@ -0,0 +1,180 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.maven.RelatedArtifacts (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.maven.RelatedArtifacts

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-frame.html new file mode 100644 index 00000000..21084e2a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-frame.html @@ -0,0 +1,28 @@ + + + + + + +com.paypal.butterfly.utilities.maven (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.maven

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-summary.html new file mode 100644 index 00000000..7da0fd2f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-summary.html @@ -0,0 +1,196 @@ + + + + + + +com.paypal.butterfly.utilities.maven (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.maven

+
+
Transformation utilities to gather meta-data about Maven POM files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    MavenInvocationOutputHandler<T,R> +
    Reads lines from the Maven execution console output and return data after evaluating it.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    EnforcerErrorsOutputHandler +
    Reads lines from the Maven enforcer plugin output and produces as result a set of Strings stating the validation failures, if any.
    +
    GenericErrorsOutputHandler +
    Reads lines from the Maven execution output and produces as result a String stating the errors, if any.
    +
    MavenGoal +
    Runs one or more Maven goals against a specific Maven POM file.
    +
    RelatedArtifacts +
    Given a list of pom.xml File objects and + a parent artifact, this transformation utility results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.maven Description

+
Transformation utilities to gather meta-data about Maven POM files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-tree.html new file mode 100644 index 00000000..2cfa4ce3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-tree.html @@ -0,0 +1,158 @@ + + + + + + +com.paypal.butterfly.utilities.maven Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.maven

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+
    +
  • org.codehaus.plexus.util.cli.StreamConsumer + +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-use.html new file mode 100644 index 00000000..43bfea2d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/maven/package-use.html @@ -0,0 +1,185 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.maven (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.maven

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/RunScript.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/RunScript.html new file mode 100644 index 00000000..c9b5d74a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/RunScript.html @@ -0,0 +1,480 @@ + + + + + + +RunScript (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.misc
+

Class RunScript

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<RunScript>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.misc.RunScript
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RunScript
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<RunScript>
    +
    Executes a script and saves the result after evaluating it. + The scripting language can be chosen, and "js" is the default one. + Additionally, one or more objects, and/or transformation context attributes, + can be used in the script during transformation time.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RunScript() +
      Executes a script and saves the result after evaluating it.
      +
      RunScript(String script) +
      Executes a script and saves the result after evaluating it.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      RunScriptaddAttribute(String key, + String attributeName) 
      RunScriptaddObject(String key, + Object object) 
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      Map<String,String>getAttributes() 
      StringgetDescription() 
      StringgetLanguage() 
      Map<String,Object>getObjects() 
      StringgetScript() 
      RunScriptsetLanguage(String language) 
      RunScriptsetScript(String script) +
      Sets the script to be executed and evaluated
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RunScript

        +
        public RunScript()
        +
        Executes a script and saves the result after evaluating it. + The scripting language can be chosen, and "js" is the default one. + Additionally, one or more objects, and/or transformation context attributes, + can be used in the script during transformation time.
        +
      • +
      + + + +
        +
      • +

        RunScript

        +
        public RunScript(String script)
        +
        Executes a script and saves the result after evaluating it. + The scripting language can be chosen, and "js" is the default one. + Additionally, one or more objects, and/or transformation context attributes, + can be used in the script during transformation time.
        +
        +
        Parameters:
        +
        script - the script to be executed and evaluated
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setScript

        +
        public RunScript setScript(String script)
        +
        Sets the script to be executed and evaluated
        +
        +
        Parameters:
        +
        script - the script to be executed and evaluated
        +
        Returns:
        +
        this utility instance
        +
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        getScript

        +
        public String getScript()
        +
      • +
      + + + +
        +
      • +

        getLanguage

        +
        public String getLanguage()
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RunScript>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<RunScript>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/WebXmlContextParams.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/WebXmlContextParams.html new file mode 100644 index 00000000..2480e440 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/WebXmlContextParams.html @@ -0,0 +1,338 @@ + + + + + + +WebXmlContextParams (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.misc
+

Class WebXmlContextParams

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class WebXmlContextParams
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<WebXmlContextParams>
    +
    Parses a Java web deployment descriptor file (web.xml), + identifies all context parameters, and save them into a map, the key + being param-name and the value being param-value. +
    + Note: this utility does not validate the file's schema and content, + other than what it takes to identify all context-param elements at the document + element, and also their respective param-name and param-value elements
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        WebXmlContextParams

        +
        public WebXmlContextParams()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<WebXmlContextParams>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<WebXmlContextParams>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/RunScript.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/RunScript.html new file mode 100644 index 00000000..5dd5d8b5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/RunScript.html @@ -0,0 +1,184 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.misc.RunScript (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.misc.RunScript

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/WebXmlContextParams.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/WebXmlContextParams.html new file mode 100644 index 00000000..bc21b736 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/class-use/WebXmlContextParams.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.misc.WebXmlContextParams (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.misc.WebXmlContextParams

+
+
No usage of com.paypal.butterfly.utilities.misc.WebXmlContextParams
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-frame.html new file mode 100644 index 00000000..aa3aca2f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-frame.html @@ -0,0 +1,22 @@ + + + + + + +com.paypal.butterfly.utilities.misc (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.misc

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-summary.html new file mode 100644 index 00000000..273ed8db --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-summary.html @@ -0,0 +1,167 @@ + + + + + + +com.paypal.butterfly.utilities.misc (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.misc

+
+
Miscellaneous collection of transformation utilities.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    RunScript +
    Executes a script and saves the result after evaluating it.
    +
    WebXmlContextParams +
    Parses a Java web deployment descriptor file (web.xml), + identifies all context parameters, and save them into a map, the key + being param-name and the value being param-value.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.misc Description

+
Miscellaneous collection of transformation utilities.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-tree.html new file mode 100644 index 00000000..a6fe2357 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-tree.html @@ -0,0 +1,144 @@ + + + + + + +com.paypal.butterfly.utilities.misc Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.misc

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) + +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-use.html new file mode 100644 index 00000000..e8f0de8a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/misc/package-use.html @@ -0,0 +1,163 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.misc (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.misc

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyFile.html new file mode 100644 index 00000000..46274b60 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyFile.html @@ -0,0 +1,413 @@ + + + + + + +ApplyFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class ApplyFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<ApplyFile>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.ApplyFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ApplyFile
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<ApplyFile>
    +
    Applies a file, whose location is set as a URL, + into the transformed application
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      ApplyFile() 
      ApplyFile(String fileUrl) +
      Applies a file, whose location is set as a URL, + into the transformed application
      +
      ApplyFile(URL fileUrl) +
      Applies a file, whose location is set as a URL, + into the transformed application
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      URLgetFileUrl() 
      ApplyFilesetFileUrl(URL fileUrl) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ApplyFile

        +
        public ApplyFile()
        +
      • +
      + + + +
        +
      • +

        ApplyFile

        +
        public ApplyFile(String fileUrl)
        +
        Applies a file, whose location is set as a URL, + into the transformed application
        +
        +
        Parameters:
        +
        fileUrl - URL string to locate the file to be applied
        +
        +
      • +
      + + + +
        +
      • +

        ApplyFile

        +
        public ApplyFile(URL fileUrl)
        +
        Applies a file, whose location is set as a URL, + into the transformed application
        +
        +
        Parameters:
        +
        fileUrl - URL to locate the file to be applied
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setFileUrl

        +
        public ApplyFile setFileUrl(URL fileUrl)
        +
      • +
      + + + +
        +
      • +

        getFileUrl

        +
        public URL getFileUrl()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<ApplyFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<ApplyFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyZip.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyZip.html new file mode 100644 index 00000000..a633f9a4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/ApplyZip.html @@ -0,0 +1,418 @@ + + + + + + +ApplyZip (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class ApplyZip

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<ApplyZip>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.ApplyZip
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ApplyZip
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<ApplyZip>
    +
    Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      ApplyZip() 
      ApplyZip(String zipFileUrl) +
      Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
      +
      ApplyZip(URL zipFileUrl) +
      Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      URLgetZipFileUrl() 
      ApplyZipsetZipFileUrl(URL zipFileUrl) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ApplyZip

        +
        public ApplyZip()
        +
      • +
      + + + +
        +
      • +

        ApplyZip

        +
        public ApplyZip(String zipFileUrl)
        +
        Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
        +
        +
        Parameters:
        +
        zipFileUrl - URL string to locate the zip file to be applied
        +
        +
      • +
      + + + +
        +
      • +

        ApplyZip

        +
        public ApplyZip(URL zipFileUrl)
        +
        Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
        +
        +
        Parameters:
        +
        zipFileUrl - URL to locate the zip file to be applied
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setZipFileUrl

        +
        public ApplyZip setZipFileUrl(URL zipFileUrl)
        +
      • +
      + + + +
        +
      • +

        getZipFileUrl

        +
        public URL getZipFileUrl()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<ApplyZip>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<ApplyZip>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyDirectory.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyDirectory.html new file mode 100644 index 00000000..317b4fde --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyDirectory.html @@ -0,0 +1,582 @@ + + + + + + +CopyDirectory (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class CopyDirectory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<A>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.CopyDirectory
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class CopyDirectory
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<A>
    +
    Copies a directory and its content from one location to another. + The files to be copied include sub-folders and their files, coming from relative + or absolute location. The path to the files to be copied are preserved, and those + folders are also copied to the destination location. If the destination directory + does not exist, it is created. But, if it does, then the content to be copied is + merged with the destination content, with the source taking precedence. +
    + Note: if all you want is to copy a set of specific files from one + location to another, then use a multiple transformation operation + (see TransformationTemplate.addMultiple()) with CopyFile
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    CopyFile, +MoveFile, +MoveDirectory
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CopyDirectory() +
      Operation to copy a directory and its content from one location to another.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      protected FilegetFileTo(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetToAbsoluteAttribute() 
      StringgetToRelative() 
      AsetDescription(String description) 
      AsetToAbsolute(String attributeName) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToAbsolute(String attributeName, + String additionalRelativePath) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToRelative(String toRelative) +
      Set relative destination location.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        description

        +
        protected String description
        +
      • +
      + + + +
        +
      • +

        toRelative

        +
        protected String toRelative
        +
      • +
      + + + +
        +
      • +

        toAbsoluteAttribute

        +
        protected String toAbsoluteAttribute
        +
      • +
      + + + +
        +
      • +

        additionalRelativePath

        +
        protected String additionalRelativePath
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CopyDirectory

        +
        public CopyDirectory()
        +
        Operation to copy a directory and its content from one location to another. + The files to be copied include sub-folders and their files, coming rom relative + or absolute location. The path to the files to be copied are preserved, and those + folders are also copied to the destination location. If the destination directory + does not exist, it is created. But, if it does, then the content to be copied is + merged with the destination content, with the source taking precedence.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<CopyDirectory>
        +
        +
      • +
      + + + +
        +
      • +

        setDescription

        +
        public A setDescription(String description)
        +
      • +
      + + + +
        +
      • +

        setToRelative

        +
        public A setToRelative(String toRelative)
        +
        Set relative destination location. +
        + If the relative destination location is NOT known during transformation definition time, + then don't set it (leaving as null) and use setToAbsolute(String) + based on a transformation context attribute set by a + LocateFile + transformation utility. +
        + By setting this relative location, the absolute location attribute name is automatically set to null
        +
        +
        Parameters:
        +
        toRelative - relative destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName,
        +                       String additionalRelativePath)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        additionalRelativePath - an additional relative path to be added to the absolute + file coming from the transformation context. The path + separator will be normalized, similar to what happens + in TransformationUtility.relative(String)
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getToRelative

        +
        public String getToRelative()
        +
      • +
      + + + +
        +
      • +

        getToAbsoluteAttribute

        +
        public String getToAbsoluteAttribute()
        +
      • +
      + + + +
        +
      • +

        getFileTo

        +
        protected File getFileTo(File transformedAppFolder,
        +                         com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<A extends com.paypal.butterfly.utilities.operations.file.AbstractToOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyFile.html new file mode 100644 index 00000000..2b31318f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/CopyFile.html @@ -0,0 +1,578 @@ + + + + + + +CopyFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class CopyFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<A>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.CopyFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class CopyFile
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<A>
    +
    Copies a file. The relative or absolute file is the + "from" file, while the "to" location is specified via setToRelative(String) + or setToAbsolute(String) +
    + Note: if you want to copy a set of specific files from one + location to another, then use a multiple transformation operation + (see TransformationTemplate.addMultiple()) with CopyFile. Now, if + you want to copy a directory and its content from one location to another, then + use CopyDirectory instead.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    MoveFile, +CopyDirectory, +MoveDirectory
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      CopyFile() +
      Copies a file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      protected FilegetFileTo(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetToAbsoluteAttribute() 
      StringgetToRelative() 
      AsetDescription(String description) 
      AsetToAbsolute(String attributeName) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToAbsolute(String attributeName, + String additionalRelativePath) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToRelative(String toRelative) +
      Set relative destination location.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        description

        +
        protected String description
        +
      • +
      + + + +
        +
      • +

        toRelative

        +
        protected String toRelative
        +
      • +
      + + + +
        +
      • +

        toAbsoluteAttribute

        +
        protected String toAbsoluteAttribute
        +
      • +
      + + + +
        +
      • +

        additionalRelativePath

        +
        protected String additionalRelativePath
        +
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<CopyFile>
        +
        +
      • +
      + + + +
        +
      • +

        setDescription

        +
        public A setDescription(String description)
        +
      • +
      + + + +
        +
      • +

        setToRelative

        +
        public A setToRelative(String toRelative)
        +
        Set relative destination location. +
        + If the relative destination location is NOT known during transformation definition time, + then don't set it (leaving as null) and use setToAbsolute(String) + based on a transformation context attribute set by a + LocateFile + transformation utility. +
        + By setting this relative location, the absolute location attribute name is automatically set to null
        +
        +
        Parameters:
        +
        toRelative - relative destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName,
        +                       String additionalRelativePath)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        additionalRelativePath - an additional relative path to be added to the absolute + file coming from the transformation context. The path + separator will be normalized, similar to what happens + in TransformationUtility.relative(String)
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getToRelative

        +
        public String getToRelative()
        +
      • +
      + + + +
        +
      • +

        getToAbsoluteAttribute

        +
        public String getToAbsoluteAttribute()
        +
      • +
      + + + +
        +
      • +

        getFileTo

        +
        protected File getFileTo(File transformedAppFolder,
        +                         com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<A extends com.paypal.butterfly.utilities.operations.file.AbstractToOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/DeleteFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/DeleteFile.html new file mode 100644 index 00000000..5041ace7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/DeleteFile.html @@ -0,0 +1,344 @@ + + + + + + +DeleteFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class DeleteFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<DeleteFile>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.DeleteFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class DeleteFile
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<DeleteFile>
    +
    Deletes a single file or folder (empty or not).
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DeleteFile() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DeleteFile

        +
        public DeleteFile()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<DeleteFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<DeleteFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveDirectory.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveDirectory.html new file mode 100644 index 00000000..be917cd2 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveDirectory.html @@ -0,0 +1,574 @@ + + + + + + +MoveDirectory (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class MoveDirectory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<A>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.MoveDirectory
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class MoveDirectory
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<A>
    +
    Moves a directory and its content from one location to another. + The directory to be moved is specified from relative + or absolute location. If the destination directory + does not exist, it is created.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    CopyFile, +CopyDirectory, +MoveFile
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MoveDirectory() +
      Moves a directory and its content from one location to another.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      protected FilegetFileTo(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetToAbsoluteAttribute() 
      StringgetToRelative() 
      AsetDescription(String description) 
      AsetToAbsolute(String attributeName) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToAbsolute(String attributeName, + String additionalRelativePath) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToRelative(String toRelative) +
      Set relative destination location.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        description

        +
        protected String description
        +
      • +
      + + + +
        +
      • +

        toRelative

        +
        protected String toRelative
        +
      • +
      + + + +
        +
      • +

        toAbsoluteAttribute

        +
        protected String toAbsoluteAttribute
        +
      • +
      + + + +
        +
      • +

        additionalRelativePath

        +
        protected String additionalRelativePath
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MoveDirectory

        +
        public MoveDirectory()
        +
        Moves a directory and its content from one location to another. + The directory to be moved is specified from relative + or absolute location. If the destination directory + does not exist, it is created.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<MoveDirectory>
        +
        +
      • +
      + + + +
        +
      • +

        setDescription

        +
        public A setDescription(String description)
        +
      • +
      + + + +
        +
      • +

        setToRelative

        +
        public A setToRelative(String toRelative)
        +
        Set relative destination location. +
        + If the relative destination location is NOT known during transformation definition time, + then don't set it (leaving as null) and use setToAbsolute(String) + based on a transformation context attribute set by a + LocateFile + transformation utility. +
        + By setting this relative location, the absolute location attribute name is automatically set to null
        +
        +
        Parameters:
        +
        toRelative - relative destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName,
        +                       String additionalRelativePath)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        additionalRelativePath - an additional relative path to be added to the absolute + file coming from the transformation context. The path + separator will be normalized, similar to what happens + in TransformationUtility.relative(String)
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getToRelative

        +
        public String getToRelative()
        +
      • +
      + + + +
        +
      • +

        getToAbsoluteAttribute

        +
        public String getToAbsoluteAttribute()
        +
      • +
      + + + +
        +
      • +

        getFileTo

        +
        protected File getFileTo(File transformedAppFolder,
        +                         com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<A extends com.paypal.butterfly.utilities.operations.file.AbstractToOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveFile.html new file mode 100644 index 00000000..1c8a37cc --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/MoveFile.html @@ -0,0 +1,578 @@ + + + + + + +MoveFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class MoveFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<A>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.MoveFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class MoveFile
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<A>
    +
    Moves a file. The relative or absolute file is the + "from" file, while the "to" location is specified via setToRelative(String) + or setToAbsolute(String) +
    + Note: if you want to move a set of specific files from one + location to another, then use a multiple transformation operation + (see TransformationTemplate.addMultiple()) with MoveFile. Now, if + you want to move a directory and its content from one location to another, then + use MoveDirectory instead.
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    CopyFile, +CopyDirectory, +MoveDirectory
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      MoveFile() +
      Moves a file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      protected FilegetFileTo(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetToAbsoluteAttribute() 
      StringgetToRelative() 
      AsetDescription(String description) 
      AsetToAbsolute(String attributeName) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToAbsolute(String attributeName, + String additionalRelativePath) +
      The name of the transformation context attribute that holds + the absolute destination location.
      +
      AsetToRelative(String toRelative) +
      Set relative destination location.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        description

        +
        protected String description
        +
      • +
      + + + +
        +
      • +

        toRelative

        +
        protected String toRelative
        +
      • +
      + + + +
        +
      • +

        toAbsoluteAttribute

        +
        protected String toAbsoluteAttribute
        +
      • +
      + + + +
        +
      • +

        additionalRelativePath

        +
        protected String additionalRelativePath
        +
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<MoveFile>
        +
        +
      • +
      + + + +
        +
      • +

        setDescription

        +
        public A setDescription(String description)
        +
      • +
      + + + +
        +
      • +

        setToRelative

        +
        public A setToRelative(String toRelative)
        +
        Set relative destination location. +
        + If the relative destination location is NOT known during transformation definition time, + then don't set it (leaving as null) and use setToAbsolute(String) + based on a transformation context attribute set by a + LocateFile + transformation utility. +
        + By setting this relative location, the absolute location attribute name is automatically set to null
        +
        +
        Parameters:
        +
        toRelative - relative destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setToAbsolute

        +
        public A setToAbsolute(String attributeName,
        +                       String additionalRelativePath)
        +
        The name of the transformation context attribute that holds + the absolute destination location. +
        + If the relative destination location is known during transformation definition time, + then don't use this setter, use setToRelative(String) instead. +
        + By setting this attribute name, the relative destination location is automatically set to null
        +
        +
        Parameters:
        +
        attributeName - name of the transformation context attribute that holds + the absolute destination location
        +
        additionalRelativePath - an additional relative path to be added to the absolute + file coming from the transformation context. The path + separator will be normalized, similar to what happens + in TransformationUtility.relative(String)
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getToRelative

        +
        public String getToRelative()
        +
      • +
      + + + +
        +
      • +

        getToAbsoluteAttribute

        +
        public String getToAbsoluteAttribute()
        +
      • +
      + + + +
        +
      • +

        getFileTo

        +
        protected File getFileTo(File transformedAppFolder,
        +                         com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<A extends com.paypal.butterfly.utilities.operations.file.AbstractToOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/RenameFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/RenameFile.html new file mode 100644 index 00000000..4db094a7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/RenameFile.html @@ -0,0 +1,389 @@ + + + + + + +RenameFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.file
+

Class RenameFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<RenameFile>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.file.RenameFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RenameFile
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<RenameFile>
    +
    Renames a single file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RenameFile() 
      RenameFile(String newName) +
      Renames a single file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetNewName() 
      RenameFilesetNewName(String newName) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RenameFile

        +
        public RenameFile()
        +
      • +
      + + + +
        +
      • +

        RenameFile

        +
        public RenameFile(String newName)
        +
        Renames a single file.
        +
        +
        Parameters:
        +
        newName - new name for the file
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getNewName

        +
        public String getNewName()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RenameFile>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<RenameFile>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyFile.html new file mode 100644 index 00000000..26b06fe8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyFile.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.ApplyFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.ApplyFile

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyZip.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyZip.html new file mode 100644 index 00000000..4924d892 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/ApplyZip.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.ApplyZip (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.ApplyZip

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyDirectory.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyDirectory.html new file mode 100644 index 00000000..dec695dc --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyDirectory.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.CopyDirectory (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.CopyDirectory

+
+
No usage of com.paypal.butterfly.utilities.operations.file.CopyDirectory
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyFile.html new file mode 100644 index 00000000..c27eea42 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/CopyFile.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.CopyFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.CopyFile

+
+
No usage of com.paypal.butterfly.utilities.operations.file.CopyFile
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/DeleteFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/DeleteFile.html new file mode 100644 index 00000000..97501987 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/DeleteFile.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.DeleteFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.DeleteFile

+
+
No usage of com.paypal.butterfly.utilities.operations.file.DeleteFile
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveDirectory.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveDirectory.html new file mode 100644 index 00000000..bf677697 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveDirectory.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.MoveDirectory (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.MoveDirectory

+
+
No usage of com.paypal.butterfly.utilities.operations.file.MoveDirectory
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveFile.html new file mode 100644 index 00000000..cab194de --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/MoveFile.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.MoveFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.MoveFile

+
+
No usage of com.paypal.butterfly.utilities.operations.file.MoveFile
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/RenameFile.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/RenameFile.html new file mode 100644 index 00000000..6f8dc659 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/class-use/RenameFile.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.file.RenameFile (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.file.RenameFile

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-frame.html new file mode 100644 index 00000000..efea4892 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-frame.html @@ -0,0 +1,28 @@ + + + + + + +com.paypal.butterfly.utilities.operations.file (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.operations.file

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-summary.html new file mode 100644 index 00000000..2212f3e1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-summary.html @@ -0,0 +1,204 @@ + + + + + + +com.paypal.butterfly.utilities.operations.file (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.operations.file

+
+
Transformation operations to manipulate files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ApplyFile +
    Applies a file, whose location is set as a URL, + into the transformed application
    +
    ApplyZip +
    Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
    +
    CopyDirectory +
    Copies a directory and its content from one location to another.
    +
    CopyFile +
    Copies a file.
    +
    DeleteFile +
    Deletes a single file or folder (empty or not).
    +
    MoveDirectory +
    Moves a directory and its content from one location to another.
    +
    MoveFile +
    Moves a file.
    +
    RenameFile +
    Renames a single file.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.operations.file Description

+
Transformation operations to manipulate files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-tree.html new file mode 100644 index 00000000..1b97d4e7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-tree.html @@ -0,0 +1,154 @@ + + + + + + +com.paypal.butterfly.utilities.operations.file Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.operations.file

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T> +
          +
        • com.paypal.butterfly.utilities.operations.file.ApplyFile
        • +
        • com.paypal.butterfly.utilities.operations.file.ApplyZip
        • +
        • com.paypal.butterfly.utilities.operations.file.CopyDirectory
        • +
        • com.paypal.butterfly.utilities.operations.file.CopyFile
        • +
        • com.paypal.butterfly.utilities.operations.file.DeleteFile
        • +
        • com.paypal.butterfly.utilities.operations.file.MoveDirectory
        • +
        • com.paypal.butterfly.utilities.operations.file.MoveFile
        • +
        • com.paypal.butterfly.utilities.operations.file.RenameFile
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-use.html new file mode 100644 index 00000000..4631187f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/file/package-use.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.operations.file (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.operations.file

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.html new file mode 100644 index 00000000..82bdc620 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddDependency.html @@ -0,0 +1,609 @@ + + + + + + +PomAddDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomAddDependency

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddDependency>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomAddDependency
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>, Cloneable
    +
    +
    +
    +
    public class PomAddDependency
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddDependency>
    +implements com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
    +
    Adds a new dependency to a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.AddElement

        +com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomAddDependencyfailIfPresent() 
      StringgetDescription() 
      StringgetScope() 
      StringgetVersion() 
      PomAddDependencynoOpIfPresent() 
      PomAddDependencyoverwriteIfPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomAddDependencysetScope(String scope) 
      PomAddDependencysetVersion(String version) 
      PomAddDependencywarnButAddIfPresent() 
      PomAddDependencywarnNotAddIfPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +equals, getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, hashCode, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomAddDependency

        +
        public PomAddDependency()
        +
      • +
      + + + +
        +
      • +

        PomAddDependency

        +
        public PomAddDependency(String groupId,
        +                        String artifactId)
        +
        Operation to add a new dependency to a POM file. + This constructor assumes this is a managed dependency, since the version + is not set. However, if that is not really the case, during transformation + this operation will fail pre-validation.
        +
        +
        Parameters:
        +
        groupId - new dependency group id
        +
        artifactId - new dependency artifact id
        +
        +
      • +
      + + + +
        +
      • +

        PomAddDependency

        +
        public PomAddDependency(String groupId,
        +                        String artifactId,
        +                        String version)
        +
        Operation to add a new dependency to a POM file.
        +
        +
        Parameters:
        +
        groupId - new dependency group id
        +
        artifactId - new dependency artifact id
        +
        version - new dependency artifact version
        +
        +
      • +
      + + + +
        +
      • +

        PomAddDependency

        +
        public PomAddDependency(String groupId,
        +                        String artifactId,
        +                        String version,
        +                        String scope)
        +
        Operation to add a new dependency to a POM file.
        +
        +
        Parameters:
        +
        groupId - new dependency group id
        +
        artifactId - new dependency artifact id
        +
        version - new dependency artifact version
        +
        scope - new dependency artifact scope
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        failIfPresent

        +
        public PomAddDependency failIfPresent()
        +
        +
        Specified by:
        +
        failIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        warnNotAddIfPresent

        +
        public PomAddDependency warnNotAddIfPresent()
        +
        +
        Specified by:
        +
        warnNotAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        warnButAddIfPresent

        +
        public PomAddDependency warnButAddIfPresent()
        +
        +
        Specified by:
        +
        warnButAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfPresent

        +
        public PomAddDependency noOpIfPresent()
        +
        +
        Specified by:
        +
        noOpIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        overwriteIfPresent

        +
        public PomAddDependency overwriteIfPresent()
        +
        +
        Specified by:
        +
        overwriteIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getScope

        +
        public String getScope()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomAddDependency>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddParent.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddParent.html new file mode 100644 index 00000000..fba2c255 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddParent.html @@ -0,0 +1,537 @@ + + + + + + +PomAddParent (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomAddParent

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddParent>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomAddParent
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>, Cloneable
    +
    +
    +
    +
    public class PomAddParent
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddParent>
    +implements com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
    +
    Add a parent artifact in a Maven POM file. + By default, if parent is already present, it is overwritten. + This behavior though can be changed.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.AddElement

        +com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      PomAddParent() +
      Add a parent artifact in a Maven POM file.
      +
      PomAddParent(String groupId, + String artifactId, + String version) +
      Operation to add a parent artifact in a Maven POM file
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomAddParentfailIfPresent() 
      StringgetDescription() 
      StringgetVersion() 
      PomAddParentnoOpIfPresent() 
      PomAddParentoverwriteIfPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomAddParentsetVersion(String version) 
      PomAddParentwarnButAddIfPresent() 
      PomAddParentwarnNotAddIfPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +equals, getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, hashCode, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomAddParent

        +
        public PomAddParent()
        +
        Add a parent artifact in a Maven POM file. + By default, if parent is already present, it is overwritten. + This behavior though can be changed.
        +
      • +
      + + + +
        +
      • +

        PomAddParent

        +
        public PomAddParent(String groupId,
        +                    String artifactId,
        +                    String version)
        +
        Operation to add a parent artifact in a Maven POM file
        +
        +
        Parameters:
        +
        groupId - parent artifact group id to be set
        +
        artifactId - parent artifact id to be set
        +
        version - parent artifact version to be set
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        failIfPresent

        +
        public PomAddParent failIfPresent()
        +
        +
        Specified by:
        +
        failIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        warnNotAddIfPresent

        +
        public PomAddParent warnNotAddIfPresent()
        +
        +
        Specified by:
        +
        warnNotAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        warnButAddIfPresent

        +
        public PomAddParent warnButAddIfPresent()
        +
        +
        Specified by:
        +
        warnButAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfPresent

        +
        public PomAddParent noOpIfPresent()
        +
        +
        Specified by:
        +
        noOpIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        overwriteIfPresent

        +
        public PomAddParent overwriteIfPresent()
        +
        +
        Specified by:
        +
        overwriteIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomAddParent>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.html new file mode 100644 index 00000000..bca4c037 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomAddPlugin.html @@ -0,0 +1,589 @@ + + + + + + +PomAddPlugin (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomAddPlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddPlugin>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>, Cloneable
    +
    +
    +
    +
    public class PomAddPlugin
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddPlugin>
    +implements com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
    +
    Adds a new plugin to a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.AddElement

        +com.paypal.butterfly.extensions.api.operations.AddElement.IfPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanequals(Object obj) 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomAddPluginfailIfPresent() 
      StringgetDescription() 
      StringgetVersion() 
      inthashCode() 
      PomAddPluginnoOpIfPresent() 
      PomAddPluginoverwriteIfPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomAddPluginsetVersion(String version) 
      PomAddPluginwarnButAddIfPresent() 
      PomAddPluginwarnNotAddIfPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomAddPlugin

        +
        public PomAddPlugin()
        +
      • +
      + + + +
        +
      • +

        PomAddPlugin

        +
        public PomAddPlugin(String groupId,
        +                    String artifactId)
        +
        Operation to add a new plugin to a POM file. + This constructor assumes this is a managed plugin, since the version + is not set. However, if that is not really the case, during transformation + this operation will fail pre-validation.
        +
        +
        Parameters:
        +
        groupId - new plugin group id
        +
        artifactId - new plugin artifact id
        +
        +
      • +
      + + + +
        +
      • +

        PomAddPlugin

        +
        public PomAddPlugin(String groupId,
        +                    String artifactId,
        +                    String version)
        +
        Operation to add a new plugin to a POM file.
        +
        +
        Parameters:
        +
        groupId - new plugin group id
        +
        artifactId - new plugin artifact id
        +
        version - new plugin artifact version
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        failIfPresent

        +
        public PomAddPlugin failIfPresent()
        +
        +
        Specified by:
        +
        failIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        warnNotAddIfPresent

        +
        public PomAddPlugin warnNotAddIfPresent()
        +
        +
        Specified by:
        +
        warnNotAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        warnButAddIfPresent

        +
        public PomAddPlugin warnButAddIfPresent()
        +
        +
        Specified by:
        +
        warnButAddIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfPresent

        +
        public PomAddPlugin noOpIfPresent()
        +
        +
        Specified by:
        +
        noOpIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        overwriteIfPresent

        +
        public PomAddPlugin overwriteIfPresent()
        +
        +
        Specified by:
        +
        overwriteIfPresent in interface com.paypal.butterfly.extensions.api.operations.AddElement<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(Object obj)
        +
        +
        Overrides:
        +
        equals in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomAddPlugin>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.html new file mode 100644 index 00000000..e25453cc --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeDependency.html @@ -0,0 +1,693 @@ + + + + + + +PomChangeDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomChangeDependency

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeDependency>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeDependency>, Cloneable
    +
    +
    +
    +
    public class PomChangeDependency
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeDependency>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeDependency>
    +
    Changes a dependency in a Maven POM file. + It allows changing anything but group id and artifact id. + It also allows removing specific configuration, letting them + to have default values, or be managed when applicable. +
    + If the dependency to be changed doesn't actually exist, it will result + in error +
    + Important: no check will be done here for possible reasons to break + the build, like the lack of version when the dependency is not managed
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomChangeDependency

        +
        public PomChangeDependency()
        +
      • +
      + + + +
        +
      • +

        PomChangeDependency

        +
        public PomChangeDependency(String groupId,
        +                           String artifactId)
        +
        Operation to change a dependency in a Maven POM file. + It allows changing anything but group id and artifact id. + It also allows removing specific configuration, letting them + to have default values, or be managed when applicable. +
        + If the dependency to be changed doesn't actually exist, it will result + in error +
        + Important: no check will be done here for possible reasons to break + the build, like the lack of version when the dependency is not managed
        +
        +
        Parameters:
        +
        groupId - dependency group id
        +
        artifactId - dependency artifact id
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
      • +

        failIfNotPresent

        +
        public PomChangeDependency failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeDependency>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomChangeDependency warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeDependency>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomChangeDependency noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeDependency>
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getScope

        +
        public String getScope()
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public String getType()
        +
      • +
      + + + +
        +
      • +

        isOptional

        +
        public boolean isOptional()
        +
      • +
      + + + +
        +
      • +

        isRemoveVersion

        +
        public boolean isRemoveVersion()
        +
      • +
      + + + +
        +
      • +

        isRemoveScope

        +
        public boolean isRemoveScope()
        +
      • +
      + + + +
        +
      • +

        isRemoveType

        +
        public boolean isRemoveType()
        +
      • +
      + + + +
        +
      • +

        isRemoveOptional

        +
        public boolean isRemoveOptional()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomChangeDependency>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.html new file mode 100644 index 00000000..19b74646 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangePackaging.html @@ -0,0 +1,438 @@ + + + + + + +PomChangePackaging (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomChangePackaging

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class PomChangePackaging
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<T>
    +
    Changes the packaging of a Maven artifact, by changing its POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      PomChangePackaging() 
      PomChangePackaging(String packagingType) +
      Operation to change the packaging of a Maven artifact, by changing its POM file
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanequals(Object obj) 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetPackagingType() 
      inthashCode() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomChangePackagingsetPackagingType(String packagingType) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomChangePackaging

        +
        public PomChangePackaging()
        +
      • +
      + + + +
        +
      • +

        PomChangePackaging

        +
        public PomChangePackaging(String packagingType)
        +
        Operation to change the packaging of a Maven artifact, by changing its POM file
        +
        +
        Parameters:
        +
        packagingType - packaging type
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getPackagingType

        +
        public String getPackagingType()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomChangePackaging>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(Object obj)
        +
        +
        Overrides:
        +
        equals in class com.paypal.butterfly.extensions.api.TransformationUtility<PomChangePackaging>
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class com.paypal.butterfly.extensions.api.TransformationUtility<PomChangePackaging>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.html new file mode 100644 index 00000000..175a7905 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomChangeParent.html @@ -0,0 +1,549 @@ + + + + + + +PomChangeParent (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomChangeParent

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeParent>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeParent
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeParent>, Cloneable
    +
    +
    +
    +
    public class PomChangeParent
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeParent>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeParent>
    +
    Changes the parent, or its version, in a Maven POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      PomChangeParent() 
      PomChangeParent(String version) +
      Operation to change the parent, or its version, in a Maven POM file
      +
      PomChangeParent(String groupId, + String artifactId, + String version) +
      Operation to change the parent, or its version, in a Maven POM file
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomChangeParentfailIfNotPresent() 
      StringgetDescription() 
      StringgetVersion() 
      PomChangeParentnoOpIfNotPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomChangeParentsetArtifactId(String artifactId) 
      PomChangeParentsetGroupId(String groupId) 
      PomChangeParentsetVersion(String version) 
      PomChangeParentwarnIfNotPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +equals, getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, hashCode, setArtifact
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomChangeParent

        +
        public PomChangeParent()
        +
      • +
      + + + +
        +
      • +

        PomChangeParent

        +
        public PomChangeParent(String version)
        +
        Operation to change the parent, or its version, in a Maven POM file
        +
        +
        Parameters:
        +
        version - parent artifact version to be set
        +
        +
      • +
      + + + +
        +
      • +

        PomChangeParent

        +
        public PomChangeParent(String groupId,
        +                       String artifactId,
        +                       String version)
        +
        Operation to change the parent, or its version, in a Maven POM file
        +
        +
        Parameters:
        +
        groupId - parent artifact group id to be set
        +
        artifactId - parent artifact id to be set
        +
        version - parent artifact version to be set
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setGroupId

        +
        public PomChangeParent setGroupId(String groupId)
        +
        +
        Overrides:
        +
        setGroupId in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeParent>
        +
        +
      • +
      + + + +
        +
      • +

        setArtifactId

        +
        public PomChangeParent setArtifactId(String artifactId)
        +
        +
        Overrides:
        +
        setArtifactId in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomChangeParent>
        +
        +
      • +
      + + + + + + + +
        +
      • +

        failIfNotPresent

        +
        public PomChangeParent failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeParent>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomChangeParent warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeParent>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomChangeParent noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomChangeParent>
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public String getVersion()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomChangeParent>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.html new file mode 100644 index 00000000..1d0d9aa1 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveDependency.html @@ -0,0 +1,501 @@ + + + + + + +PomRemoveDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomRemoveDependency

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveDependency>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveDependency>, Cloneable
    +
    +
    +
    +
    public class PomRemoveDependency
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveDependency>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveDependency>
    +
    Removes a dependency entry from a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanequals(Object obj) 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomRemoveDependencyfailIfNotPresent() 
      StringgetDescription() 
      inthashCode() 
      PomRemoveDependencynoOpIfNotPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomRemoveDependencywarnIfNotPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomRemoveDependency

        +
        public PomRemoveDependency()
        +
      • +
      + + + +
        +
      • +

        PomRemoveDependency

        +
        public PomRemoveDependency(String groupId,
        +                           String artifactId)
        +
        Operation to remove a dependency entry from a POM file
        +
        +
        Parameters:
        +
        groupId - dependency to be removed group id
        +
        artifactId - dependency to be removed artifact id
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        failIfNotPresent

        +
        public PomRemoveDependency failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomRemoveDependency warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomRemoveDependency noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(Object obj)
        +
        +
        Overrides:
        +
        equals in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveDependency>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.html new file mode 100644 index 00000000..18ad3cec --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveManagedDependency.html @@ -0,0 +1,467 @@ + + + + + + +PomRemoveManagedDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomRemoveManagedDependency

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveManagedDependency>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveManagedDependency>, Cloneable
    +
    +
    +
    +
    public class PomRemoveManagedDependency
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemoveManagedDependency>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveManagedDependency>
    +
    Removes a managed dependency entry from a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomRemoveManagedDependencyfailIfNotPresent() 
      StringgetDescription() 
      PomRemoveManagedDependencynoOpIfNotPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomRemoveManagedDependencywarnIfNotPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +equals, getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, hashCode, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomRemoveManagedDependency

        +
        public PomRemoveManagedDependency()
        +
      • +
      + + + +
        +
      • +

        PomRemoveManagedDependency

        +
        public PomRemoveManagedDependency(String groupId,
        +                                  String artifactId)
        +
        Operation to remove a managed dependency entry from a POM file
        +
        +
        Parameters:
        +
        groupId - managed dependency to be removed group id
        +
        artifactId - managed dependency to be removed artifact id
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomRemoveManagedDependency>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.html new file mode 100644 index 00000000..21d73455 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemovePlugin.html @@ -0,0 +1,501 @@ + + + + + + +PomRemovePlugin (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomRemovePlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemovePlugin>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemovePlugin>, Cloneable
    +
    +
    +
    +
    public class PomRemovePlugin
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemovePlugin>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemovePlugin>
    +
    Removes a plugin entry from a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanequals(Object obj) 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomRemovePluginfailIfNotPresent() 
      StringgetDescription() 
      inthashCode() 
      PomRemovePluginnoOpIfNotPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomRemovePluginwarnIfNotPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +getArtifactId, getDependency, getDependency, getGroupId, getManagedDependency, getManagedDependency, getManagedPlugin, getManagedPlugin, getPlugin, getPlugin, setArtifact, setArtifactId, setGroupId
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomRemovePlugin

        +
        public PomRemovePlugin()
        +
      • +
      + + + +
        +
      • +

        PomRemovePlugin

        +
        public PomRemovePlugin(String groupId,
        +                       String artifactId)
        +
        Operation to remove a plugin entry from a POM file
        +
        +
        Parameters:
        +
        groupId - plugin to be removed group id
        +
        artifactId - plugin to be removed artifact id
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        failIfNotPresent

        +
        public PomRemovePlugin failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomRemovePlugin warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomRemovePlugin noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(Object obj)
        +
        +
        Overrides:
        +
        equals in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomRemovePlugin>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.html new file mode 100644 index 00000000..a7f94074 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomRemoveProperty.html @@ -0,0 +1,471 @@ + + + + + + +PomRemoveProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomRemoveProperty

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveProperty>, Cloneable
    +
    +
    +
    +
    public class PomRemoveProperty
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<T>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveProperty>
    +
    Removes a property entry from a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      PomRemovePropertyfailIfNotPresent() 
      StringgetDescription() 
      StringgetPropertyName() 
      PomRemovePropertynoOpIfNotPresent() 
      protected com.paypal.butterfly.extensions.api.TOExecutionResultpomExecution(String relativePomFile, + org.apache.maven.model.Model model) 
      PomRemovePropertysetPropertyName(String propertyName) 
      PomRemovePropertywarnIfNotPresent() 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomRemoveProperty

        +
        public PomRemoveProperty()
        +
      • +
      + + + +
        +
      • +

        PomRemoveProperty

        +
        public PomRemoveProperty(String propertyName)
        +
        Operation to remove a property entry from a properties file
        +
        +
        Parameters:
        +
        propertyName - property to be removed
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        failIfNotPresent

        +
        public PomRemoveProperty failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveProperty>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomRemoveProperty warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveProperty>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomRemoveProperty noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomRemoveProperty>
        +
        +
      • +
      + + + +
        +
      • +

        getPropertyName

        +
        public String getPropertyName()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomRemoveProperty>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.html new file mode 100644 index 00000000..f2165dd7 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/PomReplaceDependency.html @@ -0,0 +1,642 @@ + + + + + + +PomReplaceDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.pom
+

Class PomReplaceDependency

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomReplaceDependency>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomReplaceDependency>, Cloneable
    +
    +
    +
    +
    public class PomReplaceDependency
    +extends com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<PomReplaceDependency>
    +implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomReplaceDependency>
    +
    Replaces a dependency by another one in a POM file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement

        +com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement.IfNotPresent
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation

        +artifactId, groupId
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PomReplaceDependency

        +
        public PomReplaceDependency()
        +
      • +
      + + + +
        +
      • +

        PomReplaceDependency

        +
        public PomReplaceDependency(String groupId,
        +                            String artifactId,
        +                            String newGroupId,
        +                            String newArtifactId)
        +
        Operation to replace a dependency by another one in a POM file
        +
        +
        Parameters:
        +
        groupId - group id of the dependency to be replaced
        +
        artifactId - artifact id of the dependency to be replaced
        +
        newGroupId - group id of the new dependency
        +
        newArtifactId - artifact id of the new dependency
        +
        +
      • +
      + + + +
        +
      • +

        PomReplaceDependency

        +
        public PomReplaceDependency(String groupId,
        +                            String artifactId,
        +                            String newGroupId,
        +                            String newArtifactId,
        +                            String newVersion)
        +
        Operation to replace a dependency by another one in a POM file
        +
        +
        Parameters:
        +
        groupId - group id of the dependency to be replaced
        +
        artifactId - artifact id of the dependency to be replaced
        +
        newGroupId - group id of the new dependency
        +
        newArtifactId - artifact id of the new dependency
        +
        newVersion - version of the new dependency
        +
        +
      • +
      + + + +
        +
      • +

        PomReplaceDependency

        +
        public PomReplaceDependency(String groupId,
        +                            String artifactId,
        +                            String newGroupId,
        +                            String newArtifactId,
        +                            String newVersion,
        +                            String newScope)
        +
        Operation to replace a dependency by another one in a POM file
        +
        +
        Parameters:
        +
        groupId - group id of the dependency to be replaced
        +
        artifactId - artifact id of the dependency to be replaced
        +
        newGroupId - group id of the new dependency
        +
        newArtifactId - artifact id of the new dependency
        +
        newVersion - version of the new dependency
        +
        newScope - version of the new dependency
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        failIfNotPresent

        +
        public PomReplaceDependency failIfNotPresent()
        +
        +
        Specified by:
        +
        failIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomReplaceDependency>
        +
        +
      • +
      + + + +
        +
      • +

        warnIfNotPresent

        +
        public PomReplaceDependency warnIfNotPresent()
        +
        +
        Specified by:
        +
        warnIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomReplaceDependency>
        +
        +
      • +
      + + + +
        +
      • +

        noOpIfNotPresent

        +
        public PomReplaceDependency noOpIfNotPresent()
        +
        +
        Specified by:
        +
        noOpIfNotPresent in interface com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<PomReplaceDependency>
        +
        +
      • +
      + + + +
        +
      • +

        getNewGroupId

        +
        public String getNewGroupId()
        +
      • +
      + + + +
        +
      • +

        getNewArtifactId

        +
        public String getNewArtifactId()
        +
      • +
      + + + +
        +
      • +

        getNewVersion

        +
        public String getNewVersion()
        +
      • +
      + + + +
        +
      • +

        getNewScope

        +
        public String getNewScope()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<PomReplaceDependency>
        +
        +
      • +
      + + + +
        +
      • +

        pomExecution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult pomExecution(String relativePomFile,
        +                                                                             org.apache.maven.model.Model model)
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<T extends com.paypal.butterfly.utilities.operations.pom.AbstractPomOperation>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddDependency.html new file mode 100644 index 00000000..9ddb9530 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddDependency.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomAddDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomAddDependency

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddParent.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddParent.html new file mode 100644 index 00000000..6f37f3e0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddParent.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomAddParent (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomAddParent

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddPlugin.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddPlugin.html new file mode 100644 index 00000000..2c1b645a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomAddPlugin.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomAddPlugin

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeDependency.html new file mode 100644 index 00000000..3d5a2592 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeDependency.html @@ -0,0 +1,208 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomChangeDependency

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangePackaging.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangePackaging.html new file mode 100644 index 00000000..f8ff0624 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangePackaging.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomChangePackaging

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeParent.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeParent.html new file mode 100644 index 00000000..7455acfe --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomChangeParent.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomChangeParent (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomChangeParent

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveDependency.html new file mode 100644 index 00000000..804d7c96 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveDependency.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveManagedDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveManagedDependency.html new file mode 100644 index 00000000..e24b2a4d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveManagedDependency.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemovePlugin.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemovePlugin.html new file mode 100644 index 00000000..0664390d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemovePlugin.html @@ -0,0 +1,176 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveProperty.html new file mode 100644 index 00000000..15341e2a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomRemoveProperty.html @@ -0,0 +1,180 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomReplaceDependency.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomReplaceDependency.html new file mode 100644 index 00000000..bb7f4155 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/class-use/PomReplaceDependency.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-frame.html new file mode 100644 index 00000000..259c3419 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-frame.html @@ -0,0 +1,31 @@ + + + + + + +com.paypal.butterfly.utilities.operations.pom (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.operations.pom

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-summary.html new file mode 100644 index 00000000..d3a8763f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-summary.html @@ -0,0 +1,219 @@ + + + + + + +com.paypal.butterfly.utilities.operations.pom (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.operations.pom

+
+
Transformation operations to manipulate Maven POM files.
+
+

See: Description

+
+
+ + + + +

Package com.paypal.butterfly.utilities.operations.pom Description

+
Transformation operations to manipulate Maven POM files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-tree.html new file mode 100644 index 00000000..5dfd5397 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-tree.html @@ -0,0 +1,161 @@ + + + + + + +com.paypal.butterfly.utilities.operations.pom Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.operations.pom

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T> +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<T> +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomAddDependency (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomAddParent (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomAddPlugin (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeParent (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          +
        • +
        • com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
        • +
        • com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-use.html new file mode 100644 index 00000000..2ae089a4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/pom/package-use.html @@ -0,0 +1,218 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.operations.pom (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.operations.pom

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/AddProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/AddProperty.html new file mode 100644 index 00000000..4fd3fc96 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/AddProperty.html @@ -0,0 +1,420 @@ + + + + + + +AddProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.properties
+

Class AddProperty

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<AddProperty>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.properties.AddProperty
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class AddProperty
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<AddProperty>
    +
    Adds a new property to a properties file. + If the property already exists, its value is overwritten.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      AddProperty() 
      AddProperty(String propertyName, + String propertyValue) +
      Operation to add a new property to a properties file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetPropertyName() 
      StringgetPropertyValue() 
      AddPropertysetPropertyName(String propertyName) 
      AddPropertysetPropertyValue(String propertyValue) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AddProperty

        +
        public AddProperty()
        +
      • +
      + + + +
        +
      • +

        AddProperty

        +
        public AddProperty(String propertyName,
        +                   String propertyValue)
        +
        Operation to add a new property to a properties file. + If the property already exists, its value is overwritten.
        +
        +
        Parameters:
        +
        propertyName - name to the property to be added
        +
        propertyValue - value to be set to the new property
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setPropertyValue

        +
        public AddProperty setPropertyValue(String propertyValue)
        +
      • +
      + + + +
        +
      • +

        getPropertyName

        +
        public String getPropertyName()
        +
      • +
      + + + +
        +
      • +

        getPropertyValue

        +
        public String getPropertyValue()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<AddProperty>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<AddProperty>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.html new file mode 100644 index 00000000..ec9cc571 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/RemoveProperty.html @@ -0,0 +1,389 @@ + + + + + + +RemoveProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.properties
+

Class RemoveProperty

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<RemoveProperty>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.properties.RemoveProperty
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RemoveProperty
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<RemoveProperty>
    +
    Removes a property from a properties file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RemoveProperty() 
      RemoveProperty(String propertyName) +
      Operation to remove a property from a properties file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetPropertyName() 
      RemovePropertysetPropertyName(String propertyName) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RemoveProperty

        +
        public RemoveProperty()
        +
      • +
      + + + +
        +
      • +

        RemoveProperty

        +
        public RemoveProperty(String propertyName)
        +
        Operation to remove a property from a properties file.
        +
        +
        Parameters:
        +
        propertyName - name to the property to be removed
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getPropertyName

        +
        public String getPropertyName()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RemoveProperty>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<RemoveProperty>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/AddProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/AddProperty.html new file mode 100644 index 00000000..d183ebd8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/AddProperty.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.properties.AddProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.properties.AddProperty

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/RemoveProperty.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/RemoveProperty.html new file mode 100644 index 00000000..2fcb0bb0 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/class-use/RemoveProperty.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.properties.RemoveProperty (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.properties.RemoveProperty

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-frame.html new file mode 100644 index 00000000..89cb25b4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-frame.html @@ -0,0 +1,22 @@ + + + + + + +com.paypal.butterfly.utilities.operations.properties (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.operations.properties

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-summary.html new file mode 100644 index 00000000..6fcc79d8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-summary.html @@ -0,0 +1,165 @@ + + + + + + +com.paypal.butterfly.utilities.operations.properties (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.operations.properties

+
+
Transformation operations to manipulate properties files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AddProperty +
    Adds a new property to a properties file.
    +
    RemoveProperty +
    Removes a property from a properties file.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.operations.properties Description

+
Transformation operations to manipulate properties files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-tree.html new file mode 100644 index 00000000..9a188145 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +com.paypal.butterfly.utilities.operations.properties Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.operations.properties

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T> +
          +
        • com.paypal.butterfly.utilities.operations.properties.AddProperty
        • +
        • com.paypal.butterfly.utilities.operations.properties.RemoveProperty
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-use.html new file mode 100644 index 00000000..78b89979 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/properties/package-use.html @@ -0,0 +1,168 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.operations.properties (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.operations.properties

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/AddLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/AddLine.html new file mode 100644 index 00000000..cadde193 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/AddLine.html @@ -0,0 +1,400 @@ + + + + + + +AddLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class AddLine

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<AddLine>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.AddLine
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class AddLine
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<AddLine>
    +
    Adds a new line to the end of a file.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      AddLine() 
      AddLine(String newLine) +
      Operation to add a new line to the end of a file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetNewLine() 
      AddLinesetNewLine(String newLine) +
      Sets the new line to be inserted.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AddLine

        +
        public AddLine()
        +
      • +
      + + + +
        +
      • +

        AddLine

        +
        public AddLine(String newLine)
        +
        Operation to add a new line to the end of a file. To add a new blank line, + just set newLine to an empty string ""
        +
        +
        Parameters:
        +
        newLine - the new line to be added
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNewLine

        +
        public AddLine setNewLine(String newLine)
        +
        Sets the new line to be inserted. To add a new blank line, + just set newLine to an empty string ""
        +
        +
        Parameters:
        +
        newLine - the new line to be inserted
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getNewLine

        +
        public String getNewLine()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<AddLine>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<AddLine>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.InsertionMode.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.InsertionMode.html new file mode 100644 index 00000000..7e575419 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.InsertionMode.html @@ -0,0 +1,378 @@ + + + + + + +InsertLine.InsertionMode (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Enum InsertLine.InsertionMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<InsertLine.InsertionMode>
    +
    +
    +
    Enclosing class:
    +
    InsertLine
    +
    +
    +
    +
    public static enum InsertLine.InsertionMode
    +extends Enum<InsertLine.InsertionMode>
    +
    The new line(s) can be inserted: +
      +
    1. InsertionMode.CONCAT: At the final of the file (default)
    2. +
    3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
    4. +
    5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
    6. +
    7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
    8. +
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static InsertLine.InsertionMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (InsertLine.InsertionMode c : InsertLine.InsertionMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static InsertLine.InsertionMode valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.html new file mode 100644 index 00000000..5e211f6e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertLine.html @@ -0,0 +1,575 @@ + + + + + + +InsertLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class InsertLine

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<InsertLine>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.InsertLine
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class InsertLine
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<InsertLine>
    +
    Inserts new line(s) into a text file. + The new line can be inserted: +
      +
    1. InsertionMode.CONCAT: At the final of the file (default)
    2. +
    3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
    4. +
    5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
    6. +
    7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
    8. +
    + See setInsertionMode(InsertionMode).
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    InsertLine.InsertionMode
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class InsertLine.InsertionMode +
      The new line(s) can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
      +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      InsertLine() +
      Operation to insert new line(s) into a text file.
      +
      InsertLine(String newLine) +
      Operation to insert a new line into a text file.
      +
      InsertLine(String newLine, + Integer lineNumber) +
      Operation to insert a new line into a text file.
      +
      InsertLine(String newLine, + String regex) +
      Operation to insert a new line into a text file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      InsertLinesetInsertionMode(InsertLine.InsertionMode insertionMode) +
      Sets the insertion mode
      +
      InsertLinesetLineNumber(Integer lineNumber) +
      Sets the line number the new line should be added at.
      +
      InsertLinesetNewLine(String newLine) +
      Sets the new line to be inserted.
      +
      InsertLinesetRegex(String regex) +
      Sets the regular expression to find insertion points + Notice that the insertion mode is automatically set to + InsertLine.InsertionMode.REGEX_FIRST, unless already set + to InsertLine.InsertionMode.REGEX_ALL.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InsertLine

        +
        public InsertLine()
        +
        Operation to insert new line(s) into a text file. + The new line can be inserted: +
          +
        1. InsertionMode.CONCAT: At the final of the file (default)
        2. +
        3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
        4. +
        5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
        6. +
        7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
        8. +
        + See setInsertionMode(InsertionMode).
        +
        +
        See Also:
        +
        InsertLine.InsertionMode
        +
        +
      • +
      + + + +
        +
      • +

        InsertLine

        +
        public InsertLine(String newLine)
        +
        Operation to insert a new line into a text file. + The new line will be inserted at the end of the file, + unless another insertion method is specified + + See setInsertionMode(InsertionMode).
        +
        +
        Parameters:
        +
        newLine - the new line to be inserted
        +
        +
      • +
      + + + +
        +
      • +

        InsertLine

        +
        public InsertLine(String newLine,
        +                  Integer lineNumber)
        +
        Operation to insert a new line into a text file. + The new line will be inserted at the specified line number +
        + Notice that the insertion mode is automatically set to + InsertLine.InsertionMode.LINE_NUMBER
        +
        +
        Parameters:
        +
        newLine - the new line to be inserted
        +
        lineNumber - the line number where the new line will be inserted
        +
        +
      • +
      + + + +
        +
      • +

        InsertLine

        +
        public InsertLine(String newLine,
        +                  String regex)
        +
        Operation to insert a new line into a text file. + The new line will be inserted right after only the first + line to match the specified regular expression +
        + Notice that the insertion mode is automatically set to + InsertLine.InsertionMode.REGEX_FIRST
        +
        +
        Parameters:
        +
        newLine - the new line to be inserted
        +
        regex - the regular expression used to determine where + the new line should be inserted
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setInsertionMode

        +
        public InsertLine setInsertionMode(InsertLine.InsertionMode insertionMode)
        +
        Sets the insertion mode
        +
        +
        Parameters:
        +
        insertionMode - the insertion mode
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setNewLine

        +
        public InsertLine setNewLine(String newLine)
        +
        Sets the new line to be inserted. To insert a new blank line, + just set newLine to an empty string ""
        +
        +
        Parameters:
        +
        newLine - the new line to be inserted
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setLineNumber

        +
        public InsertLine setLineNumber(Integer lineNumber)
        +
        Sets the line number the new line should be added at. + Line number for first line is 1. + Notice that the insertion mode is automatically set to + InsertLine.InsertionMode.LINE_NUMBER.
        +
        +
        Parameters:
        +
        lineNumber - the line number the new line should be added at
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<InsertLine>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<InsertLine>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.InsertionMode.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.InsertionMode.html new file mode 100644 index 00000000..051f078e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.InsertionMode.html @@ -0,0 +1,378 @@ + + + + + + +InsertText.InsertionMode (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Enum InsertText.InsertionMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<InsertText.InsertionMode>
    +
    +
    +
    Enclosing class:
    +
    InsertText
    +
    +
    +
    +
    public static enum InsertText.InsertionMode
    +extends Enum<InsertText.InsertionMode>
    +
    The text can be inserted: +
      +
    1. InsertionMode.CONCAT: At the final of the file (default)
    2. +
    3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
    4. +
    5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
    6. +
    7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
    8. +
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static InsertText.InsertionMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (InsertText.InsertionMode c : InsertText.InsertionMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static InsertText.InsertionMode valueOf(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.html new file mode 100644 index 00000000..d9a3e925 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/InsertText.html @@ -0,0 +1,572 @@ + + + + + + +InsertText (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class InsertText

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<InsertText>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.InsertText
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class InsertText
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<InsertText>
    +
    Inserts text from one file into another text file. + The text can be inserted: +
      +
    1. InsertionMode.CONCAT: At the final of the file (default)
    2. +
    3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
    4. +
    5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
    6. +
    7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
    8. +
    + Notice concat is the default insertion mode. It is also important to state that the text to be inserted will + always start on a new line and, if not placed on the end of the file, the continuation of the original text + will follow in a new line, even if the inserted text does not end with a line break. +
    + See setInsertionMode(InsertionMode)
    +
    +
    Author:
    +
    facarvalho
    +
    See Also:
    +
    InsertText.InsertionMode
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class InsertText.InsertionMode +
      The text can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
      +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      InsertText() +
      Operation to insert text into another text file.
      +
      InsertText(URL textFileUrl) +
      Operation to insert text into another text file.
      +
      InsertText(URL textFileUrl, + Integer lineNumber) +
      Operation to insert text into another text file.
      +
      InsertText(URL textFileUrl, + String regex) +
      Operation to insert text into another text file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      InsertTextsetInsertionMode(InsertText.InsertionMode insertionMode) +
      Sets the insertion mode
      +
      InsertTextsetLineNumber(Integer lineNumber) +
      Sets the line number the text should be added at.
      +
      InsertTextsetRegex(String regex) +
      Sets the regular expression to find insertion points +
      + See setInsertionMode(InsertionMode)
      +
      InsertTextsetTextFileUrl(URL textFileUrl) +
      Sets the URL to the text to be inserted
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InsertText

        +
        public InsertText()
        +
        Operation to insert text into another text file. + The text can be inserted: +
          +
        1. InsertionMode.CONCAT: At the final of the file (default)
        2. +
        3. InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1)
        4. +
        5. InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression
        6. +
        7. InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression
        8. +
        +
        + See setInsertionMode(InsertionMode)
        +
        +
        See Also:
        +
        InsertText.InsertionMode
        +
        +
      • +
      + + + +
        +
      • +

        InsertText

        +
        public InsertText(URL textFileUrl)
        +
        Operation to insert text into another text file. + The text will be inserted at the end of the file, + unless another insertion method is specified +
        + See setInsertionMode(InsertionMode)
        +
        +
        Parameters:
        +
        textFileUrl - the URL to the text to be inserted
        +
        +
      • +
      + + + +
        +
      • +

        InsertText

        +
        public InsertText(URL textFileUrl,
        +                  Integer lineNumber)
        +
        Operation to insert text into another text file. + The text will be inserted at the specified line number +
        + Notice that the insertion mode is automatically set to + InsertText.InsertionMode.LINE_NUMBER
        +
        +
        Parameters:
        +
        textFileUrl - the URL to the text to be inserted
        +
        lineNumber - the line number the text should be added at
        +
        +
      • +
      + + + +
        +
      • +

        InsertText

        +
        public InsertText(URL textFileUrl,
        +                  String regex)
        +
        Operation to insert text into another text file. + The text will be inserted right after only the first + line to match the specified regular expression +
        + Notice that the insertion mode is automatically set to + InsertText.InsertionMode.REGEX_FIRST
        +
        +
        Parameters:
        +
        textFileUrl - the URL to the text to be inserted
        +
        regex - the regular expression to find insertion points
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setInsertionMode

        +
        public InsertText setInsertionMode(InsertText.InsertionMode insertionMode)
        +
        Sets the insertion mode
        +
        +
        Parameters:
        +
        insertionMode - the insertion mode
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setTextFileUrl

        +
        public InsertText setTextFileUrl(URL textFileUrl)
        +
        Sets the URL to the text to be inserted
        +
        +
        Parameters:
        +
        textFileUrl - the URL to the text to be inserted
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setLineNumber

        +
        public InsertText setLineNumber(Integer lineNumber)
        +
        Sets the line number the text should be added at. + Line number for first line is 1.
        +
        +
        Parameters:
        +
        lineNumber - the line number the text should be added at
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<InsertText>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<InsertText>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/RemoveLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/RemoveLine.html new file mode 100644 index 00000000..fffddaf5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/RemoveLine.html @@ -0,0 +1,483 @@ + + + + + + +RemoveLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class RemoveLine

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<RemoveLine>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.text.RemoveLine
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class RemoveLine
    +extends com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<RemoveLine>
    +
    Removes one, or more, lines from a text file. + The line to be removed is chosen either based on a regular + expression, or by the line number. +
    + If the regular expression + is set, only the first line found to match it will be removed, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be removed. +
    + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation

        +manipulationWord
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      RemoveLine() +
      Operation to remove one, or more, lines from a text file.
      +
      RemoveLine(Integer lineNumber) +
      Operation to remove one line from a text file, based on a + line number.
      +
      RemoveLine(String regex) +
      Operation to remove one, or more, lines from a text file.
      +
      RemoveLine(String regex, + boolean firstOnly) +
      Operation to remove one, or more, lines from a text file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      StringgetDescription() 
      protected booleanmanipulateLine(String lineToBeManipulated, + Writer writer) +
      To be specialized by subclasses, defining what specific change should be done
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation

        +execution, getLineNumber, getRegex, isFirstOnly, setFirstOnly, setLineNumber, setRegex
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RemoveLine

        +
        public RemoveLine()
        +
        Operation to remove one, or more, lines from a text file. + The line to be removed is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be removed, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be removed. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
      • +
      + + + +
        +
      • +

        RemoveLine

        +
        public RemoveLine(String regex)
        +
        Operation to remove one, or more, lines from a text file. + The line to be removed is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be removed, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be removed. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
        +
        Parameters:
        +
        regex - the regular expression to identify the line(s) to be removed
        +
        +
      • +
      + + + +
        +
      • +

        RemoveLine

        +
        public RemoveLine(String regex,
        +                  boolean firstOnly)
        +
        Operation to remove one, or more, lines from a text file. + The line to be removed is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be removed, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be removed. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
        +
        Parameters:
        +
        regex - the regular expression to identify the line(s) to be removed
        +
        firstOnly - if true, only the first line found (from top down) to match + the regular expression will be removed. If false, all of them + will
        +
        +
      • +
      + + + +
        +
      • +

        RemoveLine

        +
        public RemoveLine(Integer lineNumber)
        +
        Operation to remove one line from a text file, based on a + line number.
        +
        +
        Parameters:
        +
        lineNumber - the number of the line to be removed
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        manipulateLine

        +
        protected boolean manipulateLine(String lineToBeManipulated,
        +                                 Writer writer)
        +
        Description copied from class: com.paypal.butterfly.utilities.operations.text.AbstractLineOperation
        +
        To be specialized by subclasses, defining what specific change should be done
        +
        +
        Specified by:
        +
        manipulateLine in class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<RemoveLine>
        +
        Parameters:
        +
        lineToBeManipulated - if it has an EOL character, it will be in the beginning, not in the end
        +
        writer - used to manipulate the file to be changed
        +
        Returns:
        +
        true only if anything has been written in writer
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<RemoveLine>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceLine.html new file mode 100644 index 00000000..99740c03 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceLine.html @@ -0,0 +1,550 @@ + + + + + + +ReplaceLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class ReplaceLine

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<ReplaceLine>
        • +
        • +
            +
          • com.paypal.butterfly.utilities.operations.text.ReplaceLine
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ReplaceLine
    +extends com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<ReplaceLine>
    +
    Replaces one, or more, lines from a text file. + The line to be replace is chosen either based on a regular + expression, or by the line number. +
    + If the regular expression + is set, only the first line found to match it will be replaced, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be replaced. +
    + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation

        +manipulationWord
      • +
      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      ReplaceLine() +
      Operation to replace one, or more, lines from a text file.
      +
      ReplaceLine(Integer lineNumber, + String replacement) +
      Operation to replace one line from a text file, based on a + line number.
      +
      ReplaceLine(String regex, + String replacement) +
      Operation to replace one, or more, lines from a text file.
      +
      ReplaceLine(String regex, + String replacement, + boolean firstOnly) +
      Operation to replace one, or more, lines from a text file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      StringgetDescription() 
      StringgetReplacement() 
      protected booleanmanipulateLine(String lineToBeManipulated, + Writer writer) +
      To be specialized by subclasses, defining what specific change should be done
      +
      ReplaceLinesetReplacement(String replacement) +
      Sets the replacement line
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation

        +execution, getLineNumber, getRegex, isFirstOnly, setFirstOnly, setLineNumber, setRegex
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ReplaceLine

        +
        public ReplaceLine()
        +
        Operation to replace one, or more, lines from a text file. + The line to be replaced is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be replaced, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be replaced. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
      • +
      + + + +
        +
      • +

        ReplaceLine

        +
        public ReplaceLine(String regex,
        +                   String replacement)
        +
        Operation to replace one, or more, lines from a text file. + The line to be replaced is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be replaced, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be replaced. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
        +
        Parameters:
        +
        regex - the regular expression to identify the line(s) to be replaced
        +
        replacement - the replacement line. It is not necessary to add explicitly any + end of line (EOL) character in the end of the line, that will be done + automatically, but ONLY if the original line has an EOL character too. + The same format of EOL character will be preserved. + If any EOL character is present anywhere in replacement, it + will not be removed nor changed.
        +
        +
      • +
      + + + +
        +
      • +

        ReplaceLine

        +
        public ReplaceLine(String regex,
        +                   String replacement,
        +                   boolean firstOnly)
        +
        Operation to replace one, or more, lines from a text file. + The line to be replaced is chosen either based on a regular + expression, or by the line number. +
        + If the regular expression + is set, only the first found to match it will be replaced, + unless AbstractLineOperation.setFirstOnly(boolean) is set to false, then + all lines that match it will be replaced. +
        + If a regular expression and a line number are both set, + the line number will take precedence, and the regular expression + will be ignored
        +
        +
        Parameters:
        +
        regex - the regular expression to identify the line(s) to be replaced
        +
        replacement - the replacement line. It is not necessary to add explicitly any + end of line (EOL) character in the end of the line, that will be done + automatically, but ONLY if the original line has an EOL character too. + The same format of EOL character will be preserved. + If any EOL character is present anywhere in replacement, it + will not be removed nor changed.
        +
        firstOnly - if true, only the first line found (from top down) to match + the regular expression will be replaced. If false, all of them + will
        +
        +
      • +
      + + + +
        +
      • +

        ReplaceLine

        +
        public ReplaceLine(Integer lineNumber,
        +                   String replacement)
        +
        Operation to replace one line from a text file, based on a + line number.
        +
        +
        Parameters:
        +
        replacement - the replacement line. It is not necessary to add explicitly any + end of line (EOL) character in the end of the line, that will be done + automatically, but ONLY if the original line has an EOL character too. + The same format of EOL character will be preserved. + If any EOL character is present anywhere in replacement, it + will not be removed nor changed.
        +
        lineNumber - the number of the line to be replaced
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setReplacement

        +
        public ReplaceLine setReplacement(String replacement)
        +
        Sets the replacement line
        +
        +
        Parameters:
        +
        replacement - the replacement line. It is not necessary to add explicitly any + end of line (EOL) character in the end of the line, that will be done + automatically, but ONLY if the original line has an EOL character too. + The same format of EOL character will be preserved. + If any EOL character is present anywhere in replacement, it + will not be removed nor changed.
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getReplacement

        +
        public String getReplacement()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<ReplaceLine>
        +
        +
      • +
      + + + +
        +
      • +

        manipulateLine

        +
        protected boolean manipulateLine(String lineToBeManipulated,
        +                                 Writer writer)
        +                          throws IOException
        +
        Description copied from class: com.paypal.butterfly.utilities.operations.text.AbstractLineOperation
        +
        To be specialized by subclasses, defining what specific change should be done
        +
        +
        Specified by:
        +
        manipulateLine in class com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<ReplaceLine>
        +
        Parameters:
        +
        lineToBeManipulated - if it has an EOL character, it will be in the beginning, not in the end
        +
        writer - used to manipulate the file to be changed
        +
        Returns:
        +
        true only if anything has been written in writer
        +
        Throws:
        +
        IOException - if an IO operation fails
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceText.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceText.html new file mode 100644 index 00000000..2cdb137f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/ReplaceText.html @@ -0,0 +1,503 @@ + + + + + + +ReplaceText (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.operations.text
+

Class ReplaceText

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T>
    • +
    • +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<ReplaceText>
      • +
      • +
          +
        • com.paypal.butterfly.utilities.operations.text.ReplaceText
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class ReplaceText
    +extends com.paypal.butterfly.extensions.api.TransformationOperation<ReplaceText>
    +
    Replaces text in a text file + based on a regular expression.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      ReplaceText() +
      Operation to replace text in a text file + based on a regular expression.
      +
      ReplaceText(String regex) +
      Operation to replace text in a text file + based on a regular expression.
      +
      ReplaceText(String regex, + String replacement) +
      Operation to replace text in a text file + based on a regular expression.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TOExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      StringgetRegex() 
      StringgetReplacement() 
      booleanisFirstOnly() 
      ReplaceTextsetFirstOnly(boolean firstOnly) +
      Sets whether all lines, or only the first, to match the + regular expression will be replaced
      +
      ReplaceTextsetRegex(String regex) +
      Sets the regular expression to find replacement points
      +
      ReplaceTextsetReplacement(String replacement) +
      Sets the replacement text
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationOperation

        +getOrCreateReadFile, perform, setSaveResult
      • +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, relative, set, setContextAttributeName, setName, setParent, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ReplaceText

        +
        public ReplaceText()
        +
        Operation to replace text in a text file + based on a regular expression.
        +
      • +
      + + + +
        +
      • +

        ReplaceText

        +
        public ReplaceText(String regex)
        +
        Operation to replace text in a text file + based on a regular expression.
        +
        +
        Parameters:
        +
        regex - the regular expression to find replacement points
        +
        +
      • +
      + + + +
        +
      • +

        ReplaceText

        +
        public ReplaceText(String regex,
        +                   String replacement)
        +
        Operation to replace text in a text file + based on a regular expression.
        +
        +
        Parameters:
        +
        regex - the regular expression to find replacement points
        +
        replacement - the replacement text
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setRegex

        +
        public ReplaceText setRegex(String regex)
        +
        Sets the regular expression to find replacement points
        +
        +
        Parameters:
        +
        regex - the regular expression to find replacement points
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setReplacement

        +
        public ReplaceText setReplacement(String replacement)
        +
        Sets the replacement text
        +
        +
        Parameters:
        +
        replacement - the replacement text
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        setFirstOnly

        +
        public ReplaceText setFirstOnly(boolean firstOnly)
        +
        Sets whether all lines, or only the first, to match the + regular expression will be replaced
        +
        +
        Parameters:
        +
        firstOnly - all lines, or only the first, to match the + regular expression will be replaced
        +
        Returns:
        +
        this transformation operation instance
        +
        +
      • +
      + + + +
        +
      • +

        getRegex

        +
        public String getRegex()
        +
      • +
      + + + +
        +
      • +

        getReplacement

        +
        public String getReplacement()
        +
      • +
      + + + +
        +
      • +

        isFirstOnly

        +
        public boolean isFirstOnly()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<ReplaceText>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TOExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<ReplaceText>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/AddLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/AddLine.html new file mode 100644 index 00000000..c28a067c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/AddLine.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.AddLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.AddLine

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.InsertionMode.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.InsertionMode.html new file mode 100644 index 00000000..e616ee4b --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.InsertionMode.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.InsertLine.InsertionMode (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.InsertLine.InsertionMode

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.html new file mode 100644 index 00000000..2b373905 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertLine.html @@ -0,0 +1,191 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.InsertLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.InsertLine

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.InsertionMode.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.InsertionMode.html new file mode 100644 index 00000000..dbb7353d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.InsertionMode.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.InsertText.InsertionMode (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.InsertText.InsertionMode

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.html new file mode 100644 index 00000000..9c9b2230 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/InsertText.html @@ -0,0 +1,190 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.InsertText (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.InsertText

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/RemoveLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/RemoveLine.html new file mode 100644 index 00000000..7d0691b8 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/RemoveLine.html @@ -0,0 +1,126 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.RemoveLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.RemoveLine

+
+
No usage of com.paypal.butterfly.utilities.operations.text.RemoveLine
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceLine.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceLine.html new file mode 100644 index 00000000..0923c53e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceLine.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.ReplaceLine (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.ReplaceLine

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceText.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceText.html new file mode 100644 index 00000000..3908e9de --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/class-use/ReplaceText.html @@ -0,0 +1,183 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.operations.text.ReplaceText (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.operations.text.ReplaceText

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-frame.html new file mode 100644 index 00000000..ebd29666 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-frame.html @@ -0,0 +1,31 @@ + + + + + + +com.paypal.butterfly.utilities.operations.text (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.operations.text

+ + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-summary.html new file mode 100644 index 00000000..295cd6fc --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-summary.html @@ -0,0 +1,225 @@ + + + + + + +com.paypal.butterfly.utilities.operations.text (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.operations.text

+
+
Transformation operations to manipulate text files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AddLine +
    Adds a new line to the end of a file.
    +
    InsertLine +
    Inserts new line(s) into a text file.
    +
    InsertText +
    Inserts text from one file into another text file.
    +
    RemoveLine +
    Removes one, or more, lines from a text file.
    +
    ReplaceLine +
    Replaces one, or more, lines from a text file.
    +
    ReplaceText +
    Replaces text in a text file + based on a regular expression.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    InsertLine.InsertionMode +
    The new line(s) can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
    +
    InsertText.InsertionMode +
    The text can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.operations.text Description

+
Transformation operations to manipulate text files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-tree.html new file mode 100644 index 00000000..ee8de8d2 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-tree.html @@ -0,0 +1,169 @@ + + + + + + +com.paypal.butterfly.utilities.operations.text Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.operations.text

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T> +
          +
        • com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<T> +
            +
          • com.paypal.butterfly.utilities.operations.text.RemoveLine
          • +
          • com.paypal.butterfly.utilities.operations.text.ReplaceLine
          • +
          +
        • +
        • com.paypal.butterfly.utilities.operations.text.AddLine
        • +
        • com.paypal.butterfly.utilities.operations.text.InsertLine
        • +
        • com.paypal.butterfly.utilities.operations.text.InsertText
        • +
        • com.paypal.butterfly.utilities.operations.text.ReplaceText
        • +
        +
      • +
      +
    • +
    +
  • +
+

Enum Hierarchy

+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-use.html new file mode 100644 index 00000000..614c25b6 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/operations/text/package-use.html @@ -0,0 +1,211 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.operations.text (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.operations.text

+
+
+
    +
  • + + + + + + + + + + + + +
    Packages that use com.paypal.butterfly.utilities.operations.text 
    PackageDescription
    com.paypal.butterfly.utilities.operations.text +
    Transformation operations to manipulate text files.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Classes in com.paypal.butterfly.utilities.operations.text used by com.paypal.butterfly.utilities.operations.text 
    Class and Description
    AbstractLineOperation +
    Abstract operation to manipulate one, or more, lines from a text file.
    +
    AddLine +
    Adds a new line to the end of a file.
    +
    InsertLine +
    Inserts new line(s) into a text file.
    +
    InsertLine.InsertionMode +
    The new line(s) can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
    +
    InsertText +
    Inserts text from one file into another text file.
    +
    InsertText.InsertionMode +
    The text can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
    +
    ReplaceLine +
    Replaces one, or more, lines from a text file.
    +
    ReplaceText +
    Replaces text in a text file + based on a regular expression.
    +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/StringFormat.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/StringFormat.html new file mode 100644 index 00000000..e2d29885 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/StringFormat.html @@ -0,0 +1,401 @@ + + + + + + +StringFormat (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.text
+

Class StringFormat

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<StringFormat>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.text.StringFormat
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class StringFormat
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<StringFormat>
    +
    Registers a new transformation context + attribute by applying one or more existent + String transformation context attributes to + String.format(String, Object...). + The setting order of attributes will be + honored when applying the formatting.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      String[]getAttributeNames() 
      StringgetDescription() 
      StringgetFormat() 
      StringFormatsetAttributeNames(String... attributeNames) 
      StringFormatsetFormat(String format) 
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StringFormat

        +
        public StringFormat()
        +
      • +
      + + + +
        +
      • +

        StringFormat

        +
        public StringFormat(String format)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        setAttributeNames

        +
        public StringFormat setAttributeNames(String... attributeNames)
        +
      • +
      + + + +
        +
      • +

        getFormat

        +
        public String getFormat()
        +
      • +
      + + + +
        +
      • +

        getAttributeNames

        +
        public String[] getAttributeNames()
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<StringFormat>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<StringFormat>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/class-use/StringFormat.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/class-use/StringFormat.html new file mode 100644 index 00000000..dd43f957 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/class-use/StringFormat.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.text.StringFormat (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.text.StringFormat

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-frame.html new file mode 100644 index 00000000..beb65d7d --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.paypal.butterfly.utilities.text (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.text

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-summary.html new file mode 100644 index 00000000..b9fff86a --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-summary.html @@ -0,0 +1,162 @@ + + + + + + +com.paypal.butterfly.utilities.text (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.text

+
+
Transformation utilities to gather meta-data about text files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    StringFormat +
    Registers a new transformation context + attribute by applying one or more existent + String transformation context attributes to + String.format(String, Object...).
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.text Description

+
Transformation utilities to gather meta-data about text files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-tree.html new file mode 100644 index 00000000..632ffff4 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.paypal.butterfly.utilities.text Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.text

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) + +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-use.html new file mode 100644 index 00000000..9cc73189 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/text/package-use.html @@ -0,0 +1,166 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.text (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.text

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/XmlElement.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/XmlElement.html new file mode 100644 index 00000000..1eec0961 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/XmlElement.html @@ -0,0 +1,460 @@ + + + + + + +XmlElement (butterfly-utilities 2.2.0 API) + + + + + + + + + + + + +
+
com.paypal.butterfly.utilities.xml
+

Class XmlElement

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<XmlElement>
    • +
    • +
        +
      • com.paypal.butterfly.utilities.xml.XmlElement
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Cloneable
    +
    +
    +
    +
    public class XmlElement
    +extends com.paypal.butterfly.extensions.api.TransformationUtility<XmlElement>
    +
    Retrieves the value of an element, + or one of its attributes, in a XML file. +
    + Note: if more than one element match + the specified XML element, the very first + one will be used +
    + If no element, nor attribute, is found, + TUExecutionResult.Type.NULL is returned. + If the file is not a well formed XML file, an error is returned.
    +
    +
    Author:
    +
    facarvalho
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +UTILITY_NAME_SYNTAX
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      XmlElement() +
      Retrieves the value of an element, + or one of its attributes, in a XML file.
      +
      XmlElement(String xmlElement) +
      Retrieves the value of an element, + or one of its attributes, in a XML file.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected com.paypal.butterfly.extensions.api.TUExecutionResultexecution(File transformedAppFolder, + com.paypal.butterfly.extensions.api.TransformationContext transformationContext) 
      StringgetDescription() 
      XmlElementsetAttribute(String attribute) +
      Set the name of the XML element attribute + to be retrieved.
      +
      XmlElementsetXmlElement(String xmlElement) +
      The XML element whose value, or an attribute, should be + the result of this transformation utility.
      +
      +
        +
      • + + +

        Methods inherited from class com.paypal.butterfly.extensions.api.TransformationUtility

        +abortOnFailure, abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
      • +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XmlElement

        +
        public XmlElement()
        +
        Retrieves the value of an element, + or one of its attributes, in a XML file. +
        + Note: if more than one element match + the specified XML element, the very first + one will be used
        +
      • +
      + + + +
        +
      • +

        XmlElement

        +
        public XmlElement(String xmlElement)
        +
        Retrieves the value of an element, + or one of its attributes, in a XML file. +
        + Note: if more than one element match + the specified XML element, the very first + one will be used +
        + Specify in xmlElement the XML element whose value, or an attribute, should be + the result of this transformation utility. The element specified + here should be set based on a path containing all its + parent elements separated by '.'. See the example bellow. +
        + To retrieve the value of the child name, set xmlElement + to person.child.name. In this example, + that would return Gabriela +
        + <?xml version="1.0" encoding="UTF-8"?> + <person> + <name>Bruna</name> + <child> + <name>Gabriela</name> + </child> + </peson> +
        +
        +
        Parameters:
        +
        xmlElement - the XML element whose value, or an attribute, should be + the result of this transformation utility
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setXmlElement

        +
        public XmlElement setXmlElement(String xmlElement)
        +
        The XML element whose value, or an attribute, should be + the result of this transformation utility. The element specified + here should be set based on a path containing all its + parent elements separated by '.'. See the example bellow. +
        + To retrieve the value of the child name, set xmlElement + to person.child.name. In this example, + that would return Gabriela +
        + <?xml version="1.0" encoding="UTF-8"?> + <person> + <name>Bruna</name> + <child> + <name>Gabriela</name> + </child> + </peson> +
        +
        +
        Parameters:
        +
        xmlElement - the XML element whose value, or an attribute, should be + the result of this transformation utility
        +
        Returns:
        +
        this instance
        +
        +
      • +
      + + + +
        +
      • +

        setAttribute

        +
        public XmlElement setAttribute(String attribute)
        +
        Set the name of the XML element attribute + to be retrieved. If null, the element + value will be retrieved instead
        +
        +
        Parameters:
        +
        attribute - the name of the XML element attribute + to be retrieved
        +
        Returns:
        +
        this instance
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public String getDescription()
        +
        +
        Specified by:
        +
        getDescription in class com.paypal.butterfly.extensions.api.TransformationUtility<XmlElement>
        +
        +
      • +
      + + + +
        +
      • +

        execution

        +
        protected com.paypal.butterfly.extensions.api.TUExecutionResult execution(File transformedAppFolder,
        +                                                                          com.paypal.butterfly.extensions.api.TransformationContext transformationContext)
        +
        +
        Specified by:
        +
        execution in class com.paypal.butterfly.extensions.api.TransformationUtility<XmlElement>
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/class-use/XmlElement.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/class-use/XmlElement.html new file mode 100644 index 00000000..00b3c5f3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/class-use/XmlElement.html @@ -0,0 +1,178 @@ + + + + + + +Uses of Class com.paypal.butterfly.utilities.xml.XmlElement (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Class
com.paypal.butterfly.utilities.xml.XmlElement

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-frame.html new file mode 100644 index 00000000..a8bbd8f5 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +com.paypal.butterfly.utilities.xml (butterfly-utilities 2.2.0 API) + + + + + +

com.paypal.butterfly.utilities.xml

+
+

Classes

+ +
+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-summary.html new file mode 100644 index 00000000..d49c8abf --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-summary.html @@ -0,0 +1,160 @@ + + + + + + +com.paypal.butterfly.utilities.xml (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Package com.paypal.butterfly.utilities.xml

+
+
Transformation utilities to gather meta-data about XML files.
+
+

See: Description

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    XmlElement +
    Retrieves the value of an element, + or one of its attributes, in a XML file.
    +
    +
  • +
+ + + +

Package com.paypal.butterfly.utilities.xml Description

+
Transformation utilities to gather meta-data about XML files.
+
+
Since:
+
1.0.0
+
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-tree.html new file mode 100644 index 00000000..5892457e --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-tree.html @@ -0,0 +1,143 @@ + + + + + + +com.paypal.butterfly.utilities.xml Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Hierarchy For Package com.paypal.butterfly.utilities.xml

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) + +
    • +
    +
  • +
+
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-use.html b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-use.html new file mode 100644 index 00000000..04a047da --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/com/paypal/butterfly/utilities/xml/package-use.html @@ -0,0 +1,164 @@ + + + + + + +Uses of Package com.paypal.butterfly.utilities.xml (butterfly-utilities 2.2.0 API) + + + + + + + + + + + +
+

Uses of Package
com.paypal.butterfly.utilities.xml

+
+
+ +
+ + + + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/constant-values.html b/docs/javadocs/2.2.0/butterfly-utilities/constant-values.html new file mode 100644 index 00000000..90ef90b3 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/constant-values.html @@ -0,0 +1,126 @@ + + + + + + +Constant Field Values (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/deprecated-list.html b/docs/javadocs/2.2.0/butterfly-utilities/deprecated-list.html new file mode 100644 index 00000000..6c0236ec --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/deprecated-list.html @@ -0,0 +1,126 @@ + + + + + + +Deprecated List (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/help-doc.html b/docs/javadocs/2.2.0/butterfly-utilities/help-doc.html new file mode 100644 index 00000000..8d115024 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/help-doc.html @@ -0,0 +1,231 @@ + + + + + + +API Help (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/index-all.html b/docs/javadocs/2.2.0/butterfly-utilities/index-all.html new file mode 100644 index 00000000..bbd8d668 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/index-all.html @@ -0,0 +1,1652 @@ + + + + + + +Index (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
A C D E F G H I J L M N O P R S V W X  + + +

A

+
+
AbstractTypeCheck<T extends AbstractTypeCheck> - Class in com.paypal.butterfly.utilities.conditions.java
+
+
Evaluates the specified + compilation unit based on an abstract check + against a specified type.
+
+
AbstractTypeCheck(Class) - Constructor for class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck
+
 
+
AbstractTypeCheck(String) - Constructor for class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck
+
 
+
addAttribute(String, String) - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
addCondition(JavaCondition) - Method in class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
+
Add a new Java condition to be evaluated against the Java class.
+
+
AddLine - Class in com.paypal.butterfly.utilities.operations.text
+
+
Adds a new line to the end of a file.
+
+
AddLine() - Constructor for class com.paypal.butterfly.utilities.operations.text.AddLine
+
 
+
AddLine(String) - Constructor for class com.paypal.butterfly.utilities.operations.text.AddLine
+
+
Operation to add a new line to the end of a file.
+
+
addObject(String, Object) - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
AddProperty - Class in com.paypal.butterfly.utilities.operations.properties
+
+
Adds a new property to a properties file.
+
+
AddProperty() - Constructor for class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
AddProperty(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
+
Operation to add a new property to a properties file.
+
+
AnnotatedWith - Class in com.paypal.butterfly.utilities.conditions.java
+
+
Evaluates if the specified + Java class or interface is annotated with the + specified annotation.
+
+
AnnotatedWith(Class) - Constructor for class com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
+
 
+
AnnotatedWith(String) - Constructor for class com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
+
 
+
ApplyFile - Class in com.paypal.butterfly.utilities.operations.file
+
+
Applies a file, whose location is set as a URL, + into the transformed application
+
+
ApplyFile() - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
 
+
ApplyFile(String) - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
+
Applies a file, whose location is set as a URL, + into the transformed application
+
+
ApplyFile(URL) - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
+
Applies a file, whose location is set as a URL, + into the transformed application
+
+
ApplyZip - Class in com.paypal.butterfly.utilities.operations.file
+
+
Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
+
+
ApplyZip() - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
 
+
ApplyZip(String) - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
+
Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
+
+
ApplyZip(URL) - Constructor for class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
+
Applies the contents of a zip file, whose location is set as a URL, + into the transformed application, preserving the relative folders + structure inside the zip file.
+
+
+ + + +

C

+
+
clone() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
 
+
com.paypal.butterfly.utilities.conditions - package com.paypal.butterfly.utilities.conditions
+
+
Multiple transformation utility conditions, organized by type, each one having its own subpackage.
+
+
com.paypal.butterfly.utilities.conditions.java - package com.paypal.butterfly.utilities.conditions.java
+
+
Transformation utility conditions to analyze and evaluate Java class files.
+
+
com.paypal.butterfly.utilities.conditions.pom - package com.paypal.butterfly.utilities.conditions.pom
+
+
Transformation utility conditions to analyze and evaluate Maven POM files.
+
+
com.paypal.butterfly.utilities.file - package com.paypal.butterfly.utilities.file
+
+
Transformation utilities to gather meta-data, find and locate files.
+
+
com.paypal.butterfly.utilities.java - package com.paypal.butterfly.utilities.java
+
+
Transformation utilities to gather meta-data about Java class files.
+
+
com.paypal.butterfly.utilities.maven - package com.paypal.butterfly.utilities.maven
+
+
Transformation utilities to gather meta-data about Maven POM files.
+
+
com.paypal.butterfly.utilities.misc - package com.paypal.butterfly.utilities.misc
+
+
Miscellaneous collection of transformation utilities.
+
+
com.paypal.butterfly.utilities.operations.file - package com.paypal.butterfly.utilities.operations.file
+
+
Transformation operations to manipulate files.
+
+
com.paypal.butterfly.utilities.operations.pom - package com.paypal.butterfly.utilities.operations.pom
+
+
Transformation operations to manipulate Maven POM files.
+
+
com.paypal.butterfly.utilities.operations.properties - package com.paypal.butterfly.utilities.operations.properties
+
+
Transformation operations to manipulate properties files.
+
+
com.paypal.butterfly.utilities.operations.text - package com.paypal.butterfly.utilities.operations.text
+
+
Transformation operations to manipulate text files.
+
+
com.paypal.butterfly.utilities.text - package com.paypal.butterfly.utilities.text
+
+
Transformation utilities to gather meta-data about text files.
+
+
com.paypal.butterfly.utilities.xml - package com.paypal.butterfly.utilities.xml
+
+
Transformation utilities to gather meta-data about XML files.
+
+
compare(File, File) - Method in class com.paypal.butterfly.utilities.conditions.CompareFiles
+
 
+
compare(File, File) - Method in class com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+
 
+
CompareFiles - Class in com.paypal.butterfly.utilities.conditions
+
+
Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
+
+
CompareFiles() - Constructor for class com.paypal.butterfly.utilities.conditions.CompareFiles
+
+
Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
+
+
CompareFiles(String) - Constructor for class com.paypal.butterfly.utilities.conditions.CompareFiles
+
+
Compares two files and returns true if the content of the files are equal, + or if they both don't exist.
+
+
CompareXMLFiles - Class in com.paypal.butterfly.utilities.conditions
+
+
Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
+
+
CompareXMLFiles() - Constructor for class com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+
+
Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
+
+
CompareXMLFiles(String) - Constructor for class com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+
+
Compares two XML files and returns true if their contents are equal, + or if both files don't exist.
+
+
consumeLine(String) - Method in class com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler
+
 
+
consumeLine(String) - Method in class com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler
+
 
+
copy() - Method in class com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler
+
 
+
copy() - Method in class com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler
+
 
+
copy() - Method in interface com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler
+
+
Returns a copy of this object, but with its internal state reset, + so it can be run in a brand new Maven invocation
+
+
CopyDirectory - Class in com.paypal.butterfly.utilities.operations.file
+
+
Copies a directory and its content from one location to another.
+
+
CopyDirectory() - Constructor for class com.paypal.butterfly.utilities.operations.file.CopyDirectory
+
+
Operation to copy a directory and its content from one location to another.
+
+
CopyFile - Class in com.paypal.butterfly.utilities.operations.file
+
+
Copies a file.
+
+
CopyFile() - Constructor for class com.paypal.butterfly.utilities.operations.file.CopyFile
+
+
Copies a file.
+
+
+ + + +

D

+
+
DeleteFile - Class in com.paypal.butterfly.utilities.operations.file
+
+
Deletes a single file or folder (empty or not).
+
+
DeleteFile() - Constructor for class com.paypal.butterfly.utilities.operations.file.DeleteFile
+
 
+
+ + + +

E

+
+
EnforcerErrorsOutputHandler - Class in com.paypal.butterfly.utilities.maven
+
+
Reads lines from the Maven enforcer plugin output and produces as result a set of Strings stating the validation failures, if any.
+
+
EnforcerErrorsOutputHandler() - Constructor for class com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler
+
 
+
equals(Object) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
equals(Object) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
equals(Object) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
equals(Object) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
eval(CompilationUnit) - Method in class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck
+
 
+
eval(CompilationUnit) - Method in class com.paypal.butterfly.utilities.conditions.java.JavaCondition
+
+
Evaluates this condition against the specified compilation + unit and returns the evaluation result.
+
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.CompareFiles
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.FileExists
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.conditions.RegexMatch
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.file.LoadFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.file.LocateFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.java.JavaPackage
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.misc.WebXmlContextParams
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.CopyDirectory
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.CopyFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.DeleteFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.MoveDirectory
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.MoveFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.file.RenameFile
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.text.AddLine
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
execution(File, TransformationContext) - Method in class com.paypal.butterfly.utilities.xml.XmlElement
+
 
+
Extends - Class in com.paypal.butterfly.utilities.conditions.java
+
+
Evaluates if the specified + compilation unit directly extends the + specified class.
+
+
Extends(Class) - Constructor for class com.paypal.butterfly.utilities.conditions.java.Extends
+
 
+
Extends(String) - Constructor for class com.paypal.butterfly.utilities.conditions.java.Extends
+
 
+
+ + + +

F

+
+
failIfNotFound(boolean) - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
failIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
failIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
failIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
failIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
FileExists - Class in com.paypal.butterfly.utilities.conditions
+
+
Checks if a particular file or folder exists.
+
+
FileExists() - Constructor for class com.paypal.butterfly.utilities.conditions.FileExists
+
 
+
FindFile - Class in com.paypal.butterfly.utilities.file
+
+
Finds a file based on its name.
+
+
FindFile() - Constructor for class com.paypal.butterfly.utilities.file.FindFile
+
 
+
FindFile(String) - Constructor for class com.paypal.butterfly.utilities.file.FindFile
+
+
Utility to find a file based on its name
+
+
FindFiles - Class in com.paypal.butterfly.utilities.file
+
+
Finds files based on a regular expression + against the file name and/or the file path.
+
+
FindFiles() - Constructor for class com.paypal.butterfly.utilities.file.FindFiles
+
 
+
FindFiles(String, boolean) - Constructor for class com.paypal.butterfly.utilities.file.FindFiles
+
+
Utility to find files based on a regular expression + against the file name.
+
+
FindFiles(String, boolean, boolean, boolean) - Constructor for class com.paypal.butterfly.utilities.file.FindFiles
+
+
Utility to find files based on a regular expression + against the file name.
+
+
FindFiles(String, String) - Constructor for class com.paypal.butterfly.utilities.file.FindFiles
+
+
Utility to find files based on a regular expression + against the file name and the file path.
+
+
+ + + +

G

+
+
GenericErrorsOutputHandler - Class in com.paypal.butterfly.utilities.maven
+
+
Reads lines from the Maven execution output and produces as result a String stating the errors, if any.
+
+
GenericErrorsOutputHandler() - Constructor for class com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler
+
 
+
getArtifactId() - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
getAttributeNames() - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
getAttributes() - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
getConditions() - Method in class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
+
Returns the set of Java conditions to be used to + evaluate the specified class.
+
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.CompareFiles
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.CompareXMLFiles
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.FileExists
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.conditions.RegexMatch
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.file.LoadFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.file.LocateFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.java.JavaPackage
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.misc.WebXmlContextParams
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.file.DeleteFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.file.RenameFile
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.AddLine
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
getDescription() - Method in class com.paypal.butterfly.utilities.xml.XmlElement
+
 
+
getFileName() - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
getFileUrl() - Method in class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
 
+
getFormat() - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
getGoals() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Return the Maven goals to be executed
+
+
getGroupId() - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
getLanguage() - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
getNameRegex() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Returns the file name regular expression
+
+
getNewArtifactId() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
getNewGroupId() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
getNewLine() - Method in class com.paypal.butterfly.utilities.operations.text.AddLine
+
 
+
getNewName() - Method in class com.paypal.butterfly.utilities.operations.file.RenameFile
+
 
+
getNewScope() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
getNewVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
getNumberOfTypes(CompilationUnit) - Method in class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck
+
 
+
getNumberOfTypes(CompilationUnit) - Method in class com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
+
 
+
getNumberOfTypes(CompilationUnit) - Method in class com.paypal.butterfly.utilities.conditions.java.Extends
+
 
+
getObjects() - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
getOutputHandlers() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Return the output handlers to be executed against the Maven goals execution result
+
+
getPackagingType() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
getParentArtifactId() - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
getParentGroupId() - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
getParentLevel() - Method in class com.paypal.butterfly.utilities.file.LocateFile
+
 
+
getParentVersion() - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
getPathRegex() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Returns the file path regular expression
+
+
getPomFilesAttribute() - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
getProperties() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Return the Maven properties for the goal
+
+
getPropertyName() - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
getPropertyName() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
getPropertyName() - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
getPropertyName() - Method in class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
 
+
getPropertyNameRegex() - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
getPropertyValue() - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
getRegex() - Method in class com.paypal.butterfly.utilities.conditions.RegexMatch
+
+
Returns the regular expression to be evaluated against the specified text file
+
+
getRegex() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
 
+
getReplacement() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
 
+
getReplacement() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
 
+
getResource() - Method in class com.paypal.butterfly.utilities.file.LoadFile
+
+
Returns the name of the resource in the classpath
+
+
getResult() - Method in class com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler
+
 
+
getResult() - Method in class com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler
+
 
+
getResult() - Method in interface com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler
+
+
Returns the desired result from parsing the console output
+
+
getScope() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
getScope() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
getScript() - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
getType() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
getTypeName(CompilationUnit, int) - Method in class com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck
+
 
+
getTypeName(CompilationUnit, int) - Method in class com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
+
 
+
getTypeName(CompilationUnit, int) - Method in class com.paypal.butterfly.utilities.conditions.java.Extends
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
getVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
getZipFileUrl() - Method in class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
 
+
+ + + +

H

+
+
hashCode() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
hashCode() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
hashCode() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
hashCode() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
+ + + +

I

+
+
InsertLine - Class in com.paypal.butterfly.utilities.operations.text
+
+
Inserts new line(s) into a text file.
+
+
InsertLine() - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Operation to insert new line(s) into a text file.
+
+
InsertLine(String) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Operation to insert a new line into a text file.
+
+
InsertLine(String, Integer) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Operation to insert a new line into a text file.
+
+
InsertLine(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Operation to insert a new line into a text file.
+
+
InsertLine.InsertionMode - Enum in com.paypal.butterfly.utilities.operations.text
+
+
The new line(s) can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
+
+
InsertText - Class in com.paypal.butterfly.utilities.operations.text
+
+
Inserts text from one file into another text file.
+
+
InsertText() - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Operation to insert text into another text file.
+
+
InsertText(URL) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Operation to insert text into another text file.
+
+
InsertText(URL, Integer) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Operation to insert text into another text file.
+
+
InsertText(URL, String) - Constructor for class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Operation to insert text into another text file.
+
+
InsertText.InsertionMode - Enum in com.paypal.butterfly.utilities.operations.text
+
+
The text can be inserted: + + InsertionMode.CONCAT: At the final of the file (default) + InsertionMode.LINE_NUMBER: At one particular specified line number (first line is number 1) + InsertionMode.REGEX_FIRST: Right after only the first line to match the specified regular expression + InsertionMode.REGEX_ALL: Right after any line to match the specified regular expression +
+
+
isFailIfNotFound() - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
isFirstOnly() - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
 
+
isIncludeFiles() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Returns whether files should be included in the search or not
+
+
isIncludeFolders() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Returns whether folders should be included in the search or not
+
+
isNegate() - Method in class com.paypal.butterfly.utilities.conditions.java.JavaCondition
+
+
Returns whether the evaluation result will be negated + or not.
+
+
isOptional() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
isRecursive() - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Returns whether the file search is recursive or not
+
+
isRemoveOptional() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
isRemoveScope() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
isRemoveType() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
isRemoveVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
+ + + +

J

+
+
JavaCondition<T extends JavaCondition> - Class in com.paypal.butterfly.utilities.conditions.java
+
+
Abstract class to specify a condition to be + evaluated against a Java class, which is + represented as a CompilationUnit.
+
+
JavaCondition() - Constructor for class com.paypal.butterfly.utilities.conditions.java.JavaCondition
+
 
+
JavaMatch - Class in com.paypal.butterfly.utilities.conditions.java
+
+
Parses and evaluates the specified Java class file + based on a set of JavaCondition.
+
+
JavaMatch() - Constructor for class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
+
This utility parses and evaluates the specified Java class file + based on a set of JavaCondition.
+
+
JavaMatch(JavaCondition) - Constructor for class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
+
This utility parses and evaluates the specified Java class file + based on a set of JavaCondition.
+
+
JavaPackage - Class in com.paypal.butterfly.utilities.java
+
+
Retrieves the package + of a given Java class.
+
+
JavaPackage() - Constructor for class com.paypal.butterfly.utilities.java.JavaPackage
+
 
+
+ + + +

L

+
+
LoadFile - Class in com.paypal.butterfly.utilities.file
+
+
Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
+
+
LoadFile() - Constructor for class com.paypal.butterfly.utilities.file.LoadFile
+
+
Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
+
+
LoadFile(String) - Constructor for class com.paypal.butterfly.utilities.file.LoadFile
+
+
Loads a resource from the classpath, writes it to a temporary file, + and then returns a File reference to it, which is saved in the transformation + context.
+
+
LocateFile - Class in com.paypal.butterfly.utilities.file
+
+
Locates a file based on the relative or absolute + location specified.
+
+
LocateFile() - Constructor for class com.paypal.butterfly.utilities.file.LocateFile
+
+
Locates a file based on the relative or absolute + location specified.
+
+
LocateFile(int) - Constructor for class com.paypal.butterfly.utilities.file.LocateFile
+
+
Locates a file based on the relative or absolute + location specified.
+
+
+ + + +

M

+
+
manipulateLine(String, Writer) - Method in class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
 
+
manipulateLine(String, Writer) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
 
+
MavenGoal - Class in com.paypal.butterfly.utilities.maven
+
+
Runs one or more Maven goals against a specific Maven POM file.
+
+
MavenGoal() - Constructor for class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Utility to run one or more Maven goals against a specific Maven POM file
+
+
MavenGoal(String...) - Constructor for class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Utility to run one or more Maven goals against a specific Maven POM file
+
+
MavenGoal(String[], MavenInvocationOutputHandler[]) - Constructor for class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Utility to run one or more Maven goals against a specific Maven POM file
+
+
MavenInvocationOutputHandler<T,R> - Interface in com.paypal.butterfly.utilities.maven
+
+
Reads lines from the Maven execution console output and return data after evaluating it.
+
+
MoveDirectory - Class in com.paypal.butterfly.utilities.operations.file
+
+
Moves a directory and its content from one location to another.
+
+
MoveDirectory() - Constructor for class com.paypal.butterfly.utilities.operations.file.MoveDirectory
+
+
Moves a directory and its content from one location to another.
+
+
MoveFile - Class in com.paypal.butterfly.utilities.operations.file
+
+
Moves a file.
+
+
MoveFile() - Constructor for class com.paypal.butterfly.utilities.operations.file.MoveFile
+
+
Moves a file.
+
+
+ + + +

N

+
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
noOpIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
noOpIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
noOpIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
noOpIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
+ + + +

O

+
+
overwriteIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
overwriteIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
overwriteIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
+ + + +

P

+
+
PomAddDependency - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Adds a new dependency to a POM file.
+
+
PomAddDependency() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
PomAddDependency(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
+
Operation to add a new dependency to a POM file.
+
+
PomAddDependency(String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
+
Operation to add a new dependency to a POM file.
+
+
PomAddDependency(String, String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
+
Operation to add a new dependency to a POM file.
+
+
PomAddParent - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Add a parent artifact in a Maven POM file.
+
+
PomAddParent() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
+
Add a parent artifact in a Maven POM file.
+
+
PomAddParent(String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
+
Operation to add a parent artifact in a Maven POM file
+
+
PomAddPlugin - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Adds a new plugin to a POM file.
+
+
PomAddPlugin() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
PomAddPlugin(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
+
Operation to add a new plugin to a POM file.
+
+
PomAddPlugin(String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
+
Operation to add a new plugin to a POM file.
+
+
PomChangeDependency - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Changes a dependency in a Maven POM file.
+
+
PomChangeDependency() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
PomChangeDependency(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
+
Operation to change a dependency in a Maven POM file.
+
+
PomChangePackaging - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Changes the packaging of a Maven artifact, by changing its POM file.
+
+
PomChangePackaging() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
PomChangePackaging(String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
+
Operation to change the packaging of a Maven artifact, by changing its POM file
+
+
PomChangeParent - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Changes the parent, or its version, in a Maven POM file.
+
+
PomChangeParent() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
PomChangeParent(String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
+
Operation to change the parent, or its version, in a Maven POM file
+
+
PomChangeParent(String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
+
Operation to change the parent, or its version, in a Maven POM file
+
+
PomDependencyExists - Class in com.paypal.butterfly.utilities.conditions.pom
+
+
Checks if a particular Maven dependency exists in a Maven pom file.
+
+
PomDependencyExists() - Constructor for class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
PomDependencyExists(String, String) - Constructor for class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
+
Condition to check if a particular Maven dependency exists in a Maven pom files
+
+
PomDependencyExists(String, String, String) - Constructor for class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
+
Condition to check if a particular Maven dependency exists in a Maven pom files
+
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
pomExecution(String, Model) - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
PomRemoveDependency - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Removes a dependency entry from a POM file.
+
+
PomRemoveDependency() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
PomRemoveDependency(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
+
Operation to remove a dependency entry from a POM file
+
+
PomRemoveManagedDependency - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Removes a managed dependency entry from a POM file.
+
+
PomRemoveManagedDependency() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
PomRemoveManagedDependency(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
+
Operation to remove a managed dependency entry from a POM file
+
+
PomRemovePlugin - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Removes a plugin entry from a POM file.
+
+
PomRemovePlugin() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
PomRemovePlugin(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
+
Operation to remove a plugin entry from a POM file
+
+
PomRemoveProperty - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Removes a property entry from a POM file.
+
+
PomRemoveProperty() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
PomRemoveProperty(String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
+
Operation to remove a property entry from a properties file
+
+
PomReplaceDependency - Class in com.paypal.butterfly.utilities.operations.pom
+
+
Replaces a dependency by another one in a POM file.
+
+
PomReplaceDependency() - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
PomReplaceDependency(String, String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
+
Operation to replace a dependency by another one in a POM file
+
+
PomReplaceDependency(String, String, String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
+
Operation to replace a dependency by another one in a POM file
+
+
PomReplaceDependency(String, String, String, String, String, String) - Constructor for class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
+
Operation to replace a dependency by another one in a POM file
+
+
PropertyExists - Class in com.paypal.butterfly.utilities.conditions
+
+
Checks if a particular property exists in a property file.
+
+
PropertyExists() - Constructor for class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
PropertyExists(String) - Constructor for class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
+ + + +

R

+
+
RegexMatch - Class in com.paypal.butterfly.utilities.conditions
+
+
Checks if a regular expression matches any line in the specified text file.
+
+
RegexMatch() - Constructor for class com.paypal.butterfly.utilities.conditions.RegexMatch
+
+
Checks if a regular expression matches any line in the specified text file.
+
+
RegexMatch(String) - Constructor for class com.paypal.butterfly.utilities.conditions.RegexMatch
+
+
Checks if a regular expression matches any line in the specified text file.
+
+
RelatedArtifacts - Class in com.paypal.butterfly.utilities.maven
+
+
Given a list of pom.xml File objects and + a parent artifact, this transformation utility results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
+
+
RelatedArtifacts() - Constructor for class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
RelatedArtifacts(String, String, String, String) - Constructor for class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
+
This transformation utility, given a list of pom.xml File objects and + a parent artifact, results in a sub-list of those pom.xml files containing only the ones + that are, directly or indirectly, a child of the specified parent artifact.
+
+
RemoveLine - Class in com.paypal.butterfly.utilities.operations.text
+
+
Removes one, or more, lines from a text file.
+
+
RemoveLine() - Constructor for class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
+
Operation to remove one, or more, lines from a text file.
+
+
RemoveLine(String) - Constructor for class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
+
Operation to remove one, or more, lines from a text file.
+
+
RemoveLine(String, boolean) - Constructor for class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
+
Operation to remove one, or more, lines from a text file.
+
+
RemoveLine(Integer) - Constructor for class com.paypal.butterfly.utilities.operations.text.RemoveLine
+
+
Operation to remove one line from a text file, based on a + line number.
+
+
removeOptional() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
RemoveProperty - Class in com.paypal.butterfly.utilities.operations.properties
+
+
Removes a property from a properties file.
+
+
RemoveProperty() - Constructor for class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
 
+
RemoveProperty(String) - Constructor for class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
+
Operation to remove a property from a properties file.
+
+
removeScope() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
removeType() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
removeVersion() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
RenameFile - Class in com.paypal.butterfly.utilities.operations.file
+
+
Renames a single file.
+
+
RenameFile() - Constructor for class com.paypal.butterfly.utilities.operations.file.RenameFile
+
 
+
RenameFile(String) - Constructor for class com.paypal.butterfly.utilities.operations.file.RenameFile
+
+
Renames a single file.
+
+
ReplaceLine - Class in com.paypal.butterfly.utilities.operations.text
+
+
Replaces one, or more, lines from a text file.
+
+
ReplaceLine() - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
+
Operation to replace one, or more, lines from a text file.
+
+
ReplaceLine(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
+
Operation to replace one, or more, lines from a text file.
+
+
ReplaceLine(String, String, boolean) - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
+
Operation to replace one, or more, lines from a text file.
+
+
ReplaceLine(Integer, String) - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
+
Operation to replace one line from a text file, based on a + line number.
+
+
ReplaceText - Class in com.paypal.butterfly.utilities.operations.text
+
+
Replaces text in a text file + based on a regular expression.
+
+
ReplaceText() - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Operation to replace text in a text file + based on a regular expression.
+
+
ReplaceText(String) - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Operation to replace text in a text file + based on a regular expression.
+
+
ReplaceText(String, String) - Constructor for class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Operation to replace text in a text file + based on a regular expression.
+
+
RunScript - Class in com.paypal.butterfly.utilities.misc
+
+
Executes a script and saves the result after evaluating it.
+
+
RunScript() - Constructor for class com.paypal.butterfly.utilities.misc.RunScript
+
+
Executes a script and saves the result after evaluating it.
+
+
RunScript(String) - Constructor for class com.paypal.butterfly.utilities.misc.RunScript
+
+
Executes a script and saves the result after evaluating it.
+
+
+ + + +

S

+
+
setArtifactId(String) - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
setArtifactId(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
setAttribute(String) - Method in class com.paypal.butterfly.utilities.xml.XmlElement
+
+
Set the name of the XML element attribute + to be retrieved.
+
+
setAttributeNames(String...) - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
setConditions(Set<JavaCondition>) - Method in class com.paypal.butterfly.utilities.conditions.java.JavaMatch
+
+
Sets the set of Java conditions to be used to + evaluate the specified class.
+
+
setFailAtEnd() - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Set the maven failure behavior to only fail at the end.
+
+
setFileName(String) - Method in class com.paypal.butterfly.utilities.file.FindFile
+
 
+
setFileUrl(URL) - Method in class com.paypal.butterfly.utilities.operations.file.ApplyFile
+
 
+
setFirstOnly(boolean) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Sets whether all lines, or only the first, to match the + regular expression will be replaced
+
+
setFormat(String) - Method in class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
setGoals(String...) - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Set the Maven goals to be executed
+
+
setGroupId(String) - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
setGroupId(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
setIncludeFiles(boolean) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Set whether files should be included in the search or not.
+
+
setIncludeFolders(boolean) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Set whether folders should be included in the search or not.
+
+
setInsertionMode(InsertLine.InsertionMode) - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Sets the insertion mode
+
+
setInsertionMode(InsertText.InsertionMode) - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Sets the insertion mode
+
+
setLanguage(String) - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
 
+
setLineNumber(Integer) - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Sets the line number the new line should be added at.
+
+
setLineNumber(Integer) - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Sets the line number the text should be added at.
+
+
setNameRegex(String) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Set regular expression to be used to match the file name + during the search
+
+
setNegate(boolean) - Method in class com.paypal.butterfly.utilities.conditions.java.JavaCondition
+
+
Sets whether the result should be negated, meaning, + resulting true whenever its evaluation result would + normally results false, and vice-versa.
+
+
setNewArtifactId(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
setNewGroupId(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
setNewLine(String) - Method in class com.paypal.butterfly.utilities.operations.text.AddLine
+
+
Sets the new line to be inserted.
+
+
setNewLine(String) - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Sets the new line to be inserted.
+
+
setNewName(String) - Method in class com.paypal.butterfly.utilities.operations.file.RenameFile
+
 
+
setNewScope(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
setNewVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
setOptional() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
setOutputHandlers(MavenInvocationOutputHandler...) - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Set the output handlers to be executed against the Maven goals execution result
+
+
setPackagingType(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
+
 
+
setParentArtifactId(String) - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
setParentGroupId(String) - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
setParentLevel(int) - Method in class com.paypal.butterfly.utilities.file.LocateFile
+
+
Set how many parent levels up the location process should + go through.
+
+
setParentVersion(String) - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
setPathRegex(String) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Set regular expression to be used to match the file path + during the search
+ Important notes: + + Use forward slash as file separator.
+
+
setPomFilesAttribute(String) - Method in class com.paypal.butterfly.utilities.maven.RelatedArtifacts
+
 
+
setProperties(Properties) - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
Set the Maven properties for the goal
+
+
setPropertyName(String) - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
setPropertyName(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
setPropertyName(String) - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
setPropertyName(String) - Method in class com.paypal.butterfly.utilities.operations.properties.RemoveProperty
+
 
+
setPropertyNameRegex(String) - Method in class com.paypal.butterfly.utilities.conditions.PropertyExists
+
 
+
setPropertyValue(String) - Method in class com.paypal.butterfly.utilities.operations.properties.AddProperty
+
 
+
setRecursive(boolean) - Method in class com.paypal.butterfly.utilities.file.FindFiles
+
+
Set whether the search should be recursive or not.
+
+
setRegex(String) - Method in class com.paypal.butterfly.utilities.conditions.RegexMatch
+
+
Sets the regular expression to be evaluated against the specified text file
+
+
setRegex(String) - Method in class com.paypal.butterfly.utilities.operations.text.InsertLine
+
+
Sets the regular expression to find insertion points + Notice that the insertion mode is automatically set to + InsertLine.InsertionMode.REGEX_FIRST, unless already set + to InsertLine.InsertionMode.REGEX_ALL.
+
+
setRegex(String) - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Sets the regular expression to find insertion points +
+ See InsertText.setInsertionMode(InsertionMode)
+
+
setRegex(String) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Sets the regular expression to find replacement points
+
+
setReplacement(String) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceLine
+
+
Sets the replacement line
+
+
setReplacement(String) - Method in class com.paypal.butterfly.utilities.operations.text.ReplaceText
+
+
Sets the replacement text
+
+
setResource(String) - Method in class com.paypal.butterfly.utilities.file.LoadFile
+
+
Sets the name of the resource in the classpath.
+
+
setScope(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
setScope(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
setScript(String) - Method in class com.paypal.butterfly.utilities.misc.RunScript
+
+
Sets the script to be executed and evaluated
+
+
setTextFileUrl(URL) - Method in class com.paypal.butterfly.utilities.operations.text.InsertText
+
+
Sets the URL to the text to be inserted
+
+
setType(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.conditions.pom.PomDependencyExists
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
setVersion(String) - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
setWarnOnError(boolean) - Method in class com.paypal.butterfly.utilities.maven.MavenGoal
+
+
If this is set to true, then in case the maven goal command + does not succeed, then a warn result type will be returned, + instead of error.
+
+
setXmlElement(String) - Method in class com.paypal.butterfly.utilities.xml.XmlElement
+
+
The XML element whose value, or an attribute, should be + the result of this transformation utility.
+
+
setZipFileUrl(URL) - Method in class com.paypal.butterfly.utilities.operations.file.ApplyZip
+
 
+
StringFormat - Class in com.paypal.butterfly.utilities.text
+
+
Registers a new transformation context + attribute by applying one or more existent + String transformation context attributes to + String.format(String, Object...).
+
+
StringFormat() - Constructor for class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
StringFormat(String) - Constructor for class com.paypal.butterfly.utilities.text.StringFormat
+
 
+
+ + + +

V

+
+
valueOf(String) - Static method in enum com.paypal.butterfly.utilities.operations.text.InsertLine.InsertionMode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum com.paypal.butterfly.utilities.operations.text.InsertText.InsertionMode
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum com.paypal.butterfly.utilities.operations.text.InsertLine.InsertionMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum com.paypal.butterfly.utilities.operations.text.InsertText.InsertionMode
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+ + + +

W

+
+
warnButAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
warnButAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
warnButAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeDependency
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomChangeParent
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty
+
 
+
warnIfNotPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency
+
 
+
warnNotAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddDependency
+
 
+
warnNotAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddParent
+
 
+
warnNotAddIfPresent() - Method in class com.paypal.butterfly.utilities.operations.pom.PomAddPlugin
+
 
+
WebXmlContextParams - Class in com.paypal.butterfly.utilities.misc
+
+
Parses a Java web deployment descriptor file (web.xml), + identifies all context parameters, and save them into a map, the key + being param-name and the value being param-value.
+
+
WebXmlContextParams() - Constructor for class com.paypal.butterfly.utilities.misc.WebXmlContextParams
+
 
+
+ + + +

X

+
+
XmlElement - Class in com.paypal.butterfly.utilities.xml
+
+
Retrieves the value of an element, + or one of its attributes, in a XML file.
+
+
XmlElement() - Constructor for class com.paypal.butterfly.utilities.xml.XmlElement
+
+
Retrieves the value of an element, + or one of its attributes, in a XML file.
+
+
XmlElement(String) - Constructor for class com.paypal.butterfly.utilities.xml.XmlElement
+
+
Retrieves the value of an element, + or one of its attributes, in a XML file.
+
+
+A C D E F G H I J L M N O P R S V W X 
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/index.html b/docs/javadocs/2.2.0/butterfly-utilities/index.html new file mode 100644 index 00000000..38eb8a52 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/index.html @@ -0,0 +1,75 @@ + + + + + + +butterfly-utilities 2.2.0 API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/overview-frame.html b/docs/javadocs/2.2.0/butterfly-utilities/overview-frame.html new file mode 100644 index 00000000..8b8bca72 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/overview-frame.html @@ -0,0 +1,34 @@ + + + + + + +Overview List (butterfly-utilities 2.2.0 API) + + + + + + + +

 

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/overview-summary.html b/docs/javadocs/2.2.0/butterfly-utilities/overview-summary.html new file mode 100644 index 00000000..633e618f --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/overview-summary.html @@ -0,0 +1,214 @@ + + + + + + +Overview (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + +
+

butterfly-utilities 2.2.0 API

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
com.paypal.butterfly.utilities.conditions +
Multiple transformation utility conditions, organized by type, each one having its own subpackage.
+
com.paypal.butterfly.utilities.conditions.java +
Transformation utility conditions to analyze and evaluate Java class files.
+
com.paypal.butterfly.utilities.conditions.pom +
Transformation utility conditions to analyze and evaluate Maven POM files.
+
com.paypal.butterfly.utilities.file +
Transformation utilities to gather meta-data, find and locate files.
+
com.paypal.butterfly.utilities.java +
Transformation utilities to gather meta-data about Java class files.
+
com.paypal.butterfly.utilities.maven +
Transformation utilities to gather meta-data about Maven POM files.
+
com.paypal.butterfly.utilities.misc +
Miscellaneous collection of transformation utilities.
+
com.paypal.butterfly.utilities.operations.file +
Transformation operations to manipulate files.
+
com.paypal.butterfly.utilities.operations.pom +
Transformation operations to manipulate Maven POM files.
+
com.paypal.butterfly.utilities.operations.properties +
Transformation operations to manipulate properties files.
+
com.paypal.butterfly.utilities.operations.text +
Transformation operations to manipulate text files.
+
com.paypal.butterfly.utilities.text +
Transformation utilities to gather meta-data about text files.
+
com.paypal.butterfly.utilities.xml +
Transformation utilities to gather meta-data about XML files.
+
+
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/overview-tree.html b/docs/javadocs/2.2.0/butterfly-utilities/overview-tree.html new file mode 100644 index 00000000..b1d23a5c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/overview-tree.html @@ -0,0 +1,261 @@ + + + + + + +Class Hierarchy (butterfly-utilities 2.2.0 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • com.paypal.butterfly.utilities.maven.EnforcerErrorsOutputHandler (implements com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler<T,R>)
    • +
    • com.paypal.butterfly.utilities.maven.GenericErrorsOutputHandler (implements com.paypal.butterfly.utilities.maven.MavenInvocationOutputHandler<T,R>)
    • +
    • com.paypal.butterfly.utilities.conditions.java.JavaCondition<T> +
        +
      • com.paypal.butterfly.utilities.conditions.java.AbstractTypeCheck<T> +
          +
        • com.paypal.butterfly.utilities.conditions.java.AnnotatedWith
        • +
        • com.paypal.butterfly.utilities.conditions.java.Extends
        • +
        +
      • +
      +
    • +
    • com.paypal.butterfly.extensions.api.TransformationUtility<T> (implements java.lang.Cloneable) +
        +
      • com.paypal.butterfly.utilities.file.FindFile
      • +
      • com.paypal.butterfly.utilities.file.FindFiles
      • +
      • com.paypal.butterfly.utilities.java.JavaPackage
      • +
      • com.paypal.butterfly.utilities.file.LoadFile
      • +
      • com.paypal.butterfly.utilities.file.LocateFile
      • +
      • com.paypal.butterfly.utilities.maven.MavenGoal
      • +
      • com.paypal.butterfly.utilities.maven.RelatedArtifacts
      • +
      • com.paypal.butterfly.utilities.misc.RunScript
      • +
      • com.paypal.butterfly.utilities.text.StringFormat
      • +
      • com.paypal.butterfly.extensions.api.TransformationOperation<T> +
          +
        • com.paypal.butterfly.utilities.operations.pom.AbstractArtifactPomOperation<T> +
            +
          • com.paypal.butterfly.utilities.operations.pom.PomAddDependency (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomAddParent (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomAddPlugin (implements com.paypal.butterfly.extensions.api.operations.AddElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomChangeParent (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemoveManagedDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomRemovePlugin (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          • com.paypal.butterfly.utilities.operations.pom.PomReplaceDependency (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
          • +
          +
        • +
        • com.paypal.butterfly.utilities.operations.text.AbstractLineOperation<T> +
            +
          • com.paypal.butterfly.utilities.operations.text.RemoveLine
          • +
          • com.paypal.butterfly.utilities.operations.text.ReplaceLine
          • +
          +
        • +
        • com.paypal.butterfly.utilities.operations.text.AddLine
        • +
        • com.paypal.butterfly.utilities.operations.properties.AddProperty
        • +
        • com.paypal.butterfly.utilities.operations.file.ApplyFile
        • +
        • com.paypal.butterfly.utilities.operations.file.ApplyZip
        • +
        • com.paypal.butterfly.utilities.operations.file.CopyDirectory
        • +
        • com.paypal.butterfly.utilities.operations.file.CopyFile
        • +
        • com.paypal.butterfly.utilities.operations.file.DeleteFile
        • +
        • com.paypal.butterfly.utilities.operations.text.InsertLine
        • +
        • com.paypal.butterfly.utilities.operations.text.InsertText
        • +
        • com.paypal.butterfly.utilities.operations.file.MoveDirectory
        • +
        • com.paypal.butterfly.utilities.operations.file.MoveFile
        • +
        • com.paypal.butterfly.utilities.operations.pom.PomChangePackaging
        • +
        • com.paypal.butterfly.utilities.operations.pom.PomRemoveProperty (implements com.paypal.butterfly.extensions.api.operations.ChangeOrRemoveElement<T>)
        • +
        • com.paypal.butterfly.utilities.operations.properties.RemoveProperty
        • +
        • com.paypal.butterfly.utilities.operations.file.RenameFile
        • +
        • com.paypal.butterfly.utilities.operations.text.ReplaceText
        • +
        +
      • +
      • com.paypal.butterfly.extensions.api.UtilityCondition<U> +
          +
        • com.paypal.butterfly.extensions.api.DoubleCondition<T> + +
        • +
        • com.paypal.butterfly.extensions.api.SingleCondition<T> + +
        • +
        +
      • +
      • com.paypal.butterfly.utilities.misc.WebXmlContextParams
      • +
      • com.paypal.butterfly.utilities.xml.XmlElement
      • +
      +
    • +
    +
  • +
+

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + +

Copyright © 2018. All rights reserved.

+ + diff --git a/docs/javadocs/2.2.0/butterfly-utilities/package-list b/docs/javadocs/2.2.0/butterfly-utilities/package-list new file mode 100644 index 00000000..0c633e90 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/package-list @@ -0,0 +1,13 @@ +com.paypal.butterfly.utilities.conditions +com.paypal.butterfly.utilities.conditions.java +com.paypal.butterfly.utilities.conditions.pom +com.paypal.butterfly.utilities.file +com.paypal.butterfly.utilities.java +com.paypal.butterfly.utilities.maven +com.paypal.butterfly.utilities.misc +com.paypal.butterfly.utilities.operations.file +com.paypal.butterfly.utilities.operations.pom +com.paypal.butterfly.utilities.operations.properties +com.paypal.butterfly.utilities.operations.text +com.paypal.butterfly.utilities.text +com.paypal.butterfly.utilities.xml diff --git a/docs/javadocs/2.2.0/butterfly-utilities/script.js b/docs/javadocs/2.2.0/butterfly-utilities/script.js new file mode 100644 index 00000000..b3463569 --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/javadocs/2.2.0/butterfly-utilities/stylesheet.css b/docs/javadocs/2.2.0/butterfly-utilities/stylesheet.css new file mode 100644 index 00000000..c4f6312c --- /dev/null +++ b/docs/javadocs/2.2.0/butterfly-utilities/stylesheet.css @@ -0,0 +1,571 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#0085DC; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#0085DC; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#0085DC; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding:5px 12px 7px 12px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#0085DC; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#0085DC; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/pom.xml b/pom.xml index 6186f3bb..e0cf51b8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.paypal.butterfly butterfly-parent - 2.1.0 + 2.2.0 pom ${project.artifactId} @@ -168,6 +168,7 @@ org.apache.maven.plugins maven-source-plugin + 3.0.1 attach-sources @@ -180,6 +181,7 @@ org.apache.maven.plugins maven-javadoc-plugin + 3.0.0 attach-javadocs diff --git a/release_steps.md b/release_steps.md new file mode 100644 index 00000000..d4051a37 --- /dev/null +++ b/release_steps.md @@ -0,0 +1,27 @@ +# Release steps + +1. Working from develop branch: + 1. Rev up all 9 pom files to the release version + 1. Build and test it + 1. javadoc + 1. generate javadocs for utilities and extensions-api projects: `mvn javadoc:javadoc` + 1. place javadocs files under `docs/javadocs/` + 1. update links in `Extension-development-guide.md`, pointing to latest javadoc + 1. commit only javadocs `Adding javadocs for version x` + 1. doc + 1. update zip link in `Installing-Butterfly.md` + 1. Update release notes + 1. Push changes `Releasing x` (deployment will be done automatically by CI job) +1. Manual sonatype release + 1. Staging Repositories + 1. Close (the one with sources and everything) + 1. Release +1. Send and merge PR from develop to master +1. tag new release +1. Close milestone +1. Working from develop branch: + 1. Rev up all 9 pom files to the next SNAPSHOT version + 1. Add new version empty section in release notes + 1. Push changes +1. Create new milestone +1. Add issues to new milestone (if any) \ No newline at end of file diff --git a/release_steps.txt b/release_steps.txt deleted file mode 100644 index 40ed1c1c..00000000 --- a/release_steps.txt +++ /dev/null @@ -1,24 +0,0 @@ -Working from develop branch: - Rev up all 9 pom files to the release version - Build to test it - javadoc - generate javadocs for utilities and extensions-api - mvn javadoc:javadoc - place javadocs files under docs/javadocs/ - Update release notes - Push changes (deployment will be done automatically by CI job) -Manual sonatype release - Staging Repositories - Close (the one with sources and everything) - Release -Send and merge PR from develop to master -Close milestone -Working from develop branch: - tag new release from develop branch - git tag -a - git push origin - Rev up all 9 pom files to the next SNAPSHOT version - Add new version empty section in release notes - Push changes -Create new milestone -Add issues to new milestone (if any) \ No newline at end of file diff --git a/secring.gpg.enc b/secring.gpg.enc new file mode 100644 index 00000000..e7185a20 Binary files /dev/null and b/secring.gpg.enc differ diff --git a/settings.xml b/settings.xml index 257bed1d..ba73ffe3 100644 --- a/settings.xml +++ b/settings.xml @@ -7,4 +7,16 @@ ${env.SONATYPE_PASSWORD} + + + ossrh + + false + + + ${env.GPG_KEYNAME} + ${env.GPG_PASSPHRASE} + + + \ No newline at end of file diff --git a/tests/sample-extension/src/main/java/com/extensiontest/SampleTransformationTemplate.java b/tests/sample-extension/src/main/java/com/extensiontest/SampleTransformationTemplate.java index f4a65aa5..fffc8a27 100644 --- a/tests/sample-extension/src/main/java/com/extensiontest/SampleTransformationTemplate.java +++ b/tests/sample-extension/src/main/java/com/extensiontest/SampleTransformationTemplate.java @@ -51,7 +51,7 @@ public SampleTransformationTemplate() { // Adding Spring Boot entry point class URL javaFileUrl = this.getClass().getResource("/Application.java"); - final String applicationFile = add(new ApplyFile(javaFileUrl).relative("/src/main/java/com/sample/app")); + add(new ApplyFile(javaFileUrl).relative("/src/main/java/com/sample/app")); // Changing README.md add(new ReplaceText("(Spring framework)", "Spring Boot framework").relative("README.md"));