本文整理汇总了Java中com.sun.xml.internal.ws.streaming.XMLReaderException类的典型用法代码示例。如果您正苦于以下问题:Java XMLReaderException类的具体用法?Java XMLReaderException怎么用?Java XMLReaderException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLReaderException类属于com.sun.xml.internal.ws.streaming包,在下文中一共展示了XMLReaderException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import com.sun.xml.internal.ws.streaming.XMLReaderException; //导入依赖的package包/类
public static XMLStreamReader create(InputSource source, boolean rejectDTDs) {
try {
// Char stream available?
if (source.getCharacterStream() != null) {
return get().doCreate(source.getSystemId(), source.getCharacterStream(), rejectDTDs);
}
// Byte stream available?
if (source.getByteStream() != null) {
return get().doCreate(source.getSystemId(), source.getByteStream(), rejectDTDs);
}
// Otherwise, open URI
return get().doCreate(source.getSystemId(), new URL(source.getSystemId()).openStream(),rejectDTDs);
} catch (IOException e) {
throw new XMLReaderException("stax.cantCreate",e);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:XMLStreamReaderFactory.java
示例2: createFIStreamReader
import com.sun.xml.internal.ws.streaming.XMLReaderException; //导入依赖的package包/类
/**
* Returns the FI parser allocated for this thread.
*/
public static XMLStreamReader createFIStreamReader(InputStream in) {
// Check if compatible implementation of FI was found
if (FastInfosetReflection.fiStAXDocumentParser_new == null) {
throw new XMLReaderException("fastinfoset.noImplementation");
}
try {
// Do not use StAX pluggable layer for FI
Object sdp = FastInfosetReflection.fiStAXDocumentParser_new.newInstance();
FastInfosetReflection.fiStAXDocumentParser_setStringInterning.invoke(sdp, Boolean.TRUE);
FastInfosetReflection.fiStAXDocumentParser_setInputStream.invoke(sdp, in);
return (XMLStreamReader) sdp;
} catch (Exception e) {
throw new XMLStreamReaderException(e);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:FastInfosetUtil.java
示例3: doCreate
import com.sun.xml.internal.ws.streaming.XMLReaderException; //导入依赖的package包/类
@Override
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
try {
return xif.get().createXMLStreamReader(systemId,in);
} catch (XMLStreamException e) {
throw new XMLReaderException("stax.cantCreate",e);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:XMLStreamReaderFactory.java
示例4: doCreate
import com.sun.xml.internal.ws.streaming.XMLReaderException; //导入依赖的package包/类
@Override
public synchronized XMLStreamWriter doCreate(OutputStream out, String encoding) {
try {
XMLStreamWriter writer = xof.createXMLStreamWriter(out,encoding);
return new HasEncodingWriter(writer, encoding);
} catch (XMLStreamException e) {
throw new XMLReaderException("stax.cantCreate",e);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XMLStreamWriterFactory.java
示例5: doCreate
import com.sun.xml.internal.ws.streaming.XMLReaderException; //导入依赖的package包/类
private XMLStreamReader doCreate(String systemId, InputStream in, @NotNull String encoding, boolean rejectDTDs) {
Reader reader;
try {
reader = new InputStreamReader(in, encoding);
} catch(UnsupportedEncodingException ue) {
throw new XMLReaderException("stax.cantCreate", ue);
}
return doCreate(systemId, reader, rejectDTDs);
}
开发者ID:campolake,项目名称:openjdk9,代码行数:10,代码来源:XMLStreamReaderFactory.java
注:本文中的com.sun.xml.internal.ws.streaming.XMLReaderException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论