Package javolution.text

Examples of javolution.text.TextFormat


            if (cfg == null)
                continue;
            // Use the default value to retrieve the configurable type
            // and the associated textual format.
            Class type = cfg.getDefault().getClass();
            TextFormat format = TextFormat.getInstance(type);
            if (!format.isParsingSupported()) {
                LogContext.error("Cannot find suitable TextFormat to parse instances of " + type);
                continue;
            }
            Object newValue = format.parse(Configurable.toCsq(textValue));
            Configurable.configure(cfg, newValue);
        }
    }
View Full Code Here


            CharArray value = getAttribute(name);
            if (value == null)
                return defaultValue;
            // Parses attribute value.
            Class type = defaultValue.getClass();
            TextFormat format = TextFormat.getInstance(type);
            if (!format.isParsingSupported())
                throw new XMLStreamException("No TextFormat instance for " + type);
            return ( T ) format.parse(value);
        }
View Full Code Here

        public void setAttribute(String name, Object value)
                throws XMLStreamException {
            if (value == null)
                return;
            Class type = value.getClass();
            TextFormat format = TextFormat.getInstance(type);
            setAttribute(name, (TextBuilder) format.format(value,
                    _tmpTextBuilder.clear()));
        }
View Full Code Here

TOP

Related Classes of javolution.text.TextFormat

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.