com.ctc.wstx.io.WstxInputLocation类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中com.ctc.wstx.io.WstxInputLocation类的一些代码示例,展示了WstxInputLocation类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WstxInputLocation类的具体详情如下:
包路径:com.ctc.wstx.io.WstxInputLocation
类名称:WstxInputLocation

WstxInputLocation介绍

[英]Basic implementation of Location, used by Wstx readers.
[中]Wstx阅读器使用的位置的基本实现。

代码示例

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. public static IntEntity create(String id, char[] val)
  2. {
  3. WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
  4. return new IntEntity(loc, id, null, val, loc);
  5. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. protected Location getLocation()
  2. {
  3. return new WstxInputLocation(null, mPublicId, mSystemId,
  4. mInputProcessed + mInputPtr - 1,
  5. mInputRow, mInputPtr - mInputRowStart);
  6. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. public String toString()
  2. {
  3. if (mDesc == null) {
  4. StringBuffer sb;
  5. if (mContext != null) {
  6. sb = new StringBuffer(200);
  7. } else {
  8. sb = new StringBuffer(80);
  9. }
  10. appendDesc(sb);
  11. mDesc = sb.toString();
  12. }
  13. return mDesc;
  14. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. public boolean equals(Object o) {
  2. if (!(o instanceof WstxInputLocation)) {
  3. return false;
  4. }
  5. WstxInputLocation other = (WstxInputLocation) o;
  6. // char offset should be good enough, without row/col:
  7. if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
  8. return false;
  9. }
  10. String otherPub = other.getPublicId();
  11. if (otherPub == null) {
  12. otherPub = "";
  13. }
  14. if (!otherPub.equals(mPublicId)) {
  15. return false;
  16. }
  17. String otherSys = other.getSystemId();
  18. if (otherSys == null) {
  19. otherSys = "";
  20. }
  21. return otherSys.equals(mSystemId);
  22. }

代码示例来源:origin: woodstox/wstx-asl

  1. public boolean equals(Object o) {
  2. if (!(o instanceof Location)) {
  3. return false;
  4. }
  5. Location other = (Location) o;
  6. // char offset should be good enough, without row/col:
  7. if (other.getCharacterOffset() != getCharacterOffset()) {
  8. return false;
  9. }
  10. String otherPub = other.getPublicId();
  11. if (otherPub == null) {
  12. otherPub = "";
  13. }
  14. if (!otherPub.equals(mPublicId)) {
  15. return false;
  16. }
  17. String otherSys = other.getSystemId();
  18. if (otherSys == null) {
  19. otherSys = "";
  20. }
  21. return otherSys.equals(mSystemId);
  22. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

  1. public boolean equals(Object o) {
  2. if (!(o instanceof WstxInputLocation)) {
  3. return false;
  4. }
  5. WstxInputLocation other = (WstxInputLocation) o;
  6. // char offset should be good enough, without row/col:
  7. if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
  8. return false;
  9. }
  10. String otherPub = other.getPublicId();
  11. if (otherPub == null) {
  12. otherPub = "";
  13. }
  14. if (!otherPub.equals(mPublicId)) {
  15. return false;
  16. }
  17. String otherSys = other.getSystemId();
  18. if (otherSys == null) {
  19. otherSys = "";
  20. }
  21. return otherSys.equals(mSystemId);
  22. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

  1. public boolean equals(Object o) {
  2. if (!(o instanceof Location)) {
  3. return false;
  4. }
  5. Location other = (Location) o;
  6. // char offset should be good enough, without row/col:
  7. if (other.getCharacterOffset() != getCharacterOffset()) {
  8. return false;
  9. }
  10. String otherPub = other.getPublicId();
  11. if (otherPub == null) {
  12. otherPub = "";
  13. }
  14. if (!otherPub.equals(mPublicId)) {
  15. return false;
  16. }
  17. String otherSys = other.getSystemId();
  18. if (otherSys == null) {
  19. otherSys = "";
  20. }
  21. return otherSys.equals(mSystemId);
  22. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. protected Location getLocation()
  2. {
  3. /* Ok; for fixed-size multi-byte encodings, need to divide numbers
  4. * to get character locations. For variable-length encodings the
  5. * good thing is that xml declaration only uses shortest codepoints,
  6. * ie. char count == byte count.
  7. */
  8. int total = mInputProcessed + mInputPtr;
  9. int col = mInputPtr - mInputRowStart;
  10. if (mBytesPerChar > 1) {
  11. total /= mBytesPerChar;
  12. col /= mBytesPerChar;
  13. }
  14. return new WstxInputLocation(null, mPublicId, mSystemId,
  15. total - 1, // 0-based
  16. mInputRow, col);
  17. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. (oldInput, id, null, null, resolver, mConfig, xmlVersion);
  2. if (mCfgTreatCharRefsAsEntities) {
  3. return new IntEntity(WstxInputLocation.getEmptyLocation(), newInput.getEntityId(),
  4. newInput.getSource(), new char[]{}, WstxInputLocation.getEmptyLocation());

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. StringUtil.appendLF(sb);
  2. sb.append(" from ");
  3. mContext.appendDesc(sb);

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

  1. @Override
  2. public boolean equals(Object o) {
  3. if (!(o instanceof WstxInputLocation)) {
  4. return false;
  5. }
  6. WstxInputLocation other = (WstxInputLocation) o;
  7. // char offset should be good enough, without row/col:
  8. if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
  9. return false;
  10. }
  11. String otherPub = other.getPublicId();
  12. if (otherPub == null) {
  13. otherPub = "";
  14. }
  15. if (!otherPub.equals(mPublicId)) {
  16. return false;
  17. }
  18. String otherSys = other.getSystemId();
  19. if (otherSys == null) {
  20. otherSys = "";
  21. }
  22. return otherSys.equals(mSystemId);
  23. }

代码示例来源:origin: woodstox/wstx-lgpl

  1. public boolean equals(Object o) {
  2. if (!(o instanceof Location)) {
  3. return false;
  4. }
  5. Location other = (Location) o;
  6. // char offset should be good enough, without row/col:
  7. if (other.getCharacterOffset() != getCharacterOffset()) {
  8. return false;
  9. }
  10. String otherPub = other.getPublicId();
  11. if (otherPub == null) {
  12. otherPub = "";
  13. }
  14. if (!otherPub.equals(mPublicId)) {
  15. return false;
  16. }
  17. String otherSys = other.getSystemId();
  18. if (otherSys == null) {
  19. otherSys = "";
  20. }
  21. return otherSys.equals(mSystemId);
  22. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. public XMLStreamLocation2 getLocation()
  2. {
  3. return new WstxInputLocation(null, // no parent
  4. null, (String) null, // pub/sys ids not yet known
  5. mWriter.getAbsOffset(),
  6. mWriter.getRow(), mWriter.getColumn());
  7. }

代码示例来源:origin: woodstox/wstx-asl

  1. public static IntEntity create(String id, char[] val)
  2. {
  3. WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
  4. return new IntEntity(loc, id, null, val, loc);
  5. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

  1. public String toString()
  2. {
  3. if (mDesc == null) {
  4. StringBuffer sb;
  5. if (mContext != null) {
  6. sb = new StringBuffer(200);
  7. } else {
  8. sb = new StringBuffer(80);
  9. }
  10. appendDesc(sb);
  11. mDesc = sb.toString();
  12. }
  13. return mDesc;
  14. }

代码示例来源:origin: FasterXML/woodstox

  1. @Override
  2. public boolean equals(Object o) {
  3. if (!(o instanceof WstxInputLocation)) {
  4. return false;
  5. }
  6. WstxInputLocation other = (WstxInputLocation) o;
  7. // char offset should be good enough, without row/col:
  8. if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
  9. return false;
  10. }
  11. String otherPub = other.getPublicId();
  12. if (otherPub == null) {
  13. otherPub = "";
  14. }
  15. if (!otherPub.equals(mPublicId)) {
  16. return false;
  17. }
  18. String otherSys = other.getSystemId();
  19. if (otherSys == null) {
  20. otherSys = "";
  21. }
  22. return otherSys.equals(mSystemId);
  23. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

  1. public final WstxInputLocation getLocation(long total, int row, int col)
  2. {
  3. WstxInputLocation pl;
  4. if (mParent == null) {
  5. pl = null;
  6. } else {
  7. /* 13-Apr-2005, TSa: We can actually reuse parent location, since
  8. * it can not change during lifetime of this child context...
  9. */
  10. pl = mParentLocation;
  11. if (pl == null) {
  12. mParentLocation = pl = mParent.getLocation();
  13. }
  14. pl = mParent.getLocation();
  15. }
  16. /* !!! 15-Apr-2005, TSa: This will cause overflow for total count,
  17. * but since StAX 1.0 API doesn't have any way to deal with that,
  18. * let's just let that be...
  19. */
  20. return new WstxInputLocation(pl, getPublicId(), getSystemId(),
  21. total, row, col);
  22. }
  23. }

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

  1. public static IntEntity create(String id, char[] val)
  2. {
  3. WstxInputLocation loc = WstxInputLocation.getEmptyLocation();
  4. return new IntEntity(loc, id, null, val, loc);
  5. }

代码示例来源:origin: woodstox/wstx-asl

  1. public String toString()
  2. {
  3. if (mDesc == null) {
  4. StringBuffer sb;
  5. if (mContext != null) {
  6. sb = new StringBuffer(200);
  7. } else {
  8. sb = new StringBuffer(80);
  9. }
  10. appendDesc(sb);
  11. mDesc = sb.toString();
  12. }
  13. return mDesc;
  14. }

代码示例来源:origin: Nextdoor/bender

  1. @Override
  2. public boolean equals(Object o) {
  3. if (!(o instanceof WstxInputLocation)) {
  4. return false;
  5. }
  6. WstxInputLocation other = (WstxInputLocation) o;
  7. // char offset should be good enough, without row/col:
  8. if (other.getCharacterOffsetLong() != getCharacterOffsetLong()) {
  9. return false;
  10. }
  11. String otherPub = other.getPublicId();
  12. if (otherPub == null) {
  13. otherPub = "";
  14. }
  15. if (!otherPub.equals(mPublicId)) {
  16. return false;
  17. }
  18. String otherSys = other.getSystemId();
  19. if (otherSys == null) {
  20. otherSys = "";
  21. }
  22. return otherSys.equals(mSystemId);
  23. }

相关文章