Package org.teiid.core.types

Examples of org.teiid.core.types.SQLXMLImpl


      }
      return new BlobType(new BlobImpl(fsisf));
    }
    if (value instanceof Source) {
      if (value instanceof InputStreamFactory) {
        return new XMLType(new SQLXMLImpl((InputStreamFactory)value));
      }
      StandardXMLTranslator sxt = new StandardXMLTranslator((Source)value);
      SQLXMLImpl sqlxml;
      try {
        sqlxml = XMLSystemFunctions.saveToBufferManager(dtm.getBufferManager(), sxt);
      } catch (TeiidComponentException e) {
        throw new TeiidRuntimeException(e);
      } catch (TeiidProcessingException e) {
View Full Code Here


    }
    Item next = iter.next();
    if (next != null) {
      type = Type.CONTENT;
    }
    SQLXMLImpl xml = XMLSystemFunctions.saveToBufferManager(bufferManager, new XMLTranslator() {
     
      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
        Properties props = new Properties();
View Full Code Here

          while (string.startsWith("../")) { //$NON-NLS-1$
            relative = true;
            string = string.substring(3);
            parentPath = new File(parentPath).getParent();
          }
          SQLXMLImpl schema = null;
          if (!relative) {
            schema = getVDBResourceAsSQLXML(string);
          }
          if (schema == null) {
            if (!parentPath.endsWith("/")) { //$NON-NLS-1$
View Full Code Here

    public SQLXMLImpl getVDBResourceAsSQLXML(String resourcePath) {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
    return new SQLXMLImpl(new VirtualFileInputStreamFactory(f));
    }
View Full Code Here

    private boolean isFormatted = MappingNodeConstants.Defaults.DEFAULT_FORMATTED_DOCUMENT.booleanValue();
    private SQLXMLImpl xml;
   
    public DocumentInProgress(FileStore store, String encoding) throws TeiidComponentException{
      final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(store, encoding);
        this.xml = new SQLXMLImpl(fsisf);
        this.xml.setEncoding(encoding);
        SAXTransformerFactory factory = new TransformerFactoryImpl();
        try {
      //SAX2.0 ContentHandler
      handler = factory.newTransformerHandler();
View Full Code Here

      }
      else if (lob instanceof ClobType) {
        persistedLob = new ClobType(new ClobImpl(isf, ((ClobType)lob).length()));
      }
      else {
        persistedLob = new XMLType(new SQLXMLImpl(isf));
        ((XMLType)persistedLob).setEncoding(((XMLType)lob).getEncoding());
        ((XMLType)persistedLob).setType(((XMLType)lob).getType());
      }
    } catch (SQLException e) {
      throw new TeiidComponentException(e);
View Full Code Here

    Object value = internalEvaluate(xp.getExpression(), tuple);
    if (value == null) {
      return null;
    }
    XMLType.Type type = Type.DOCUMENT;
    SQLXMLImpl result = null;
    try {
      if (value instanceof String) {
        String string = (String)value;
        result = new SQLXMLImpl(string);
        result.setEncoding(Streamable.ENCODING);
        if (!xp.isWellFormed()) {
          Reader r = new StringReader(string);
          type = validate(xp, r);
        }
      } else {
        InputStreamFactory isf = null;
        Streamable<?> s = (Streamable<?>)value;
        isf = getInputStreamFactory(s);
        result = new SQLXMLImpl(isf);
        if (!xp.isWellFormed()) {
          Reader r = result.getCharacterStream();
          type = validate(xp, r);
        }
      }
    } catch (TransformationException e) {
      throw new ExpressionEvaluationException(e, e.getMessage());
View Full Code Here

        assertEquals("test", value); //$NON-NLS-1$
    }

    // simulate what would happen if someone passed the output of an XML query to the xpathvalue function
    @Test public void testXMLInput() throws Exception {
        XMLType doc = new XMLType(new SQLXMLImpl("<foo/>"));//$NON-NLS-1$
        String xpath = "a/b/c"; //$NON-NLS-1$
        String value = XMLSystemFunctions.xpathValue(doc, xpath);
        assertNull(value);
    }
View Full Code Here

              isf.setLength(((BlobType)currentValue).getLength());
              currentValue = new BlobImpl(isf);
            }
            else if (currentValue instanceof XMLType) {
              XMLType val = (XMLType)currentValue;
              currentValue = new SQLXMLImpl(createInputStreamFactory(val));
              ((SQLXMLImpl)currentValue).setEncoding(val.getEncoding());
            }
        }
        else if (currentValue instanceof java.util.Date) {
            return TimestampWithTimezone.create((java.util.Date)currentValue, serverTimeZone, getDefaultCalendar(), currentValue.getClass());
View Full Code Here

TOP

Related Classes of org.teiid.core.types.SQLXMLImpl

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.