Java Code Examples for com.sun.xml.internal.txw2.TypedXmlWriter#_pcdata

The following examples show how to use com.sun.xml.internal.txw2.TypedXmlWriter#_pcdata . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlPolicyModelMarshaller.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 2
Source File: XmlPolicyModelMarshaller.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 3
Source File: XmlPolicyModelMarshaller.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 4
Source File: XmlPolicyModelMarshaller.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 5
Source File: XmlPolicyModelMarshaller.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 6
Source File: XmlPolicyModelMarshaller.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 7
Source File: XmlPolicyModelMarshaller.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}
 
Example 8
Source File: XmlPolicyModelMarshaller.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Marshal given ModelNode and child elements on given TypedXmlWriter.
 *
 * @param nsVersion The WS-Policy version.
 * @param rootNode The ModelNode that is marshalled.
 * @param writer The TypedXmlWriter onto which the content of the rootNode is marshalled.
 */
private void marshal(final NamespaceVersion nsVersion, final ModelNode rootNode, final TypedXmlWriter writer) {
    for (ModelNode node : rootNode) {
        final AssertionData data = node.getNodeData();
        if (marshallInvisible || data == null || !data.isPrivateAttributeSet()) {
            TypedXmlWriter child = null;
            if (data == null) {
                child = writer._element(nsVersion.asQName(node.getType().getXmlToken()), TypedXmlWriter.class);
            } else {
                child = writer._element(data.getName(), TypedXmlWriter.class);
                final String value = data.getValue();
                if (value != null) {
                    child._pcdata(value);
                }
                if (data.isOptionalAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Optional), Boolean.TRUE);
                }
                if (data.isIgnorableAttributeSet()) {
                    child._attribute(nsVersion.asQName(XmlToken.Ignorable), Boolean.TRUE);
                }
                for (Entry<QName, String> entry : data.getAttributesSet()) {
                    child._attribute(entry.getKey(), entry.getValue());
                }
            }
            marshal(nsVersion, node, child);
        }
    }
}