Package nexj.core.util

Examples of nexj.core.util.XMLWriter


      String sDescriptorFile = getProperty("meta.descfile");

      if (sDescriptorFile != null && sDescriptorFile.length() != 0)
      {
         StringWriter swriter = new StringWriter(0x2000);
         XMLWriter writer = new XMLWriter(swriter);

         if (s_logger.isDebugEnabled())
         {
            s_logger.debug("Writing the repository descriptor to file \"" + sDescriptorFile + "\"");
         }

         writer.openElement("Metadata");
         writer.writeAttribute("version", "0");
         writer.closeElement();

         writer.startElement("Classes");

         List metaclassList = new ArrayList(metadata.getMetaclassCount());

         for (Iterator itr = metadata.getMetaclassIterator(); itr.hasNext();)
         {
            metaclassList.add(itr.next());
         }

         Collections.sort(metaclassList, new Comparator()
         {
            public int compare(Object o1, Object o2)
            {
               return ((Metaclass)o1).getName().compareToIgnoreCase(((Metaclass)o2).getName());
            }
         });

         for (int i = 0; i < metaclassList.size(); ++i)
         {
            writer.openElement("ClassRef");
            writer.writeAttribute("resource", "classes/" +
               ((Metaclass)metaclassList.get(i)).getName() + ".meta");
            writer.closeEmptyElement();
         }

         writer.endElement("Classes");
         writer.startElement("DataSources");
         writer.openElement("DataSourceRef");
         writer.writeAttribute("resource", "datasources/" + m_database.getName() + ".datasource");
         writer.closeEmptyElement();
         writer.endElement("DataSources");
         writer.endElement("Metadata");

         Writer fwriter = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(sDescriptorFile)), XMLUtil.ENCODING);

         try
         {
View Full Code Here


         // writer
         // Note: Buffering the ouput stream may cause too much overhead to have
         // significant performance advantages
         OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(m_fragmentFile));
         Writer writer = new BufferedWriter(new OutputStreamWriter(outputStream, XMLUtil.ENCODING));
         m_writer = new XMLWriter(writer);
      }
      catch (IOException e)
      {
         raiseIOException("Could not create temporary \"" + TEMP_FILE_PREFIX + ".wxs\" file", e);
      }
View Full Code Here

            s_logger.dump(tobj);
         }

         Writer writer = out.getWriter();

         m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);
         m_writer.write(XML.HEADER);

         append1(tobj, message.getRoot(), null);
      }
      catch (Exception e)
View Full Code Here

    * Creates a new XSD any element parser.
    */
   public AnyTypeAcceptor(String sType)
   {
      m_writerData = new StringWriter();
      m_writer = new XMLWriter(m_writerData);
      m_sType = sType;
   }
View Full Code Here

    * @param writer The destination writer.
    * @throws IOException If an I/O error occurs.
    */
   protected void init(Writer writer) throws IOException
   {
      m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);
      m_writer.setNamespace(null);
      m_writer.write(XML.HEADER);
   }
View Full Code Here

    * @param writer The output writer.
    * @throws IOException If an I/O error occurs.
    */
   protected void init(Writer writer) throws IOException
   {
      m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);
      m_writer.setNamespace(null);

      if (!m_bEmbedded)
      {
         m_writer.write(XML.HEADER);
View Full Code Here

   {
      // Initialize
      m_nFixupCount = 0;
      m_fixupArray = new Object[48];
      m_idMap = new IdentityHashTab();
      m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);

      // Write out the header
      m_writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
      m_writer.setNamespace(SOAP.ENV_NS);
      m_writer.openElement("Envelope");
View Full Code Here

    * Creates the exporter with an output character stream.
    * @param writer The output character stream.
    */
   public XMLMetadataExporter(Writer writer)
   {
      m_writer = new XMLWriter(writer);
   }
View Full Code Here

         {
            addMetaclass((Metaclass)metaItr.next());
         }
      }

      m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);
      m_optionalMetaclassMap = null; // release memory
      m_optionalXMLMetatypeMap = null; // release memory
      m_metaclassArray = (Metaclass[])m_requiredMetaclassSet.toArray(new Metaclass[0]);
      m_requiredMetaclassSet = null; // release memory
      m_metatypeArray = new XMLMetatype[m_requiredXMLMetatypeMap.size()];
View Full Code Here

   /**
    * @see nexj.core.rpc.CharacterStreamMarshaller#serialize(java.lang.Object, java.io.Writer)
    */
   public void serialize(Object obj, Writer writer) throws IOException, MarshallerException
   {
      m_writer = (writer instanceof XMLWriter) ? (XMLWriter)writer : new XMLWriter(writer);
      m_idMap = new IdentityHashTab();
      m_nNextMarshalledObjectId = 0;
      m_bDynamicTypeEnabled = true;
      m_sDefaultNS = XML.NS_URI_TNS;

View Full Code Here

TOP

Related Classes of nexj.core.util.XMLWriter

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.