Examples of Transformer


Examples of org.apache.xml.security.stax.ext.Transformer

    public void testXMLSecEventToXMLSecEventAPI() throws Exception {
        TransformEnvelopedSignature transformEnvelopedSignature = new TransformEnvelopedSignature();

        final List<XMLSecEvent> xmlSecEvents = new ArrayList<XMLSecEvent>();

        Transformer transformer = new Transformer() {
            @Override
            public void setOutputStream(OutputStream outputStream) throws XMLSecurityException {
            }

            @Override
View Full Code Here

Examples of org.bson.Transformer

        DBCollection c = collection;

        c.save( BasicDBObjectBuilder.start( "_id" , 1 ).add( "x" , 1.1 ).get() );
        assertEquals( Double.class , c.findOne().get( "x" ).getClass() );

        Bytes.addEncodingHook( Double.class , new Transformer(){
            public Object transform( Object o ){
                return o.toString();
            }
        } );

        c.save( BasicDBObjectBuilder.start( "_id" , 1 ).add( "x" , 1.1 ).get() );
        assertEquals( String.class , c.findOne().get( "x" ).getClass() );

        Bytes.clearAllHooks();
        c.save( BasicDBObjectBuilder.start( "_id" , 1 ).add( "x" , 1.1 ).get() );
        assertEquals( Double.class , c.findOne().get( "x" ).getClass() );

        Bytes.addDecodingHook( Double.class , new Transformer(){
            public Object transform( Object o ){
                return o.toString();
            }
        } );
        assertEquals( String.class , c.findOne().get( "x" ).getClass() );
View Full Code Here

Examples of org.codehaus.aspectwerkz.transform.Transformer

        boolean advisedAtLeastOnce = false;
        Klass klass = (Klass) context.getClassAbstraction();
        for (Iterator it = m_stack.iterator(); it.hasNext();) {
            Object transformer = it.next();
            if (transformer instanceof Transformer) {
                Transformer tf = (Transformer) transformer;
                context.resetAdvised();
                try {
                    tf.transform(context, klass);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (context.isAdvised()) {
                    advisedAtLeastOnce = true;
View Full Code Here

Examples of org.codehaus.plexus.formica.population.transformer.Transformer

    protected Map transformers;

    protected Transformer getTransformer( String id )
        throws TransformerNotFoundException
    {
        Transformer transformer = (Transformer) transformers.get( id );

        if ( transformer == null )
        {
            throw new TransformerNotFoundException( "Transformer with the id = " + id + " cannot be found." );
        }
View Full Code Here

Examples of org.drools.runtime.pipeline.Transformer

        KnowledgeRuntimeCommand insertStage = PipelineFactory.newStatefulKnowledgeSessionInsert();
        insertStage.setReceiver( executeResultHandler );

        Smooks smooks = new Smooks( getClass().getResourceAsStream( "smooks-config.xml" ) );

        Transformer transformer = PipelineFactory.newSmooksFromSourceTransformer( smooks,
                                                                                  "root" );
        transformer.setReceiver( insertStage );

        Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( transformer );

        ResultHandlerImpl resultHandler = new ResultHandlerImpl();
        pipeline.insert( new StreamSource( getClass().getResourceAsStream( "SmooksNestedIterable.xml" ) ),
                         resultHandler );
       
        FactHandle factHandle = ( FactHandle ) ((Map)resultHandler.getObject()).keySet().iterator().next();
        assertNotNull( factHandle );        

        // now round trip that fact
        Action executeResult = PipelineFactory.newExecuteResultHandler();
       
        Action assignAsResult = PipelineFactory.newAssignObjectAsResult();
        assignAsResult.setReceiver( executeResult );

        transformer = PipelineFactory.newSmooksToSourceTransformer( smooks );
        transformer.setReceiver( assignAsResult );
       
        KnowledgeRuntimeCommand getObject = PipelineFactory.newStatefulKnowledgeSessionGetObject();     
        getObject.setReceiver( transformer );

        pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
View Full Code Here

Examples of org.gdal.gdal.Transformer

        sr2.ImportFromEPSG(32631);

        Vector options = new Vector();
        options.add("SRC_SRS=" + sr1.ExportToWkt());
        options.add("DST_SRS=" + sr2.ExportToWkt());
        Transformer t = new Transformer(ds1, ds2, options);
        double argout[] = new double[3];
        argout[0] = 0;
        argout[1] = 0;
        int ret = t.TransformPoint(0, argout);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + argout[0] + " y=" + argout[1]);

        ret = t.TransformPoint(1, argout);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + argout[0] + " y=" + argout[1]);

        ret = t.TransformPoint(argout, 0, 0, 0, 0);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + argout[0] + " y=" + argout[1]);

        ret = t.TransformPoint(argout, 0, 0, 0);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + argout[0] + " y=" + argout[1]);

        double arrayOfPoints[][] = new double[][] { new double[]{0, 0}, new double[]{100,100} };
        ret = t.TransformPoints(0, arrayOfPoints, null);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + arrayOfPoints[0][0] + " y=" + arrayOfPoints[0][1]);
        System.out.println("x=" + arrayOfPoints[1][0] + " y=" + arrayOfPoints[1][1]);

        ret = t.TransformPoints(1, arrayOfPoints, null);
        if (ret == 0)
            throw new RuntimeException();
        System.out.println("x=" + arrayOfPoints[0][0] + " y=" + arrayOfPoints[0][1]);
        System.out.println("x=" + arrayOfPoints[1][0] + " y=" + arrayOfPoints[1][1]);
    }
View Full Code Here

Examples of org.gephi.appearance.spi.Transformer

        Map<Class, Transformer> tMap = new HashMap<Class, Transformer>();
        for (Transformer t : Lookup.getDefault().lookupAll(Transformer.class)) {
            tMap.put(t.getClass(), t);
        }
        for (TransformerUI ui : Lookup.getDefault().lookupAll(TransformerUI.class)) {
            Transformer t = tMap.get(ui.getTransformerClass());
            if (t != null) {
                TransformerCategory c = ui.getCategory();
                if (t.isNode()) {
                    Set<TransformerUI> uis = transformers.get(NODE_ELEMENT).get(c);
                    if (uis == null) {
                        uis = new LinkedHashSet<TransformerUI>();
                        transformers.get(NODE_ELEMENT).put(c, uis);
                    }
                    uis.add(ui);
                }
                if (t.isEdge()) {
                    Set<TransformerUI> uis = transformers.get(EDGE_ELEMENT).get(c);
                    if (uis == null) {
                        uis = new LinkedHashSet<TransformerUI>();
                        transformers.get(EDGE_ELEMENT).put(c, uis);
                    }
View Full Code Here

Examples of org.gephi.partition.spi.Transformer

            currentPanel = null;
        }
        if (model.getSelectedTransformerBuilder() == null) {
            centerScrollPane.setViewportView(null);
        } else {
            Transformer t = model.getSelectedTransformer();
            currentUI = model.getSelectedTransformerBuilder().getUI();
            if (model.getSelectedPartition() != null) {
                currentPanel = currentUI.getPanel();
                currentPanel.setOpaque(false);
                currentUI.setup(model.getSelectedPartition(), t);
View Full Code Here

Examples of org.gephi.ranking.api.Transformer

    private void initApply() {
        applyButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                Transformer transformer = getSelectedTransformer();
                if (transformer != null) {
                    RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
                    if (interpolator != null) {
                        transformer.setInterpolator(new org.gephi.ranking.api.Interpolator() {

                            public float interpolate(float x) {
                                return interpolator.interpolate(x);
                            }
                        });
View Full Code Here

Examples of org.gradle.groovy.scripts.Transformer

        checkScriptCacheEmpty();
    }

    @Test
    public void testCanVisitAndTransformScriptClass() throws Exception {
        Transformer visitor = new AbstractScriptTransformer() {
            public String getId() {
                return "id";
            }

            protected int getPhase() {
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.