本文整理了Java中org.apache.isis.applib.Identifier.actionIdentifier()
方法的一些代码示例,展示了Identifier.actionIdentifier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Identifier.actionIdentifier()
方法的具体详情如下:
包路径:org.apache.isis.applib.Identifier
类名称:Identifier
方法名:actionIdentifier
暂无
代码示例来源:origin: org.apache.isis.core/metamodel
@Override
public Identifier identifierFor(final Class<?> type, final Method method) {
final String fullMethodName = method.getName();
final Class<?>[] parameterTypes = method.getParameterTypes();
return Identifier.actionIdentifier(type.getName(), fullMethodName, parameterTypes);
}
},
代码示例来源:origin: org.apache.isis.core/isis-core-applib
public static Identifier actionIdentifier(final Class<?> declaringClass, final String actionName, final Class<?>... parameterClasses) {
return actionIdentifier(declaringClass.getCanonicalName(), actionName, classNamesOf(parameterClasses));
}
代码示例来源:origin: org.apache.isis.core/isis-core-applib
public static Identifier actionIdentifier(final String declaringClassName, final String actionName, final Class<?>... parameterClasses) {
return actionIdentifier(declaringClassName, actionName, classNamesOf(parameterClasses));
}
代码示例来源:origin: org.apache.isis/applib
public static Identifier actionIdentifier(final Class<?> declaringClass, final String actionName, final Class<?>... parameterClasses) {
return actionIdentifier(declaringClass.getCanonicalName(), actionName, classNamesOf(parameterClasses));
}
代码示例来源:origin: org.apache.isis/applib
public static Identifier actionIdentifier(final String declaringClassName, final String actionName, final Class<?>... parameterClasses) {
return actionIdentifier(declaringClassName, actionName, classNamesOf(parameterClasses));
}
代码示例来源:origin: org.apache.isis.core/isis-core-applib
return actionIdentifier(className, name, parmList);
代码示例来源:origin: org.apache.isis/applib
return actionIdentifier(className, name, parmList);
代码示例来源:origin: org.apache.isis.core/isis-core-applib
@Before
public void setUp() {
source = new Object();
identifier = Identifier.actionIdentifier("CustomerOrder", "cancelOrder", new Class[] { String.class, boolean.class });
advisorClass = this.getClass();
}
代码示例来源:origin: org.apache.isis.core/isis-core-applib
@Test
public void memberParameterNames() {
final Class<?> domainClass = SomeDomainClass.class;
identifier = Identifier.actionIdentifier(domainClass, "placeOrder", int.class, String.class);
assertThat(identifier.getMemberParameterNames(), is(Arrays.asList("int", "java.lang.String")));
}
代码示例来源:origin: org.apache.isis.core/isis-core-applib
@Test
public void paramsIdentityString() {
final Class<?> domainClass = SomeDomainClass.class;
identifier = Identifier.actionIdentifier(domainClass, "placeOrder", int.class, String.class, BigDecimal.class);
assertThat(identifier.toParmsIdentityString(), is("(int,java.lang.String,java.math.BigDecimal)"));
}
代码示例来源:origin: org.apache.isis.core/isis-core-metamodel
@Test
public void defaultEventType() throws Exception {
final SomeDomainObject sdo = new SomeDomainObject();
final Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
final ActionDomainEvent<Object> ev = new DomainEventHelper(null).newActionDomainEvent(
ActionDomainEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
assertThat(ev.getSource(), is((Object)sdo));
assertThat(ev.getIdentifier(), is(identifier));
assertThat(ev.getArguments(), is(not(nullValue())));
assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
assertThat(ev.getArguments().get(1), is((Object)"bar"));
}
代码示例来源:origin: org.apache.isis.core/isis-core-metamodel
@Test
public void customEventType() throws Exception {
final SomeDomainObject sdo = new SomeDomainObject();
final Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
final ActionDomainEvent<SomeDomainObject> ev = new DomainEventHelper(null).newActionDomainEvent(
SomeDomainObjectFooInvokedDomainEvent.class, identifier, sdo, new Object[]{1, "bar"});
assertThat((SomeDomainObject)ev.getSource(), is(sdo));
assertThat(ev.getIdentifier(), is(identifier));
assertThat(ev.getArguments(), is(not(nullValue())));
assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
assertThat(ev.getArguments().get(1), is((Object)"bar"));
}
代码示例来源:origin: org.apache.isis.core/isis-core-metamodel
@Test
public void actionInvokedEventDefaultEventType() throws Exception {
final SomeDomainObject sdo = new SomeDomainObject();
final Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
final ActionDomainEvent<Object> ev = new DomainEventHelper(null).newActionDomainEvent(
ActionInvokedEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
assertThat(ev.getSource(), is((Object)sdo));
assertThat(ev.getIdentifier(), is(identifier));
assertThat(ev.getArguments(), is(not(nullValue())));
assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
assertThat(ev.getArguments().get(1), is((Object)"bar"));
}
代码示例来源:origin: org.apache.isis.core/isis-core-metamodel
@Before
public void setUp() throws Exception {
context.checking(new Expectations() {{
allowing(mockServicesInjector).lookupService(TranslationService.class);
will(returnValue(mockTranslationService));
allowing(mockServicesInjector).getConfigurationServiceInternal();
will(returnValue(mockConfiguration));
allowing(mockServicesInjector).injectServicesInto(with(any(List.class)));
allowing(mockFacetedMethod).getIdentifier();
will(returnValue(Identifier.actionIdentifier(Customer.class, "foo")));
}});
domainObjectClassWithoutAnnotation = DomainObjectWithoutMustSatisfyAnnotations.class;
domainObjectClassWithAnnotation = DomainObjectWithMustSatisfyAnnotations.class;
firstNameMethodWithout = domainObjectClassWithoutAnnotation.getMethod("getFirstName");
firstNameMethodWith = domainObjectClassWithAnnotation.getMethod("getFirstName");
facetFactory = new PropertyAnnotationFacetFactory();
facetFactory.setServicesInjector(mockServicesInjector);
}
代码示例来源:origin: org.apache.isis.viewer/wicket-ui
@Ignore("broken...")
@Test
public void whenUserActionThenSingleMenuItem() throws Exception {
new ActionFixtures(context).isVisible(mockUserAction, true);
new ActionFixtures(context).isUsable(mockUserAction, true);
new ActionFixtures(context).getName(mockUserAction, "findCustomers");
new ActionFixtures(context).getParameterCount(mockUserAction, 0);
new AdapterFixtures(context).getOid(mockAdapter, mockOid);
new ActionFixtures(context).getOnType(mockUserAction, mockUserActionOnTypeSpec);
new SpecFixtures(context).getFullName(mockUserActionOnTypeSpec, Customers.class.getName());
new ActionFixtures(context).getType(mockUserAction, ActionType.USER);
new ActionFixtures(context).getIdentifier(context, mockUserAction, Identifier.actionIdentifier(Customers.class, "findCustomers", new Class[0]));
new SystemFixtures(context).newLink(mockLinkBuilder, "linkId", mockAdapterMemento, mockUserAction, fakeLink);
final CssMenuItem parentMenuItem = CssMenuItem.newMenuItem("parent").build();
parentMenuItem.newSubMenuItem(mockAdapterMemento, mockUserAction, mockLinkBuilder).build();
assertThat(parentMenuItem.hasSubMenuItems(), is(true));
assertThat(parentMenuItem.getSubMenuItems().size(), is(1));
}
代码示例来源:origin: org.apache.isis.core/isis-core-metamodel
@Before
public void setUp() throws Exception {
stubConfiguration = new IsisConfigurationDefault();
context.checking(new Expectations() {{
allowing(mockServicesInjector).lookupService(TranslationService.class);
will(returnValue(mockTranslationService));
allowing(mockServicesInjector).getConfigurationServiceInternal();
will(returnValue(stubConfiguration));
allowing(mockServicesInjector).injectServicesInto(with(any(List.class)));
}});
domainObjectClassWithoutAnnotation = DomainObjectWithoutMustSatisfyAnnotations.class;
domainObjectClassWithAnnotation = DomainObjectWithMustSatisfyAnnotations.class;
changeLastNameMethodWithout = domainObjectClassWithoutAnnotation.getMethod("changeLastName", String.class);
changeLastNameMethodWith = domainObjectClassWithAnnotation.getMethod("changeLastName", String.class);
context.checking(new Expectations() {
{
allowing(mockFacetedMethodParameter).getIdentifier();
will(returnValue(Identifier.actionIdentifier(Customer.class, "foo")));
}
});
facetFactory = new ParameterAnnotationFacetFactory();
facetFactory.setServicesInjector(mockServicesInjector);
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime
@Override
@Before
public void setUp() throws Exception {
super.setUp();
mockFacetedMethod = mockery.mock(FacetedMethod.class);
mockAuthenticationSessionProvider = mockery.mock(AuthenticationSessionProvider.class);
mockSpecificationLookup = mockery.mock(SpecificationLookup.class);
mockAdapterManager = mockery.mock(AdapterMap.class);
mockServicesProvider = mockery.mock(ServicesProvider.class);
mockQuerySubmitter = mockery.mock(QuerySubmitter.class);
mockCollectionTypeRegistry = mockery.mock(CollectionTypeRegistry.class);
mockery.checking(new Expectations() {
{
one(mockFacetedMethod).getIdentifier();
will(returnValue(Identifier.actionIdentifier("Customer", "reduceheadcount")));
}
});
action = new ObjectActionImpl(mockFacetedMethod, new ObjectMemberContext(mockAuthenticationSessionProvider, mockSpecificationLookup, mockAdapterManager, mockQuerySubmitter, mockCollectionTypeRegistry), mockServicesProvider);
}
内容来源于网络,如有侵权,请联系作者删除!