Examples of addMixin()


Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixIn()

     */
   
    public void testMixinFieldInheritance() throws IOException
    {
        ObjectMapper mapper = new ObjectMapper();
        mapper.addMixIn(Beano.class, BeanoMixinSub.class);
        Map<String,Object> result;
        result = writeAndMap(mapper, new Beano());
        assertEquals(2, result.size());
        assertTrue(result.containsKey("id"));
        assertTrue(result.containsKey("name"));
View Full Code Here

Examples of javax.jcr.Node.addMixin()

                    }
                }

                // add the remaining mixing types that are not yet set
                for (String mixin : mixins) {
                    n.addMixin(mixin);
                }
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } else if (JCR_PRIMARYNODETYPE.equals(propName)) {
View Full Code Here

Examples of javax.jcr.Node.addMixin()

                    mixinNames.removeAll(currentMixins);
                    for (String mixName : remove) {
                        n.removeMixin(mixName);
                    }
                    for (String mixName : mixinNames) {
                        n.addMixin(mixName);
                    }
                    return null;
                }
            });
        }
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        assertTrue(it.hasNext());

        // the same should be true, if the rep:AccessControllable mixin has
        // been manually added
        Node n = (Node) superuser.getItem(childNPath);
        n.addMixin(((SessionImpl) superuser).getJCRName(AccessControlConstants.NT_REP_ACCESS_CONTROLLABLE));
        it = acMgr.getApplicablePolicies(childNPath);
        assertTrue(it.hasNext());
    }

    public void testInheritance2() throws RepositoryException, NotExecutableException {
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            if ( !create ) {
                return null;
            }
            try {
                final Node bcNode = parentNode.addNode(nodeName, "nt:unstructured");
                bcNode.addMixin("mix:lockable");
                parentNode.save();
            } catch (RepositoryException re) {
                // for concurrency issues (running in a cluster) we ignore exceptions
                this.log.warn("Unable to create node " + nodeName, re);
                session.refresh(true);
View Full Code Here

Examples of javax.jcr.Node.addMixin()

     * Test for regressing this issue:
     * https://issues.apache.org/jira/browse/SLING-534
     */
    public void testMultiValReferencePropLookup() throws Exception {
        Node refNode1 = getNewNode();
        refNode1.addMixin("mix:referenceable");
        Node refNode2 = getNewNode();
        refNode2.addMixin("mix:referenceable");

        node.setProperty("singleRef", refNode1);
        node.setProperty("multiRef", new Value[] {
View Full Code Here

Examples of javax.jcr.Node.addMixin()

     */
    public void testMultiValReferencePropLookup() throws Exception {
        Node refNode1 = getNewNode();
        refNode1.addMixin("mix:referenceable");
        Node refNode2 = getNewNode();
        refNode2.addMixin("mix:referenceable");

        node.setProperty("singleRef", refNode1);
        node.setProperty("multiRef", new Value[] {
            session.getValueFactory().createValue(refNode1),
            session.getValueFactory().createValue(refNode2) });
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            // amend mixin node types
            if (mixinNodeTypes != null) {
                for (final String mixin : mixinNodeTypes) {
                    if (!node.isNodeType(mixin)) {
                        node.addMixin(mixin);
                    }
                }
            }

            // check if node is versionable
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        Session s = repository.loginAdministrative(null);
        try {
            final String path = "XPATH_QUERY_" + System.currentTimeMillis();
            final String absPath = "/" + path;
            final Node n = deleteAfterTests(s.getRootNode().addNode(path));
            n.addMixin("mix:title");
            s.save();

            final String statement = "/jcr:root//element(*, mix:title)";
            @SuppressWarnings("deprecation")
            final Query q = s.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        // creating <nodeCount> x <childNodeCount> nodes with vanity
        for (int j = 0; j < nodeCount; j++) {
            Node content = rootNode.addNode("a" + j, JcrConstants.NT_UNSTRUCTURED);
            String s = new BigInteger(130, random).toString(32);
            content.addMixin(NT_VANITY_PATH);
            content.setProperty(PN_VANITY_PATH, s);
            for (int k = 0; k < childNodeCount; k++) {
                Node content2 = content.addNode("b" + k, JcrConstants.NT_UNSTRUCTURED);
                String ss = new BigInteger(130, random).toString(32);
                content2.addMixin(NT_VANITY_PATH);
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.