congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TextSerializationUnit.createTextElement
Code IndexAdd Tabnine to your IDE (free)

How to use
createTextElement
method
in
org.milyn.delivery.dom.serialize.TextSerializationUnit

Best Java code snippets using org.milyn.delivery.dom.serialize.TextSerializationUnit.createTextElement (Showing top 6 results out of 315)

origin: org.milyn/milyn-smooks-templating

  @Override
protected void visit(Element element, ExecutionContext executionContext) {
    // First thing we do is clone the template for this transformation...
      // Commented out as due to https://github.com/antlr/stringtemplate4/issues/100
    // ST transform = new ST(template);
    ST transform = templateGroupDir.getInstanceOf(templateName);
          
    Map<String, Object> beans = executionContext.getBeanContext().getBeanMap();
    
    // Set the document data beans on the template and apply it...
    for (Map.Entry<String, Object> entry : beans.entrySet()) {
        transform.add(entry.getKey(), entry.getValue());
    }

    String templatingResult = transform.render().trim();
    Node resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
    // Process the templating action, supplying the templating result...
    processTemplateAction(element, resultNode, executionContext);
  }
origin: org.milyn/milyn-smooks-all

  @Override
protected void visit(Element element, ExecutionContext executionContext) {
    // First thing we do is clone the template for this transformation...
      // Commented out as due to https://github.com/antlr/stringtemplate4/issues/100
    // ST transform = new ST(template);
    ST transform = templateGroupDir.getInstanceOf(templateName);
          
    Map<String, Object> beans = executionContext.getBeanContext().getBeanMap();
    
    // Set the document data beans on the template and apply it...
    for (Map.Entry<String, Object> entry : beans.entrySet()) {
        transform.add(entry.getKey(), entry.getValue());
    }

    String templatingResult = transform.render().trim();
    Node resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
    // Process the templating action, supplying the templating result...
    processTemplateAction(element, resultNode, executionContext);
  }
origin: org.milyn/milyn-smooks-all

private void applyTemplate(Template template, Element element, ExecutionContext executionContext) throws SmooksException {
  // Apply the template...
  String templatingResult;
  try {
    Writer writer = new StringWriter();
    Map<String, Object> model = FreeMarkerUtils.getMergedModel(executionContext);
    template.process(model, writer);
    writer.flush();
    templatingResult = writer.toString();
  } catch (TemplateException e) {
    throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
  } catch (IOException e) {
    throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
  }
  // Create the replacement DOM text node containing the applied template...
  Node resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
  // Process the templating action, supplying the templating result...
  processTemplateAction(element, resultNode, executionContext);
}
origin: org.milyn/milyn-smooks-templating

private void applyTemplate(Template template, Element element, ExecutionContext executionContext) throws SmooksException {
  // Apply the template...
  String templatingResult;
  try {
    Writer writer = new StringWriter();
    Map<String, Object> model = FreeMarkerUtils.getMergedModel(executionContext);
    template.process(model, writer);
    writer.flush();
    templatingResult = writer.toString();
  } catch (TemplateException e) {
    throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
  } catch (IOException e) {
    throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
  }
  // Create the replacement DOM text node containing the applied template...
  Node resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
  // Process the templating action, supplying the templating result...
  processTemplateAction(element, resultNode, executionContext);
}
origin: org.milyn/milyn-smooks-all

@Override
protected void visit(Element element, ExecutionContext executionContext) {
  // First thing we do is clone the template for this transformation...
  StringTemplate thisTransTemplate = template.getInstanceOf();
  Map<String, Object> beans = executionContext.getBeanContext().getBeanMap();
  String templatingResult;
  Node resultNode;
  // Set the document data beans on the template and apply it...
  thisTransTemplate.setAttributes(beans);
  templatingResult = thisTransTemplate.toString();
  resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
  // Process the templating action, supplying the templating result...
  processTemplateAction(element, resultNode, executionContext);
}
origin: org.milyn/milyn-smooks-templating

@Override
protected void visit(Element element, ExecutionContext executionContext) {
  // First thing we do is clone the template for this transformation...
  StringTemplate thisTransTemplate = template.getInstanceOf();
  Map<String, Object> beans = executionContext.getBeanContext().getBeanMap();
  String templatingResult;
  Node resultNode;
  // Set the document data beans on the template and apply it...
  thisTransTemplate.setAttributes(beans);
  templatingResult = thisTransTemplate.toString();
  resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
  // Process the templating action, supplying the templating result...
  processTemplateAction(element, resultNode, executionContext);
}
org.milyn.delivery.dom.serializeTextSerializationUnitcreateTextElement

Popular methods of TextSerializationUnit

  • getText
  • isTextElement

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JButton (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now