Tabnine Logo
org.milyn.delivery.dom.serialize
Code IndexAdd Tabnine to your IDE (free)

How to use org.milyn.delivery.dom.serialize

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

origin: smooks/smooks

public void writeElementEnd(Element element, Writer writer) throws IOException {
  writeElementEnd(element, writer, null);
}
origin: smooks/smooks

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  writeElementStart(element, writer);
}
origin: org.milyn/milyn-smooks-all

private String extractTextContent(Node node, ExecutionContext executionContext) {
  if(node.getNodeType() == Node.TEXT_NODE) {
    return node.getTextContent();
  } else if(node.getNodeType() == Node.ELEMENT_NODE && ContextObjectSerializationUnit.isContextObjectElement((Element) node)) {
    String contextKey = ContextObjectSerializationUnit.getContextKey((Element) node);
    return (String) executionContext.getAttribute(contextKey);
  } else if(node.getNodeType() == Node.ELEMENT_NODE && TextSerializationUnit.isTextElement((Element) node)) {
    return TextSerializationUnit.getText((Element) node);
  } else {
    throw new SmooksException("Unsupported 'bindTo' or toOutStream templating action.  The bind data must be attached to a DOM Text node, or already bound to a <context-object> element.");
  }
}
origin: org.milyn/milyn-smooks-all

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  String key = getContextKey(element);
  if(key != null) {
    Object object = executionContext.getAttribute(key);
    if(object != null) {
      writer.write(object.toString());
    } else {
      logger.debug("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. No Object instance found on context at '" + key + "'.");
    }
  } else {
    logger.warn("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. 'key' attribute not specified.");
  }
}
origin: org.virtuslab/milyn-smooks-core

public void writeElementStart(Element element, Writer writer) throws IOException {
  writer.write((int)'<');
  writer.write(element.getTagName());
  writeAttributes(element.getAttributes(), writer);
  if(closeEmptyElements && !element.hasChildNodes()) {
    // Do nothing.  We'll close it "short-hand" in writeElementEnd below...
  } else {
    writer.write((int)'>');
  }
}
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

private String extractTextContent(Node node, ExecutionContext executionContext) {
  if(node.getNodeType() == Node.TEXT_NODE) {
    return node.getTextContent();
  } else if(node.getNodeType() == Node.ELEMENT_NODE && ContextObjectSerializationUnit.isContextObjectElement((Element) node)) {
    String contextKey = ContextObjectSerializationUnit.getContextKey((Element) node);
    return (String) executionContext.getAttribute(contextKey);
  } else if(node.getNodeType() == Node.ELEMENT_NODE && TextSerializationUnit.isTextElement((Element) node)) {
    return TextSerializationUnit.getText((Element) node);
  } else {
    throw new SmooksException("Unsupported 'bindTo' or toOutStream templating action.  The bind data must be attached to a DOM Text node, or already bound to a <context-object> element.");
  }
}
origin: org.milyn/milyn-smooks-all

public void writeElementEnd(Element element, Writer writer) throws IOException {
  writeElementEnd(element, writer, null);
}
origin: org.virtuslab/milyn-smooks-core

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  writeElementStart(element, writer);
}
origin: org.milyn/milyn-smooks-core

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  String key = getContextKey(element);
  if(key != null) {
    Object object = executionContext.getAttribute(key);
    if(object != null) {
      writer.write(object.toString());
    } else {
      logger.debug("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. No Object instance found on context at '" + key + "'.");
    }
  } else {
    logger.warn("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. 'key' attribute not specified.");
  }
}
origin: smooks/smooks

public void writeElementStart(Element element, Writer writer) throws IOException {
  writer.write((int)'<');
  writer.write(element.getTagName());
  writeAttributes(element.getAttributes(), writer);
  if(closeEmptyElements && !element.hasChildNodes()) {
    // Do nothing.  We'll close it "short-hand" in writeElementEnd below...
  } else {
    writer.write((int)'>');
  }
}
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);
}
origin: org.milyn/milyn-smooks-core

public void writeElementEnd(Element element, Writer writer) throws IOException {
  writeElementEnd(element, writer, null);
}
origin: org.milyn/milyn-smooks-core

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  writeElementStart(element, writer);
}
origin: smooks/smooks

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  String key = getContextKey(element);
  if(key != null) {
    Object object = executionContext.getAttribute(key);
    if(object != null) {
      writer.write(object.toString());
    } else {
      logger.debug("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. No Object instance found on context at '" + key + "'.");
    }
  } else {
    logger.warn("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. 'key' attribute not specified.");
  }
}
origin: org.milyn/milyn-smooks-core

public void writeElementStart(Element element, Writer writer) throws IOException {
  writer.write((int)'<');
  writer.write(element.getTagName());
  writeAttributes(element.getAttributes(), writer);
  if(closeEmptyElements && !element.hasChildNodes()) {
    // Do nothing.  We'll close it "short-hand" in writeElementEnd below...
  } else {
    writer.write((int)'>');
  }
}
origin: org.virtuslab/milyn-smooks-core

public void writeElementEnd(Element element, Writer writer) throws IOException {
  writeElementEnd(element, writer, null);
}
origin: org.milyn/milyn-smooks-all

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  writeElementStart(element, writer);
}
origin: org.virtuslab/milyn-smooks-core

public void writeElementStart(Element element, Writer writer, ExecutionContext executionContext) throws IOException {
  String key = getContextKey(element);
  if(key != null) {
    Object object = executionContext.getAttribute(key);
    if(object != null) {
      writer.write(object.toString());
    } else {
      logger.debug("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. No Object instance found on context at '" + key + "'.");
    }
  } else {
    logger.warn("Invalid <context-object> specification at '" + DomUtils.getXPath(element) + "'. 'key' attribute not specified.");
  }
}
origin: org.milyn/milyn-smooks-all

public void writeElementStart(Element element, Writer writer) throws IOException {
  writer.write((int)'<');
  writer.write(element.getTagName());
  writeAttributes(element.getAttributes(), writer);
  if(closeEmptyElements && !element.hasChildNodes()) {
    // Do nothing.  We'll close it "short-hand" in writeElementEnd below...
  } else {
    writer.write((int)'>');
  }
}
org.milyn.delivery.dom.serialize

Most used classes

  • ContextObjectSerializationUnit
    ExecutionContext object serializer. Outputs an object bound to the ExecutionContext. The location of
  • DefaultSerializationUnit
    Default SerializationUnit implementation. Default SerialisationUnit where none defined.
  • SerializationUnit
    W3C Node Serailization interface definition. Implementations of this interface are applied to the co
  • Serializer
    Node serializer. This class uses the org.milyn.delivery.ContentDeliveryConfig and the org.milyn.deli
  • GhostElementSerializationUnit
    Ghost element serialization unit. A ghost element can be used to "wrap" other DOM content. The Ghost
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