use of com.sun.tools.ws.wscompile.AbortException in project metro-jax-ws by eclipse-ee4j.
the class AbstractDocument method define.
public void define(GloballyKnown e) {
Map map = getMap(e.getKind());
if (e.getName() == null)
return;
QName name = new QName(e.getDefining().getTargetNamespaceURI(), e.getName());
if (map.containsKey(name)) {
errReceiver.error(e.getLocator(), WsdlMessages.ENTITY_DUPLICATE_WITH_TYPE(e.getElementName().getLocalPart(), e.getName()));
throw new AbortException();
} else {
map.put(name, e);
}
}
use of com.sun.tools.ws.wscompile.AbortException in project metro-jax-ws by eclipse-ee4j.
the class AbstractDocument method find.
public GloballyKnown find(Kind k, QName name) {
Map map = getMap(k);
Object result = map.get(name);
if (result == null) {
errReceiver.error(null, WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(k.getName(), name, _systemId));
throw new AbortException();
}
return (GloballyKnown) result;
}
use of com.sun.tools.ws.wscompile.AbortException in project metro-jax-ws by eclipse-ee4j.
the class ModelerUtils method createRpcLitParameters.
public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver) {
RpcLitStructure rpcStruct = (RpcLitStructure) block.getType();
List<Parameter> parameters = new ArrayList<>();
for (MessagePart part : message.getParts()) {
if (!ModelerUtils.isBoundToSOAPBody(part))
continue;
QName name = part.getDescriptor();
TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
if (typeAndAnn == null) {
String msgQName = "{" + message.getDefining().getTargetNamespaceURI() + "}" + message.getName();
errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(), part.getName(), msgQName));
throw new AbortException();
}
String type = typeAndAnn.getTypeClass().fullName();
type = ClassNameInfo.getGenericClass(type);
RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
param.setJavaType(javaType);
rpcStruct.addRpcLitMember(param);
Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
parameter.setEmbedded(true);
parameters.add(parameter);
}
return parameters;
}
use of com.sun.tools.ws.wscompile.AbortException in project metro-jax-ws by eclipse-ee4j.
the class WSDLParserTest method createErrorReceiver.
private static ErrorReceiverFilter createErrorReceiver() {
class Listener extends WsimportListener {
ConsoleErrorReporter cer = new ConsoleErrorReporter(System.err);
@Override
public void generatedFile(String fileName) {
message(fileName);
}
@Override
public void message(String msg) {
System.out.println(msg);
}
@Override
public void error(SAXParseException exception) {
cer.error(exception);
}
@Override
public void fatalError(SAXParseException exception) {
cer.fatalError(exception);
}
@Override
public void warning(SAXParseException exception) {
cer.warning(exception);
}
@Override
public void debug(SAXParseException exception) {
cer.debug(exception);
}
@Override
public void info(SAXParseException exception) {
cer.info(exception);
}
public void enableDebugging() {
cer.enableDebugging();
}
}
final Listener listener = new Listener();
ErrorReceiverFilter errorReceiver = new ErrorReceiverFilter(listener) {
public void info(SAXParseException exception) {
super.info(exception);
}
public void warning(SAXParseException exception) {
super.warning(exception);
}
@Override
public void pollAbort() throws AbortException {
if (listener.isCanceled()) {
throw new AbortException();
}
}
@Override
public void debug(SAXParseException exception) {
listener.debug(exception);
}
};
return errorReceiver;
}
use of com.sun.tools.ws.wscompile.AbortException in project metro-jax-ws by eclipse-ee4j.
the class JAXBModelBuilder method bind.
protected void bind() {
S2JJAXBModel rawJaxbModel = schemaCompiler.bind();
if (rawJaxbModel == null)
throw new AbortException();
options.setCodeModel(rawJaxbModel.generateCode(null, errReceiver));
jaxbModel = new JAXBModel(rawJaxbModel);
jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
}
Aggregations