![JAR search and dependency download from the Maven repository](/logo.png)
org.objectweb.fractal.bf.adl.common.ParameterVerifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fractal-bf-adl Show documentation
Show all versions of fractal-bf-adl Show documentation
Extend Fractal-ADL to specify binding protocols.
package org.objectweb.fractal.bf.adl.common;
import java.util.logging.Logger;
import org.objectweb.fractal.adl.ADLException;
public class ParameterVerifier {
static Logger log = Logger.getLogger(ParameterVerifier.class
.getCanonicalName());
private ParameterVerifier() {
}
/**
* @param pc
* @throws ADLException
*/
public static void verify(ParameterContainer pc) throws ADLException {
if (pc.getParameters().length > 0) {
for (Parameter p : pc.getParameters()) {
log.config("ADL Parameter to be verified: [" + p.getName()
+ ":" + p.getValue() + "] ");
if ((p.getName() == null) || (p.getName().equalsIgnoreCase(""))) {
throw new ADLException(
"The name of a parameter can't be empty");
} else if (p.getValue() == null
|| p.getValue().equalsIgnoreCase("")) {
throw new ADLException("The value for parameter '"
+ p.getName() + "' can't be empty");
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy