Package org.apache.ws.policy.util

Examples of org.apache.ws.policy.util.StAXPolicyWriter.writePolicy()


    protected void writePolicyExtensibilityElement(PolicyExtensibilityElement policyExtensibilityElement) throws XMLStreamException {
        StAXPolicyWriter policyWriter = (StAXPolicyWriter) PolicyFactory.getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
        Object policyElement = policyExtensibilityElement.getPolicyElement();
       
        if (policyElement instanceof Policy) {
            policyWriter.writePolicy((Policy) policyElement, writer);
                       
        } else if (policyElement instanceof PolicyReference) {
            policyWriter.writePolicyReference((PolicyReference) policyElement, writer);
        }
    }
View Full Code Here


   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    StAXPolicyWriter pwtr = (StAXPolicyWriter) PolicyFactory
        .getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
   
    pwtr.writePolicy(policy, baos);
    return getSafeString(baos.toString());
  }
 
  private static String getSafeString(String unsafeString) {
    StringBuffer sbuf = new StringBuffer();
View Full Code Here

    protected void writePolicyExtensibilityElement(PolicyExtensibilityElement policyExtensibilityElement) throws XMLStreamException {
        StAXPolicyWriter policyWriter = (StAXPolicyWriter) PolicyFactory.getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
        Object policyElement = policyExtensibilityElement.getPolicyElement();
       
        if (policyElement instanceof Policy) {
            policyWriter.writePolicy((Policy) policyElement, writer);
                       
        } else if (policyElement instanceof PolicyReference) {
            policyWriter.writePolicyReference((PolicyReference) policyElement, writer);
        }
    }
View Full Code Here

        for (Iterator iterator = elementList.iterator(); iterator.hasNext();) {
            Object policyElement = iterator.next();

            if (policyElement instanceof Policy) {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                pwrt.writePolicy((Policy) policyElement, baos);

                ByteArrayInputStream bais = new ByteArrayInputStream(baos
                        .toByteArray());
                element.addChild(OMXMLBuilderFactory.createStAXOMBuilder(
                        factory,
View Full Code Here

                if(p == null) {
                    throw new Exception("Policy not found for uri : " + policyURIString);
                }
               
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                pwrt.writePolicy(p, baos);

                ByteArrayInputStream bais = new ByteArrayInputStream(baos
                        .toByteArray());
                getDefinitionElement().addChild(OMXMLBuilderFactory.createStAXOMBuilder(
                        factory,
View Full Code Here

   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    StAXPolicyWriter pwtr = (StAXPolicyWriter) PolicyFactory
        .getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
   
    pwtr.writePolicy(policy, baos);
    return getSafeString(baos.toString());
  }
 
  private static String getSafeString(String unsafeString) {
    StringBuffer sbuf = new StringBuffer();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.