本文整理了Java中org.teiid.core.types.XMLType.getEncoding()
方法的一些代码示例,展示了XMLType.getEncoding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLType.getEncoding()
方法的具体详情如下:
包路径:org.teiid.core.types.XMLType
类名称:XMLType
方法名:getEncoding
[英]Returns the encoding or null if it cannot be determined
[中]如果无法确定,则返回编码或null
代码示例来源:origin: org.teiid/teiid-common-core
public String getEncoding() {
if (encoding == null) {
this.encoding = getEncoding(this);
}
return encoding;
}
代码示例来源:origin: teiid/teiid
public String getEncoding() {
if (encoding == null) {
this.encoding = getEncoding(this);
}
return encoding;
}
代码示例来源:origin: teiid/teiid
public void writeExternal(ObjectOutput out, byte version) throws IOException {
super.writeExternal(out);
if (this.encoding == null) {
this.encoding = getEncoding(this);
}
out.writeObject(this.encoding);
if (version > 0) {
ExternalizeUtil.writeEnum(out, this.type);
} else {
out.writeObject(this.type);
}
}
代码示例来源:origin: org.teiid/teiid-common-core
public void writeExternal(ObjectOutput out, byte version) throws IOException {
super.writeExternal(out);
if (this.encoding == null) {
this.encoding = getEncoding(this);
}
out.writeObject(this.encoding);
if (version > 0) {
ExternalizeUtil.writeEnum(out, this.type);
} else {
out.writeObject(this.type);
}
}
代码示例来源:origin: org.teiid/teiid-common-core
/**
* Returns the encoding or null if it cannot be determined
* @param xml
* @return
*/
public static String getEncoding(SQLXML xml) {
try {
if (xml instanceof XMLType) {
XMLType type = (XMLType)xml;
if (type.encoding != null) {
return type.encoding;
}
xml = type.reference;
}
if (xml instanceof SQLXMLImpl) {
Charset cs = ((SQLXMLImpl)xml).getCharset();
if (cs != null) {
return cs.name();
}
}
return getEncoding(xml.getBinaryStream());
} catch (SQLException e) {
return null;
}
}
代码示例来源:origin: teiid/teiid
/**
* Returns the encoding or null if it cannot be determined
* @param xml
* @return
*/
public static String getEncoding(SQLXML xml) {
try {
if (xml instanceof XMLType) {
XMLType type = (XMLType)xml;
if (type.encoding != null) {
return type.encoding;
}
xml = type.reference;
}
if (xml instanceof SQLXMLImpl) {
Charset cs = ((SQLXMLImpl)xml).getCharset();
if (cs != null) {
return cs.name();
}
}
return getEncoding(xml.getBinaryStream());
} catch (SQLException e) {
return null;
}
}
代码示例来源:origin: org.teiid/teiid-common-core
@Override
public Charset getCharset() {
Charset cs = super.getCharset();
if (cs != null) {
return cs;
}
String enc = null;
try {
enc = XMLType.getEncoding(this.getBinaryStream());
} catch (SQLException e) {
}
if (enc != null) {
setEncoding(enc);
} else {
super.setCharset(Streamable.CHARSET);
}
return super.getCharset();
}
代码示例来源:origin: teiid/teiid
@Override
public Charset getCharset() {
Charset cs = super.getCharset();
if (cs != null) {
return cs;
}
String enc = null;
try {
enc = XMLType.getEncoding(this.getBinaryStream());
} catch (SQLException e) {
}
if (enc != null) {
setEncoding(enc);
} else {
super.setCharset(Streamable.CHARSET);
}
return super.getCharset();
}
代码示例来源:origin: teiid/teiid
XMLType val = (XMLType)currentValue;
SQLXMLImpl impl = new SQLXMLImpl(createInputStreamFactory(val));
impl.setEncoding(val.getEncoding());
return impl;
代码示例来源:origin: org.teiid/teiid-client
XMLType val = (XMLType)currentValue;
SQLXMLImpl impl = new SQLXMLImpl(createInputStreamFactory(val));
impl.setEncoding(val.getEncoding());
return impl;
代码示例来源:origin: org.teiid/teiid-engine
try {
InputStream is = null;
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
is = new ReaderInputStream(value.getCharacterStream(), encoding);
} else {
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
代码示例来源:origin: teiid/teiid
try {
InputStream is = null;
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
is = new ReaderInputStream(value.getCharacterStream(), encoding);
} else {
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
代码示例来源:origin: org.jboss.teiid/teiid-engine
try {
InputStream is = null;
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
is = new ReaderInputStream(value.getCharacterStream(), encoding);
} else {
if (!Charset.forName(value.getEncoding()).equals(encoding)) {
内容来源于网络,如有侵权,请联系作者删除!