gpt4 book ai didi

org.apache.batik.xml.XMLUtilities.isXMLSpace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 09:01:05 26 4
gpt4 key购买 nike

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

XMLUtilities.isXMLSpace介绍

[英]Tests whether the given character is a valid space.
[中]测试给定字符是否为有效空格。

代码示例

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Tells whether the given character represents white spaces.
 */
protected boolean isWhiteSpace(char[] text) {
  for (int i = 0; i < text.length; i++) {
    if (!XMLUtilities.isXMLSpace(text[i])) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: apache/batik

/**
 * Tells whether the given character represents white spaces.
 */
protected boolean isWhiteSpace(char[] text) {
  for (char aText : text) {
    if (!XMLUtilities.isXMLSpace(aText)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

protected int skipSpaces() {
  do {
    nextChar();
  } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
  return current;
}

代码示例来源:origin: apache/batik

protected int skipSpaces() {
  do {
    nextChar();
  } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
  return current;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the next lexical unit in the context of a start tag.
 */
private int scanElement() {
  //position = position + 1;    // to skip the first <
  while (current != -1) {
    if (current == '>') {
      return CHARACTER_DATA_CONTEXT;
    } else if (XMLUtilities.isXMLSpace((char)current)) {
      return ATTRIBUTE_NAME_CONTEXT;
    } 
    
    nextChar();
  }
  
  if (current == -1) {
    return EOF_CONTEXT;
  }
  
  return ELEMENT_CONTEXT;
}

代码示例来源:origin: apache/batik

/**
 * Returns the next lexical unit in the context of a start tag.
 */
private int scanElement() {
  //position = position + 1;    // to skip the first <
  while (current != -1) {
    if (current == '>') {
      return CHARACTER_DATA_CONTEXT;
    } else if (XMLUtilities.isXMLSpace((char)current)) {
      return ATTRIBUTE_NAME_CONTEXT;
    } 
    
    nextChar();
  }
  
  if (current == -1) {
    return EOF_CONTEXT;
  }
  
  return ELEMENT_CONTEXT;
}

代码示例来源:origin: org.apache.xmlgraphics/batik-dom

/**
   * Splits a whitespace separated string into tokens.
   */
  protected String[] split(String s) {
    List a = new ArrayList(8);
    StringBuffer sb;
    int i = 0;
    int len = s.length();
    while (i < len) {
      char c = s.charAt(i++);
      if (XMLUtilities.isXMLSpace(c)) {
        continue;
      }
      sb = new StringBuffer();
      sb.append(c);
      while (i < len) {
        c = s.charAt(i++);
        if (XMLUtilities.isXMLSpace(c)) {
          a.add(sb.toString());
          break;
        }
        sb.append(c);
      }
      if (i == len) {
        a.add(sb.toString());
      }
    }
    return (String[]) a.toArray(new String[a.size()]);
  }
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
   * Splits a whitespace separated string into tokens.
   */
  protected String[] split(String s) {
    List a = new ArrayList(8);
    StringBuffer sb;
    int i = 0;
    int len = s.length();
    while (i < len) {
      char c = s.charAt(i++);
      if (XMLUtilities.isXMLSpace(c)) {
        continue;
      }
      sb = new StringBuffer();
      sb.append(c);
      while (i < len) {
        c = s.charAt(i++);
        if (XMLUtilities.isXMLSpace(c)) {
          a.add(sb.toString());
          break;
        }
        sb.append(c);
      }
      if (i == len) {
        a.add(sb.toString());
      }
    }
    return (String[]) a.toArray(new String[a.size()]);
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-dom

/**
 * <b>DOM</b>: Implements
 * {@link org.w3c.dom.Text#isElementContentWhitespace()}.
 */
public boolean isElementContentWhitespace() {
  int len = nodeValue.length();
  for (int i = 0; i < len; i++) {
    if (!XMLUtilities.isXMLSpace(nodeValue.charAt(i))) {
      return false;
    }
  }
  Node p = getParentNode();
  if (p.getNodeType() == Node.ELEMENT_NODE) {
    String sp = XMLSupport.getXMLSpace((Element) p);
    return !sp.equals(XMLConstants.XML_PRESERVE_VALUE);
  }
  return true;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * <b>DOM</b>: Implements
 * {@link org.w3c.dom.Text#isElementContentWhitespace()}.
 */
public boolean isElementContentWhitespace() {
  int len = nodeValue.length();
  for (int i = 0; i < len; i++) {
    if (!XMLUtilities.isXMLSpace(nodeValue.charAt(i))) {
      return false;
    }
  }
  Node p = getParentNode();
  if (p.getNodeType() == Node.ELEMENT_NODE) {
    String sp = XMLSupport.getXMLSpace((Element) p);
    return !sp.equals(XMLConstants.XML_PRESERVE_VALUE);
  }
  return true;
}

代码示例来源:origin: apache/batik

/**
 * <b>DOM</b>: Implements
 * {@link org.w3c.dom.Text#isElementContentWhitespace()}.
 */
public boolean isElementContentWhitespace() {
  int len = nodeValue.length();
  for (int i = 0; i < len; i++) {
    if (!XMLUtilities.isXMLSpace(nodeValue.charAt(i))) {
      return false;
    }
  }
  Node p = getParentNode();
  if (p.getNodeType() == Node.ELEMENT_NODE) {
    String sp = XMLSupport.getXMLSpace((Element) p);
    return !sp.equals(XMLConstants.XML_PRESERVE_VALUE);
  }
  return true;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the next lexical unit in the context of an enumeration.
 */
protected int nextInEnumeration() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readNmtoken();
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-xml

/**
 * Returns the next lexical unit in the context of an enumeration.
 */
protected int nextInEnumeration() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readNmtoken();
  }
}

代码示例来源:origin: apache/batik

/**
 * Returns the next lexical unit in the context of an enumeration.
 */
protected int nextInEnumeration() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readNmtoken();
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-xml

/**
 * Returns the next lexical unit in the context of a end tag.
 */
protected int nextInEndTag() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 &&
         XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '>':
    if (--depth < 0) {
      throw createXMLException("unexpected.end.tag");
    } else if (depth == 0) {
      context = TOP_LEVEL_CONTEXT;
    } else {
      context = CONTENT_CONTEXT;
    }
    nextChar();
    return LexicalUnits.END_CHAR;
  default:
    throw createXMLException("invalid.character");
  }
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the next lexical unit in the context of a end tag.
 */
protected int nextInEndTag() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 &&
         XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '>':
    if (--depth < 0) {
      throw createXMLException("unexpected.end.tag");
    } else if (depth == 0) {
      context = TOP_LEVEL_CONTEXT;
    } else {
      context = CONTENT_CONTEXT;
    }
    nextChar();
    return LexicalUnits.END_CHAR;
  default:
    throw createXMLException("invalid.character");
  }
}

代码示例来源:origin: apache/batik

/**
 * Returns the next lexical unit in the context of a end tag.
 */
protected int nextInEndTag() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 &&
         XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '>':
    if (--depth < 0) {
      throw createXMLException("unexpected.end.tag");
    } else if (depth == 0) {
      context = TOP_LEVEL_CONTEXT;
    } else {
      context = CONTENT_CONTEXT;
    }
    nextChar();
    return LexicalUnits.END_CHAR;
  default:
    throw createXMLException("invalid.character");
  }
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Returns the next lexical unit in the context of a notation type.
 */
protected int nextInNotationType() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case '(':
    nextChar();
    return LexicalUnits.LEFT_BRACE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readName(LexicalUnits.NAME);
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-xml

/**
 * Returns the next lexical unit in the context of a notation type.
 */
protected int nextInNotationType() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case '(':
    nextChar();
    return LexicalUnits.LEFT_BRACE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readName(LexicalUnits.NAME);
  }
}

代码示例来源:origin: apache/batik

/**
 * Returns the next lexical unit in the context of a notation type.
 */
protected int nextInNotationType() throws IOException, XMLException {
  switch (current) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
    do {
      nextChar();
    } while (current != -1 && XMLUtilities.isXMLSpace((char)current));
    return LexicalUnits.S;
  case '|':
    nextChar();
    return LexicalUnits.PIPE;
  case '(':
    nextChar();
    return LexicalUnits.LEFT_BRACE;
  case ')':
    nextChar();
    context = ATTLIST_CONTEXT;
    return LexicalUnits.RIGHT_BRACE;
  default:
    return readName(LexicalUnits.NAME);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com