Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2013-08-20 15:37:19 +0000
committerBrian Vosburgh2013-08-26 19:13:35 +0000
commit9bf4c5933ad1c34ae4df6ed0c0f55bb6275ae180 (patch)
tree4f5f02f8946ebe92796ac576e58751fd1bd005b2
parent7573d37e58d754064aa38954a9a7b1f74c5519e1 (diff)
downloadwebtools.dali-9bf4c5933ad1c34ae4df6ed0c0f55bb6275ae180.tar.gz
webtools.dali-9bf4c5933ad1c34ae4df6ed0c0f55bb6275ae180.tar.xz
webtools.dali-9bf4c5933ad1c34ae4df6ed0c0f55bb6275ae180.zip
add InterruptibleTransformer interface
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java6
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java6
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java6
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java4
5 files changed, 47 insertions, 14 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
index 5d34197cd6..6953faa23c 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleCommand.java
@@ -20,11 +20,9 @@ package org.eclipse.jpt.common.utility.command;
* will almost certainly be broken (repeatedly) as the API evolves.
*
* @see Command
- * @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
- * @see org.eclipse.jpt.common.utility.factory.Factory
* @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
- * @see org.eclipse.jpt.common.utility.command.ParameterizedCommand
- * @see org.eclipse.jpt.common.utility.transformer.Transformer
+ * @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
+ * @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
public interface InterruptibleCommand {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java
index 0dec449ebb..f30de9b8f9 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/command/InterruptibleParameterizedCommand.java
@@ -19,16 +19,12 @@ package org.eclipse.jpt.common.utility.command;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @see org.eclipse.jpt.common.utility.command.ParameterizedCommand
- *
* @param <A> the type of the object passed to the command
*
* @see ParameterizedCommand
* @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
- * @see org.eclipse.jpt.common.utility.command.Command
* @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
- * @see org.eclipse.jpt.common.utility.factory.Factory
- * @see org.eclipse.jpt.common.utility.transformer.Transformer
+ * @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
public interface InterruptibleParameterizedCommand<A> {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
index d40defa946..abb0b8e550 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/factory/InterruptibleFactory.java
@@ -22,11 +22,9 @@ package org.eclipse.jpt.common.utility.factory;
* @param <T> the type of the object created by the factory
*
* @see Factory
- * @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
- * @see org.eclipse.jpt.common.utility.command.Command
* @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
- * @see org.eclipse.jpt.common.utility.command.ParameterizedCommand
- * @see org.eclipse.jpt.common.utility.transformer.Transformer
+ * @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
+ * @see org.eclipse.jpt.common.utility.transformer.InterruptibleTransformer
*/
public interface InterruptibleFactory<T> {
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java
new file mode 100644
index 0000000000..765962477f
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/InterruptibleTransformer.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.utility.transformer;
+
+/**
+ * Used by various "pluggable" classes to transform objects.
+ * Transform an <em>input</em> object of type <code>I</code>
+ * to an <em>output</em> object of type <code>O</code>.
+ * Allow for the transformer to throw an {@link InterruptedException}.
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @param <I> input: the type of the object passed to the transformer
+ * @param <O> output: the type of the object returned by the transformer
+ *
+ * @see Transformer
+ * @see org.eclipse.jpt.common.utility.command.InterruptibleParameterizedCommand
+ * @see org.eclipse.jpt.common.utility.command.InterruptibleCommand
+ * @see org.eclipse.jpt.common.utility.factory.InterruptibleFactory
+ */
+public interface InterruptibleTransformer<I, O> {
+ /**
+ * Return the transformed object.
+ * The semantics of "transform" is determined by the
+ * contract between the client and the server.
+ */
+ O transform(I input) throws InterruptedException;
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
index df0c5fbc5f..a99c39f432 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
@@ -23,7 +23,9 @@ package org.eclipse.jpt.common.utility.transformer;
* @param <I> input: the type of the object passed to the transformer
* @param <O> output: the type of the object returned by the transformer
*/
-public interface Transformer<I, O> {
+public interface Transformer<I, O>
+ extends InterruptibleTransformer<I, O>
+{
/**
* Return the transformed object.
* The semantics of "transform" is determined by the

Back to the top