Examples of FieldConfig


Examples of com.addthis.codec.annotations.FieldConfig

    /**
     * Decide whether it is okay to read/ write a field. If configured via an annotation on the field, use that.
     * Otherwise return true only if the field is both public and non-final.
     */
    private static boolean isCodable(Field field) {
        FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
        if (fieldConfigPolicy != null) {
            return fieldConfigPolicy.codable();
        }
        int modifierBitSet = field.getModifiers();
        return !Modifier.isFinal(modifierBitSet) && Modifier.isPublic(modifierBitSet);
    }
View Full Code Here

Examples of com.addthis.codec.annotations.FieldConfig

        SortedMap<String, CodableFieldInfo> buildClassData = new TreeMap<>();
        for (Field field : fields) {
            int mod = field.getModifiers();
            boolean store = ((mod & Modifier.FINAL) == 0) && ((mod & Modifier.PUBLIC) != 0);
            // extract annotations
            FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
            if (fieldConfigPolicy != null) {
                field.setAccessible(true);
                store |= fieldConfigPolicy.codable();
            }
            // field must be public and non-final or annotated with a store policy
            if (!store) {
                continue;
            }
View Full Code Here

Examples of com.addthis.codec.annotations.FieldConfig

        }
        for (Field field : fields.values()) {
            int mod = field.getModifiers();
            boolean store = ((mod & Modifier.FINAL) == 0) && ((mod & Modifier.PUBLIC) != 0);
            // extract annotations
            FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
            if (fieldConfigPolicy != null) {
                field.setAccessible(true);
                store |= fieldConfigPolicy.codable();
            }
            // field must be public and non-final or annotated with a store policy
            if (!store) {
                continue;
            }
View Full Code Here

Examples of com.alibaba.citrus.service.form.configuration.FieldConfig

    }

    @Test
    public void init_fieldConfig() throws Exception {
        V v = newValidatorFor_AbstractCompositeValidatorTests();
        FieldConfig fieldConfig = createMock(FieldConfig.class);
        Validator v1 = createMock(Validator.class);
        Validator v2 = createMock(Validator.class);
        Validator v3 = createMock(Validator.class);

        v1.init(fieldConfig);
View Full Code Here

Examples of com.alibaba.citrus.service.form.configuration.FieldConfig

            for (FieldConfig srcFieldConfig : srcGroupConfig.getFieldConfigList()) {
                mergeField((FieldConfigImpl) srcFieldConfig, checkDuplicate);
            }
        } else {
            // merge/import single field
            FieldConfig srcFieldConfig = srcGroupConfig.getFieldConfig(fieldName);
            assertNotNull(srcFieldConfig, "Field \"%s.%s\" not found", srcGroupConfig.getName(), fieldName);
            mergeField((FieldConfigImpl) srcFieldConfig, checkDuplicate);
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.service.form.configuration.FieldConfig

        GroupConfig groupConfig = getFormConfig().getGroupConfigByKey(groupKey);

        if (groupConfig != null) {
            groupKey = groupConfig.getKey();

            FieldConfig fieldConfig = groupConfig.getFieldConfigByKey(fieldKey);

            if (fieldConfig != null) {
                fieldKey = fieldConfig.getKey();
            }
        }

        String normalizedKey = FORM_KEY_PREFIX + FIELD_KEY_SEPARATOR + groupKey + FIELD_KEY_SEPARATOR + instanceKey
                               + FIELD_KEY_SEPARATOR + fieldKey;
View Full Code Here

Examples of com.alibaba.citrus.service.form.configuration.FieldConfig

            for (FieldConfig srcFieldConfig : srcGroupConfig.getFieldConfigList()) {
                mergeField((FieldConfigImpl) srcFieldConfig, checkDuplicate);
            }
        } else {
            // merge/import single field
            FieldConfig srcFieldConfig = srcGroupConfig.getFieldConfig(fieldName);
            assertNotNull(srcFieldConfig, "Field \"%s.%s\" not found", srcGroupConfig.getName(), fieldName);
            mergeField((FieldConfigImpl) srcFieldConfig, checkDuplicate);
        }
    }
View Full Code Here

Examples of de.odysseus.calyxo.forms.conf.FieldConfig

      getClass().getResource(VALIDATORS),
      getClass().getResource("test2.xml")
    };
    FormsRootConfig config = parser.parse(inputs);
    FormConfig form = config.findFormConfig("LoginForm", null);
    FieldConfig field = form.getFieldConfig("password");
    Iterator matchers = field.getMatchConfigs();

    MatchConfig notEmpty = (MatchConfig)matchers.next();
    assertEquals("notEmpty", notEmpty.getMatcherConfig().getId());

    MatchConfig regexp = (MatchConfig)matchers.next();
View Full Code Here

Examples of de.odysseus.calyxo.forms.conf.FieldConfig

    this.inputs = new HashMap();

    Iterator fieldConfigs = config.getFieldConfigs();
    if (fieldConfigs.hasNext()) {
      while (fieldConfigs.hasNext()) {
        FieldConfig fieldConfig = (FieldConfig)fieldConfigs.next();
        inputs.put(fieldConfig.getName(), new Field(factory, fieldConfig, locale));
      }
    }

    Iterator inputConfigs = config.getInputConfigs();
    if (inputConfigs.hasNext()) {
View Full Code Here

Examples of de.odysseus.calyxo.forms.conf.FieldConfig

  private Map getProperty() {
    if (property == null) {
      property = new MapFacade() {
        public Object get(Object key) {
          String property = (String)key;
          FieldConfig field = formResult.getFormConfig().findFieldConfig(property);
          if (field == null) {
            throw new NoSuchElementException("Bad property name: " + key);
          }
          FormInputResult result =
            formResult.getFormInputResult(field.getName());
          FormInput input = result.getFormInput();
          involvedInputs.add(input);
          if (!result.isValid()) {
            invalidPropertyReferenced = true;
            return null;
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.