Examples of XMLResourceImpl


Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

                DocumentImpl doc = new DocumentImpl();
                doc.setSymbols(symbols);
                doc.importNode(n, true);
                doc.appendChild(n);
                byte[] b = DOMCompressor.compress(doc, symbols);
                resource = new XMLResourceImpl(null, documentId, collection, symbols, b);
            } else {
                resource = new XMLResourceImpl(null, documentId, collection, TextWriter.toString(n));
            }

            i++;
            resources.add(resource);
        }
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

            set.appendChild(resource);

            i++;
        }

        return new XMLResourceImpl(null, null, collection, TextWriter.toString(doc));
    }
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

                return null;
            } else if (entry instanceof Document) {
                DocumentImpl doc = (DocumentImpl) entry;

                // This should probably just pass the document.
                return new XMLResourceImpl(id, id, this,
                                           doc.getSymbols(),
                                           doc.getDataBytes());

            } else if (entry instanceof byte[]) {
                return new BinaryResourceImpl(id, this, (byte[])entry);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

            throw new XMLDBException(ErrorCodes.INVALID_RESOURCE,
                                     "Name cannot contain '/'");
        }

        if ("XMLResource".equals(type)) {
            return new XMLResourceImpl(name, this);
        } else {
            return new BinaryResourceImpl(name, this, null);
        }
    }
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

                    DocumentImpl doc = new DocumentImpl();
                    doc.setSymbols(symbols);
                    doc.importNode(n, true);
                    doc.appendChild(n);
                    byte[] b = DOMCompressor.Compress(doc, symbols);
                    resource = new XMLResourceImpl(null, documentId, collection,
                                                   symbols, b);
                } else {
                    resource = new XMLResourceImpl(null, documentId, collection,
                                                   TextWriter.toString(n));
                }

                i++;
                resources.add(resource);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

            set.appendChild(resource);

            i++;
        }

        XMLResource result = new XMLResourceImpl(null, null,
                                                 collection, TextWriter.toString(doc));
        return result;
    }
View Full Code Here

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

                return null;
            } else if (result instanceof Hashtable) {
                // Result is compressed XML.
                Hashtable compressed = (Hashtable) result;
                SymbolDeserializer symbolDeserial = new SymbolDeserializer();
                return new XMLResourceImpl(id, id, this, symbolDeserial.getSymbols(compressed), (byte[]) compressed.get("document"));
            } else if (result instanceof byte[]) {
                // Result is binary.
                return new BinaryResourceImpl(id, this, (byte[]) result);
            } else {
                // Result is XML.
                return new XMLResourceImpl(id, this, (String) result);
            }

        } catch (XMLDBException x) {

            throw x;  // propagate any xmldb exception.
View Full Code Here

Examples of org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl

    super();
  }

  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    result.setEncoding("UTF-8");

    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);

    result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
    result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);

    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());
    result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());

    result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());
    result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());

    return result;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl

     * @param out
     * @throws IOException
     */
    public void save(final OutputStream out) throws IOException
    {
        final Resource res = new XMLResourceImpl()
        {
            @Override
            protected XMLHelper createXMLHelper()
            {
                return new XMLHelperImpl()
                {
                    public String getHREF(EObject obj)
                    {
                        return ComponentMappingPackage.eNS_URI;
                    }

                    @Override
                    public EPackage getNoNamespacePackage()
                    {
                        return MetadataPackage.eINSTANCE;
                    }
                };
            }
        };// _resourceSet.createResource(URI.createURI("foo.xml"));
        res.getContents().add(_root);
        // res.setURI(uri);
        // resourceSet.getResources().add(res);
        // setLoadOptions(res);
        Map options = new HashMap();
        options.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
        options.put(XMLResource.OPTION_EXTENDED_META_DATA, _extendedMetadata);
        // options.put(XMLResource.OPTION_RESOURCE_HANDLER, res);
        options.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
        options.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.FALSE);// turning
        // this
        // off
        // so
        // that
        // res.getErrors()
        // has
        // values
        // to
        // check!
        // bizarre
        // that
        // I
        // should
        // need
        // to
        // do
        // this.
        res.save(out, options);
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl

    super();
  }
 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
    //result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
    //result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    return result;
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.