Examples of Transformer


Examples of eu.planets_project.pp.plato.model.transform.Transformer

     * Will on the other hand be less necessary when we introduce property-specific
     * transformers stored in the knowledge base.
     */
    public void calculateDefaultTransformers() {
        for (Leaf leaf: tree.getRoot().getAllLeaves()) {
            Transformer t = leaf.getTransformer();
            if (t instanceof NumericTransformer) {
                // calculate min, max
                // set min,max
                NumericTransformer nt = (NumericTransformer) t;
               
View Full Code Here

Examples of eu.scape_project.planning.model.transform.Transformer

        if (this.getScale() != null) {
            clone.setScale(this.getScale().clone());
        }
        clone.setValueMap(new HashMap<String, Values>());

        Transformer newTransformer = null;
        if (transformer != null) {
            newTransformer = transformer.clone();
        }
        clone.setTransformer(newTransformer);
        clone.setAggregationMode(this.getAggregationMode());
View Full Code Here

Examples of flexjson.transformer.Transformer

   * @return
   */
  public void transform(Object object)
  {

    Transformer transformer= getPathTransformer(object);

    if (transformer == null)
    {
      transformer= getTypeTransformer(object);
    }

    if (transformer == null)
      transformer= new TransformerWrapper(new NullTransformer());

    transformer.transform(object);

  }
View Full Code Here

Examples of fr.jayasoft.commons.lang.Transformer

                }
                return false;
            }
        });
       
        List newCheckedUsers = TransformerUtils.transform(IteratorUtils.toList(fi), new Transformer() {
            public Object transform(Object input) {
                if (input instanceof String) {
                    String checkedUser = (String)input;
                    return new Long(checkedUser.substring(Params.USER_ADMIN.USER_CHECKED.length()));
                }
View Full Code Here

Examples of games.stendhal.server.core.engine.transformer.Transformer

          + " because it does not have an RPClass.");
      return super.transform(object);
    }

    final String name = clazz.getName();
    Transformer trafo = transformerMap.get(name);
    if (trafo == null) {

      return super.transform(object);
    }
    return trafo.transform(object);
  }
View Full Code Here

Examples of javax.xml.transform.Transformer

  public static String prettyPrint(SQLXML xml) throws SQLException {
    try {
      TransformerFactory transFactory = TransformerFactory.newInstance();
      transFactory.setAttribute("indent-number", new Integer(2)); //$NON-NLS-1$
     
      Transformer tf = transFactory.newTransformer();
      tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.INDENT, "yes");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.METHOD, "xml");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
      tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      StreamResult xmlOut = new StreamResult(new BufferedOutputStream(out));
      tf.transform(xml.getSource(StreamSource.class), xmlOut);
     
      return out.toString();
    } catch (Exception e) {
      return xml.getString();
    }
View Full Code Here

Examples of javax.xml.transform.Transformer

      Source source = new DOMSource(root);
      //Result output = new StAXResult(streamWriter); JDK 6 only
      Result output = new SAXResult((ContentHandler)streamWriter);

      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      transformer.transform(source, output);

      streamWriter.flush();
      writer.flush();

      return new String(bout.toByteArray());
View Full Code Here

Examples of javax.xml.transform.Transformer

    public static String getDocumentAsString(Document doc)
            throws TransformerException {
        StringWriter writer = new StringWriter();

        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();
        transformer.transform(new DOMSource(doc), new StreamResult(writer));

        return writer.toString();
    }
View Full Code Here

Examples of javax.xml.transform.Transformer

          }
        }else if(DataHandler.class.isAssignableFrom(value.getClass())){
          ((DataHandler)value).writeTo(output);
        }else if(Source.class.isAssignableFrom(value.getClass())){
          try {
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            transformer.transform( ((Source)value), new StreamResult(output) );
          } catch (Throwable e) {
            //TODO LOG
            e.printStackTrace();
          }
         
View Full Code Here

Examples of javax.xml.transform.Transformer

        if (source != null && !"POST".equalsIgnoreCase(action)) { //$NON-NLS-1$
          if (this.executionFactory.getXMLParamName() == null) {
            throw new WebServiceException(WSExecutionFactory.UTIL.getString("http_usage_error")); //$NON-NLS-1$
          }
          try {
            Transformer t = TransformerFactory.newInstance().newTransformer();
            StringWriter writer = new StringWriter();
            //TODO: prevent this from being too large
                t.transform(source, new StreamResult(writer));
            String param = Util.httpURLEncode(this.executionFactory.getXMLParamName())+"="+Util.httpURLEncode(writer.toString()); //$NON-NLS-1$
            endpoint = WSConnection.Util.appendQueryString(endpoint, param);
          } catch (TransformerException e) {
            throw new WebServiceException(e);
          }
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.