java.lang.Character.isIdentifierIgnorable()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(193)

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

Character.isIdentifierIgnorable介绍

[英]Indicates whether the specified character is ignorable in a Java or Unicode identifier.
[中]指示指定的字符在Java或Unicode标识符中是否可忽略。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: konsoletyper/teavm

@Override
  public boolean contains(int ch) {
    return Character.isIdentifierIgnorable(ch);
  }
};

代码示例来源:origin: fesh0r/fernflower

/**
 * Return {@code true} if, and only if identifier passed is compliant to JLS9 section 3.8 AND DOES NOT CONTAINS so-called "ignorable" characters.
 * Ignorable characters are removed by javac silently during compilation and thus may appear only in specially crafted obfuscated classes.
 * For more information about "ignorable" characters see <a href="https://bugs.openjdk.java.net/browse/JDK-7144981">JDK-7144981</a>.
 *
 * @param identifier Identifier to be checked
 * @return {@code true} in case {@code identifier} passed can be used as an identifier; {@code false} otherwise.
 */
private static boolean isValidIdentifier(boolean isMethod, String identifier) {
 assert identifier != null : "Null identifier passed to the isValidIdentifier() method.";
 assert !identifier.isEmpty() : "Empty identifier passed to the isValidIdentifier() method.";
 if (isMethod && (identifier.equals(CodeConstants.INIT_NAME) || identifier.equals(CodeConstants.CLINIT_NAME))) {
  return true;
 }
 if (!Character.isJavaIdentifierStart(identifier.charAt(0))) {
  return false;
 }
 char[] chars = identifier.toCharArray();
 for(int i = 1; i < chars.length; i++) {
  char ch = chars[i];
  if ((!Character.isJavaIdentifierPart(ch)) || Character.isIdentifierIgnorable(ch)) {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Indicates whether the specified character is ignorable in a Java or
 * Unicode identifier.
 *
 * @param c
 *            the character to check.
 * @return {@code true} if {@code c} is ignorable; {@code false} otherwise.
 */
public static boolean isIdentifierIgnorable(char c) {
  return isIdentifierIgnorable((int) c);
}

代码示例来源:origin: com.itextpdf/io

public static boolean isNonPrintable(int c) {
  return Character.isIdentifierIgnorable(c) || c == '\u00AD';
}

代码示例来源:origin: bluestreak01/questdb

boolean isSatisfiedBy(int ch) {
    return Character.isIdentifierIgnorable(ch);
  }
});

代码示例来源:origin: itext/itext7

public static boolean isNonPrintable(int c) {
  return Character.isIdentifierIgnorable(c) || c == '\u00AD';
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

boolean isSatisfiedBy(int ch) {
    return Character.isIdentifierIgnorable(ch);}});
defClone("javaSpaceChar", new CloneableProperty() {

代码示例来源:origin: hltfbk/Excitement-Open-Platform

@Override
  public boolean is(char c){return (!Character.isSpaceChar(c))&&(!Character.isIdentifierIgnorable(c));}
}).toCharArray();

代码示例来源:origin: org.scala-js/closure-compiler-java-6

static boolean isJSIdentifier(String s) {
 int length = s.length();
 if (length == 0
   || Character.isIdentifierIgnorable(s.charAt(0))
   || !Character.isJavaIdentifierStart(s.charAt(0))) {
  return false;
 }
 for (int i = 1; i < length; i++) {
  if (Character.isIdentifierIgnorable(s.charAt(i))
    || !Character.isJavaIdentifierPart(s.charAt(i))) {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: org.bluestemsoftware.open.eoa.ext/ext-system-test

@Override
public void write(int c) throws IOException {
  if (Character.isWhitespace(c) || Character.isIdentifierIgnorable(c)) {
    return;
  } else {
    super.write(c);
  }
}

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

/**
   * Returns {@code true} if this subset contains the given Unicode character.
   */
  @Override
  public boolean contains(final int codePoint) {
    return Character.isUnicodeIdentifierPart(codePoint) &&
       !Character.isIdentifierIgnorable(codePoint);
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
   * Returns {@code true} if this subset contains the given Unicode character.
   */
  @Override
  public boolean contains(final int codePoint) {
    return Character.isUnicodeIdentifierPart(codePoint) &&
       !Character.isIdentifierIgnorable(codePoint);
  }
}

代码示例来源:origin: ggp-org/ggp-base

public boolean isPrintableChar( char c ) {
  if(!Character.isDefined(c)) return false;
  if(Character.isIdentifierIgnorable(c)) return false;
  return true;
}

代码示例来源:origin: org.gephi/directory-chooser

private boolean isCharForSearch (KeyEvent evt) {
  char ch = evt.getKeyChar();
  // refuse backspace key
  if ((int)ch == 8) {
    return false;
  }
  // #110975: refuse modifiers
  if (evt.getModifiers() != 0) {
    return false;
  }
  return (Character.isJavaIdentifierPart(ch) && !Character.isIdentifierIgnorable(ch)) 
      || Character.isSpaceChar(ch);
}

相关文章

Character类方法