Java源码示例:com.sun.tools.internal.ws.wsdl.parser.DOMForest
示例1
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例2
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例3
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例4
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例5
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例6
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例7
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例8
private DocumentLocationResolver createDocResolver(final String baseWsdl, final DOMForest forest, final Map<String,String> documentMap) {
return new DocumentLocationResolver() {
@Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
systemId = reference.toExternalForm();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
if(documentMap.get(systemId) != null) {
return documentMap.get(systemId);
} else {
String parsedEntity = forest.getReferencedEntityMap().get(systemId);
return documentMap.get(parsedEntity);
}
}
};
}
示例9
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例10
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例11
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例12
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例13
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例14
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例15
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例16
public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
this._document = doc;
this._listeners = listeners;
this._nsSupport = new NamespaceSupport();
this._wsdlLocation = new WSDLLocation();
this.forest = forest;
this.errorReceiver = errReceiver;
}
示例17
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例18
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例19
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例20
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例21
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例22
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例23
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
示例24
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}