当前位置: 首页>>代码示例>>Java>>正文


Java JField.isPublic方法代码示例

本文整理汇总了Java中com.google.gwt.core.ext.typeinfo.JField.isPublic方法的典型用法代码示例。如果您正苦于以下问题:Java JField.isPublic方法的具体用法?Java JField.isPublic怎么用?Java JField.isPublic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.core.ext.typeinfo.JField的用法示例。


在下文中一共展示了JField.isPublic方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFieldModifier

import com.google.gwt.core.ext.typeinfo.JField; //导入方法依赖的package包/类
private String getFieldModifier( JField field )
{
	ModifierBuilder mb = new ModifierBuilder();
	if( field.isPrivate() )
		mb.append( "2" );//"java.lang.reflect.Modifier.PRIVATE" );
	if( field.isProtected() )
		mb.append( "4" );//"java.lang.reflect.Modifier.PROTECTED" );
	if( field.isPublic() )
		mb.append( "1" );//"java.lang.reflect.Modifier.PUBLIC" );

	if( field.isStatic() )
		mb.append( "8" );//"java.lang.reflect.Modifier.STATIC" );
	if( field.isTransient() )
		mb.append( "128" );//"java.lang.reflect.Modifier.TRANSIENT" );
	if( field.isVolatile() )
		mb.append( "64" );//"java.lang.reflect.Modifier.VOLATILE" );
	if( field.isFinal() )
		mb.append( "16" );//"java.lang.reflect.Modifier.FINAL" );

	return mb.toString();
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:22,代码来源:ClazzInfoBuilder.java

示例2: writeValidateFieldCall

import com.google.gwt.core.ext.typeinfo.JField; //导入方法依赖的package包/类
private void writeValidateFieldCall(final SourceWriter sw,
    final PropertyDescriptor ppropertyDescription, final boolean useValue,
    final boolean honorValid) {
  final String propertyName = ppropertyDescription.getPropertyName();

  // validateProperty_<<field>>(context,
  sw.print(this.validateMethodFieldName(ppropertyDescription));
  sw.print("(context, ");
  sw.print("violations, ");

  // null, (MyType) value,
  // or
  // object, object.getLastName(),
  if (useValue) {
    sw.print("null, ");
    sw.print("(");
    sw.print(this.getQualifiedSourceNonPrimitiveType(
        this.beanHelper.getElementType(ppropertyDescription, true)));
    sw.print(") value");
  } else {
    sw.print("object, ");
    final JField field = this.beanType.getField(propertyName);
    if (field.isPublic()) {
      sw.print("object.");
      sw.print(propertyName);
    } else {
      this.fieldsToWrap.add(field);
      sw.print(this.toWrapperName(field) + "(object)");
    }
  }
  sw.print(", ");

  // honorValid, groups);
  sw.print(Boolean.toString(honorValid));
  sw.println(", groups);");
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:37,代码来源:GwtSpecificValidatorCreator.java

示例3: listPublicFields

import com.google.gwt.core.ext.typeinfo.JField; //导入方法依赖的package包/类
private void listPublicFields(JField[] fields) {
	for (JField field : fields) {
		if (field.isPublic() && !field.isFinal()) {
			this.publicFields.put(field.getName(), field.getType());
			this.propertyTypes.put(field.getName(), field.getType());
			this.addImport(field.getType());
		}
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:10,代码来源:ModelCreator.java

示例4: createImport

import com.google.gwt.core.ext.typeinfo.JField; //导入方法依赖的package包/类
/**
 * Process <code>&lt;ui:import field="com.example.Blah.CONSTANT"></code>.
 */
private void createImport(XMLElement elem) throws UnableToCompleteException {
  String rawFieldName = elem.consumeRequiredRawAttribute(FIELD_ATTRIBUTE);
  if (elem.getAttributeCount() > 0) {
    writer.die(elem, "Should only find attribute \"%s\"", FIELD_ATTRIBUTE);
  }

  int idx = rawFieldName.lastIndexOf('.');
  if (idx < 1) {
    writer.die(elem, "Attribute %s does not look like a static import "
        + "reference", FIELD_ATTRIBUTE);
  }
  String enclosingName = rawFieldName.substring(0, idx);
  String constantName = rawFieldName.substring(idx + 1);

  JClassType enclosingType = oracle.findType(enclosingName);
  if (enclosingType == null) {
    writer.die(elem, "Unable to locate type %s", enclosingName);
  }

  if ("*".equals(constantName)) {
    for (JField field : enclosingType.getFields()) {
      if (!field.isStatic()) {
        continue;
      } else if (field.isPublic()) {
        // OK
      } else if (field.isProtected() || field.isPrivate()) {
        continue;
      } else if (!enclosingType.getPackage().equals(
          writer.getOwnerClass().getOwnerType().getPackage())) {
        // package-protected in another package
        continue;
      }
      createSingleImport(elem, enclosingType, enclosingName + "."
          + field.getName(), field.getName());
    }
  } else {
    createSingleImport(elem, enclosingType, rawFieldName, constantName);
  }
}
 
开发者ID:ahome-it,项目名称:ahome-core,代码行数:43,代码来源:UiBinderParser.java

示例5: isFieldVisibleInJS

import com.google.gwt.core.ext.typeinfo.JField; //导入方法依赖的package包/类
/**
 * Return weather a given field is visible in JS (JsInterop).
 * It will be the case if it's public and it's class has the {@link JsType} annotation, or
 * if it has the {@link JsProperty} annotation.
 * @param field The field to check
 * @return true if it is visible (JsInterop), false otherwise
 */
public static boolean isFieldVisibleInJS(JField field)
{
    return (hasAnnotation(field.getEnclosingType(), JsType.class) && field.isPublic())
        || hasAnnotation(field, JsProperty.class);
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:13,代码来源:ComponentGenerationUtil.java


注:本文中的com.google.gwt.core.ext.typeinfo.JField.isPublic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。