本文整理了Java中com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.create()
方法的一些代码示例,展示了XMLStreamReaderFactory.create()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLStreamReaderFactory.create()
方法的具体详情如下:
包路径:com.sun.xml.ws.api.streaming.XMLStreamReaderFactory
类名称:XMLStreamReaderFactory
方法名:create
暂无
代码示例来源:origin: com.sun.xml.ws/rt
/**
* Creates a {@link WSEndpointReference} by parsing an infoset.
*/
public WSEndpointReference(InputStream infoset, AddressingVersion version) throws XMLStreamException {
this(XMLStreamReaderFactory.create(null,infoset,false),version);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
/**
* Creates a {@link WSEndpointReference} by parsing an infoset.
*/
public WSEndpointReference(InputStream infoset, AddressingVersion version) throws XMLStreamException {
this(XMLStreamReaderFactory.create(null,infoset,false),version);
}
代码示例来源:origin: javaee/metro-jax-ws
/**
* Creates a {@link WSEndpointReference} by parsing an infoset.
*/
public WSEndpointReference(InputStream infoset, AddressingVersion version) throws XMLStreamException {
this(XMLStreamReaderFactory.create(null,infoset,false),version);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public XMLStreamReader read() throws IOException, XMLStreamException {
InputStream is = url.openStream();
return new TidyXMLStreamReader(
XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
}
代码示例来源:origin: com.sun.xml.ws/rt
@Override
public XMLStreamReader read() throws IOException, XMLStreamException {
InputStream is = url.openStream();
return new TidyXMLStreamReader(
XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
}
代码示例来源:origin: javaee/metro-jax-ws
@Override
public XMLStreamReader read() throws IOException, XMLStreamException {
InputStream is = url.openStream();
return new TidyXMLStreamReader(
XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
}
代码示例来源:origin: com.sun.xml.ws/rt
@Override
public Message decode(InputStream in, String charset,
AttachmentSet att, SOAPVersion soapVersion) throws IOException {
XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true);
reader = new TidyXMLStreamReader(reader, in);
return StreamSOAPCodec.decode(soapVersion, reader, att);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public Message decode(InputStream in, String charset,
AttachmentSet att, SOAPVersion soapVersion) throws IOException {
XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true);
reader = new TidyXMLStreamReader(reader, in);
return StreamSOAPCodec.decode(soapVersion, reader, att);
}
代码示例来源:origin: javaee/metro-jax-ws
@Override
public Message decode(InputStream in, String charset,
AttachmentSet att, SOAPVersion soapVersion) throws IOException {
XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true);
reader = new TidyXMLStreamReader(reader, in);
return StreamSOAPCodec.decode(soapVersion, reader, att);
}
代码示例来源:origin: com.sun.xml.ws/rt
public Parser resolveEntity(String publicId, String systemId) throws SAXException, IOException {
InputSource source = core.resolveEntity(publicId,systemId);
if(source==null)
return null; // default
// ideally entity resolvers should be giving us the system ID for the resource
// (or otherwise we won't be able to resolve references within this imported WSDL correctly),
// but if none is given, the system ID before the entity resolution is better than nothing.
if(source.getSystemId()!=null)
systemId = source.getSystemId();
URL url = new URL(systemId);
InputStream stream;
if (useStreamFromEntityResolver) {
stream = source.getByteStream();
} else {
stream = url.openStream();
}
return new Parser(url,
new TidyXMLStreamReader(XMLStreamReaderFactory.create(url.toExternalForm(), stream, true), stream));
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public Parser resolveEntity(String publicId, String systemId) throws SAXException, IOException {
InputSource source = core.resolveEntity(publicId,systemId);
if(source==null)
return null; // default
// ideally entity resolvers should be giving us the system ID for the resource
// (or otherwise we won't be able to resolve references within this imported WSDL correctly),
// but if none is given, the system ID before the entity resolution is better than nothing.
if(source.getSystemId()!=null)
systemId = source.getSystemId();
URL url = new URL(systemId);
InputStream stream;
if (useStreamFromEntityResolver) {
stream = source.getByteStream();
} else {
stream = url.openStream();
}
return new Parser(url,
new TidyXMLStreamReader(XMLStreamReaderFactory.create(url.toExternalForm(), stream, true), stream));
}
}
代码示例来源:origin: javaee/metro-jax-ws
public Parser resolveEntity(String publicId, String systemId) throws SAXException, IOException {
InputSource source = core.resolveEntity(publicId,systemId);
if(source==null)
return null; // default
// ideally entity resolvers should be giving us the system ID for the resource
// (or otherwise we won't be able to resolve references within this imported WSDL correctly),
// but if none is given, the system ID before the entity resolution is better than nothing.
if(source.getSystemId()!=null)
systemId = source.getSystemId();
URL url = new URL(systemId);
InputStream stream;
if (useStreamFromEntityResolver) {
stream = source.getByteStream();
} else {
stream = url.openStream();
}
return new Parser(url,
new TidyXMLStreamReader(XMLStreamReaderFactory.create(url.toExternalForm(), stream, true), stream));
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public static HandlerChainsModel buildHandlerChainsModel(final Class<?> clazz) {
if(clazz == null) {
return null;
}
HandlerChain handlerChain =
clazz.getAnnotation(HandlerChain.class);
if(handlerChain == null)
return null;
InputStream iStream = getFileAsStream(clazz, handlerChain);
XMLStreamReader reader =
XMLStreamReaderFactory.create(null,iStream, true);
XMLStreamReaderUtil.nextElementContent(reader);
HandlerChainsModel handlerChainsModel = HandlerChainsModel.parseHandlerConfigFile(clazz, reader);
try {
reader.close();
iStream.close();
} catch (XMLStreamException e) {
e.printStackTrace();
throw new UtilException(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
throw new UtilException(e.getMessage());
}
return handlerChainsModel;
}
代码示例来源:origin: com.sun.xml.ws/rt
public static HandlerChainsModel buildHandlerChainsModel(final Class<?> clazz) {
if(clazz == null) {
return null;
}
HandlerChain handlerChain =
clazz.getAnnotation(HandlerChain.class);
if(handlerChain == null)
return null;
InputStream iStream = getFileAsStream(clazz, handlerChain);
XMLStreamReader reader =
XMLStreamReaderFactory.create(null,iStream, true);
XMLStreamReaderUtil.nextElementContent(reader);
HandlerChainsModel handlerChainsModel = HandlerChainsModel.parseHandlerConfigFile(clazz, reader);
try {
reader.close();
iStream.close();
} catch (XMLStreamException e) {
e.printStackTrace();
throw new UtilException(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
throw new UtilException(e.getMessage());
}
return handlerChainsModel;
}
代码示例来源:origin: com.sun.xml.ws/rt
public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs) {
return (encoding == null)
? create(systemId, in, rejectDTDs)
: get().doCreate(systemId,in,encoding,rejectDTDs);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs) {
return (encoding == null)
? create(systemId, in, rejectDTDs)
: get().doCreate(systemId,in,encoding,rejectDTDs);
}
代码示例来源:origin: javaee/metro-jax-ws
public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs) {
return (encoding == null)
? create(systemId, in, rejectDTDs)
: get().doCreate(systemId,in,encoding,rejectDTDs);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
/**
* Parses the {@code sun-jaxws.xml} file and configures
* a set of {@link HttpAdapter}s.
*/
public @NotNull List<A> parse(String systemId, InputStream is) {
XMLStreamReader reader = null;
try {
reader = new TidyXMLStreamReader(
XMLStreamReaderFactory.create(systemId, is, true), is);
XMLStreamReaderUtil.nextElementContent(reader);
return parseAdapters(reader);
} finally {
if (reader != null) {
try {
reader.close();
} catch (XMLStreamException e) {
throw new ServerRtException("runtime.parser.xmlReader", e);
}
}
try {
is.close();
} catch (IOException e) {
// ignore
}
}
}
代码示例来源:origin: com.sun.xml.ws/rt
/**
* Parses the {@code sun-jaxws.xml} file and configures
* a set of {@link HttpAdapter}s.
*/
public @NotNull List<A> parse(String systemId, InputStream is) {
XMLStreamReader reader = null;
try {
reader = new TidyXMLStreamReader(
XMLStreamReaderFactory.create(systemId, is, true), is);
XMLStreamReaderUtil.nextElementContent(reader);
return parseAdapters(reader);
} finally {
if (reader != null) {
try {
reader.close();
} catch (XMLStreamException e) {
throw new ServerRtException("runtime.parser.xmlReader", e);
}
}
try {
is.close();
} catch (IOException e) {
// ignore
}
}
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
//TODO shouldn't we check for SOAP1.1/SOAP1.2 and throw
//TODO UnsupportedMediaException like StreamSOAPCodec
String charset = null;
String ct = mpp.getRootPart().getContentType();
if (ct != null) {
charset = new ContentTypeImpl(ct).getCharSet();
}
if (charset != null && !Charset.isSupported(charset)) {
throw new UnsupportedMediaException(charset);
}
if (charset != null) {
packet.invocationProperties.put(DECODED_MESSAGE_CHARSET, charset);
} else {
packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET);
}
// we'd like to reuse those reader objects but unfortunately decoder may be reused
// before the decoded message is completely used.
XMLStreamReader mtomReader = new MtomXMLStreamReaderEx( mpp,
XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), charset, true)
);
packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp)));
packet.setMtomFeature(mtomFeature);
packet.setContentType(mpp.getContentType());
}
内容来源于网络,如有侵权,请联系作者删除!