Examples of PropertyName


Examples of atg.droplet.PropertyName

      if (mBeanSpecified) {
        // Resolve the bean name against the imports
        mBean = ImportedBeans.resolveName (mBean, mPageContext);

        // Compute the property name
        PropertyName propertyName = PropertyName.createPropertyName (mBean);

        // Compute the string name, which must be calculated specially
        // if the bean is an array reference
        String nameString =
          (mBean.indexOf ('[') >= 0) ?
View Full Code Here

Examples of atg.droplet.PropertyName

      // Resolve the bean name against the imports
      mBean = ImportedBeans.resolveName (mBean, mPageContext);

      // Compute the property name
      PropertyName propertyName = PropertyName.createPropertyName (mBean);

      // Compute the string name, which must be calculated specially
      // if the bean is an array reference
      String nameString =
  (mBean.indexOf ('[') >= 0) ?
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

        Map<PropertyName, Method> results = new TreeMap<PropertyName, Method>();
        for (Method method : modelClass.getMethods()) {
            if (VALUE_DRIVERS.containsKey(method.getReturnType()) == false) {
                continue;
            }
            PropertyName property = getPropertyNameIfAccessor(method);
            if (property == null) {
                continue;
            }
            results.put(property, method);
        }

        PropertyOrder annotation = modelClass.getAnnotation(PropertyOrder.class);
        if (annotation == null) {
            LOG.info("Annotation {} is not defined in {}",
                    PropertyOrder.class.getSimpleName(),
                    modelClass.getName());
            return results;
        }
        Map<PropertyName, Method> ordered = new LinkedHashMap<PropertyName, Method>();
        for (String name : annotation.value()) {
            String[] words = name.split("(_|-)+");
            PropertyName propertyName = PropertyName.newInstance(words);
            Method method = results.remove(propertyName);
            if (method == null) {
                LOG.warn("Property {} is not found in {}", name, modelClass.getName());
            } else {
                ordered.put(propertyName, method);
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    @Override
    public DataModelReflection toReflection(T object) {
        Builder<T> builder = newReflection();
        try {
            for (Map.Entry<PropertyName, Method> entry : accessors.entrySet()) {
                PropertyName property = entry.getKey();
                Method accessor = entry.getValue();
                Object value = get(object, accessor);
                builder.add(property, value);
            }
        } catch (Exception e) {
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    @Override
    public T toObject(DataModelReflection reflection) {
        try {
            T instance = modelClass.newInstance();
            for (Map.Entry<PropertyName, Method> entry : accessors.entrySet()) {
                PropertyName property = entry.getKey();
                Method accessor = entry.getValue();
                Object value = reflection.getValue(property);
                set(instance, accessor, value);
            }
            return instance;
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    }

    private Map<PropertyName, Field> collectProperties() {
        Map<PropertyName, Field> results = new HashMap<PropertyName, Field>();
        for (Field field : modelClass.getDeclaredFields()) {
            PropertyName name = extract(field);
            if (name != null) {
                results.put(name, field);
            }
        }
        return Collections.unmodifiableMap(results);
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    @Override
    public DataModelReflection toReflection(T object) {
        Builder<T> builder = newReflection();
        for (Map.Entry<PropertyName, Field> entry : fields.entrySet()) {
            PropertyName name = entry.getKey();
            Field field = entry.getValue();
            try {
                Object value = field.get(object);
                builder.add(name, value);
            } catch (IllegalAccessException e) {
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    @Override
    public T toObject(DataModelReflection reflection) {
        try {
            T instance = modelClass.newInstance();
            for (Map.Entry<PropertyName, Field> entry : fields.entrySet()) {
                PropertyName name = entry.getKey();
                Field field = entry.getValue();
                Object value = reflection.getValue(name);
                try {
                    field.set(instance, value);
                } catch (IllegalAccessException e) {
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

    public Property property(String name) {
        if (name == null) {
            throw new IllegalArgumentException("name must not be null"); //$NON-NLS-1$
        }
        String[] words = name.split("_|-|\\s+");
        PropertyName propertyName = PropertyName.newInstance(words);
        PropertyType type = definition.getType(propertyName);
        if (type == null) {
            throw new IllegalArgumentException(MessageFormat.format(
                    "\"{0}\"にプロパティ\"{1}\"は定義されていません",
                    definition.getModelClass().getName(),
View Full Code Here

Examples of com.asakusafw.testdriver.core.PropertyName

        assert definition != null;
        assert columnNames != null;
        Map<String, PropertyName> allMapping = extractAllMappings();
        Map<String, PropertyName> results = new LinkedHashMap<String, PropertyName>();
        for (String column : columnNames) {
            PropertyName propertyName = allMapping.get(column);
            if (propertyName == null) {
                LOG.warn(MessageFormat.format(
                        "カラム{0}.{1}に対応するプロパティが{2}に見つかりませんでした。このカラムをスキップします",
                        tableName,
                        column,
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.