use of org.apache.cxf.tools.validator.ServiceValidator in project cxf by apache.
the class JavaScriptContainer method validate.
public void validate(final ServiceInfo service) throws ToolException {
for (ServiceValidator validator : getServiceValidators()) {
service.setProperty(ToolContext.class.getName(), context);
validator.setService(service);
if (!validator.isValid()) {
throw new ToolException(validator.getErrorMessage());
}
}
}
use of org.apache.cxf.tools.validator.ServiceValidator in project cxf by apache.
the class WSDLToJavaContainer method validate.
public void validate(final ServiceInfo service) throws ToolException {
for (ServiceValidator validator : getServiceValidators()) {
service.setProperty(ToolContext.class.getName(), context);
validator.setService(service);
if (!validator.isValid()) {
throw new ToolException(validator.getErrorMessage());
}
}
}
use of org.apache.cxf.tools.validator.ServiceValidator in project cxf by apache.
the class JavaScriptContainer method getServiceValidators.
public List<ServiceValidator> getServiceValidators() {
List<ServiceValidator> validators = new ArrayList<>();
Properties initialExtensions = null;
try {
initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread.currentThread().getContextClassLoader());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
for (Object element : initialExtensions.values()) {
String validatorClass = (String) element;
try {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Found service validator : " + validatorClass);
}
ServiceValidator validator = (ServiceValidator) Class.forName(validatorClass, true, Thread.currentThread().getContextClassLoader()).newInstance();
validators.add(validator);
} catch (Exception ex) {
LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex);
}
}
return validators;
}
use of org.apache.cxf.tools.validator.ServiceValidator in project cxf by apache.
the class WSDLToJavaContainer method getServiceValidators.
public List<ServiceValidator> getServiceValidators() {
List<ServiceValidator> validators = new ArrayList<>();
Properties initialExtensions = null;
try {
initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread.currentThread().getContextClassLoader());
} catch (IOException ex) {
throw new RuntimeException(ex);
}
for (Iterator<?> it = initialExtensions.values().iterator(); it.hasNext(); ) {
String validatorClass = (String) it.next();
try {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Found service validator : " + validatorClass);
}
ServiceValidator validator = (ServiceValidator) Class.forName(validatorClass, true, Thread.currentThread().getContextClassLoader()).newInstance();
validators.add(validator);
} catch (Exception ex) {
LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex);
}
}
return validators;
}
use of org.apache.cxf.tools.validator.ServiceValidator in project cxf by apache.
the class JAXWSContainerTest method testGetServceValidator.
@Test
public void testGetServceValidator() throws Exception {
JAXWSContainer container = new JAXWSContainer(null);
List<ServiceValidator> validators = container.getServiceValidators();
assertNotNull(validators);
assertTrue(!validators.isEmpty());
}
Aggregations