Package org.apache.isis.applib

Examples of org.apache.isis.applib.Identifier


   
    @Test
    public void defaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        SomeReferencedObject other = new SomeReferencedObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");

        final CollectionRemovedFromEvent<Object, Object> ev = PostsCollectionRemovedFromEventFacet.Util.newEvent(
                CollectionRemovedFromEvent.Default.class, sdo, identifier, other);
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here


    @Test
    public void customEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        SomeReferencedObject other = new SomeReferencedObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");
       
        final CollectionRemovedFromEvent<SomeDomainObject, SomeReferencedObject> ev = PostsCollectionRemovedFromEventFacet.Util.newEvent(
                SomeDomainObjectCollectionRemovedFromEvent.class, sdo, identifier, other);
        assertThat(ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

   
    @Test
    public void defautEventType() throws Exception {
        final SomeDomainObject sdo = new SomeDomainObject();
        final SomeReferencedObject other = new SomeReferencedObject();
        final Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");

        final CollectionAddedToEvent<Object, Object> ev = PostsCollectionAddedToEventFacet.Util.newEvent(
                CollectionAddedToEvent.Default.class, sdo, identifier, other);
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void customEventType() throws Exception {
        final SomeDomainObject sdo = new SomeDomainObject();
        final SomeReferencedObject other = new SomeReferencedObject();
        final Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");
       
        final CollectionAddedToEvent<SomeDomainObject, SomeReferencedObject> ev = PostsCollectionAddedToEventFacet.Util.newEvent(
                SomeDomainObjectCollectionAddedToEvent.class, sdo, identifier, other);
        assertThat(ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

        public Properties metadataProperties(String subKey) {
           
            if(metadataProperties == null) {
                return null;
            }
            Identifier identifier = featureType.identifierFor(getCls(), getMethod());
            final String id = identifier.getMemberName();
           
            // build list of keys to search for...
            final List<String> keys = Lists.newArrayList();
            if(featureType == FeatureType.ACTION) {
                // ... either "action.actionId" or "member.actionId()"
View Full Code Here

        // copy over facets from contributed to own.
        FacetUtil.copyFacets(serviceAction.getFacetedMethod(), facetHolder);

        // calculate the identifier
        final Identifier contributorIdentifier = serviceAction.getFacetedMethod().getIdentifier();
        final String memberName = contributorIdentifier.getMemberName();
        List<String> memberParameterNames = contributorIdentifier.getMemberParameterNames();
        identifier = Identifier.actionIdentifier(getOnType().getCorrespondingClass().getName(), memberName, memberParameterNames);
    }
View Full Code Here

    private static final long serialVersionUID = 1L;

    @Override
    public int compare(final IdentifiedHolder o1, final IdentifiedHolder o2) {
        final Identifier identifier1 = o1.getIdentifier();
        final Identifier identifier2 = o2.getIdentifier();
        return identifier1.compareTo(identifier2);
    }
View Full Code Here

    public String disables(final UsabilityContext<? extends UsabilityEvent> ic) {
        if (!(ic instanceof UsabilityContext)) {
            return null;
        }
        final ObjectAdapter toDisable = ic.getTarget();
        final Identifier identifier = ic.getIdentifier();
        return toDisable != null ? disabledReason(toDisable, identifier) : null;
    }
View Full Code Here

    }
   
    @Test
    public void defaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});

        final ActionInvokedEvent<Object> ev = PostsActionInvokedEventFacet.Util.newEvent(
                ActionInvokedEvent.Default.class, sdo, identifier, new Object[]{1, "bar"});
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    }

    @Test
    public void customEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
       
        final ActionInvokedEvent<SomeDomainObject> ev = PostsActionInvokedEventFacet.Util.newEvent(
                SomeDomainObjectFooInvokedEvent.class, sdo, identifier, new Object[]{1, "bar"});
        assertThat((SomeDomainObject)ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.Identifier

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.