Package org.apache.xindice.client.xmldb.resources

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


                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

                case Entry.DOCUMENT:
                    DocumentImpl doc = (DocumentImpl) entry.getValue();

                    // This should probably just pass the document.
                    if (doc.getDataBytes() == null) {
                        return new XMLResourceImpl(id, id, this, TextWriter.toString(doc));
                    } else {
                        return new XMLResourceImpl(id, id, this, doc.getSymbols(), doc.getDataBytes());
                    }

                case Entry.BINARY:
                    return new BinaryResourceImpl(id, this, (byte[]) entry.getValue());
View Full Code Here

            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

                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

            set.appendChild(resource);

            i++;
        }

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

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

                // This should probably just pass the document.
                if (doc.getDataBytes() == null) {
                    return new XMLResourceImpl(id, id, this, TextWriter.toString(doc));
                } else {
                    return new XMLResourceImpl(id, id, this, doc.getSymbols(), doc.getDataBytes());
                }

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

                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

            } else if (result instanceof Map) {
                // Result is compressed XML.
                Map compressed = (Map) 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

            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

TOP

Related Classes of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

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.