summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmusset2009-03-05 12:14:49 (EST)
committer jmusset2009-03-05 12:14:49 (EST)
commit858d64d46cbc103bd4b2e2c0799ea711027d12b4 (patch)
tree3da43a37e6c9182471c4ca3c93fdb430a29234e5
parent7b5a9551f33eaff96fab152a882da6689989e5b9 (diff)
downloadorg.eclipse.acceleo-858d64d46cbc103bd4b2e2c0799ea711027d12b4.zip
org.eclipse.acceleo-858d64d46cbc103bd4b2e2c0799ea711027d12b4.tar.gz
org.eclipse.acceleo-858d64d46cbc103bd4b2e2c0799ea711027d12b4.tar.bz2
format after renaming
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/AcceleoEnginePlugin.java6
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/generation/AcceleoGenericEngine.java11
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java24
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationContext.java12
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationVisitor.java56
-rw-r--r--plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/service/AcceleoService.java22
6 files changed, 77 insertions, 54 deletions
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/AcceleoEnginePlugin.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/AcceleoEnginePlugin.java
index 5102c0a..f5ed586 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/AcceleoEnginePlugin.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/AcceleoEnginePlugin.java
@@ -78,7 +78,8 @@ public class AcceleoEnginePlugin extends Plugin {
*/
public static void log(Exception e, boolean blocker) {
if (e == null) {
- throw new NullPointerException(AcceleoEngineMessages.getString("AcceleoEnginePlugin.LogNullException")); //$NON-NLS-1$
+ throw new NullPointerException(AcceleoEngineMessages
+ .getString("AcceleoEnginePlugin.LogNullException")); //$NON-NLS-1$
}
if (getDefault() == null) {
@@ -115,7 +116,8 @@ public class AcceleoEnginePlugin extends Plugin {
// Eclipse platform displays NullPointer on standard error instead of throwing it.
// We'll handle this by throwing it ourselves.
if (status == null) {
- throw new NullPointerException(AcceleoEngineMessages.getString("AcceleoEnginePlugin.LogNullStatus")); //$NON-NLS-1$
+ throw new NullPointerException(AcceleoEngineMessages
+ .getString("AcceleoEnginePlugin.LogNullStatus")); //$NON-NLS-1$
}
if (getDefault() != null) {
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/generation/AcceleoGenericEngine.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/generation/AcceleoGenericEngine.java
index bc1fd8e..49729db 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/generation/AcceleoGenericEngine.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/generation/AcceleoGenericEngine.java
@@ -29,7 +29,6 @@ import org.eclipse.ocl.ecore.OCL;
import org.eclipse.ocl.ecore.OCL.Query;
import org.eclipse.ocl.ecore.Variable;
-
/**
* This class can be used to launch the generation of an Acceleo template.
*
@@ -40,7 +39,8 @@ public class AcceleoGenericEngine implements IAcceleoEngine {
* This will hold the list of all listeners registered for notification on text generation from this
* engine.
*/
- private final List<AcceleoTextGenerationListener> listeners = new ArrayList<AcceleoTextGenerationListener>(3);
+ private final List<AcceleoTextGenerationListener> listeners = new ArrayList<AcceleoTextGenerationListener>(
+ 3);
/** Holds a reference to the ocl instance. */
private OCL ocl;
@@ -57,8 +57,8 @@ public class AcceleoGenericEngine implements IAcceleoEngine {
/**
* {@inheritDoc}
*
- * @see org.eclipse.acceleo.engine.generation.IAcceleoEngine#evaluate(org.eclipse.acceleo.model.mtl.Template, java.util.List,
- * java.io.File, boolean)
+ * @see org.eclipse.acceleo.engine.generation.IAcceleoEngine#evaluate(org.eclipse.acceleo.model.mtl.Template,
+ * java.util.List, java.io.File, boolean)
*/
public Map<String, StringWriter> evaluate(Template template, List<? extends Object> arguments,
File generationRoot, boolean preview) {
@@ -70,7 +70,8 @@ public class AcceleoGenericEngine implements IAcceleoEngine {
.getString("AcceleoEngine.IllegalTemplateInvocation")); //$NON-NLS-1$
}
if (template.getParameter().size() != arguments.size()) {
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoEngine.IllegalArguments")); //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages
+ .getString("AcceleoEngine.IllegalArguments")); //$NON-NLS-1$
}
// We need to create an OCL instance for each generation since the environment factory is contextual
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java
index 5e574d2..35db88d 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/environment/AcceleoEvaluationEnvironment.java
@@ -46,8 +46,8 @@ import org.eclipse.ocl.EvaluationEnvironment;
import org.eclipse.ocl.ecore.EcoreEvaluationEnvironment;
/**
- * This will allow us to accurately evaluate custom operations defined in the Acceleo standard library and resolve
- * the right template for each call (guards, overrides, namesakes, ...).
+ * This will allow us to accurately evaluate custom operations defined in the Acceleo standard library and
+ * resolve the right template for each call (guards, overrides, namesakes, ...).
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
@@ -104,8 +104,8 @@ public class AcceleoEvaluationEnvironment extends EcoreEvaluationEnvironment {
}
/**
- * The environment will delegate operation calls to this method if it needs to evaluate non-standard Acceleo
- * operations.
+ * The environment will delegate operation calls to this method if it needs to evaluate non-standard
+ * Acceleo operations.
*
* @param operation
* Operation which is to be evaluated.
@@ -177,9 +177,11 @@ public class AcceleoEvaluationEnvironment extends EcoreEvaluationEnvironment {
} else {
sourceLabel = source.getClass().getName();
}
- throw new UnsupportedOperationException(AcceleoEngineMessages.getString(
- "AcceleoEvaluationEnvironment.UndefinedOperation", operation.getName(), argErrorMsg.toString(), //$NON-NLS-1$
- sourceLabel));
+ throw new UnsupportedOperationException(
+ AcceleoEngineMessages
+ .getString(
+ "AcceleoEvaluationEnvironment.UndefinedOperation", operation.getName(), argErrorMsg.toString(), //$NON-NLS-1$
+ sourceLabel));
}
/**
@@ -293,9 +295,11 @@ public class AcceleoEvaluationEnvironment extends EcoreEvaluationEnvironment {
} else {
sourceLabel = source.getClass().getName();
}
- throw new UnsupportedOperationException(AcceleoEngineMessages.getString(
- "AcceleoEvaluationEnvironment.UndefinedOperation", operation.getName(), argErrorMsg.toString(), //$NON-NLS-1$
- sourceLabel));
+ throw new UnsupportedOperationException(
+ AcceleoEngineMessages
+ .getString(
+ "AcceleoEvaluationEnvironment.UndefinedOperation", operation.getName(), argErrorMsg.toString(), //$NON-NLS-1$
+ sourceLabel));
}
/**
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationContext.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationContext.java
index 7e0476e..fa13375 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationContext.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationContext.java
@@ -75,7 +75,8 @@ public final class AcceleoEvaluationContext {
* This will hold the list of all listeners registered for notification on text generation from this
* engine.
*/
- private final List<AcceleoTextGenerationListener> listeners = new ArrayList<AcceleoTextGenerationListener>(3);
+ private final List<AcceleoTextGenerationListener> listeners = new ArrayList<AcceleoTextGenerationListener>(
+ 3);
/** If <code>true</code>, no file will be generated by this context. */
private final boolean previewMode;
@@ -193,7 +194,8 @@ public final class AcceleoEvaluationContext {
}
return result;
} catch (final IOException e) {
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoEvaluationContext.WriteError"), //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages
+ .getString("AcceleoEvaluationContext.WriteError"), //$NON-NLS-1$
e);
}
}
@@ -292,7 +294,8 @@ public final class AcceleoEvaluationContext {
writers.getLast().flush();
}
} catch (final IOException e) {
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoEvaluationContext.FlushError"), //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages
+ .getString("AcceleoEvaluationContext.FlushError"), //$NON-NLS-1$
e);
}
writers.add(new StringWriter(DEFAULT_BUFFER_SIZE));
@@ -311,7 +314,8 @@ public final class AcceleoEvaluationContext {
writers.getLast().flush();
}
} catch (final IOException e) {
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoEvaluationContext.FlushError"), //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages
+ .getString("AcceleoEvaluationContext.FlushError"), //$NON-NLS-1$
e);
}
writers.add(new OutputStreamWriter(new AcceleoFilterOutputStream(stream)));
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationVisitor.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationVisitor.java
index 236f739..0ce6e33 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationVisitor.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/internal/evaluation/AcceleoEvaluationVisitor.java
@@ -340,9 +340,11 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
final Object currentSelf = getEvaluationEnvironment().getValueOf(SELF_VARIABLE_NAME);
if (isUndefined(iteration)) {
- final AcceleoEvaluationException exception = new AcceleoEvaluationException(AcceleoEngineMessages.getString(
- "AcceleoEvaluationVisitor.NullForIteration", forBlock.getStartPosition(), ((Module)EcoreUtil //$NON-NLS-1$
- .getRootContainer(forBlock)).getName()));
+ final AcceleoEvaluationException exception = new AcceleoEvaluationException(
+ AcceleoEngineMessages
+ .getString(
+ "AcceleoEvaluationVisitor.NullForIteration", forBlock.getStartPosition(), ((Module)EcoreUtil //$NON-NLS-1$
+ .getRootContainer(forBlock)).getName()));
exception.fillInStackTrace();
throw exception;
}
@@ -366,9 +368,10 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
guardValue = visitExpression((OCLExpression)forBlock.getGuard());
}
if (isUndefined(guardValue)) {
- final AcceleoEvaluationException exception = new AcceleoEvaluationException(AcceleoEngineMessages
- .getString(UNDEFINED_GUARD_MESSAGE_KEY, forBlock.getStartPosition(),
- ((Module)EcoreUtil.getRootContainer(forBlock)).getName()));
+ final AcceleoEvaluationException exception = new AcceleoEvaluationException(
+ AcceleoEngineMessages.getString(UNDEFINED_GUARD_MESSAGE_KEY, forBlock
+ .getStartPosition(), ((Module)EcoreUtil.getRootContainer(forBlock))
+ .getName()));
exception.fillInStackTrace();
throw exception;
}
@@ -400,9 +403,10 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
guardValue = visitExpression((OCLExpression)forBlock.getGuard());
}
if (isUndefined(guardValue)) {
- final AcceleoEvaluationException exception = new AcceleoEvaluationException(AcceleoEngineMessages
- .getString(UNDEFINED_GUARD_MESSAGE_KEY, forBlock.getStartPosition(),
- ((Module)EcoreUtil.getRootContainer(forBlock)).getName()));
+ final AcceleoEvaluationException exception = new AcceleoEvaluationException(
+ AcceleoEngineMessages
+ .getString(UNDEFINED_GUARD_MESSAGE_KEY, forBlock.getStartPosition(),
+ ((Module)EcoreUtil.getRootContainer(forBlock)).getName()));
exception.fillInStackTrace();
throw exception;
}
@@ -562,12 +566,12 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
if (areaContent != null) {
context.append(areaContent, protectedArea, lastEObjectSelfValue);
} else {
- context
- .append(
- AcceleoEngineMessages.getString("usercode.start"), protectedArea, lastEObjectSelfValue); //$NON-NLS-1$
+ context.append(
+ AcceleoEngineMessages.getString("usercode.start"), protectedArea, lastEObjectSelfValue); //$NON-NLS-1$
context.append(' ' + marker, protectedArea, lastEObjectSelfValue);
visitAcceleoBlock(protectedArea);
- context.append(AcceleoEngineMessages.getString("usercode.end"), protectedArea, lastEObjectSelfValue); //$NON-NLS-1$
+ context.append(
+ AcceleoEngineMessages.getString("usercode.end"), protectedArea, lastEObjectSelfValue); //$NON-NLS-1$
}
}
@@ -586,8 +590,9 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
for (int i = 0; i < query.getParameter().size(); i++) {
final Object argValue = visitExpression((OCLExpression)invocation.getArgument().get(i));
if (isUndefined(argValue)) {
- final AcceleoEvaluationException exception = new AcceleoEvaluationException(AcceleoEngineMessages
- .getString("AcceleoEvaluationVisitor.UndefinedArgument", invocation.getStartPosition(), //$NON-NLS-1$
+ final AcceleoEvaluationException exception = new AcceleoEvaluationException(
+ AcceleoEngineMessages.getString(
+ "AcceleoEvaluationVisitor.UndefinedArgument", invocation.getStartPosition(), //$NON-NLS-1$
((Module)EcoreUtil.getRootContainer(invocation)).getName()));
exception.fillInStackTrace();
throw exception;
@@ -651,8 +656,8 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
public String visitAcceleoTemplate(Template template) {
context.openNested();
/*
- * Variables have been positionned by either the AcceleoEngine (first template) or this visitor (template
- * invocation).
+ * Variables have been positionned by either the AcceleoEngine (first template) or this visitor
+ * (template invocation).
*/
for (final OCLExpression nested : template.getBody()) {
visitExpression(nested);
@@ -709,10 +714,11 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
for (OCLExpression expression : invocation.getArgument()) {
final Object argValue = visitExpression(expression);
if (isUndefined(argValue)) {
- final AcceleoEvaluationException exception = new AcceleoEvaluationException(AcceleoEngineMessages
- .getString("AcceleoEvaluationVisitor.UndefinedArgument", invocation //$NON-NLS-1$
- .getStartPosition(), ((Module)EcoreUtil.getRootContainer(invocation))
- .getName()));
+ final AcceleoEvaluationException exception = new AcceleoEvaluationException(
+ AcceleoEngineMessages.getString(
+ "AcceleoEvaluationVisitor.UndefinedArgument", invocation //$NON-NLS-1$
+ .getStartPosition(), ((Module)EcoreUtil
+ .getRootContainer(invocation)).getName()));
exception.fillInStackTrace();
throw exception;
}
@@ -837,10 +843,10 @@ public class AcceleoEvaluationVisitor<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS,
}
/**
- * Handles the evaluation of an Acceleo {@link InitSection}. This will simply add all the declared variables
- * to the evaluation environment. Evaluation of all blocks should use this in order to save the variables
- * state <u>before</u> evaluation and be able to restore it afterwards through {@link #restoreVariables()}
- * .
+ * Handles the evaluation of an Acceleo {@link InitSection}. This will simply add all the declared
+ * variables to the evaluation environment. Evaluation of all blocks should use this in order to save the
+ * variables state <u>before</u> evaluation and be able to restore it afterwards through
+ * {@link #restoreVariables()} .
*
* @param init
* The init section containing the variables to process.
diff --git a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/service/AcceleoService.java b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/service/AcceleoService.java
index ca629ae..cb642a3 100644
--- a/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/service/AcceleoService.java
+++ b/plugins/org.eclipse.acceleo.engine/src/org/eclipse/acceleo/engine/service/AcceleoService.java
@@ -42,7 +42,8 @@ public final class AcceleoService {
private static final IAcceleoEngine GENERATION_ENGINE = new AcceleoGenericEngine();
/** This message will be set for all NPE thrown because of null arguments for this utility's methods. */
- private static final String TEMPLATE_CALL_NPE = AcceleoEngineMessages.getString("AcceleoService.NullArguments"); //$NON-NLS-1$
+ private static final String TEMPLATE_CALL_NPE = AcceleoEngineMessages
+ .getString("AcceleoService.NullArguments"); //$NON-NLS-1$
/**
* Utility classes don't need to (and shouldn't) be instantiated.
@@ -68,7 +69,8 @@ public final class AcceleoService {
* containing modules.
* <p>
* Keep in mind that this can only be used with single-argument templates. Any attempt to call to a
- * template with more than one argument through this method will throw {@link AcceleoEvaluationException}s.
+ * template with more than one argument through this method will throw {@link AcceleoEvaluationException}
+ * s.
* </p>
* <p>
* The input model will be iterated over for objects matching the templates' parameter types.
@@ -270,11 +272,12 @@ public final class AcceleoService {
}
/**
- * Launches the generation of a single-argument Acceleo template for all matching EObjects in the given model.
+ * Launches the generation of a single-argument Acceleo template for all matching EObjects in the given
+ * model.
* <p>
* This is a convenience method that can only be used with single argument templates. Any attempt at
- * calling other templates through this method will throw {@link AcceleoEvaluationException}s. The input model
- * will be iterated over for objects matching the template's parameter type.
+ * calling other templates through this method will throw {@link AcceleoEvaluationException}s. The input
+ * model will be iterated over for objects matching the template's parameter type.
* </p>
* <p>
* <tt>generationRoot</tt> will be used as the root of all generated files. For example, a template such
@@ -314,7 +317,8 @@ public final class AcceleoService {
.getString("AcceleoEngine.IllegalTemplateInvocation")); //$NON-NLS-1$
}
if (template.getParameter().size() != 1) {
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoEngine.VoidArguments")); //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages
+ .getString("AcceleoEngine.VoidArguments")); //$NON-NLS-1$
}
final Map<String, StringWriter> previewResult = new HashMap<String, StringWriter>();
@@ -447,7 +451,8 @@ public final class AcceleoService {
}
}
}
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoService.UndefinedTemplate", //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
+ "AcceleoService.UndefinedTemplate", //$NON-NLS-1$
templateName, module.getName()));
}
@@ -483,7 +488,8 @@ public final class AcceleoService {
}
}
}
- throw new AcceleoEvaluationException(AcceleoEngineMessages.getString("AcceleoService.UndefinedTemplate", //$NON-NLS-1$
+ throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
+ "AcceleoService.UndefinedTemplate", //$NON-NLS-1$
templateName, module.getName()));
}
}