コード例 #1
0
  @Override
  protected void fillVoiceXmlDocument(
      Document document, Element formElement, VoiceXmlDialogueContext dialogueContext)
      throws VoiceXmlDocumentRenderingException {
    addVariableDeclarations(formElement, mVariables);

    Element blockElement = DomUtils.appendNewElement(formElement, BLOCK_ELEMENT);

    if (mScript != null) {
      Element scriptElement = DomUtils.appendNewElement(blockElement, SCRIPT_ELEMENT);
      DomUtils.appendNewText(scriptElement, mScript);
    }

    StringBuffer scriptBuffer = new StringBuffer();

    scriptBuffer.append(RIVR_SCOPE_OBJECT + ".addValueResult({");
    boolean first = true;
    for (VariableDeclaration variableDeclaration : mVariables) {
      if (!first) {
        scriptBuffer.append(", ");
      } else {
        first = false;
      }
      scriptBuffer.append("\"");
      scriptBuffer.append(variableDeclaration.getName());
      scriptBuffer.append("\": ");
      scriptBuffer.append("dialog.");
      scriptBuffer.append(variableDeclaration.getName());
    }
    scriptBuffer.append("});");

    createScript(blockElement, scriptBuffer.toString());
    createGotoSubmit(blockElement);
  }
コード例 #2
0
 public void visit(VariableDeclaration entity) {
   wGetVisitor1().visit(entity.getName());
   wGetVisitor1().visit(entity.getReference());
   wGetVisitor1().visit(entity.getReferenceType());
 }
コード例 #3
0
ファイル: ToSourceVisitor.java プロジェクト: aam/dartdev
 @Override
 public Void visitVariableDeclaration(VariableDeclaration node) {
   visit(node.getName());
   visit(" = ", node.getInitializer());
   return null;
 }
コード例 #4
0
 public String getNameLowerCase() {
   if (nameLowerCase == null) {
     nameLowerCase = variable.getName().toLowerCase();
   }
   return nameLowerCase;
 }
コード例 #5
0
 public String getName() {
   if (cachedToString == null) {
     cachedToString = variable.getName();
   }
   return cachedToString;
 }