Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#24 Correct usage of VariableUnsupportedTypeException #25

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Copyright (c) 2019-2021 Linagora
*
*
* This program/library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or (at your
* option) any later version.
*
*
* This program/library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program/library; If not, see http://www.gnu.org/licenses/
* for the GNU Lesser General Public License version 2.1.
Expand Down Expand Up @@ -41,14 +41,14 @@

/**
* Variable definition used as an internal model of a variable.
*
*
* @author Christophe DENEUX - Linagora
*
*/
public class VariableDefinition {

private final String name;

private final XPathExpression xpathExprValue;

private Templates preXmlTransformation;
Expand Down Expand Up @@ -174,7 +174,7 @@ public void setPreXmlTranformationResultJson(final boolean isPreXmlTranformation

/**
* Return the Flowable variable value in the right format according to its type
*
*
* @param stringValue
* The Flowable varaible value as {@link String} to convert in the right type
* @throws VariableException
Expand Down Expand Up @@ -224,12 +224,12 @@ private Object convert(final String variableValueAsStr) throws VariableException
} else if (this.type.equals("json")) {
return Boolean.valueOf(variableValueAsStr);
} else {
throw new VariableUnsupportedTypeException(this.type, this.name);
throw new VariableUnsupportedTypeException(this.name, this.type);
}
}

/**
*
*
* @param incomingPayload
* @param emptyVariableValueLogger
* A callback logger to log message about an empty value extracted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Copyright (c) 2019-2021 Linagora
*
*
* This program/library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or (at your
* option) any later version.
*
*
* This program/library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program/library; If not, see http://www.gnu.org/licenses/
* for the GNU Lesser General Public License version 2.1.
Expand All @@ -28,7 +28,7 @@

/**
* Abstract variable implementation.
*
*
* @author Christophe DENEUX - Linagora
*
*/
Expand All @@ -40,7 +40,7 @@ private VariableImplBuilder() {

/**
* Builds a {@link VariableImpl} from its {@link VariableDefinition}.
*
*
* @param variable
* The variable definition. Not {@code null}.
* @return The variable implementation
Expand Down Expand Up @@ -74,13 +74,13 @@ public static final VariableImpl build(final VariableDefinition variable, final
variable.getNamespaceMappings(),
jacksonObjectMapper, logger);
} else {
throw new VariableUnsupportedTypeException(variable.getType(), variable.getName());
throw new VariableUnsupportedTypeException(variable.getName(), variable.getType());
}
}

/**
* Builds a list of {@link VariableImpl} from a list of {@link VariableDefinition}.
*
*
* @param variables
* The variable definitions. Not {@code null}.
* @return The variable implementations
Expand Down