Package com.google.gwt.core.ext.typeinfo

Examples of com.google.gwt.core.ext.typeinfo.JClassType.findMethod()


      generateCloneFields(beanType.getSuperclass());
      JField[] fields = beanType.getFields();
      for(JField field : fields) {
        JClassType targetType = beanType;
        String capFieldName = capitalize(field.getName());
        JMethod getter = targetType.findMethod("get"+capFieldName, new JType[0]);
        if(getter == null) getter = targetType.findMethod("is"+capFieldName, new JType[0]);
        JType type = field.getType();
        JMethod setter = targetType.findMethod("set"+capFieldName, new JType[]{type});
        if(getter != null && setter != null) {
          String copyValue = "src."+getter.getName()+"()";
View Full Code Here


      JField[] fields = beanType.getFields();
      for(JField field : fields) {
        JClassType targetType = beanType;
        String capFieldName = capitalize(field.getName());
        JMethod getter = targetType.findMethod("get"+capFieldName, new JType[0]);
        if(getter == null) getter = targetType.findMethod("is"+capFieldName, new JType[0]);
        JType type = field.getType();
        JMethod setter = targetType.findMethod("set"+capFieldName, new JType[]{type});
        if(getter != null && setter != null) {
          String copyValue = "src."+getter.getName()+"()";
         
View Full Code Here

        JClassType targetType = beanType;
        String capFieldName = capitalize(field.getName());
        JMethod getter = targetType.findMethod("get"+capFieldName, new JType[0]);
        if(getter == null) getter = targetType.findMethod("is"+capFieldName, new JType[0]);
        JType type = field.getType();
        JMethod setter = targetType.findMethod("set"+capFieldName, new JType[]{type});
        if(getter != null && setter != null) {
          String copyValue = "src."+getter.getName()+"()";
         
          copyValue = copyField(type, copyValue, capFieldName);
          sw.println("dest.set"+capFieldName+"("+copyValue+");");
View Full Code Here

      generateGetDifferences(beanType.getSuperclass(), firstObject, secondObject);
      JField[] fields = beanType.getFields();
      for(JField field : fields) {
        JClassType targetType = beanType;
        String capFieldName = capitalize(field.getName());
        JMethod getter = targetType.findMethod("get"+capFieldName, new JType[0]);
        if(getter == null) getter = targetType.findMethod("is"+capFieldName, new JType[0]);
        JType type = field.getType();
        if(getter != null) {
          String firstValue = firstObject+"."+getter.getName()+"()";
          String secondValue = secondObject+"."+getter.getName()+"()";
View Full Code Here

      JField[] fields = beanType.getFields();
      for(JField field : fields) {
        JClassType targetType = beanType;
        String capFieldName = capitalize(field.getName());
        JMethod getter = targetType.findMethod("get"+capFieldName, new JType[0]);
        if(getter == null) getter = targetType.findMethod("is"+capFieldName, new JType[0]);
        JType type = field.getType();
        if(getter != null) {
          String firstValue = firstObject+"."+getter.getName()+"()";
          String secondValue = secondObject+"."+getter.getName()+"()";
          generateCompareValue(field.getName(), type, firstValue,
View Full Code Here

      }
     
      // Deep copy objects
      JClassType cls = type.isClassOrInterface();
      if(cls != null) {
          if(cls.findMethod("clone", new JType[0]) != null) {
            copyValue = "("+cls.getParameterizedQualifiedSourceName()+") "+copyValue;
          } else {
            beanTypes.add(cls);
            copyValue = "clone("+copyValue+")";
          }
View Full Code Here

    JClassType jClass = beanHelper.getJClass();
    if (useField &&
        jClass.findField(p.getPropertyName()).isAnnotationPresent(Valid.class)) {
      return true;
    } else if (!useField &&
        jClass.findMethod(asGetter(p),NO_ARGS).isAnnotationPresent(Valid.class)) {
      return true;
    }
    // for non-cascaded properties
    for (ConstraintDescriptor<?> constraint : p.getConstraintDescriptors()) {
      org.hibernate.validator.metadata.ConstraintDescriptorImpl<?> constraintHibernate =
View Full Code Here

    JClassType customSerializer = serializationOracle.hasCustomFieldSerializer(type);
    if (customSerializer == null) {
      return false;
    }

    JMethod customInstantiate = customSerializer.findMethod(
        "instantiate",
        new JType[] {typeOracle.findType(SerializationStreamReader.class.getName())});
    if (customInstantiate != null) {
      return false;
    }
View Full Code Here

     * We want to allow the user to override some of the useful Object methods,
     * so we'll extract them here.
     */
    JClassType objectType = oracle.getJavaLangObject();
    objectMethods = Arrays.asList(
        objectType.findMethod("equals", new JType[] {objectType}),
        objectType.findMethod("hashCode", EMPTY_JTYPE),
        objectType.findMethod("toString", EMPTY_JTYPE));

    // Process annotations
    {
View Full Code Here

     * so we'll extract them here.
     */
    JClassType objectType = oracle.getJavaLangObject();
    objectMethods = Arrays.asList(
        objectType.findMethod("equals", new JType[] {objectType}),
        objectType.findMethod("hashCode", EMPTY_JTYPE),
        objectType.findMethod("toString", EMPTY_JTYPE));

    // Process annotations
    {
      Category categoryAnnotation = factoryType.getAnnotation(Category.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.