Examples of Serializer


Examples of org.apache.oodt.cas.catalog.util.Serializer

         Validate.notNull(catalogRepositoryId, "Must specify catalogRepositoryId");
         Validate.notNull(beanRepo, "Must specify beanRepo");

         FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
               new String[] { this.beanRepo }, false);
         appContext.setClassLoader(new Serializer().getClassLoader());
         appContext.refresh();
         CatalogRepositoryFactory factory = (CatalogRepositoryFactory) appContext
               .getBean(this.catalogRepositoryId, CatalogRepositoryFactory.class);
         CatalogRepository catalogRepository = factory.createRepository();
         Set<Catalog> catalogs = catalogRepository.deserializeAllCatalogs();
View Full Code Here

Examples of org.apache.serialize.Serializer

    // IV. Perform the transformation.

    // Set up the ContentHandler for the output.
  FileOutputStream fos = new FileOutputStream(args[2]);
    Result result = new Result(fos);
    Serializer serializer = SerializerFactory.getSerializer("xml");
    serializer.setOutputStream(fos);

    transformer.setContentHandler(serializer.asContentHandler());

    // Set up the ContentHandler for the input.
    org.xml.sax.ContentHandler chandler = transformer.getInputContentHandler();
    DC dc = new DC(chandler);
    reader.setContentHandler(dc);
View Full Code Here

Examples of org.apache.soap.util.xml.Serializer

                        .newInstance();
            } catch (Throwable ignored) {
            Trc.ignoredException(ignored);
            }

        Serializer literalSerializer = partSer;
        Deserializer literalDeserializer = partSer;
        Serializer soapSerializer = beanSer;
        Deserializer soapDeserializer = beanSer;
        String soapEncoding = Constants.NS_URI_SOAP_ENC;

        // initialize ApacheSOAP specific mappings here
        for (Iterator i = theTypeMap.iterator(); i.hasNext();) {
            WSIFDynamicTypeMapping mapping = (WSIFDynamicTypeMapping) i.next();

            Class javaClass = mapping.getJavaType();
            org.apache.soap.util.xml.QName typeName =
                new org.apache.soap.util.xml.QName(
                    mapping.getXmlType().getNamespaceURI(),
                    mapping.getXmlType().getLocalPart());
                   
            // Add mappings to a local hashmap for use in preparation of the operation
            theLocalTypeMap.put(typeName, javaClass);

            Serializer ser = null;
            // Set up SOAP encoding mappings
            try {
                ser = theSMR.querySerializer(javaClass, soapEncoding);
            } catch (IllegalArgumentException iae) {
            Trc.ignoredException(iae);
View Full Code Here

Examples of org.apache.wink.json4j.internal.Serializer

     * @param writer The writer which to write the JSON text to.
     *
     * @throws JSONException Thrown on IO errors during serialization.
     */
    public Writer write(Writer writer, boolean verbose) throws JSONException {
        Serializer serializer;

        //Try to avoid double-buffering or buffering in-memory
        //writers.
        Class writerClass = writer.getClass();
        boolean flushIt = false;
        if (!StringWriter.class.isAssignableFrom(writerClass) &&
            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
            !BufferedWriter.class.isAssignableFrom(writerClass)) {
            writer = new BufferedWriter(writer);
            flushIt = true;
        }

        if (verbose) {
            serializer = new SerializerVerbose(writer);
        } else {
            serializer = new Serializer(writer);
        }

        try {
            serializer.writeObject(this);
        } catch (IOException iox) {
            JSONException jex = new JSONException("Error occurred during input read.");
            jex.initCause(iox);
            throw jex;
        }
View Full Code Here

Examples of org.apache.xalan.serialize.Serializer

      tHFrom.setResult(new SAXResult(tHTo));     
    }
    TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement();
    Transformer trans = tHLast.getTransformer();
    Properties outputProps = trans.getOutputProperties();
    Serializer serializer = SerializerFactory.getSerializer(outputProps);
    serializer.setOutputStream(new FileOutputStream(target));
    tHLast.setResult(new SAXResult(serializer.asContentHandler()));
   
    reader.parse(source);
  }
View Full Code Here

Examples of org.apache.xalan.serialize.Serializer

      StreamResult sresult = (StreamResult) outputTarget;
      String method = format.getProperty(OutputKeys.METHOD);

      try
      {
        Serializer serializer =
          SerializerFactory.getSerializer(format.getProperties());

        if (null != sresult.getWriter())
          serializer.setWriter(sresult.getWriter());
        else if (null != sresult.getOutputStream())
          serializer.setOutputStream(sresult.getOutputStream());
        else if (null != sresult.getSystemId())
        {
          String fileURL = sresult.getSystemId();

          if (fileURL.startsWith("file:///"))
          {
            if (fileURL.substring(8).indexOf(":") >0)
              fileURL = fileURL.substring(8);
            else
              fileURL = fileURL.substring(7);
          }

          m_outputStream = new java.io.FileOutputStream(fileURL);

          serializer.setOutputStream(m_outputStream);
        }
        else
          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");

        handler = serializer.asContentHandler();

        this.setSerializer(serializer);
      }
      catch (UnsupportedEncodingException uee)
      {
View Full Code Here

Examples of org.apache.xalan.serialize.Serializer

    StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance();

    m_resultTreeHandler =
      (ResultTreeHandler) m_textResultHandlerObjectPool.getInstance();

    Serializer serializer = m_resultTreeHandler.getSerializer();

    try
    {
      if (null == serializer)
      {
        serializer =
          SerializerFactory.getSerializer(m_textformat.getProperties());

        m_resultTreeHandler.setSerializer(serializer);
        serializer.setWriter(sw);

        ContentHandler shandler = serializer.asContentHandler();

        m_resultTreeHandler.init(this, shandler);
      }
      else
      {
View Full Code Here

Examples of org.apache.xml.serialize.Serializer

    org.w3c.dom.Document dom,
    SecurityOptions options) {
      Document doc = null;
      if (dom != null) {
        try {
          Serializer ser = new XMLSerializer();
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          ser.setOutputByteStream(out);
          ser.asDOMSerializer().serialize(dom);
          ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
          doc = options.getParser().parse(in);
        } catch (Exception e) {}
      }
      return doc;
View Full Code Here

Examples of org.apache.xml.serialize.Serializer

    org.w3c.dom.Element element,
    SecurityOptions options) {
    Element el = null;
    if (element != null) {
      try {
        Serializer ser = new XMLSerializer();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ser.setOutputByteStream(out);
        ser.asDOMSerializer().serialize(element);
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        el = options.getParser().parse(in).getRoot();
      } catch (Exception e) {}
    }
    return el;
View Full Code Here

Examples of org.apache.xml.serializer.Serializer

      // includes "lexical" events (e.g., comments and CDATA).
      reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
     
       FileOutputStream fos = new FileOutputStream("birds.out");
     
      Serializer serializer = SerializerFactory.getSerializer
                              (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
      serializer.setOutputStream(fos);
  
     
      // Set the result handling to be a serialization to the file output stream.
      Result result = new SAXResult(serializer.asContentHandler());
      handler.setResult(result);
     
      // Parse the XML input document.
      reader.parse("birds.xml");
     
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.