Package org.apache.commons.io.output

Examples of org.apache.commons.io.output.StringBuilderWriter


            String pref = e.getKey();
            nss.declarePrefix(pref == null ? "" : pref, e.getValue());
        }
    }
    String getInsertUpdateRawMessage(Feature feature) {
        final StringBuilderWriter sw = new StringBuilderWriter();
        long start = System.nanoTime();
        boolean success = true;
        try {
            long modCount = catalogModCount.get();
            if(modCount != catalogModCountLocal.get().longValue()) {
                catalogModCountLocal.set(modCount);
                encoder.remove();
            }
           
            final Encoder encoder = this.encoder.get();

            TransformerHandler handler = STF.newTransformerHandler();
            handler.setResult(new StreamResult(sw));

            encoder.setInline(true);
            loadNamespaceBindings(encoder.getNamespaces(), feature, xmlConfig.getXSD().getSchema());
           
            encoder.encode(feature, GML._Feature, handler);

            return sw.toString();
        } catch(Exception e) {
            success = false;
            throw new WFSException(e);
        } finally {
            if(success) {
                double millis = ((double) System.nanoTime() - start) / 1000000;
                Name name = WFSNotify.getTypeName(feature);
                serializationMillis.add(millis);
                serializationChars.add(sw.getBuilder().length());
                Statistics statsByType = serializationMillisByType.get(name);
                if(statsByType == null) {
                    Statistics newStats = new Statistics();
                    statsByType = serializationMillisByType.put(name, newStats);
                    if(statsByType == null) {
View Full Code Here

TOP

Related Classes of org.apache.commons.io.output.StringBuilderWriter

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.