Tabnine Logo
sirius.kernel.xml
Code IndexAdd Tabnine to your IDE (free)

How to use sirius.kernel.xml

Best Java code snippets using sirius.kernel.xml (Showing top 20 results out of 315)

origin: com.scireum/sirius-kernel

  /**
   * Provides access to the XML answer of the call.
   *
   * @return the XML result of the call
   * @throws IOException in case of an IO error while receiving the result
   */
  public XMLStructuredInput getInput() throws IOException {
    return new XMLStructuredInput(outcall.getInput(), true);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Can be used to generate the XML request.
 *
 * @return the an input which can be used to generate an XML document which is sent to the URL
 * @throws IOException in case of an IO error while sending the XML document
 */
public XMLStructuredOutput getOutput() throws IOException {
  return new XMLStructuredOutput(outcall.getOutput());
}
origin: com.scireum/sirius-kernel

/**
 * Creates a new XMLCall for the given url.
 *
 * @param url         the target URL to call
 * @param contentType the Content-Type to use
 * @return a new instance to perform the xml call
 * @throws IOException in case of an IO error
 */
public static XMLCall to(URL url, String contentType) throws IOException {
  XMLCall result = new XMLCall();
  result.outcall = new Outcall(url);
  result.outcall.setRequestProperty("Content-Type", contentType);
  return result;
}
origin: scireum/s3ninja

private void outputOwnerInfo(XMLStructuredOutput out, String name) {
  out.beginObject(name);
  out.property("ID", "initiatorId");
  out.property(RESPONSE_DISPLAY_NAME, "initiatorName");
  out.endObject();
}
origin: com.scireum/sirius-kernel

@Override
public StructuredOutput beginObject(String name, Attribute... attributes) {
  startObject(name, attributes);
  if (!nesting.isEmpty()) {
    nesting.get(0).setEmpty(false);
  }
  nesting.add(0, new Element(ElementType.OBJECT, name));
  return this;
}
origin: com.scireum/sirius-kernel

private boolean nodeUp() {
  if (isComplete()) {
    nodeHandler.process(StructuredNode.of(root));
    return true;
  }
  currentNode = currentNode.getParentNode();
  return false;
}
origin: com.scireum/sirius-kernel

@Override
public StructuredOutput beginArray(String name) {
  startArray(name);
  if (!nesting.isEmpty()) {
    nesting.get(0).setEmpty(false);
  }
  nesting.add(0, new Element(ElementType.ARRAY, name));
  return this;
}
origin: com.scireum/sirius-kernel

@Override
public StructuredOutput beginResult(String name) {
  return beginOutput(name);
}
origin: com.scireum/sirius-kernel

/**
 * Parses the given stream.
 *
 * @param stream the stream to parse
 * @throws IOException if parsing the XML fails either due to an IO error or due to an SAXException (when
 *                     processing a malformed XML).
 */
public void parse(InputStream stream) throws IOException {
  parse(stream, null);
}
origin: com.scireum/sirius-kernel

/**
 * Iterates through the sub-tree and invokes the given handler for each child node.
 *
 * @param nodeHandler the handler invoked for each child element
 */
public void visitNodes(Consumer<StructuredNode> nodeHandler) {
  visit(nodeHandler, null);
}
origin: com.scireum/sirius-kernel

/**
 * Writes the given XML document to the given writer.
 *
 * @param doc      the XML document to write
 * @param writer   the target to write the XML to
 * @param encoding the encoding used to write the XML
 * @throws javax.xml.transform.TransformerException if an exception during serialization occurs.
 */
public static void writeXML(Node doc, Writer writer, String encoding) throws TransformerException {
  writeXML(doc, writer, encoding, false);
}
origin: com.scireum/sirius-kernel

  /**
   * Creates a new attribute with the given name and value.
   *
   * @param name  the name of the attribute
   * @param value the value of the attribute
   * @return a new attribute with the given name and value
   */
  public static Attribute set(String name, Object value) {
    return new Attribute(name, value);
  }
}
origin: com.scireum/sirius-kernel

@Override
public void processingInstruction(String target, String data) throws SAXException {
  // Delegate to active handlers...
  for (SAX2DOMHandler handler : activeHandlers) {
    handler.processingInstruction(target, data);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Creates a new XMLCall for the given url with Content-Type 'text/xml'.
 *
 * @param url the target URL to call
 * @return an <tt>XMLCall</tt> which can be used to send and receive XML
 * @throws IOException in case of an IO error
 */
public static XMLCall to(URL url) throws IOException {
  return to(url, "text/xml");
}
origin: com.scireum/sirius-kernel

@Override
public StructuredNode getNode(String xpath) throws XPathExpressionException {
  return node.queryNode(xpath);
}
origin: com.scireum/sirius-kernel

@Override
public String toString() {
  return node == null ? "" : node.toString();
}
origin: com.scireum/sirius-kernel

/**
 * Adds a custom header field to the call
 *
 * @param name  name of the field
 * @param value value of the field
 * @return returns the XML call itself for fluent method calls
 */
public XMLCall addHeader(String name, String value) {
  outcall.setRequestProperty(name, value);
  return this;
}
origin: com.scireum/sirius-kernel

@Override
public StructuredOutput beginObject(String name) {
  startObject(name, (Attribute[]) null);
  if (!nesting.isEmpty()) {
    nesting.get(0).setEmpty(false);
  }
  nesting.add(0, new Element(ElementType.OBJECT, name));
  return this;
}
origin: com.scireum/sirius-kernel

@Override
public StructuredOutput beginResult() {
  return beginOutput("result");
}
origin: com.scireum/sirius-kernel

/**
 * Iterates through the sub-tree and invokes the given handler for each text node.
 *
 * @param textNodeHandler the handler invoked for each text node
 */
public void visitTexts(Consumer<Node> textNodeHandler) {
  visit(null, textNodeHandler);
}
sirius.kernel.xml

Most used classes

  • StructuredNode
    Represents a structured node, which is part of a StructuredInput. This is basically a XML node which
  • Attribute
    Used to pass in attributes when creating objects for a StructuredOutput.
  • XMLReader
    A combination of DOM and SAX parser which permits to parse very large XML files while conveniently h
  • XMLStructuredOutput
    Represents a StructuredOutput emitting XML data. Can be used to construct XML using the StructuredOu
  • AbstractStructuredOutput$Element
    Used by internal bookkeeping, to close elements property
  • AbstractStructuredOutput,
  • NodeHandler,
  • Outcall,
  • SAX2DOMHandler,
  • XMLCall,
  • XMLGenerator,
  • XMLReader$UserInterruptException,
  • XMLStructuredInput
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