本文整理了Java中com.google.gwt.dev.util.Util.isValidJavaIdent()
方法的一些代码示例,展示了Util.isValidJavaIdent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isValidJavaIdent()
方法的具体详情如下:
包路径:com.google.gwt.dev.util.Util
类名称:Util
方法名:isValidJavaIdent
暂无
代码示例来源:origin: net.wetheinter/gwt-user
private Property checkProperty(Property property) {
String[] tokens = (property.name() + ". ").split("\\.");
for (int i = 0; i < tokens.length - 1; i++) {
if (!Util.isValidJavaIdent(tokens[i])) {
throw new AssertionError(
"Property name invalid: " + property.name());
}
}
if (!Util.isValidJavaIdent(property.value())) {
throw new AssertionError(
"Property value invalid: " + property.value());
}
return property;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private Property checkProperty(Property property) {
String[] tokens = (property.name() + ". ").split("\\.");
for (int i = 0; i < tokens.length - 1; i++) {
if (!Util.isValidJavaIdent(tokens[i])) {
throw new AssertionError(
"Property name invalid: " + property.name());
}
}
if (!Util.isValidJavaIdent(property.value())) {
throw new AssertionError(
"Property value invalid: " + property.value());
}
return property;
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public String define(JType type, String name, String initializer,
boolean isStatic, boolean isFinal) {
assert Util.isValidJavaIdent(name) : name
+ " is not a valid Java identifier";
String ident = factory.createName(name);
StringBuilder sb = new StringBuilder();
sb.append("private ");
if (isStatic) {
sb.append("static ");
}
if (isFinal) {
sb.append("final ");
}
sb.append(type.getParameterizedQualifiedSourceName());
sb.append(" ");
sb.append(ident);
fieldsToDeclarations.put(ident, sb.toString());
if (initializer != null) {
fieldsToInitializers.put(ident, initializer);
}
return ident;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public String define(JType type, String name, String initializer,
boolean isStatic, boolean isFinal) {
assert Util.isValidJavaIdent(name) : name
+ " is not a valid Java identifier";
String ident = factory.createName(name);
StringBuilder sb = new StringBuilder();
sb.append("private ");
if (isStatic) {
sb.append("static ");
}
if (isFinal) {
sb.append("final ");
}
sb.append(type.getParameterizedQualifiedSourceName());
sb.append(" ");
sb.append(ident);
fieldsToDeclarations.put(ident, sb.toString());
if (initializer != null) {
fieldsToInitializers.put(ident, initializer);
}
return ident;
}
内容来源于网络,如有侵权,请联系作者删除!