Java Code Examples for org.apache.ibatis.reflection.SystemMetaObject#NULL_META_OBJECT

The following examples show how to use org.apache.ibatis.reflection.SystemMetaObject#NULL_META_OBJECT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapWrapper.java    From mybaties with Apache License 2.0 6 votes vote down vote up
@Override
public Class<?> getSetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getSetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
Example 2
Source File: MapWrapper.java    From mybaties with Apache License 2.0 6 votes vote down vote up
@Override
public Class<?> getGetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getGetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
Example 3
Source File: MapWrapper.java    From mybaties with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (map.containsKey(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return true;
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return map.containsKey(prop.getName());
  }
}
 
Example 4
Source File: BeanWrapper.java    From mybaties with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasSetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasSetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasSetter(name);
      } else {
        return metaValue.hasSetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasSetter(name);
  }
}
 
Example 5
Source File: BeanWrapper.java    From mybaties with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasGetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasGetter(name);
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasGetter(name);
  }
}
 
Example 6
Source File: MapWrapper.java    From mybatis with Apache License 2.0 6 votes vote down vote up
@Override
public Class<?> getSetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getSetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
Example 7
Source File: MapWrapper.java    From mybatis with Apache License 2.0 6 votes vote down vote up
@Override
public Class<?> getGetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return Object.class;
    } else {
      return metaValue.getGetterType(prop.getChildren());
    }
  } else {
    if (map.get(name) != null) {
      return map.get(name).getClass();
    } else {
      return Object.class;
    }
  }
}
 
Example 8
Source File: MapWrapper.java    From mybatis with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (map.containsKey(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return true;
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return map.containsKey(prop.getName());
  }
}
 
Example 9
Source File: BeanWrapper.java    From mybatis with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasSetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasSetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasSetter(name);
      } else {
        return metaValue.hasSetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasSetter(name);
  }
}
 
Example 10
Source File: BeanWrapper.java    From mybatis with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasGetter(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    if (metaClass.hasGetter(prop.getIndexedName())) {
      MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
      if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
        return metaClass.hasGetter(name);
      } else {
        return metaValue.hasGetter(prop.getChildren());
      }
    } else {
      return false;
    }
  } else {
    return metaClass.hasGetter(name);
  }
}
 
Example 11
Source File: BeanWrapper.java    From mybaties with Apache License 2.0 5 votes vote down vote up
@Override
public Class<?> getSetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return metaClass.getSetterType(name);
    } else {
      return metaValue.getSetterType(prop.getChildren());
    }
  } else {
    return metaClass.getSetterType(name);
  }
}
 
Example 12
Source File: BeanWrapper.java    From mybaties with Apache License 2.0 5 votes vote down vote up
@Override
public Class<?> getGetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return metaClass.getGetterType(name);
    } else {
      return metaValue.getGetterType(prop.getChildren());
    }
  } else {
    return metaClass.getGetterType(name);
  }
}
 
Example 13
Source File: BeanWrapper.java    From mybatis with Apache License 2.0 5 votes vote down vote up
@Override
public Class<?> getSetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return metaClass.getSetterType(name);
    } else {
      return metaValue.getSetterType(prop.getChildren());
    }
  } else {
    return metaClass.getSetterType(name);
  }
}
 
Example 14
Source File: BeanWrapper.java    From mybatis with Apache License 2.0 5 votes vote down vote up
@Override
public Class<?> getGetterType(String name) {
  PropertyTokenizer prop = new PropertyTokenizer(name);
  if (prop.hasNext()) {
    MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName());
    if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
      return metaClass.getGetterType(name);
    } else {
      return metaValue.getGetterType(prop.getChildren());
    }
  } else {
    return metaClass.getGetterType(name);
  }
}