Package org.apache.jackrabbit.spi.commons.namespace

Examples of org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver


     * @throws IOException if the node type definition file cannot be read
     */
    public NodeTypeReader(InputStream xml) throws IOException {
        walker = new DOMWalker(xml);
        namespaces = walker.getNamespaces();
        NamespaceResolver nsResolver = new AdditionalNamespaceResolver(namespaces);
        resolver = new DefaultNamePathResolver(nsResolver);
        valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);
    }
View Full Code Here


        this.config = config;

        // dummy value factory and dummy resolver as descriptors are not
        // expected contain Name or Path values.
        ValueFactory vf = ValueFactoryImpl.getInstance();
        NamePathResolver resolver = new DefaultNamePathResolver(new NamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return uri;
View Full Code Here

            }
        }
    }

    public void testExpandedJcrNames() throws NamespaceException, IllegalNameException {
        NamespaceResolver resolver = new TestNamespaceResolver();

        List valid = new ArrayList();
        // valid qualified jcr-names:
        // String-array consisting of { jcrName , uri , localName }
        valid.add(new String[] {"abc:{c}", "abc", "{c}"});
View Full Code Here

            }
        }
    }

    public void testCheckFormatOfExpandedNames() throws NamespaceException, IllegalNameException {
        NamespaceResolver resolver = new TestNamespaceResolver();

        List valid = new ArrayList();
        // valid qualified jcr-names:
        // String-array consisting of { jcrName , uri , localName }
        valid.add(new String[] {"abc:{c}", "abc", "{c}"});
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        factory = PathFactoryImpl.getInstance();

        NamespaceResolver nsresolver = new NamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                throw new UnsupportedOperationException();
            }
            public String getPrefix(String uri) throws NamespaceException {
                if (uri.equals(Name.NS_JCR_URI)) {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        rs = helper.getRepositoryService();
        si = helper.getAdminSessionInfo();
        NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here

                QValue[] qvs = new QValue[vs.length];
                for (int i = 0; i < vs.length; i++) {
                    // Name and path resolver that uses a dummy namespace resolver
                    // as Name/Path values are not expected to occur in the
                    // descriptors. TODO: check again.
                    NamePathResolver resolver = new DefaultNamePathResolver(new NamespaceResolver() {
                        public String getURI(String prefix) throws NamespaceException {
                            return prefix;
                        }
                        public String getPrefix(String uri) throws NamespaceException {
                            return uri;
View Full Code Here

                    NameFactory nameFactory, PathFactory pathFactory) throws RepositoryException {
        this.session = session;
        this.credentials = credentials;

        final NamespaceRegistry nsReg = session.getWorkspace().getNamespaceRegistry();
        final NamespaceResolver nsResolver = new NamespaceResolver() {
            public String getPrefix(String uri) throws NamespaceException {
                try {
                    return nsReg.getPrefix(uri);
                }
                catch (RepositoryException e) {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        rs = helper.getRepositoryService();
        si = helper.getAdminSessionInfo();
        NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        rs = helper.getRepositoryService();
        si = helper.getAdminSessionInfo();
        NamespaceResolver nsResolver = new AbstractNamespaceResolver() {
            public String getURI(String prefix) throws NamespaceException {
                return ("jcr".equals(prefix)) ? "http://www.jcp.org/jcr/1.0" : prefix;
            }
            public String getPrefix(String uri) throws NamespaceException {
                return ("http://www.jcp.org/jcr/1.0".equals(uri)) ? "jcr" : uri;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver

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.