Package org.exist.storage.serializers

Examples of org.exist.storage.serializers.Serializer.reset()


        final SAXResult result = new SAXResult(builderReceiver);
        result.setLexicalHandler(builderReceiver);    //preserve comments etc... from xslt output
        handler.setResult(result);
            final Receiver receiver = new ReceiverToSAX(handler);
            final Serializer serializer = context.getBroker().getSerializer();
            serializer.reset();
            try {
                serializer.setProperties(serializationProps);
                serializer.setReceiver(receiver, true);
                if (expandXIncludes) {
                    String xipath = serializationProps.getProperty(EXistOutputKeys.XINCLUDE_PATH);
View Full Code Here


            try {
                final OutputStream os = new BufferedOutputStream(response.getOutputStream());
                final StreamResult result = new StreamResult(os);
                handler.setResult(result);
                final Serializer serializer = context.getBroker().getSerializer();
                serializer.reset();
                Receiver receiver = new ReceiverToSAX(handler);
                try {
                    serializer.setProperties(serializationProps);
                    if (expandXIncludes) {
                        XIncludeFilter xinclude = new XIncludeFilter(serializer, receiver);
View Full Code Here

            factory.setErrorListener(errorListener);
      final TemplatesHandler handler = factory.newTemplatesHandler();
      try {
        handler.startDocument();
        final Serializer serializer = context.getBroker().getSerializer();
        serializer.reset();
        serializer.setSAXHandlers(handler, null);
        serializer.toSAX(stylesheet);
        handler.endDocument();
        final Templates t = handler.getTemplates();
                errorListener.checkForErrors();
View Full Code Here

            final SAXResult result = new SAXResult(sax);
            handler.setResult(result);
           
            final Serializer serializer = broker.getSerializer();
            serializer.reset();
           
            Receiver receiver = new ReceiverToSAX(handler);
            try {
                XIncludeFilter xinclude = new XIncludeFilter(serializer, receiver);
                receiver = xinclude;
View Full Code Here

        } else {
            // xml resource

            SAXSerializer sax = null;
            final Serializer serializer = broker.getSerializer();
            serializer.reset();

            //setup the http context
            final HttpContext httpContext = serializer.new HttpContext();
            final HttpRequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
            httpContext.setRequest(reqw);
View Full Code Here

        final int start, final boolean typed, final Properties outputProperties,
        final boolean wrap) throws BadRequestException {
       
        // serialize the results to the response output stream
        final Serializer serializer = broker.getSerializer();
        serializer.reset();
        outputProperties.setProperty(Serializer.GENERATE_DOC_EVENTS, "false");
        SAXSerializer sax = null;
        try {
            sax = (SAXSerializer) SerializerPool.getInstance().borrowObject(
                    SAXSerializer.class);
View Full Code Here

        } else {
            howmany = 0;
        }

        final Serializer serializer = broker.getSerializer();
        serializer.reset();
        outputProperties.setProperty(Serializer.GENERATE_DOC_EVENTS, "false");
        try {
            serializer.setProperties(outputProperties);
            final Writer writer = new OutputStreamWriter(response.getOutputStream(), outputProperties.getProperty(OutputKeys.ENCODING));
            final JSONObject root = new JSONObject();
View Full Code Here

        try {
          db = BrokerPool.getInstance();
          broker = db.get(null);
         
            serializer = broker.getSerializer();
            serializer.reset();
           
            final OutputStream sout = response.getOutputStream();
            final PrintWriter output = new PrintWriter(new OutputStreamWriter(sout, encoding));

          final SerializerPool serializerPool = SerializerPool.getInstance();
View Full Code Here

                      + request.getPath(), ex);
            }
          } else {
            // xml resource
            final Serializer serializer = broker.getSerializer();
            serializer.reset();

            final String charset = getContext().getDefaultCharset();
            // Serialize the document
            try {
              response.setContentType(resource.getMetadata()
View Full Code Here

      }

      final String charset = getContext().getDefaultCharset();
      response.setContentType("application/atom+xml; charset=" + charset);
      final Serializer serializer = broker.getSerializer();
      serializer.reset();
      try {
        final Writer w = new OutputStreamWriter(response.getOutputStream(), charset);
        final SAXSerializer sax = (SAXSerializer) SerializerPool.getInstance().borrowObject(SAXSerializer.class);
        final Properties outputProperties = new Properties();
        sax.setOutput(w, outputProperties);
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.