本文整理了Java中com.ctc.wstx.io.WstxInputLocation
类的一些代码示例,展示了WstxInputLocation
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WstxInputLocation
类的具体详情如下:
包路径:com.ctc.wstx.io.WstxInputLocation
类名称:WstxInputLocation
[英]Basic implementation of Location, used by Wstx readers.
[中]Wstx阅读器使用的位置的基本实现。
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public static IntEntity create(String id, char[] val)
{
WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
return new IntEntity(loc, id, null, val, loc);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
protected Location getLocation()
{
return new WstxInputLocation(null, mPublicId, mSystemId,
mInputProcessed + mInputPtr - 1,
mInputRow, mInputPtr - mInputRowStart);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public String toString()
{
if (mDesc == null) {
StringBuffer sb;
if (mContext != null) {
sb = new StringBuffer(200);
} else {
sb = new StringBuffer(80);
}
appendDesc(sb);
mDesc = sb.toString();
}
return mDesc;
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public boolean equals(Object o) {
if (!(o instanceof WstxInputLocation)) {
return false;
}
WstxInputLocation other = (WstxInputLocation) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: woodstox/wstx-asl
public boolean equals(Object o) {
if (!(o instanceof Location)) {
return false;
}
Location other = (Location) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffset() != getCharacterOffset()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl
public boolean equals(Object o) {
if (!(o instanceof WstxInputLocation)) {
return false;
}
WstxInputLocation other = (WstxInputLocation) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox
public boolean equals(Object o) {
if (!(o instanceof Location)) {
return false;
}
Location other = (Location) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffset() != getCharacterOffset()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
protected Location getLocation()
{
/* Ok; for fixed-size multi-byte encodings, need to divide numbers
* to get character locations. For variable-length encodings the
* good thing is that xml declaration only uses shortest codepoints,
* ie. char count == byte count.
*/
int total = mInputProcessed + mInputPtr;
int col = mInputPtr - mInputRowStart;
if (mBytesPerChar > 1) {
total /= mBytesPerChar;
col /= mBytesPerChar;
}
return new WstxInputLocation(null, mPublicId, mSystemId,
total - 1, // 0-based
mInputRow, col);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
(oldInput, id, null, null, resolver, mConfig, xmlVersion);
if (mCfgTreatCharRefsAsEntities) {
return new IntEntity(WstxInputLocation.getEmptyLocation(), newInput.getEntityId(),
newInput.getSource(), new char[]{}, WstxInputLocation.getEmptyLocation());
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
StringUtil.appendLF(sb);
sb.append(" from ");
mContext.appendDesc(sb);
代码示例来源:origin: com.fasterxml.woodstox/woodstox-core
@Override
public boolean equals(Object o) {
if (!(o instanceof WstxInputLocation)) {
return false;
}
WstxInputLocation other = (WstxInputLocation) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: woodstox/wstx-lgpl
public boolean equals(Object o) {
if (!(o instanceof Location)) {
return false;
}
Location other = (Location) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffset() != getCharacterOffset()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public XMLStreamLocation2 getLocation()
{
return new WstxInputLocation(null, // no parent
null, (String) null, // pub/sys ids not yet known
mWriter.getAbsOffset(),
mWriter.getRow(), mWriter.getColumn());
}
代码示例来源:origin: woodstox/wstx-asl
public static IntEntity create(String id, char[] val)
{
WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
return new IntEntity(loc, id, null, val, loc);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl
public String toString()
{
if (mDesc == null) {
StringBuffer sb;
if (mContext != null) {
sb = new StringBuffer(200);
} else {
sb = new StringBuffer(80);
}
appendDesc(sb);
mDesc = sb.toString();
}
return mDesc;
}
代码示例来源:origin: FasterXML/woodstox
@Override
public boolean equals(Object o) {
if (!(o instanceof WstxInputLocation)) {
return false;
}
WstxInputLocation other = (WstxInputLocation) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public final WstxInputLocation getLocation(long total, int row, int col)
{
WstxInputLocation pl;
if (mParent == null) {
pl = null;
} else {
/* 13-Apr-2005, TSa: We can actually reuse parent location, since
* it can not change during lifetime of this child context...
*/
pl = mParentLocation;
if (pl == null) {
mParentLocation = pl = mParent.getLocation();
}
pl = mParent.getLocation();
}
/* !!! 15-Apr-2005, TSa: This will cause overflow for total count,
* but since StAX 1.0 API doesn't have any way to deal with that,
* let's just let that be...
*/
return new WstxInputLocation(pl, getPublicId(), getSystemId(),
total, row, col);
}
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl
public static IntEntity create(String id, char[] val)
{
WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
return new IntEntity(loc, id, null, val, loc);
}
代码示例来源:origin: woodstox/wstx-asl
public String toString()
{
if (mDesc == null) {
StringBuffer sb;
if (mContext != null) {
sb = new StringBuffer(200);
} else {
sb = new StringBuffer(80);
}
appendDesc(sb);
mDesc = sb.toString();
}
return mDesc;
}
代码示例来源:origin: Nextdoor/bender
@Override
public boolean equals(Object o) {
if (!(o instanceof WstxInputLocation)) {
return false;
}
WstxInputLocation other = (WstxInputLocation) o;
// char offset should be good enough, without row/col:
if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
return false;
}
String otherPub = other.getPublicId();
if (otherPub == null) {
otherPub = "";
}
if (!otherPub.equals(mPublicId)) {
return false;
}
String otherSys = other.getSystemId();
if (otherSys == null) {
otherSys = "";
}
return otherSys.equals(mSystemId);
}
内容来源于网络,如有侵权,请联系作者删除!