Package project.gluebooster.text

Examples of project.gluebooster.text.StringFunctions


    BoostFunction toByteArray = new CollectionFunctions(CollectionFunctions.Operation.toByteArray);
    graph.addEdges( writer, toByteArray);
   
   
    BoostFunction toString = new StringFunctions(StringFunctions.Operation.byteArrayToString);
    graph.addEdges( toByteArray, toString);//TODO not correct use a combining node
    graph.addEdges( encoding, toString);
   
    FunctionByEventsourceGraph<Tag, String> result = new FunctionByEventsourceGraph(graph, root, toString);
    return result;
View Full Code Here


    
     BoostFunction start = new StandardFunctions( StandardFunctions.Operation.constant, "text");
    
     //line 1: prepend 1
     BoostFunction prepend1 = new StringFunctions( StringFunctions.Operation.prepend, "1");
     BoostFunction asIndex0 = ToPairFunction.createWithFirstConstant(Integer.valueOf(0));
     graph.addEdges(start, prepend1, asIndex0);
    
     //line 2 prepend 2
     BoostFunction prepend2 = new StringFunctions( StringFunctions.Operation.prepend, "2");
     BoostFunction asIndex1 = ToPairFunction.createWithFirstConstant(Integer.valueOf(1));
     graph.addEdges(start, prepend2, asIndex1);
    
     //combine
     ListAssemblingFunctionWithIndices toList = new ListAssemblingFunctionWithIndices(2);
     graph.addEdge(asIndex0, toList);
     graph.addEdge(asIndex1, toList);
     BoostFunction concatenation = new StringFunctions( StringFunctions.Operation.concatenate);
     graph.addEdge(toList, concatenation);
    
     FunctionByEventsourceGraph<BigDecimal, BigDecimal> function = new FunctionByEventsourceGraph(graph, start, concatenation);
   
     Object result = function.valueOf(new BigDecimal(0), new InvocationContext());
View Full Code Here

    DefaultGraphForFunctionByEventsourceGraph graph = new DefaultGraphForFunctionByEventsourceGraph();

   
    BoostFunction getTagBeansXML1 = ReflectionFunctions.createInvokeMethod("text");
    BoostFunction getTagBeansXML =  FunctionFactory.concatenation( getTagBeansXML1,
                                                                   new StringFunctions(StringFunctions.Operation.replace, "</beans>" , "<bean id=\"appletArchiveDir\" class=\"project.gluebooster.text.StringBean\"><property name=\"append\" value=\""+ getFilename(APPLET_ARCHIVE_DIR)+"\"/></bean> <bean id=\"appletCodebaseDir\" class=\"project.gluebooster.text.StringBean\"><property name=\"append\" value=\""+ getFilename(APPLET_CODEBASE_DIR)+"\"/></bean> </beans>")
                                    );
   

   
    BoostFunction toBeanFactory = new SpringContextFunctions(SpringContextFunctions.Operation.toBeanFactory );
    graph.addEdges(getTagBeansXML, toBeanFactory);
    //1: get the archive text
   
    BoostFunction archiveText = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "archive");
    BoostFunction nullToEmptyString = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
    BoostFunction prependGlueboosterArchives = new StringFunctions(StringFunctions.Operation.prepend, ",project/gluebooster/java/javaBooster/0.4/javaBooster-0.4.jar,jung/jung-api/2.0/jung-api-2.0.jar,jung/jung-graph-impl/2.0/jung-graph-impl-2.0.jar,commons-collections/collections-generic/4.01/collections-generic-4.01.jar,org/springframework/spring/2.5.5/spring-2.5.5.jar,jung/jung-algorithms/2.0/jung-algorithms-2.0.jar,jung/jung-visualization/2.0/jung-visualization-2.0.jar,commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar,commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar,commons-lang/commons-lang/2.3/commons-lang-2.3.jar,org/codehaus/groovy/groovy-all/1.5.7/groovy-all-1.5.7.jar,com/sun/tools/1.6.0/tools-1.6.0.jar,");
    BoostFunction addArchiveDir =  new StringFunctions(StringFunctions.Operation.replace, "," , ",\"+ parent.appletArchiveDir + \"/");
    BoostFunction asIndex0 = ToPairFunction.createWithFirstConstant(Integer.valueOf(0));
    graph.addEdges(toBeanFactory, archiveText, nullToEmptyString, prependGlueboosterArchives,addArchiveDir, asIndex0);
   
    //2 encode the bean xml
    BoostFunction escapeHtml = new StringFunctions( StringFunctions.Operation.escapeHtml);
    BoostFunction asIndex1 = ToPairFunction.createWithFirstConstant(Integer.valueOf(3));
    graph.addEdges(getTagBeansXML, escapeHtml, asIndex1, new StandardFunctions(StandardFunctions.Operation.constant,""));

    //3: get width
    BoostFunction width = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "width");
    BoostFunction nullToEmptyString2 = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
    BoostFunction asIndex2 = ToPairFunction.createWithFirstConstant(Integer.valueOf(1));
    graph.addEdges(toBeanFactory, width, nullToEmptyString2, asIndex2);
   
    //4: get height
    BoostFunction height = new SpringContextFunctions(SpringContextFunctions.Operation.getBean, "height");
    BoostFunction nullToEmptyString3 = new StringFunctions(StringFunctions.Operation.nullToEmptyString);
    BoostFunction asIndex3 = ToPairFunction.createWithFirstConstant(Integer.valueOf(2));
    graph.addEdges(toBeanFactory, height, nullToEmptyString3, asIndex3);
   
    //combine
    ListAssemblingFunctionWithIndices toList = new ListAssemblingFunctionWithIndices(4, "as list");
    graph.addEdge(asIndex0, toList);
    graph.addEdge(asIndex1, toList);
    graph.addEdge(asIndex2, toList);
    graph.addEdge(asIndex3, toList);
    BoostFunction concatenation = new StringFunctions( StringFunctions.Operation.concatenate, getArchiveDirJavascript() + APPLET_JAVASCRIPT_1    
         ,null, APPLET_JAVASCRIPT_2 , "' width='", null, "' height='", null, "'><param NAME='beans' value=\"", null, "\"/></applet>");   
    graph.addEdge(toList, concatenation);
   
    FunctionByEventsourceGraph<Tag, String> function = new FunctionByEventsourceGraph(graph, getTagBeansXML, concatenation);
  
View Full Code Here

    //get resource path
    BoostFunction<Tag, Doc, Object> getHolder = ReflectionFunctions.createInvokeMethod("holder");
    BoostFunction<Doc, PackageDoc, Object> getHolderPackage = ReflectionFunctions.createInvokeMethod("containingPackage");
    BoostFunction<PackageDoc, String, Object> getHolderPackageName = ReflectionFunctions.createInvokeMethod("name");
    BoostFunction replaceSeparators = new StringFunctions(StringFunctions.Operation.replace, ".", "/");
    BoostFunction concatenatePath = new StringFunctions( StringFunctions.Operation.prepend, JavadocContext.getSingleton().getConfiguration().docFileDestDirName );   
    BoostFunction asPathIndex0 = ToPairFunction.createWithFirstConstant(Integer.valueOf(0));
   
    graph.addEdges(startNode, getHolder, getHolderPackage, getHolderPackageName, replaceSeparators, concatenatePath, asPathIndex0);

    //combine path
    ListAssemblingFunctionWithIndices toPathList = new ListAssemblingFunctionWithIndices(2);
    graph.addEdge(asPathIndex0, toPathList);
    graph.addEdge(asPathIndex1, toPathList);

    BoostFunction pathConcatenation = new StringFunctions( StringFunctions.Operation.concatenate, null, "/doc-files/", null);   
    graph.addEdge(toPathList, pathConcatenation);
   
    BoostFunction asIndex1 = ToPairFunction.createWithFirstConstant(Integer.valueOf(1));
    graph.addEdge(pathConcatenation, asIndex1);
View Full Code Here

TOP

Related Classes of project.gluebooster.text.StringFunctions

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.