Package org.vaadin.teemu.clara.inflater.parser

Examples of org.vaadin.teemu.clara.inflater.parser.AttributeParser


        try {
            for (Map.Entry<String, String> attribute : attributes.entrySet()) {
                Method writeMethod = getWriteMethod(attribute.getKey(),
                        container.getClass());
                if (writeMethod != null) {
                    AttributeParser parser = getParserFor(writeMethod
                            .getParameterTypes()[1]);
                    if (parser != null) {
                        invokeWithAttributeFilters(writeMethod, container,
                                component, parser.getValueAs(
                                        attribute.getValue(),
                                        writeMethod.getParameterTypes()[1],
                                        component));
                    }
                }
View Full Code Here


                if (setter != null) {
                    if (setter.getParameterTypes().length == 0) {
                        // Setter method without any parameters.
                        setter.invoke(component);
                    } else {
                        AttributeParser parser = getParserFor(setter
                                .getParameterTypes()[0]);
                        if (parser != null) {
                            // We have a handler that knows how to handle
                            // conversion
                            // for this property.
                            String attributeValue = attribute.getValue();
                            if (attributeValue == null
                                    || attributeValue.length() == 0) {
                                // No need for conversion.
                                invokeWithAttributeFilters(setter, component,
                                        attributeValue);
                            } else {
                                // Ask the AttributeHandler to convert the
                                // value.
                                invokeWithAttributeFilters(setter, component,
                                        parser.getValueAs(attributeValue,
                                                setter.getParameterTypes()[0],
                                                component));
                            }
                        }
                    }
View Full Code Here

        }

        @Override
        public int compare(Method method1, Method method2) {
            // Check for parsers.
            AttributeParser parser1 = getParserFor(getPropertyClass(method1));
            AttributeParser parser2 = getParserFor(getPropertyClass(method2));
            if (isSpecialAttributeParser(parser1)
                    && !isSpecialAttributeParser(parser2)) {
                return -1;
            }
            if (isSpecialAttributeParser(parser2)
View Full Code Here

TOP

Related Classes of org.vaadin.teemu.clara.inflater.parser.AttributeParser

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.