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

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


    }

    private Set<Oid> rendered = Sets.newHashSet();
    @Override
    public boolean canEagerlyRender(ObjectAdapter objectAdapter) {
        final Oid oid = objectAdapter.getOid();
        return rendered.add(oid);
    }
View Full Code Here


    }

    private Set<Oid> rendered = Sets.newHashSet();
    @Override
    public boolean canEagerlyRender(ObjectAdapter objectAdapter) {
        final Oid oid = objectAdapter.getOid();
        return rendered.add(oid);
    }
View Full Code Here

        persistedObjects = new ObjectStorePersistedObjectsDefault();
    }

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

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

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

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

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

        return serviceOidByIdMap.get(objectSpecId);
    }

    @Override
    public void registerService(final ObjectSpecId objectSpecId, final Oid oid) {
        final Oid oidLookedUpByName = serviceOidByIdMap.get(objectSpecId);
        if (oidLookedUpByName != null) {
            if (oidLookedUpByName.equals(oid)) {
                throw new IsisException("Already another service registered as name: " + objectSpecId + " (existing Oid: " + oidLookedUpByName + ", " + "intended: " + oid + ")");
            }
        } else {
            serviceOidByIdMap.put(objectSpecId, oid);
        }
View Full Code Here

                public String toString(Object object) {
                    if(object == null) {
                        return null;
                    }
                    final ObjectAdapter adapter = getAdapterManager().adapterFor(object);
                    Oid oid = adapter.getOid();
                    return oid != null? oid.enString(getOidMarshaller()): encodedValueOf(adapter);
                }
                private String encodedValueOf(ObjectAdapter adapter) {
                    EncodableFacet facet = adapter.getSpecification().getFacet(EncodableFacet.class);
                    return facet != null? facet.toEncodedString(adapter): adapter.toString();
                }
View Full Code Here

        epvSpecification = iswf.loadSpecification(SimpleEntity.class);
    }

    @Test
    public void getOidForServices() throws Exception {
        final Oid oidForService = getStore().getOidForService(iswf.loadSpecification(ParentEntityRepository.class));
        assertEquals(RootOidDefault.create(ObjectSpecId.of("ParentEntities"), "1"), oidForService);
    }
View Full Code Here

        return this;
    }

    public PojoAdapter build() {
        final RootOid rootOid = persistence.createOid(objectSpecId, identifier);
        final Oid oid = type.oidFor(rootOid, objectSpecId, aggregatedId);
        final PojoAdapter pojoAdapter = new PojoAdapter(pojo, oid, specificationLoader, objectAdapterLookup, localization, authenticationSession) {
            @Override
            public ObjectSpecification getSpecification() { return objectSpec != null? objectSpec: super.getSpecification(); }
            @Override
            public String titleString() {
View Full Code Here

     *
     * @see #remapAsPersistent(ObjectAdapter)
     */
    @Override
    public void remapAsPersistent(final ObjectAdapter adapter) {
        final Oid transientOid = adapter.getOid();
        adapterManager.remapAsPersistent(adapter, null);
        final Oid persistentOid = adapter.getOid();
        persistentByTransient.put(transientOid, persistentOid);
    }
View Full Code Here

TOP

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

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.