Package sisc.data

Examples of sisc.data.Value


    SchemeSitemap sitemap = schemeSitemap(scm);
    StreamPipeline pipeline = sitemap.getStreamPipeline();
    EventPipeline eventPipeline = pipeline.getEventPipeline();

    // Obtain the 'type' attribute
    Value stype = assq(sargs, Symbol.get("type"));
    String type;
    if (!stype.eq(FALSE))
      type = string(pair(stype).cdr);
    else
      type = sitemap.getDefaultGeneratorType();

    // We have a normal generator.

    // Obtain the 'src' attribute
    Value ssrc = assq(sargs, Symbol.get("src"));
    if (ssrc.eq(FALSE))
      throw new RuntimeException("No 'src' attribute specified for 'generate'!");
    String src = string(pair(ssrc).cdr);

    // Obtain the parameters
    Value sparams = assq(sargs, Symbol.get("params"));
    Parameters params = getParameters(sparams);

    //     System.out.println("generate type " + type + ", src " + src
    //                        + " params " + params);
   
View Full Code Here


    // We have an <aggregate> as the generator
    eventPipeline.setGenerator ("!content-aggregator!",
                                null, Parameters.EMPTY_PARAMETERS);
    // Get the element name of the top level element
    String element = "";
    Value selement = assq(sargs, Symbol.get("element"));
    if (!selement.eq(FALSE))
      element = string(pair(selement).cdr);
    else
      throw new RuntimeException("No 'element' attribute specified for 'aggregate'!");

    // Get the namespace of the top level element
    String ns = "";
    Value sns = assq(sargs, Symbol.get("ns"));
    if (!sns.eq(FALSE))
      ns = string(pair(sns).cdr);

    // Get the prefix of the top level element
    String prefix = "";
    Value sprefix = assq(sargs, Symbol.get("prefix"));
    if (!sprefix.eq(FALSE))
      prefix = string(pair(sprefix).cdr);

    ContentAggregator contentAggregator
      = (ContentAggregator)eventPipeline.getGenerator();
    contentAggregator.setRootElement(element, ns, prefix);
View Full Code Here

    StreamPipeline pipeline = sitemap.getStreamPipeline();
    EventPipeline eventPipeline = pipeline.getEventPipeline();

    // Get the element for the top level element
    String src = "";
    Value ssrc = assq(sargs, Symbol.get("src"));
    if (!ssrc.eq(FALSE))
      src = string(pair(ssrc).cdr);
    else
      throw new RuntimeException("No 'src' attribute specified for <part>!");

    // Get the element for the top level element
    String element = "";
    Value selement = assq(sargs, Symbol.get("element"));
    if (!selement.eq(FALSE))
      element = string(pair(selement).cdr);

    // Get the namespace for the top level element
    String ns = "";
    Value sns = assq(sargs, Symbol.get("ns"));
    if (!sns.eq(FALSE))
      ns = string(pair(sns).cdr);

    // Get the prefix for the top level element
    String prefix = "";
    Value sprefix = assq(sargs, Symbol.get("prefix"));
    if (!sprefix.eq(FALSE))
      prefix = string(pair(sprefix).cdr);

    // Whether to strip the root element of the document from src
    String stripRoot = "";
    Value sstripRoot = assq(sargs, Symbol.get("strip-root"));
    if (!sstripRoot.eq(FALSE))
      stripRoot = string(pair(sstripRoot).cdr);

    ContentAggregator contentAggregator
      = (ContentAggregator)eventPipeline.getGenerator();
    contentAggregator.addPart(src, element, ns, stripRoot, prefix);
View Full Code Here

    SchemeSitemap sitemap = schemeSitemap(scm);
    StreamPipeline pipeline = sitemap.getStreamPipeline();
    EventPipeline eventPipeline = pipeline.getEventPipeline();

    // Obtain the 'src' attribute
    Value ssrc = assq(sargs, Symbol.get("src"));
    if (ssrc.eq(FALSE))
      throw new RuntimeException("No 'src' attribute specified for 'read'!");
    String src = string(pair(ssrc).cdr);

    // Obtain the 'mime-type' attribute
    Value smimeType = assq(sargs, Symbol.get("mime-type"));
    String mimeType = null;
    if (!smimeType.eq(FALSE))
      mimeType = string(pair(smimeType).cdr);

    // Obtain the 'type' attribute
    Value stype = assq(sargs, Symbol.get("type"));
    String type;
    if (!stype.eq(FALSE))
      type = string(pair(stype).cdr);
    else
      type = sitemap.getDefaultReaderType();

    // Obtain the parameters
    Value sparams = assq(sargs, Symbol.get("params"));
    Parameters params = getParameters(sparams);

    pipeline.setReader(type, src, params, mimeType);

    return new J2S.JavaObject(pipeline);
View Full Code Here

    SchemeSitemap sitemap = schemeSitemap(scm);
    StreamPipeline pipeline = streamPipeline(spipeline);
    EventPipeline eventPipeline = pipeline.getEventPipeline();

    // Obtain the 'src' attribute
    Value ssrc = assq(sargs, Symbol.get("src"));
    if (ssrc.eq(FALSE))
      throw new RuntimeException("No 'src' attribute specified for 'transform'!");
    String src = string(pair(ssrc).cdr);

    // Obtain the 'type' attribute
    Value stype = assq(sargs, Symbol.get("type"));
    String type;
    if (!stype.eq(FALSE))
      type = string(pair(stype).cdr);
    else
      type = sitemap.getDefaultTransformerType();

    // Obtain the parameters
    Value sparams = assq(sargs, Symbol.get("params"));
    Parameters params = getParameters(sparams);

//     System.out.println("transform type " + type + ", src " + src
//                        + " params " + params);
   
View Full Code Here

  {
    SchemeSitemap sitemap = schemeSitemap(scm);
    StreamPipeline pipeline = streamPipeline(spipeline);

    // Obtain the 'type' attribute
    Value stype = assq(sargs, Symbol.get("type"));
    String type;
    if (!stype.eq(FALSE))
      type = string(pair(stype).cdr);
    else
      type = sitemap.getDefaultSerializerType();

    // Obtain the 'mime-type' attribute
    Value smimeType = assq(sargs, Symbol.get("mime-type"));
    String mimeType = null;
    if (!smimeType.eq(FALSE))
      mimeType = string(pair(smimeType).cdr);

    // Obtain the parameters
    Value sparams = assq(sargs, Symbol.get("params"));
    Parameters params = getParameters(sparams);

//     System.out.println("serialize type " + type
//                        + " params " + params + " mime-type " + mimeType);
   
View Full Code Here

    SchemeInterpreter interpreters
      = (SchemeInterpreter)manager.lookup(SchemeInterpreter.ROLE);
    Interpreter interp = interpreters.getInterpreter();
    Symbol mainFunction = interpreters.getMainFunction();
    Value result = sisc.Util.FALSE;

    try {
      result
        = interp.eval((Procedure)interp.ctx.toplevel_env.lookup(mainFunction),
                      args);
    }
    finally {
      interpreters.releaseInterpreter(interp);
    }

    return !result.eq(sisc.Util.FALSE);
  }
View Full Code Here

   * @param kont a continuation object
   * @return a <code>Value</code> value, representing the string identifier
   */
  public Value registerContinuation(Value kont)
  {
    Value kontId;

    char[] result = new char[bytes.length * 2];
    String continuationId = null;
   
    synchronized(continuations) {
View Full Code Here

   * continuation is registered.
   */
  public Value getContinuationFromId(Value id)
  {
    String continuationId = string(id);
    Value kont = (Value)continuations.get(continuationId);
    return (kont != null ? kont : Util.FALSE);
  }
View Full Code Here

    SchemeInterpreter interpreters
      = (SchemeInterpreter)manager.lookup(SchemeInterpreter.ROLE);
    Interpreter interp = interpreters.getInterpreter();
    Symbol mainFunction = interpreters.getMainFunction();
    Value result = sisc.Util.FALSE;

    try {
      result
        = interp.eval((Procedure)interp.ctx.toplevel_env.lookup(mainFunction),
                      args);
    }
    finally {
      interpreters.releaseInterpreter(interp);
    }

    return !result.eq(sisc.Util.FALSE);
  }
View Full Code Here

TOP

Related Classes of sisc.data.Value

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.