Java 类org.dom4j.ProcessingInstruction 实例源码

项目:Gargoyle    文件:XMLAttibuteFormatWriter.java   
protected void writeProcessingInstruction(ProcessingInstruction pi) throws IOException {
    // indent();
    writer.write("<?");
    writer.write(pi.getName());
    writer.write(" ");
    writer.write(pi.getText());
    writer.write("?>");
    writePrintln();

    lastOutputNodeType = Node.PROCESSING_INSTRUCTION_NODE;
}
项目:dls-repository-stack    文件:AbstractTestCase.java   
public void assertNodesEqual( Node n1, Node n2 ) {
    int nodeType1 = n1.getNodeType();
    int nodeType2 = n2.getNodeType();
    assertTrue( "Nodes are of same type: ", nodeType1 == nodeType2 );

    switch (nodeType1) {
        case Node.ELEMENT_NODE:
            assertNodesEqual((Element) n1, (Element) n2);
            break;
        case Node.DOCUMENT_NODE:
            assertNodesEqual((Document) n1, (Document) n2);
            break;
        case Node.ATTRIBUTE_NODE:
            assertNodesEqual((Attribute) n1, (Attribute) n2);
            break;
        case Node.TEXT_NODE:
            assertNodesEqual((Text) n1, (Text) n2);
            break;
        case Node.CDATA_SECTION_NODE:
            assertNodesEqual((CDATA) n1, (CDATA) n2);
            break;
        case Node.ENTITY_REFERENCE_NODE:
            assertNodesEqual((Entity) n1, (Entity) n2);
            break;
        case Node.PROCESSING_INSTRUCTION_NODE:
            assertNodesEqual((ProcessingInstruction) n1, (ProcessingInstruction) n2);
            break;
        case Node.COMMENT_NODE:
            assertNodesEqual((Comment) n1, (Comment) n2);
            break;
        case Node.DOCUMENT_TYPE_NODE:
            assertNodesEqual((DocumentType) n1, (DocumentType) n2);
            break;
        case Node.NAMESPACE_NODE:
            assertNodesEqual((Namespace) n1, (Namespace) n2);
            break;
        default:
            assertTrue( "Invalid node types. node1: " + n1 + " and node2: " + n2, false );
    }
}
项目:lams    文件:ElementWrapper.java   
public ProcessingInstruction processingInstruction(String name) {
    return element.processingInstruction( name );
}
项目:lams    文件:ElementWrapper.java   
public void add(ProcessingInstruction processingInstruction) {
    element.add( processingInstruction );
}
项目:lams    文件:ElementWrapper.java   
public boolean remove(ProcessingInstruction processingInstruction) {
    return element.remove( processingInstruction );
}
项目:gitplex-mit    文件:VersionedDocument.java   
public void add(ProcessingInstruction pi) {
    getWrapped().add(pi);
}
项目:gitplex-mit    文件:VersionedDocument.java   
public ProcessingInstruction processingInstruction(String target) {
    return getWrapped().processingInstruction(target);
}
项目:gitplex-mit    文件:VersionedDocument.java   
public List<ProcessingInstruction> processingInstructions() {
    return getWrapped().processingInstructions();
}
项目:gitplex-mit    文件:VersionedDocument.java   
public List<ProcessingInstruction> processingInstructions(String target) {
    return getWrapped().processingInstructions(target);
}
项目:gitplex-mit    文件:VersionedDocument.java   
public boolean remove(ProcessingInstruction pi) {
    return getWrapped().remove(pi);
}
项目:gitplex-mit    文件:VersionedDocument.java   
public void setProcessingInstructions(List<ProcessingInstruction> listOfPIs) {
    getWrapped().setProcessingInstructions(listOfPIs);
}
项目:dls-repository-stack    文件:AbstractTestCase.java   
public void assertNodesEqual( ProcessingInstruction n1, ProcessingInstruction n2 ) {
    assertEquals( "PI targets equal", n1.getTarget(), n2.getTarget() );
    assertEquals( "PI text equal", n1.getText(), n2.getText() );
}
项目:cacheonix-core    文件:ElementWrapper.java   
public ProcessingInstruction processingInstruction(String name) {
    return element.processingInstruction( name );
}
项目:cacheonix-core    文件:ElementWrapper.java   
public void add(ProcessingInstruction processingInstruction) {
    element.add( processingInstruction );
}
项目:cacheonix-core    文件:ElementWrapper.java   
public boolean remove(ProcessingInstruction processingInstruction) {
    return element.remove( processingInstruction );
}
项目:cacheonix-core    文件:Dom4jProxy.java   
public ProcessingInstruction processingInstruction(String name) {
    return target().processingInstruction( name );
}
项目:cacheonix-core    文件:Dom4jProxy.java   
public void add(ProcessingInstruction processingInstruction) {
    target().add( processingInstruction );
}
项目:cacheonix-core    文件:Dom4jProxy.java   
public boolean remove(ProcessingInstruction processingInstruction) {
    return target().remove( processingInstruction );
}
项目:jaxen    文件:DocumentNavigator.java   
public boolean isProcessingInstruction(Object obj)
{
    return obj instanceof ProcessingInstruction;
}
项目:jaxen    文件:DocumentNavigator.java   
public String getProcessingInstructionTarget(Object obj)
{
    ProcessingInstruction pi = (ProcessingInstruction) obj;

    return pi.getTarget();
}
项目:jaxen    文件:DocumentNavigator.java   
public String getProcessingInstructionData(Object obj)
{
    ProcessingInstruction pi = (ProcessingInstruction) obj;

    return pi.getText();
}
项目:Gargoyle    文件:XMLAttibuteFormatWriter.java   
/**
 * Writes the given {@link ProcessingInstruction}.
 * 
 * @param processingInstruction
 *            <code>ProcessingInstruction</code> to output.
 * 
 * @throws IOException
 *             DOCUMENT ME!
 */
public void write(ProcessingInstruction processingInstruction) throws IOException {
    writeProcessingInstruction(processingInstruction);

    if (autoFlush) {
        flush();
    }
}
项目:Gargoyle    文件:XMLAttibuteFormatWriter.java   
protected void writeNode(Node node) throws IOException {
    int nodeType = node.getNodeType();

    switch (nodeType) {
    case Node.ELEMENT_NODE:
        writeElement((Element) node);

        break;

    case Node.ATTRIBUTE_NODE:
        writeAttribute((Attribute) node);

        break;

    case Node.TEXT_NODE:
        writeNodeText(node);

        // write((Text) node);
        break;

    case Node.CDATA_SECTION_NODE:
        writeCDATA(node.getText());

        break;

    case Node.ENTITY_REFERENCE_NODE:
        writeEntity((Entity) node);

        break;

    case Node.PROCESSING_INSTRUCTION_NODE:
        writeProcessingInstruction((ProcessingInstruction) node);

        break;

    case Node.COMMENT_NODE:
        writeComment(node.getText());

        break;

    case Node.DOCUMENT_NODE:
        write((Document) node);

        break;

    case Node.DOCUMENT_TYPE_NODE:
        writeDocType((DocumentType) node);

        break;

    case Node.NAMESPACE_NODE:

        // Will be output with attributes
        // write((Namespace) node);
        break;

    default:
        throw new IOException("Invalid node type: " + node);
    }
}