Package org.apache.tuscany.sca.common.xml.stax.reader

Examples of org.apache.tuscany.sca.common.xml.stax.reader.NamespaceContextImpl


     * @param expression
     * @param context
     * @return
     */
    public NamespaceContext getNamespaceContext(String expression, NamespaceContext context) {
        NamespaceContextImpl nsContext = new NamespaceContextImpl(null);

        boolean found = false;
        for (String prefix : getPrefixes(expression)) {
            String namespace = context.getNamespaceURI(prefix);
            if (namespace != null && !XMLConstants.NULL_NS_URI.equals(namespace)) {
                nsContext.register(prefix, namespace);
                if ( (namespace.equals("http://docs.oasis-open.org/ns/opencsa/sca/200912")) && !prefix.equals(XMLConstants.DEFAULT_NS_PREFIX))
                  found = true;
            }
        }
       
        if(!found) {
            nsContext.register("__sca", "http://docs.oasis-open.org/ns/opencsa/sca/200912");
        }
        return nsContext;
    }
View Full Code Here


     * @param prefix
     * @param namespace
     * @param context
     */
    public void registerPrefix(String prefix, String namespace, NamespaceContext context) {
      NamespaceContextImpl nsContext = (NamespaceContextImpl) context;
      nsContext.register(prefix, namespace);
    }
View Full Code Here

    public JSR250PolicyProcessor(ExtensionPointRegistry registry) throws IntrospectionException {
        super(registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(AssemblyFactory.class));
        this.policyFactory = registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(PolicyFactory.class);
       
        this.xpathHelper = XPathHelper.getInstance(registry);
        NamespaceContextImpl nsContext = new NamespaceContextImpl(null);
        nsContext.register("sca", "http://docs.oasis-open.org/ns/opencsa/sca/200912");
        XPath path = xpathHelper.newXPath();
        try {
            appliesToExpression = xpathHelper.compile(path, nsContext, appliesToString);
        } catch (XPathExpressionException e) {
            throw new IntrospectionException(e);
View Full Code Here

     * @param expression
     * @param context
     * @return
     */
    public NamespaceContext getNamespaceContext(String expression, NamespaceContext context) {
        NamespaceContextImpl nsContext = new NamespaceContextImpl(null);

        for (String prefix : getPrefixes(expression)) {
            String namespace = context.getNamespaceURI(prefix);
            if (namespace != null && !XMLConstants.NULL_NS_URI.equals(namespace)) {
                nsContext.register(prefix, namespace);
            }
        }
        return nsContext;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.common.xml.stax.reader.NamespaceContextImpl

Copyright © 2018 www.massapicom. 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.