Package com.gwtent.reflection.client

Examples of com.gwtent.reflection.client.Field


  }
 
  private static ClassType getClassTypeBySubPath(ClassType parent, String path, String fullPath){
    String typeName = null;
    if (! isMethod(path)){
      Field field = parent.findField(path);
      if (field != null)
        typeName = field.getTypeName();
    }else{
      Method method = parent.findMethod(path, new String[0]);
     
      if (method != null)
        typeName = method.getReturnTypeName();
View Full Code Here


 
  private static Object getInstanceBySubPath(Object instance, String path, String fullPath){
    Object object = null;
    ClassType parent = TypeOracle.Instance.getClassType(instance.getClass());
    if (! isMethod(path)){
      Field field = parent.findField(path);
      if (field == null)
        pathNotFound(path, fullPath);
     
      object = field.getFieldValue(instance);
    }else{
      Method method = parent.findMethod(path, new String[0]);
      if (method == null)
        pathNotFound(path, fullPath);
     
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.gwtent.client.reflection.ClassType#findField(java.lang.String)
   */
  public Field findField(String name) {
    Field field = fields.get(name);
    if (field == null && this.getSuperclass() != null)
      field = this.getSuperclass().findField(name);

    return field;
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.gwtent.client.reflection.ClassType#getField(java.lang.String)
   */
  public Field getField(String name) {
    Field field = findField(name);
    // assert (field != null);
    return field;
  }
View Full Code Here

  }

  // sxf add
  public Object getFieldValue(Object instance, String fieldName) throws FieldIllegalAccessException {
    // no need to call findField(),because we don't want field in super class
    Field field = fields.get(fieldName);
    if (field != null && field.isPrivate()) {
      throw new FieldIllegalAccessException(getName() + "." + fieldName + " is private,can't access");
    }
    if (this.getSuperclass() != null)
      return getSuperclass().getFieldValue(instance, fieldName);
    else
View Full Code Here

  // sxf add
  public void setFieldValue(Object instance, String fieldName, Object value) throws FieldIllegalAccessException {

    // no need to call findField(),because we don't want field in super class
    Field field = fields.get(fieldName);
    if (field != null && field.isPrivate()) {
      throw new FieldIllegalAccessException(getName() + "." + fieldName + " is private,can't access");
    }
    if (field != null && field.isFinal()) {
      throw new FieldIllegalAccessException(getName() + "." + fieldName + " is final,can't access");
    }

    if (this.getSuperclass() != null)
      getSuperclass().setFieldValue(instance, fieldName, value);
View Full Code Here

TOP

Related Classes of com.gwtent.reflection.client.Field

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.