Examples of PropertyDescriptor


Examples of br.net.woodstock.rockframework.core.reflection.PropertyDescriptor

      if ((obj != null) && (obj instanceof Entity)) {
        Entity<?> entity = (Entity<?>) obj;

        BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(entity.getClass()).getBeanDescriptor();

        PropertyDescriptor propertyDescriptor = beanDescriptor.getProperty(EntityInterceptor.ENTITY_ID);
        Class<?> clazz = propertyDescriptor.getType();

        try {
          Constructor<?> contructor = clazz.getConstructor(new Class[] { String.class });
          Object fieldValue = contructor.newInstance(new Object[] { value });

          RockFrameworkLogger.getLogger().info("Setting entity ID " + entityName + "[" + fieldValue + "]");
          propertyDescriptor.setValue(entity, fieldValue);
        } catch (NoSuchMethodException e) {
          RockFrameworkLogger.getLogger().warn("Could not find constructor " + entity.getClass().getCanonicalName() + "(String). Parameter not setted");
        } catch (Exception e) {
          RockFrameworkLogger.getLogger().warn("Error in constructor " + entity.getClass().getCanonicalName() + "(String)");
          RockFrameworkLogger.getLogger().warn(e.getMessage(), e);
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.PropertyDescriptor

    for (Method method : c.getMethods()) {
      if (BeanDescriptorHelper.isValidGetterOrSetter(method)) {
        String propertyName = BeanDescriptorHelper.getPropertyName(method);
        if (!this.hasProperty(propertyName)) {
          Class<?> propertyType = BeanDescriptorHelper.getPropertyType(method);
          PropertyDescriptor property = new MethodPropertyDescriptor(this, propertyName, propertyType);
          if ((property.isReadable()) || (property.isWriteable())) {
            this.getProperties().add(property);
          }
        }
      }
    }
View Full Code Here

Examples of cc.catalysts.cdoclet.generator.velocity.PropertyDescriptor

    beginType(new EnumDescriptor(type));
  }

 
  public void beginGetter(Type classType, Type methodType, int modifier, Type returnType, String propertyName, String description, boolean override) {
    propertyDescriptor = new PropertyDescriptor(modifier, returnType, methodType, propertyName);
    propertyDescriptor.setGetter(true);
    propertyDescriptor.setOverride(override);
    propertyDescriptor.setDescription(description);
    typeDescriptor.addPropertyDescriptor(propertyDescriptor);
View Full Code Here

Examples of com.asakusafw.directio.hive.serde.PropertyDescriptor

        }
        Set<PropertyDescriptor> rest = new LinkedHashSet<PropertyDescriptor>(target.getPropertyDescriptors());
        List<Mapping> mappings = new ArrayList<Mapping>();
        for (ColumnDescriptor s : source.getColumns()) {
            String name = s.getPath()[0];
            PropertyDescriptor t = target.findPropertyDescriptor(name);
            if (t != null) {
                mappings.add(new Mapping(s, t));
                rest.remove(t);
            } else {
                mappings.add(new Mapping(s, null));
View Full Code Here

Examples of com.buschmais.jqassistant.plugin.java.api.model.PropertyDescriptor

        PropertyFileDescriptor propertyFileDescriptor = store.create(PropertyFileDescriptor.class);
        Properties properties = new Properties();
        properties.load(item);
        for (String name : properties.stringPropertyNames()) {
            String value = properties.getProperty(name);
            PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
            propertyDescriptor.setName(name);
            propertyDescriptor.setValue(value);
            propertyFileDescriptor.getProperties().add(propertyDescriptor);
        }
        propertyFileDescriptor.setFileName(path);
        return asList(propertyFileDescriptor);
    }
View Full Code Here

Examples of com.buschmais.jqassistant.plugin.java.impl.store.descriptor.PropertyDescriptor

        propertyFileDescriptor.setFileName(filename);
        Properties properties = new Properties();
        properties.load(streamSource.getInputStream());
        for (String name : properties.stringPropertyNames()) {
            String value = properties.getProperty(name);
            PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
            propertyDescriptor.setName(name);
            propertyDescriptor.setValue(value);
            propertyFileDescriptor.getProperties().add(propertyDescriptor);
        }
        return propertyFileDescriptor;
    }
View Full Code Here

Examples of com.dragome.forms.bindings.client.bean.PropertyDescriptor

      if (descriptor == null)
      {
        // this will call "re-entrant-ly" till we hit the rootDescriptor from
        // which point the path gets built from the bottom up.
        PropertyDescriptor beanDescriptor= createPropertyDescriptor(beanPath);

        Class parentBeanType= beanDescriptor.getValueType();

        ensureLegalNestedType(parentBeanType);

        descriptor= new BeanDescriptor(parentBeanType);
View Full Code Here

Examples of com.eviware.soapui.support.components.JPropertiesTable.PropertyDescriptor

            attach();
            fireTableDataChanged();
        }

        public PropertyDescriptor addProperty(String caption, String name, boolean editable, PropertyFormatter formatter) {
            PropertyDescriptor propertyDescriptor = new PropertyDescriptor(caption, name, editable, formatter);
            properties.add(propertyDescriptor);
            return propertyDescriptor;
        }
View Full Code Here

Examples of com.google.collide.client.code.debugging.DebuggerApiTypes.PropertyDescriptor

      return;
    }

    JsonArray<PropertyDescriptor> properties = response.getProperties();
    for (int i = 0, n = properties.size(); i < n; ++i) {
      PropertyDescriptor property = properties.get(i);
      boolean isGetterOrSetter =
          (property.getGetterFunction() != null || property.getSetterFunction() != null);
      if (isGetterOrSetter) {
        if (property.getGetterFunction() != null) {
          RemoteObjectNode child = RemoteObjectNode.createGetterProperty(
              property.getName(), property.getGetterFunction());
          appendNewNode(parentNode, child);
        }
        if (property.getSetterFunction() != null) {
          RemoteObjectNode child = RemoteObjectNode.createSetterProperty(
              property.getName(), property.getSetterFunction());
          appendNewNode(parentNode, child);
        }
      } else if (property.getValue() != null) {
        RemoteObjectNode child =
            new RemoteObjectNode.Builder(property.getName(), property.getValue())
                .setWasThrown(property.wasThrown())
                .setDeletable(property.isConfigurable())
                .setWritable(property.isWritable())
                .setEnumerable(property.isEnumerable())
                .build();
        appendNewNode(parentNode, child);
      }
    }
View Full Code Here

Examples of com.googlecode.mjorm.PropertyDescriptor

          hints.put(hint.name(), hint.stringValue());
        }
      }

      // create the PropertyDescriptor
      PropertyDescriptor prop = new PropertyDescriptor();
      prop.setName(pd.getName());
      prop.setFieldName(propField);
      prop.setGetter(pd.getReadMethod());
      prop.setSetter(pd.getWriteMethod());
      prop.setIdentifier(propIsIdentifier);
      prop.setType(JavaType.fromType(propType));
      prop.setAutoGenerated(propIsAutoGen);
      prop.setConversionHints(hints);
      prop.setGenericParameterTypes(genericParameterTypes);
      if (propIsAutoGen) {
        ValueGenerator<?> valueGenerator = null;
        if (valueGeneratorClass==null) {
          valueGenerator = ObjectIdValueGenerator.INSTANCE;
          storageType =  ObjectId.class;
        } else {
          try {
            valueGenerator = ValueGenerator.class.cast(valueGeneratorClass.newInstance());
          } catch(Exception e) {
            throw new IllegalArgumentException(
              "Unable to create ValueGenerator for "+valueGeneratorClass.getName(), e);
          }
        }
        prop.setValueGenerator(valueGenerator);
      }

      // set the storage type
      if (storageType!=null) {
        prop.setStorageType(JavaType.fromType(storageType));
      }

      // add to descriptor
      desc.addPropertyDescriptor(prop);
    }
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.