Package org.geotools.xml

Examples of org.geotools.xml.SimpleBinding.encode()


                }
            }

            try {
                if(object != null) {
                    String value = simple.encode(object, (text != null) ? text.getData() : null);
   
                    if (value != null) {
                        //set the text of the node
                        if (text == null) {
                            text = document.createTextNode(value);
View Full Code Here


        if (binding instanceof SimpleBinding) {
            SimpleBinding simple = (SimpleBinding) binding;

            try {
                encoding.setValue(simple.encode(object, encoding.getValue()));
            } catch (Throwable t) {
                String msg = "Encode failed for " + attribute.getName() + ". Cause: "
                    + t.getLocalizedMessage();
                throw new RuntimeException(msg, t);
            }
View Full Code Here

        E parsed = (E) strategy.parse(element(toParse, qname), toParse);
        assertTrue(toEncode.getClass().equals(parsed.getClass()));

        assertEquals(parsed.getClass().getName(), toEncode, parsed);

        String encoded = strategy.encode(toEncode, null);
        assertEquals(expectedEncoding, encoded);
    }

    private Calendar calendar(Integer... values) {
        return calendar(TimeZone.getTimeZone("GMT"), values);
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.