Package org.kite9.framework.serialization

Examples of org.kite9.framework.serialization.XMLHelper$Field


    }

    @Test
    public void record_error_for_field()
    {
        Field field = newFieldWithControlName("field");

        replay();

        ValidationTracker tracker = new ValidationTrackerImpl();
View Full Code Here


    @Test
    public void unsassoicated_errors_listed_first() {

        ValidationTracker tracker = new ValidationTrackerImpl();

        Field field = newFieldWithControlName("field");

        replay();

        tracker.recordError(field, "one");
View Full Code Here

    }

    @Test
    public void data_survives_serialization() throws Exception
    {
        Field fielda = newFieldWithControlName("fieldA");
        Field fieldb = newFieldWithControlName("fieldB");
        Field fieldc = newFieldWithControlName("fieldC");

        replay();

        ValidationTracker tracker = new ValidationTrackerImpl();
View Full Code Here

    }

    @Test
    public void clear_removes_all()
    {
        Field fielda = newFieldWithControlName("fieldA");
        Field fieldb = newFieldWithControlName("fieldB");

        replay();

        ValidationTracker tracker = new ValidationTrackerImpl();
View Full Code Here

        verify();
    }

    private final Field newFieldWithControlName(String controlName)
    {
        Field field = mockField();

        // Fields generated this way, for the purposes of this test, do not
        // ever change their controlName. In real life, elementNames can change.

        expect(field.getControlName()).andReturn(controlName).atLeastOnce();

        return field;
    }
View Full Code Here

    public FieldTranslator createDefaultTranslator(ComponentResources resources, String parameterName)
    {
        assert resources != null;
        assert InternalUtils.isNonBlank(parameterName);
        Field field = (Field) resources.getComponent();
        Class propertyType = resources.getBoundType(parameterName);

        return createDefaultTranslator(field, resources.getId(), resources.getContainerMessages(),
                null, propertyType, resources.getAnnotationProvider(parameterName));
    }
View Full Code Here

    public FieldTranslator createTranslator(ComponentResources resources, String translatorName)
    {
        assert resources != null;
        assert InternalUtils.isNonBlank(translatorName);
        Field field = (Field) resources.getComponent();

        Translator translator = translatorSource.get(translatorName);

        return createTranslator(field, resources.getId(), resources.getContainerMessages(), null, translator);
    }
View Full Code Here

        if (!Field.class.isInstance(fieldAsObject))
            throw new TapestryException(BindingsMessages.validateBindingForFieldsOnly(component),
                                        location, null);

        Field field = (Field) fieldAsObject;

        // The expression is a validator specification, such as "required,minLength=5".
        // ValidatorBindingFactory is the odd man out becasuse it needs the binding component (the
        // component whose parameter is to be bound) rather than the containing component, the way
        // most factories work.
View Full Code Here

    }

    @Test
    public void add_validations()
    {
        Field barney = mockField();
        ClientBehaviorSupport clientBehaviorSupport = mockClientBehaviorSupport();

        clientBehaviorSupport.addValidation(barney, "required", "Who can live without Barney?", null);

        replay();
View Full Code Here

    }

    @Test
    public void add_validation_when_client_validation_is_disabled()
    {
        Field barney = mockField();
        ClientBehaviorSupport clientBehaviorSupport = mockClientBehaviorSupport();

        replay();

        FormSupportImpl support = new FormSupportImpl(null, null, clientBehaviorSupport, false);
View Full Code Here

TOP

Related Classes of org.kite9.framework.serialization.XMLHelper$Field

Copyright © 2018 www.massapicom. 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.