Examples of ToValueConvertor


Examples of org.gocha.types.ToValueConvertor

            String key = propertyPrefix==null ? propName : propertyPrefix + propName;
            String textValue = getProperty(key);
            if( textValue==null )continue;

            ToValueConvertor conv = convertors.toValueFor(vc.getType());
            if( conv==null )continue;

            try{
                Object objValue = conv.convertToValue(textValue);
                if( objValue==null )continue;
                vc.setValue(objValue);
                restoreCount++;
            }catch(Throwable e){
                Logger.getLogger(GuiKeeper.class.getName()).log(Level.WARNING,null,e);
View Full Code Here

Examples of org.gocha.types.ToValueConvertor

            if( debug )System.out.println("vcMap not has "+attrName.toLowerCase());
            return;
        }
        ValueController vc = vcMap.get(attrName.toLowerCase());

        ToValueConvertor conv = getTypesConvertors().toValueFor(vc.getType());

        if( conv==null )
            return;

        Object destValue = null;
        try
        {
            destValue = conv.convertToValue(attrValue);
            vc.setValue(destValue);

            if( debug )System.out.println("attr Setted");
        }
        catch(Throwable e)
View Full Code Here

Examples of org.gocha.types.ToValueConvertor

    {
        String keyAttr = getKeyMapAttribute();
        Class keyClass = getKeyMapClass();

        TypesConverters conv = DefaultTypesConvertors.instance();
        ToValueConvertor toValue = keyClass==null ? null : conv.toValueFor(keyClass);

        if( !parentNode.hasChildNodes() ||
            !(parentObject instanceof Map) ||
            keyAttr==null || keyAttr.length()<1 ||
            keyClass==null ||
            toValue==null
          )
        {
            onChildrenAdded(parentObject);
            return;
        }

        NodeList nl = parentNode.getChildNodes();

        int count = nl.getLength();
        for( int i=0; i<count; i++ )
        {
            Node childNode = nl.item(i);
            if( childNode==null )continue;
            if( !childNode.hasAttributes() )continue;

            Node keyNode = childNode.getAttributes().getNamedItem(keyAttr);
            if( keyNode==null )continue;

            String keyValueString = keyNode.getNodeValue();
            if( keyValueString==null )continue;

            try
            {
                Object keyObject = toValue.convertToValue(keyValueString);
                if( keyObject==null )continue;

                Object childObject = parse(childNode);
                if( childObject!=null )
                {
View Full Code Here

Examples of org.gocha.types.ToValueConvertor

            String key = propertyPrefix==null ? propName : propertyPrefix + propName;
            String textValue = getProperty(key);
            if( textValue==null )continue;

            ToValueConvertor conv = convertors.toValueFor(vc.getType());
            if( conv==null )continue;

            try{
                Object objValue = conv.convertToValue(textValue);
                if( objValue==null )continue;
                vc.setValue(objValue);
                restoreCount++;
            }catch(Throwable e){
                Logger.getLogger(GuiKeeper.class.getName()).log(Level.WARNING,null,e);
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.