Package org.apache.isis.core.metamodel.adapter.oid

Examples of org.apache.isis.core.metamodel.adapter.oid.Oid$Matchers


    @SuppressWarnings("unused")
    private void ensureObjectNotLoaded(final PersistenceCapable pojo) {
        final ObjectAdapter adapter = getAdapterManager().getAdapterFor(pojo);
        if(adapter != null) {
            final Oid oid = adapter.getOid();
            throw new IsisException(MessageFormat.format("Object is already mapped in Isis: oid={0}, for {1}", oid, pojo));
        }
    }
View Full Code Here


            for (ObjectAssociation objectAssoc : properties) {
                final ObjectAdapter possibleParentAdapter = objectAssoc.get(candidateAdapter);
                if(possibleParentAdapter == null) {
                    continue;
                }
                final Oid possibleParentOid = possibleParentAdapter.getOid();
                if(possibleParentOid == null) {
                    continue;
                }
                final String possibleParentOidStr = possibleParentOid.enStringNoVersion(getOidMarshaller());
                if(Objects.equal(this.oidNoVerStr, possibleParentOidStr)) {
                    this.addChild(candidateBookmarkableModel);
                    whetherAdded = true;
                }
            }
View Full Code Here

    @Override
    public Object convertToObject(final String value, final Locale locale) {
        if (Strings.isNullOrEmpty(value)) {
            return null;
        }
        final Oid oid = RootOidDefault.deStringEncoded(value, getOidMarshaller());
        final ObjectAdapter adapter = getAdapterManager().getAdapterFor(oid);
        return ObjectAdapterMemento.createOrNull(adapter);
    }
View Full Code Here

    public String convertToString(final Object object, final Locale locale) {
        if (object == null) {
            return null;
        }
        final ObjectAdapterMemento memento = (ObjectAdapterMemento) object;
        final Oid oid = memento.getObjectAdapter(ConcurrencyChecking.NO_CHECK).getOid();
        if (oid == null) {
            // values don't have an Oid...
            // REVIEW: is this right?
            return memento.toString();
        }
        return oid.enString(getOidMarshaller());
    }
View Full Code Here

     * Converts string representation of {@link Oid} to
     * {@link ObjectAdapter}.
     */
    @Override
    public Object convertToObject(final String value, final Locale locale) {
        final Oid oid = RootOidDefault.deStringEncoded(value, getOidMarshaller());
        return getAdapterManager().getAdapterFor(oid);
    }
View Full Code Here

     * Converts {@link ObjectAdapter} to string representation of {@link Oid}.
     */
    @Override
    public String convertToString(final Object object, final Locale locale) {
        final ObjectAdapter adapter = (ObjectAdapter) object;
        final Oid oid = adapter.getOid();
        if (oid == null) {
            // values don't have an Oid
            return null;
        }
       
        return oid.enString(getOidMarshaller());
    }
View Full Code Here

        resetIdentityMap();
    }

    public void testGetObjectByOidWhenEmpty() {
        final ObjectSpecification spec = system.getSpecification(TestPojo.class);
        final Oid oid = new TestProxyOid(10, true);
        try {
            store.getObject(oid, spec);
            fail();
        } catch (final ObjectNotFoundException expected) {
        }
View Full Code Here

        mockOidForBarService = context.mock(Oid.class, "barServiceOid");
    }

    @Test
    public void noServicesInitially() throws Exception {
        final Oid service = persistedObjects.getService("fooService");
        assertThat(service, is(nullValue()));
    }
View Full Code Here

    @Test
    public void registerServicesMakesAvailable() throws Exception {
        persistedObjects.registerService("fooService", mockOidForFooService);

        final Oid service = persistedObjects.getService("fooService");
        assertThat(service, is(mockOidForFooService));
    }
View Full Code Here

    @Test
    public void registerServicesWhenMoreThanOnePullsOutTheCorrectOne() throws Exception {
        persistedObjects.registerService("fooService", mockOidForFooService);
        persistedObjects.registerService("barService", mockOidForBarService);

        final Oid service = persistedObjects.getService("fooService");
        assertThat(service, is(mockOidForFooService));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.oid.Oid$Matchers

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.