You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2011/04/26 20:24:13 UTC
svn commit: r1096837 [9/14] - in /incubator/isis/trunk:
core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/
core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/
core/metamodel/src/main/java/org/apache/isis/core/meta...
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectList.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectList.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectList.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectList.java Tue Apr 26 18:24:05 2011
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.isis.core.metamodel.spec;
import java.util.AbstractList;
@@ -27,13 +26,11 @@ import java.util.Enumeration;
import java.util.List;
import org.apache.commons.collections.iterators.IteratorEnumeration;
-
import org.apache.isis.core.commons.lang.ToString;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-
public class ObjectList extends AbstractList<ObjectAdapter> {
-
+
private final List<ObjectAdapter> instances;
private final ObjectSpecification instanceSpecification;
@@ -46,7 +43,7 @@ public class ObjectList extends Abstract
* Required implementation of {@link AbstractList}.
*/
@Override
- public ObjectAdapter get(int index) {
+ public ObjectAdapter get(final int index) {
return instances.get(index);
}
@@ -58,7 +55,6 @@ public class ObjectList extends Abstract
return instances.size();
}
-
/**
* @deprecated - use {@link #iterator()}.
*/
@@ -72,7 +68,6 @@ public class ObjectList extends Abstract
return instanceSpecification;
}
-
public String titleString() {
return instanceSpecification.getPluralName() + ", " + size();
}
@@ -95,6 +90,5 @@ public class ObjectList extends Abstract
return s.toString();
}
-
-}
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectMetaModel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectMetaModel.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectMetaModel.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectMetaModel.java Tue Apr 26 18:24:05 2011
@@ -99,14 +99,12 @@ public interface ObjectMetaModel extends
*/
void replacePojo(Object pojo);
-
/**
* For (stand-alone) collections, returns the element type.
*
* <p>
- * For owned (aggregated) collections, the element type can be determined
- * from the <tt>TypeOfFacet</tt> associated with the <tt>ObjectAssociation</tt>
- * representing the collection.
+ * For owned (aggregated) collections, the element type can be determined from the <tt>TypeOfFacet</tt> associated
+ * with the <tt>ObjectAssociation</tt> representing the collection.
*
* @see #setElementSpecificationProvider(ElementSpecificationProvider)
*/
@@ -114,11 +112,9 @@ public interface ObjectMetaModel extends
/**
* For (stand-alone) collections, returns the element type.
- *
+ *
* @see #getElementSpecification()
*/
void setElementSpecificationProvider(ElementSpecificationProvider elementSpecificationProvider);
-
-
}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java Tue Apr 26 18:24:05 2011
@@ -17,10 +17,8 @@
* under the License.
*/
-
package org.apache.isis.core.metamodel.spec;
-
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -54,41 +52,42 @@ import org.apache.isis.core.metamodel.sp
import com.google.common.base.Function;
/**
- * Represents an entity or value (cf {@link java.lang.Class}) within the
- * metamodel.
+ * Represents an entity or value (cf {@link java.lang.Class}) within the metamodel.
*
* <p>
- * As specifications are cyclic (specifically a class will reference its
- * subclasses, which in turn reference their superclass) they need be created
- * first, and then later work out its internals. Hence we create
+ * As specifications are cyclic (specifically a class will reference its subclasses, which in turn reference their
+ * superclass) they need be created first, and then later work out its internals. Hence we create
* {@link ObjectSpecification}s as we need them, and then introspect them later.
*
* <p>
* REVIEW: why is there no Help method for classes?
*/
-public interface ObjectSpecification extends Specification, ObjectActionContainer, ObjectAssociationContainer, Hierarchical, Dirtiable, DefaultProvider {
+public interface ObjectSpecification extends Specification, ObjectActionContainer, ObjectAssociationContainer,
+ Hierarchical, Dirtiable, DefaultProvider {
public final static List<ObjectSpecification> EMPTY_LIST = Collections.emptyList();
-
- public final static Function<ObjectSpecification,String> FUNCTION_FULLY_QUALIFIED_CLASS_NAME = new Function<ObjectSpecification,String>(){
- @Override
- public String apply(ObjectSpecification from) {
- return from.getFullIdentifier();
- }};
- public final static Comparator<ObjectSpecification> COMPARATOR_FULLY_QUALIFIED_CLASS_NAME = new Comparator<ObjectSpecification>() {
- @Override
- public int compare(ObjectSpecification o1,
- ObjectSpecification o2) {
- return o1.getFullIdentifier().compareTo(o2.getFullIdentifier());
- }};
- public final static Comparator<ObjectSpecification> COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE = new Comparator<ObjectSpecification>() {
- @Override
- public int compare(final ObjectSpecification s1,
- final ObjectSpecification s2) {
- return s1.getShortIdentifier().compareToIgnoreCase(s2.getShortIdentifier());
- }
- };
+ public final static Function<ObjectSpecification, String> FUNCTION_FULLY_QUALIFIED_CLASS_NAME =
+ new Function<ObjectSpecification, String>() {
+ @Override
+ public String apply(final ObjectSpecification from) {
+ return from.getFullIdentifier();
+ }
+ };
+ public final static Comparator<ObjectSpecification> COMPARATOR_FULLY_QUALIFIED_CLASS_NAME =
+ new Comparator<ObjectSpecification>() {
+ @Override
+ public int compare(final ObjectSpecification o1, final ObjectSpecification o2) {
+ return o1.getFullIdentifier().compareTo(o2.getFullIdentifier());
+ }
+ };
+ public final static Comparator<ObjectSpecification> COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE =
+ new Comparator<ObjectSpecification>() {
+ @Override
+ public int compare(final ObjectSpecification s1, final ObjectSpecification s2) {
+ return s1.getShortIdentifier().compareToIgnoreCase(s2.getShortIdentifier());
+ }
+ };
/**
* @return
@@ -99,17 +98,16 @@ public interface ObjectSpecification ext
* Returns an (immutable) "full" identifier for this specification.
*
* <p>
- * This will be the fully qualified name of the Class object that
- * this object represents (i.e. it includes the package name).
+ * This will be the fully qualified name of the Class object that this object represents (i.e. it includes the
+ * package name).
*/
String getFullIdentifier();
-
+
/**
* Returns an (immutable) "short" identifier for this specification.
*
* <p>
- * This will be the class name without the package; any text up to and
- * including the last period is removed.
+ * This will be the class name without the package; any text up to and including the last period is removed.
*/
String getShortIdentifier();
@@ -117,8 +115,7 @@ public interface ObjectSpecification ext
* Returns the (singular) name for objects of this specification.
*
* <p>
- * Corresponds to the {@link NamedFacet#value()} of {@link NamedFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link NamedFacet#value()} of {@link NamedFacet}; is not necessarily immutable.
*/
String getSingularName();
@@ -126,36 +123,33 @@ public interface ObjectSpecification ext
* Returns the plural name for objects of this specification.
*
* <p>
- * Corresponds to the {@link PluralFacet#value() value} of {@link PluralFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link PluralFacet#value() value} of {@link PluralFacet}; is not necessarily immutable.
*/
String getPluralName();
-
+
/**
* Returns the description, if any, of the specification.
*
* <p>
- * Corresponds to the {@link DescribedAsFacet#value()) value} of {@link DescribedAsFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link DescribedAsFacet#value()) value} of {@link DescribedAsFacet}; is not necessarily
+ * immutable.
*/
@Override
String getDescription();
-
+
/**
* Returns a help string or lookup reference, if any, of the specification.
*
* <p>
- * Corresponds to the {@link HelpFacet#value()) value} of {@link HelpFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link HelpFacet#value()) value} of {@link HelpFacet}; is not necessarily immutable.
*/
String getHelp();
-
+
/**
* Returns the title string for the specified object.
*
* <p>
- * Corresponds to the {@link TitleFacet#value()) value} of {@link TitleFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link TitleFacet#value()) value} of {@link TitleFacet}; is not necessarily immutable.
*/
String getTitle(ObjectAdapter adapter, Localization localization);
@@ -163,90 +157,81 @@ public interface ObjectSpecification ext
* Returns the name of an icon to use for the specified object.
*
* <p>
- * Corresponds to the {@link IconFacet#iconName(ObjectAdapter)) icon name}
- * returned by the {@link IconFacet};
- * is not necessarily immutable.
+ * Corresponds to the {@link IconFacet#iconName(ObjectAdapter)) icon name} returned by the {@link IconFacet}; is not
+ * necessarily immutable.
*/
String getIconName(ObjectAdapter object);
-
- boolean isAbstract();
+ boolean isAbstract();
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// TitleContext
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
/**
* Create an {@link InteractionContext} representing an attempt to read the object's title.
*/
- ObjectTitleContext createTitleInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter targetObjectAdapter);
-
+ ObjectTitleContext createTitleInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter);
-
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// ValidityContext, Validity
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
/**
* Create an {@link InteractionContext} representing an attempt to save the object.
*/
- ObjectValidityContext createValidityInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter targetObjectAdapter);
+ ObjectValidityContext createValidityInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter);
/**
- * Determines whether the specified object is in a valid state (for example, so
- * can be persisted); represented as a {@link Consent}.
+ * Determines whether the specified object is in a valid state (for example, so can be persisted); represented as a
+ * {@link Consent}.
*/
Consent isValid(ObjectAdapter adapter);
/**
- * Determines whether the specified object is in a valid state (for example, so can
- * be persisted); represented as a {@link InteractionResult}.
+ * Determines whether the specified object is in a valid state (for example, so can be persisted); represented as a
+ * {@link InteractionResult}.
*/
InteractionResult isValidResult(ObjectAdapter adapter);
-
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// Facets
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
/**
- * Determines if objects of this specification can be persisted or not. If it can be persisted (i.e. it
- * return something other than {@link Persistability}.TRANSIENT ObjectAdapter.isPersistent() will indicated
- * whether the object is persistent or not. If they cannot be persisted then {@link ObjectAdapter}.
- * {@link #persistability()} should be ignored.
+ * Determines if objects of this specification can be persisted or not. If it can be persisted (i.e. it return
+ * something other than {@link Persistability}.TRANSIENT ObjectAdapter.isPersistent() will indicated whether the
+ * object is persistent or not. If they cannot be persisted then {@link ObjectAdapter}. {@link #persistability()}
+ * should be ignored.
*/
Persistability persistability();
/**
* Determines if the object represents an value or object.
- *
+ *
* <p>
- * In effect, means that it doesn't have the {@link CollectionFacet}, and therefore will return
- * NOT {@link #isCollection()}
- *
+ * In effect, means that it doesn't have the {@link CollectionFacet}, and therefore will return NOT
+ * {@link #isCollection()}
+ *
* @see #isCollection().
*/
boolean isNotCollection();
/**
* Determines if objects represents a collection.
- *
+ *
* <p>
* In effect, means has got {@link CollectionFacet}, and therefore will return NOT {@link #isNotCollection()}.
- *
+ *
* @see #isNotCollection()
*/
boolean isCollection();
/**
* Whether objects of this type are a collection or are intrinsically aggregated.
- *
+ *
* <p>
* In effect, means has got a {@link CollectionFacet} and/or got the {@link AggregatedFacet}.
*/
@@ -254,7 +239,7 @@ public interface ObjectSpecification ext
/**
* Determines if objects of this type are values.
- *
+ *
* <p>
* In effect, means has got {@link ValueFacet}.
*/
@@ -262,7 +247,7 @@ public interface ObjectSpecification ext
/**
* Determines if objects of this type are aggregated.
- *
+ *
* <p>
* In effect, means has got {@link AggregatedFacet} or {@link ValueFacet}.
*/
@@ -270,16 +255,15 @@ public interface ObjectSpecification ext
/**
* Determines if objects of this type are either values or aggregated.
- *
+ *
* @see #isValue()
* @see #isAggregated()
*/
boolean isValueOrIsAggregated();
-
/**
* Determines if objects of this type can be set up from a text entry string.
- *
+ *
* <p>
* In effect, means has got a {@link ParseableFacet}.
*/
@@ -287,7 +271,7 @@ public interface ObjectSpecification ext
/**
* Determines if objects of this type can be converted to a data-stream.
- *
+ *
* <p>
* In effect, means has got {@link EncodableFacet}.
*/
@@ -303,19 +287,18 @@ public interface ObjectSpecification ext
*/
boolean isHidden();
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// Creation
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
/**
* Used by {@link ObjectSpecification#createObject(CreationMode)}
*/
public enum CreationMode {
- /**
- * Default all properties and call any {@link CreatedCallbackFacet created callbacks}.
- */
- INITIALIZE,
- NO_INITIALIZE
+ /**
+ * Default all properties and call any {@link CreatedCallbackFacet created callbacks}.
+ */
+ INITIALIZE, NO_INITIALIZE
}
/**
@@ -328,19 +311,17 @@ public interface ObjectSpecification ext
*/
Object createAggregatedObject(ObjectAdapter parent, CreationMode creationMode);
-
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// Service
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
boolean isService();
public void markAsService();
-
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
// Introspection
- ////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////
/**
* Builds actions and associations.
@@ -354,9 +335,9 @@ public interface ObjectSpecification ext
* Is called after to running the <tt>FacetDecoratorSet</tt>.
*
* <p>
- * TODO: it's possible that this could be merged with {@link #introspectTypeHierarchyAndMembers()};
- * need to check though, because this would cause facets to be decorated at the end of
- * introspection, rather than midway as is currently.
+ * TODO: it's possible that this could be merged with {@link #introspectTypeHierarchyAndMembers()}; need to check
+ * though, because this would cause facets to be decorated at the end of introspection, rather than midway as is
+ * currently.
*
*/
public void updateFromFacetValues();
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Persistability.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Persistability.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Persistability.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Persistability.java Tue Apr 26 18:24:05 2011
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.isis.core.metamodel.spec;
public enum Persistability {
@@ -41,7 +40,7 @@ public enum Persistability {
this.name = name;
this.persistable = persistable;
}
-
+
public boolean isPersistable() {
return persistable;
}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java Tue Apr 26 18:24:05 2011
@@ -17,9 +17,8 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec;
-package org.apache.isis.core.metamodel.spec;
-
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FeatureType;
import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
@@ -27,21 +26,19 @@ import org.apache.isis.core.metamodel.sp
import org.apache.isis.core.metamodel.spec.feature.ObjectFeature;
import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-
-/**
- * Base interface for elements of the metamodel.
- *
- * <p>
- * The most significant subinterfaces of this are {@link ObjectSpecification} and
- * {@link ObjectFeature} (which brings in {@link ObjectMember} and
- * {@link ObjectActionParameter}.
- *
- * <p>
- * Introduces so that viewers can deal with abstract Instances of said.
- *
- */
-public interface Specification extends IdentifiedHolder {
-
+
+/**
+ * Base interface for elements of the metamodel.
+ *
+ * <p>
+ * The most significant subinterfaces of this are {@link ObjectSpecification} and {@link ObjectFeature} (which brings in
+ * {@link ObjectMember} and {@link ObjectActionParameter}.
+ *
+ * <p>
+ * Introduces so that viewers can deal with abstract Instances of said.
+ *
+ */
+public interface Specification extends IdentifiedHolder {
FeatureType getFeatureType();
@@ -51,25 +48,22 @@ public interface Specification extends I
* @see #getHelp()
*/
String getDescription();
-
- /**
- * Return an {@link Instance} of this {@link Specification} with respect
- * to the provided {@link ObjectAdapter}.
- *
- * <p>
- * For example, if the {@link Specification} is a {@link OneToOneAssociation},
- * then is an {@link Instance} implementation representing the { {@link ObjectAdapter}/ {@link OneToOneAssociation} } tuple.
- *
- * <p>
- * Implementations are expected to use a double-dispatch back to the provided
- * {@link ObjectAdapter} (passing themselves as a parameter), using
- * {@link ObjectAdapter#getInstance(Specification)}.
- *
- * <p>
- * Note: this method may throw an {@link UnsupportedOperationException};
- * see {@link ObjectAdapter#getInstance(Specification)} for details.
- */
- Instance getInstance(final ObjectAdapter adapter);
-
-
-}
+
+ /**
+ * Return an {@link Instance} of this {@link Specification} with respect to the provided {@link ObjectAdapter}.
+ *
+ * <p>
+ * For example, if the {@link Specification} is a {@link OneToOneAssociation}, then is an {@link Instance}
+ * implementation representing the { {@link ObjectAdapter}/ {@link OneToOneAssociation} tuple.
+ *
+ * <p>
+ * Implementations are expected to use a double-dispatch back to the provided {@link ObjectAdapter} (passing
+ * themselves as a parameter), using {@link ObjectAdapter#getInstance(Specification)}.
+ *
+ * <p>
+ * Note: this method may throw an {@link UnsupportedOperationException}; see
+ * {@link ObjectAdapter#getInstance(Specification)} for details.
+ */
+ Instance getInstance(final ObjectAdapter adapter);
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationContext.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationContext.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationContext.java Tue Apr 26 18:24:05 2011
@@ -20,15 +20,15 @@ import org.apache.isis.core.commons.auth
import org.apache.isis.core.metamodel.adapter.ServicesProvider;
public class SpecificationContext {
-
+
private final AuthenticationSessionProvider authenticationSessionProvider;
private final ServicesProvider servicesProvider;
private final ObjectInstantiator objectInstantiator;
private final SpecificationLookup specificationLookup;
- public SpecificationContext(AuthenticationSessionProvider authenticationSessionProvider,
- ServicesProvider servicesProvider, ObjectInstantiator objectInstantiator,
- SpecificationLookup specificationLookup) {
+ public SpecificationContext(final AuthenticationSessionProvider authenticationSessionProvider,
+ final ServicesProvider servicesProvider, final ObjectInstantiator objectInstantiator,
+ final SpecificationLookup specificationLookup) {
this.authenticationSessionProvider = authenticationSessionProvider;
this.servicesProvider = servicesProvider;
this.objectInstantiator = objectInstantiator;
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java Tue Apr 26 18:24:05 2011
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.isis.core.metamodel.spec;
import java.util.Collection;
@@ -26,7 +25,6 @@ import java.util.List;
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-
public interface SpecificationLoader extends ApplicationScopedComponent, DebuggableWithTitle, SpecificationLookup {
Collection<ObjectSpecification> allSpecifications();
@@ -38,12 +36,10 @@ public interface SpecificationLoader ext
ObjectSpecification loadSpecification(Class<?> cls);
/**
- * Loads the specifications of the specified types except the one specified
- * (to prevent an infinite loop).
+ * Loads the specifications of the specified types except the one specified (to prevent an infinite loop).
*/
- public boolean loadSpecifications(List<Class<?>> typesToLoad,
- final Class<?> typeToIgnore);
-
+ public boolean loadSpecifications(List<Class<?>> typesToLoad, final Class<?> typeToIgnore);
+
/**
* Return the specification for the specified class of object.
*
@@ -66,7 +62,7 @@ public interface SpecificationLoader ext
/**
* Specify the classes of the services to pro-actively prime the cache.
*/
- void setServiceClasses(List<Class<?>> serviceClasses);
+ void setServiceClasses(List<Class<?>> serviceClasses);
/**
* Loads the specifications of the specified types.
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java Tue Apr 26 18:24:05 2011
@@ -17,13 +17,9 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec;
-package org.apache.isis.core.metamodel.spec;
+public interface SpecificationLoaderAware {
-
-public interface SpecificationLoaderAware {
-
- public void setSpecificationLoader(SpecificationLoader specificationLoader);
-}
-
-
+ public void setSpecificationLoader(SpecificationLoader specificationLoader);
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java Tue Apr 26 18:24:05 2011
@@ -18,7 +18,6 @@ package org.apache.isis.core.metamodel.s
import org.apache.isis.core.commons.components.Injectable;
-
public interface SpecificationLookup extends Injectable {
/**
@@ -26,5 +25,4 @@ public interface SpecificationLookup ext
*/
ObjectSpecification loadSpecification(Class<?> cls);
-
}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java Tue Apr 26 18:24:05 2011
@@ -16,17 +16,14 @@
*/
package org.apache.isis.core.metamodel.spec;
-
-
public abstract class SpecificationLookupAbstract implements SpecificationLookup {
@Override
- public void injectInto(Object candidate) {
+ public void injectInto(final Object candidate) {
if (SpecificationLookupAware.class.isAssignableFrom(candidate.getClass())) {
- SpecificationLookupAware cast = SpecificationLookupAware.class.cast(candidate);
+ final SpecificationLookupAware cast = SpecificationLookupAware.class.cast(candidate);
cast.setSpecificationLookup(this);
}
}
-
}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java Tue Apr 26 18:24:05 2011
@@ -17,12 +17,10 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec;
-package org.apache.isis.core.metamodel.spec;
+public interface SpecificationLookupAware {
-
-public interface SpecificationLookupAware {
-
- public void setSpecificationLookup(final SpecificationLookup specificationLookup);
-
-}
+ public void setSpecificationLookup(final SpecificationLookup specificationLookup);
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java Tue Apr 26 18:24:05 2011
@@ -16,22 +16,20 @@
*/
package org.apache.isis.core.metamodel.spec;
-
/**
- * Allows a SpecificationLookup to be provided even if the
- * concrete implementation is only available later.
+ * Allows a SpecificationLookup to be provided even if the concrete implementation is only available later.
*/
public class SpecificationLookupDelegator extends SpecificationLookupAbstract {
private SpecificationLookup specificationLookupDelegate;
-
- public void setDelegate(SpecificationLookup specificationLookupDelegate) {
+
+ public void setDelegate(final SpecificationLookup specificationLookupDelegate) {
this.specificationLookupDelegate = specificationLookupDelegate;
}
-
+
@Override
- public ObjectSpecification loadSpecification(Class<?> cls) {
- if(specificationLookupDelegate == null) {
+ public ObjectSpecification loadSpecification(final Class<?> cls) {
+ if (specificationLookupDelegate == null) {
throw new IllegalStateException("No SpecificationLookup provided");
}
return specificationLookupDelegate.loadSpecification(cls);
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Target.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Target.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Target.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Target.java Tue Apr 26 18:24:05 2011
@@ -17,23 +17,20 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec;
-package org.apache.isis.core.metamodel.spec;
-
-public enum Target {
-
- DEFAULT("default"),
- LOCAL("local"),
- REMOTE("remote");
-
- private String name;
-
- private Target(final String name) {
- this.name = name;
- }
-
- @Override
- public String toString() {
- return name;
- }
-}
+public enum Target {
+
+ DEFAULT("default"), LOCAL("local"), REMOTE("remote");
+
+ private String name;
+
+ private Target(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java Tue Apr 26 18:24:05 2011
@@ -17,29 +17,25 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-
-/**
- * Mix-in interface for {@link ObjectFeature}s that reference or
- * otherwise contain a 'current' value.
- *
- * <p>
- * Examples include {@link OneToOneAssociation properties}, {@link OneToManyAssociation collection}s
- * and {@link OneToOneActionParameter action parameter}s (but not
- * {@link ObjectAction action}s themselves).
- */
-public interface CurrentHolder {
-
-
- /**
- * Returns the referenced {@link ObjectAdapter} for the owning {@link ObjectAdapter}.
- *
- * <p>
- * For example, if this is an {@link OneToOneAssociation}, then returns the referenced object.
- */
- ObjectAdapter get(final ObjectAdapter owner);
-
-}
+
+/**
+ * Mix-in interface for {@link ObjectFeature}s that reference or otherwise contain a 'current' value.
+ *
+ * <p>
+ * Examples include {@link OneToOneAssociation properties}, {@link OneToManyAssociation collection}s and
+ * {@link OneToOneActionParameter action parameter}s (but not {@link ObjectAction action}s themselves).
+ */
+public interface CurrentHolder {
+
+ /**
+ * Returns the referenced {@link ObjectAdapter} for the owning {@link ObjectAdapter}.
+ *
+ * <p>
+ * For example, if this is an {@link OneToOneAssociation}, then returns the referenced object.
+ */
+ ObjectAdapter get(final ObjectAdapter owner);
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java Tue Apr 26 18:24:05 2011
@@ -17,33 +17,31 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-
-/**
- * Mix-in interface for {@link ObjectAction}s that reference or
- * otherwise contain a 'current' value that moreover can be changed.
- *
- * <p>
- * Examples include {@link OneToOneAssociation properties} and {@link OneToOneActionParameter action parameter}s (but not
- * {@link ObjectAction action}s themselves) nor {@link OneToManyAssociation collection}s.
- */
-public interface MutableCurrentHolder extends CurrentHolder {
-
-
- /**
- * Updates the referenced {@link ObjectAdapter} for the owning {@link ObjectAdapter}
- * with the new value provided, or clears the reference if null.
- *
- * <p>
- * For example, if this is a {@link OneToOneAssociation}, then updates the
- * object referenced .
- *
- * @param owner
- * @param newValue - the new value, or <tt>null</tt>
- */
- void set(final ObjectAdapter owner, final ObjectAdapter newValue);
-
-}
+
+/**
+ * Mix-in interface for {@link ObjectAction}s that reference or otherwise contain a 'current' value that moreover can be
+ * changed.
+ *
+ * <p>
+ * Examples include {@link OneToOneAssociation properties} and {@link OneToOneActionParameter action parameter}s (but
+ * not {@link ObjectAction action}s themselves) nor {@link OneToManyAssociation collection}s.
+ */
+public interface MutableCurrentHolder extends CurrentHolder {
+
+ /**
+ * Updates the referenced {@link ObjectAdapter} for the owning {@link ObjectAdapter} with the new value provided, or
+ * clears the reference if null.
+ *
+ * <p>
+ * For example, if this is a {@link OneToOneAssociation}, then updates the object referenced .
+ *
+ * @param owner
+ * @param newValue
+ * - the new value, or <tt>null</tt>
+ */
+ void set(final ObjectAdapter owner, final ObjectAdapter newValue);
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java Tue Apr 26 18:24:05 2011
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.isis.core.metamodel.spec.feature;
import java.util.List;
@@ -33,24 +32,22 @@ import org.apache.isis.core.metamodel.sp
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.Target;
-
public interface ObjectAction extends ObjectMember {
-
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
// Target, realTarget, getOnType
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
/**
- * Returns where the action should be executed: explicitly locally on the client; explicitly remotely on
- * the server; or where it normally should be executed. By default instance methods should execute on the
- * server, static methods should execute on the client.
+ * Returns where the action should be executed: explicitly locally on the client; explicitly remotely on the server;
+ * or where it normally should be executed. By default instance methods should execute on the server, static methods
+ * should execute on the client.
*/
Target getTarget();
/**
- * Determine the real target for this action. If this action represents an object action than the target
- * is returned. If this action is on a service then that service will be returned.
+ * Determine the real target for this action. If this action represents an object action than the target is
+ * returned. If this action is on a service then that service will be returned.
*/
ObjectAdapter realTarget(ObjectAdapter target);
@@ -71,7 +68,8 @@ public interface ObjectAction extends Ob
// //////////////////////////////////////////////////////////////////
/**
- * Returns the {@link ActionType type} of action: user, exploration, prototype or debug, or that it is a set of actions.
+ * Returns the {@link ActionType type} of action: user, exploration, prototype or debug, or that it is a set of
+ * actions.
*/
ActionType getType();
@@ -103,44 +101,36 @@ public interface ObjectAction extends Ob
// //////////////////////////////////////////////////////////////////
/**
- * Creates an {@link ActionInvocationContext interaction context} representing an attempt to invoke this
- * action.
+ * Creates an {@link ActionInvocationContext interaction context} representing an attempt to invoke this action.
*
* <p>
- * Typically it is easier to just call {@link #isProposedArgumentSetValid(ObjectAdapter, ObjectAdapter[])
- * {@link #isProposedArgumentSetValidResultSet(ObjectAdapter, ObjectAdapter[])}; this is provided as API for
- * symmetry with interactions (such as {@link AccessContext} accesses) have no corresponding vetoing
- * methods.
- */
- public ActionInvocationContext createActionInvocationInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter targetObject,
- ObjectAdapter[] proposedArguments);
+ * Typically it is easier to just call {@link #isProposedArgumentSetValid(ObjectAdapter, ObjectAdapter[]) {
+ * @link #isProposedArgumentSetValidResultSet(ObjectAdapter, ObjectAdapter[])}; this is provided as API for
+ * symmetry with interactions (such as {@link AccessContext} accesses) have no corresponding vetoing methods.
+ */
+ public ActionInvocationContext createActionInvocationInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter targetObject, ObjectAdapter[] proposedArguments);
/**
* Whether the provided argument set is valid, represented as a {@link Consent}.
*/
Consent isProposedArgumentSetValid(ObjectAdapter object, ObjectAdapter[] proposedArguments);
-
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
// Actions (for action set)
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
/**
- * Lists the sub-actions that are available under this name.
+ * Lists the sub-actions that are available under this name.
*
* <p>
* If any actions are returned then this action is only a set and not an action itself.
*/
List<ObjectAction> getActions();
-
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
// Parameters (declarative)
- ////////////////////////////////////////////////////////
-
+ // //////////////////////////////////////////////////////
/**
* Returns the number of parameters used by this method.
@@ -158,11 +148,10 @@ public interface ObjectAction extends Ob
List<ObjectActionParameter> getParameters();
/**
- * Returns the {@link ObjectSpecification type} of each of the
- * {@link #getParameters() parameters}.
+ * Returns the {@link ObjectSpecification type} of each of the {@link #getParameters() parameters}.
*/
List<ObjectSpecification> getParameterTypes();
-
+
/**
* Returns set of parameter information matching the supplied filter.
*
@@ -170,10 +159,9 @@ public interface ObjectAction extends Ob
*/
List<ObjectActionParameter> getParameters(Filter<ObjectActionParameter> filter);
-
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
// Parameters (per instance)
- ////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////
/**
* Returns the defaults references/values to be used for the action.
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java Tue Apr 26 18:24:05 2011
@@ -17,51 +17,46 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import java.util.List;
import org.apache.isis.applib.Identifier;
import org.apache.isis.core.metamodel.spec.ActionType;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
-
-public interface ObjectActionContainer {
-
- /**
- * TODO: convert to relatedResourceActions
- */
- List<ObjectAction> getServiceActionsReturning(ActionType... type);
-
- /**
- * Returns the action of the specified type with the specified signature.
- */
- ObjectAction getObjectAction(ActionType type, String id, List<ObjectSpecification> parameters);
-
- /**
- * Get the action object represented by the specified identity string.
- *
- * <p>
- * The identity string should be {@link Identifier#toNameParmsIdentityString()}</tt>.
- */
- ObjectAction getObjectAction(ActionType type, String nameAndParmsIdentityString);
-
- /**
- * Returns an array of actions of the specified type(s), including any
- * contributed actions.
- *
- * <p>
- * If the type is <tt>null</tt>, then returns all {@link ActionType#USER user},
- * {@link ActionType#EXPLORATION exploration} and {@link ActionType#DEBUG
- * debug} actions (but not {@link ActionType#SET action sets}).
- */
- List<ObjectAction> getObjectActions(ActionType... type);
-
+
+public interface ObjectActionContainer {
+
+ /**
+ * TODO: convert to relatedResourceActions
+ */
+ List<ObjectAction> getServiceActionsReturning(ActionType... type);
+
+ /**
+ * Returns the action of the specified type with the specified signature.
+ */
+ ObjectAction getObjectAction(ActionType type, String id, List<ObjectSpecification> parameters);
+
+ /**
+ * Get the action object represented by the specified identity string.
+ *
+ * <p>
+ * The identity string should be {@link Identifier#toNameParmsIdentityString()}</tt>.
+ */
+ ObjectAction getObjectAction(ActionType type, String nameAndParmsIdentityString);
+
+ /**
+ * Returns an array of actions of the specified type(s), including any contributed actions.
+ *
+ * <p>
+ * If the type is <tt>null</tt>, then returns all {@link ActionType#USER user}, {@link ActionType#EXPLORATION
+ * exploration} and {@link ActionType#DEBUG debug} actions (but not {@link ActionType#SET action sets}).
+ */
+ List<ObjectAction> getObjectActions(ActionType... type);
/**
* Returns an array of all object actions (excluding any contributed actions).
*/
List<ObjectAction> getObjectActionsAll();
-
-}
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java Tue Apr 26 18:24:05 2011
@@ -17,69 +17,63 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
import org.apache.isis.core.metamodel.interactions.ActionArgumentContext;
-
-/**
- * Analogous to {@link ObjectAssociation}.
-*/
-public interface ObjectActionParameter extends ObjectFeature, CurrentHolder {
-
- /**
- * If true then can cast to a {@link OneToOneActionParameter}.
- *
- * <p>
- * Either this or {@link #isCollection()} will be true.
- *
- * <p>
- * Design note: modelled after {@link ObjectAssociation#isNotCollection()}
- */
- boolean isObject();
-
- /**
- * Only for symmetry with {@link ObjectAssociation}, however since the NOF does not support
- * collections as actions all implementations should return <tt>false</tt>.
- */
- boolean isCollection();
-
- /**
- * Owning {@link ObjectAction}.
- */
- ObjectAction getAction();
-
- /**
- * Returns a flag indicating if it can be left unset when the action can be invoked.
- */
- boolean isOptional();
-
- /**
- * Returns the 0-based index to this parameter.
- */
- int getNumber();
-
- ActionArgumentContext createProposedArgumentInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter targetObject,
- ObjectAdapter[] args,
- int position);
-
- /**
- * Whether proposed value for this parameter is valid.
- *
- * @param adapter
- * @param proposedValue
- * @return
- */
- String isValid(ObjectAdapter adapter, Object proposedValue);
-
-
- ObjectAdapter[] getChoices(ObjectAdapter adapter);
-
- ObjectAdapter getDefault(ObjectAdapter adapter);
-}
+
+/**
+ * Analogous to {@link ObjectAssociation}.
+ */
+public interface ObjectActionParameter extends ObjectFeature, CurrentHolder {
+
+ /**
+ * If true then can cast to a {@link OneToOneActionParameter}.
+ *
+ * <p>
+ * Either this or {@link #isCollection()} will be true.
+ *
+ * <p>
+ * Design note: modelled after {@link ObjectAssociation#isNotCollection()}
+ */
+ boolean isObject();
+
+ /**
+ * Only for symmetry with {@link ObjectAssociation}, however since the NOF does not support collections as actions
+ * all implementations should return <tt>false</tt>.
+ */
+ boolean isCollection();
+
+ /**
+ * Owning {@link ObjectAction}.
+ */
+ ObjectAction getAction();
+
+ /**
+ * Returns a flag indicating if it can be left unset when the action can be invoked.
+ */
+ boolean isOptional();
+
+ /**
+ * Returns the 0-based index to this parameter.
+ */
+ int getNumber();
+
+ ActionArgumentContext createProposedArgumentInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter targetObject, ObjectAdapter[] args, int position);
+
+ /**
+ * Whether proposed value for this parameter is valid.
+ *
+ * @param adapter
+ * @param proposedValue
+ * @return
+ */
+ String isValid(ObjectAdapter adapter, Object proposedValue);
+
+ ObjectAdapter[] getChoices(ObjectAdapter adapter);
+
+ ObjectAdapter getDefault(ObjectAdapter adapter);
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java Tue Apr 26 18:24:05 2011
@@ -17,56 +17,53 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-
-
-/**
- * Provides reflective access to a field on a domain object.
- */
-public interface ObjectAssociation extends ObjectMember, CurrentHolder {
-
- /**
- * Get the name for the business key, if one has been specified.
- */
- String getBusinessKeyName();
-
- /**
- * Return the default for this property.
- */
- ObjectAdapter getDefault(ObjectAdapter adapter);
-
- /**
- * Set the property to it default references/values.
- */
- public void toDefault(ObjectAdapter target);
-
- /**
- * Returns a list of possible references/values for this field, which the user can choose from.
- */
- public ObjectAdapter[] getChoices(ObjectAdapter object);
-
- /**
- * Returns true if calculated from other data in the object, that is, should not be persisted.
- */
- boolean isNotPersisted();
-
- /**
- * Returns <code>true</code> if this field on the specified object is deemed to be empty, or has no
- * content.
- */
- boolean isEmpty(ObjectAdapter target);
-
- /**
- * Determines if this field must be complete before the object is in a valid state
- */
- boolean isMandatory();
-
- /**
- * Whether there are any choices provided (eg <tt>choicesXxx</tt> supporting method) for the association.
- */
- public boolean hasChoices();
-
-}
+
+/**
+ * Provides reflective access to a field on a domain object.
+ */
+public interface ObjectAssociation extends ObjectMember, CurrentHolder {
+
+ /**
+ * Get the name for the business key, if one has been specified.
+ */
+ String getBusinessKeyName();
+
+ /**
+ * Return the default for this property.
+ */
+ ObjectAdapter getDefault(ObjectAdapter adapter);
+
+ /**
+ * Set the property to it default references/values.
+ */
+ public void toDefault(ObjectAdapter target);
+
+ /**
+ * Returns a list of possible references/values for this field, which the user can choose from.
+ */
+ public ObjectAdapter[] getChoices(ObjectAdapter object);
+
+ /**
+ * Returns true if calculated from other data in the object, that is, should not be persisted.
+ */
+ boolean isNotPersisted();
+
+ /**
+ * Returns <code>true</code> if this field on the specified object is deemed to be empty, or has no content.
+ */
+ boolean isEmpty(ObjectAdapter target);
+
+ /**
+ * Determines if this field must be complete before the object is in a valid state
+ */
+ boolean isMandatory();
+
+ /**
+ * Whether there are any choices provided (eg <tt>choicesXxx</tt> supporting method) for the association.
+ */
+ public boolean hasChoices();
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationContainer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationContainer.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationContainer.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationContainer.java Tue Apr 26 18:24:05 2011
@@ -17,51 +17,49 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import java.util.List;
import org.apache.isis.applib.filter.Filter;
import org.apache.isis.applib.filter.Filters;
import org.apache.isis.core.metamodel.spec.ObjectSpecificationException;
-
-
-public interface ObjectAssociationContainer {
-
- /**
- * Get the field object representing the field with the specified field identifier.
- *
- * Throw a {@link ObjectSpecificationException} if no such association exists.
- */
- ObjectAssociation getAssociation(String id);
-
- /**
- * Return all the fields that exist in an object of this specification, although they need not all be
- * accessible or visible.
- */
- List<ObjectAssociation> getAssociations();
-
- /**
- * Return all {@link ObjectAssociation}s matching the supplied filter.
- *
- * To get the statically visible fields (where any invisible and unauthorised fields have been removed)
- * use <tt>ObjectAssociationFilters#STATICALLY_VISIBLE_ASSOCIATIONS</tt>
- *
- * @see Filters
- */
- List<ObjectAssociation> getAssociations(Filter<ObjectAssociation> filter);
-
- /**
- * All {@link ObjectAssociation association}s that represent {@link OneToOneAssociation properties}.
- */
- List<OneToOneAssociation> getProperties();
-
- /**
- * All {@link ObjectAssociation association}s that represents {@link OneToManyAssociation collections}.
- * @return
- */
- List<OneToManyAssociation> getCollections();
-
-
-}
+
+public interface ObjectAssociationContainer {
+
+ /**
+ * Get the field object representing the field with the specified field identifier.
+ *
+ * Throw a {@link ObjectSpecificationException} if no such association exists.
+ */
+ ObjectAssociation getAssociation(String id);
+
+ /**
+ * Return all the fields that exist in an object of this specification, although they need not all be accessible or
+ * visible.
+ */
+ List<ObjectAssociation> getAssociations();
+
+ /**
+ * Return all {@link ObjectAssociation}s matching the supplied filter.
+ *
+ * To get the statically visible fields (where any invisible and unauthorised fields have been removed) use
+ * <tt>ObjectAssociationFilters#STATICALLY_VISIBLE_ASSOCIATIONS</tt>
+ *
+ * @see Filters
+ */
+ List<ObjectAssociation> getAssociations(Filter<ObjectAssociation> filter);
+
+ /**
+ * All {@link ObjectAssociation association}s that represent {@link OneToOneAssociation properties}.
+ */
+ List<OneToOneAssociation> getProperties();
+
+ /**
+ * All {@link ObjectAssociation association}s that represents {@link OneToManyAssociation collections}.
+ *
+ * @return
+ */
+ List<OneToManyAssociation> getCollections();
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationFilters.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationFilters.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationFilters.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociationFilters.java Tue Apr 26 18:24:05 2011
@@ -17,71 +17,72 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.applib.filter.Filter;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.consent.Consent;
-
-
-public class ObjectAssociationFilters {
-
- private ObjectAssociationFilters() {}
-
- /**
- * Filters only fields that are for properties (ie 1:1 associations)
- */
- public final static Filter<ObjectAssociation> PROPERTIES = new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation association) {
- return association.isOneToOneAssociation();
- }
- };
-
- /**
- * Returns all fields (that is, filters out nothing).
- */
- public final static Filter<ObjectAssociation> ALL = new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation property) {
- return true;
- }
- };
-
- /**
- * Filters only fields that are for collections (ie 1:m associations)
- */
- public final static Filter<ObjectAssociation> COLLECTIONS = new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation property) {
- return property.isOneToManyAssociation();
- }
- };
-
- /**
- * Filters only properties that are visible statically, ie have not been unconditionally hidden at compile time. Note this list will include
- * properties marked as hidden once persisted and until persisted, but not those marked hidden always.
- */
- public static final Filter<ObjectAssociation> STATICALLY_VISIBLE_ASSOCIATIONS = new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation property) {
- return !property.isAlwaysHidden();
- }
- };
-
- /**
- * Filters only properties that are visible statically, ie have not been hidden at compile time.
- */
- public static Filter<ObjectAssociation> dynamicallyVisible(final AuthenticationSession session, final ObjectAdapter target) {
- return new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(final ObjectAssociation objectAssociation) {
- final Consent visible = objectAssociation.isVisible(session, target);
- return visible.isAllowed();
- }
- };
- }
-
-}
+
+public class ObjectAssociationFilters {
+
+ private ObjectAssociationFilters() {
+ }
+
+ /**
+ * Filters only fields that are for properties (ie 1:1 associations)
+ */
+ public final static Filter<ObjectAssociation> PROPERTIES = new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation association) {
+ return association.isOneToOneAssociation();
+ }
+ };
+
+ /**
+ * Returns all fields (that is, filters out nothing).
+ */
+ public final static Filter<ObjectAssociation> ALL = new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation property) {
+ return true;
+ }
+ };
+
+ /**
+ * Filters only fields that are for collections (ie 1:m associations)
+ */
+ public final static Filter<ObjectAssociation> COLLECTIONS = new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation property) {
+ return property.isOneToManyAssociation();
+ }
+ };
+
+ /**
+ * Filters only properties that are visible statically, ie have not been unconditionally hidden at compile time.
+ * Note this list will include properties marked as hidden once persisted and until persisted, but not those marked
+ * hidden always.
+ */
+ public static final Filter<ObjectAssociation> STATICALLY_VISIBLE_ASSOCIATIONS = new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation property) {
+ return !property.isAlwaysHidden();
+ }
+ };
+
+ /**
+ * Filters only properties that are visible statically, ie have not been hidden at compile time.
+ */
+ public static Filter<ObjectAssociation> dynamicallyVisible(final AuthenticationSession session,
+ final ObjectAdapter target) {
+ return new Filter<ObjectAssociation>() {
+ @Override
+ public boolean accept(final ObjectAssociation objectAssociation) {
+ final Consent visible = objectAssociation.isVisible(session, target);
+ return visible.isAllowed();
+ }
+ };
+ }
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeature.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeature.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeature.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectFeature.java Tue Apr 26 18:24:05 2011
@@ -17,23 +17,21 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.metamodel.facetapi.FeatureType;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.Specification;
-
-
+
/**
- * A specification representing a non-{@link FeatureType#OBJECT object},
- * that therefore has an underlying type (the type of the property, collection)
+ * A specification representing a non-{@link FeatureType#OBJECT object}, that therefore has an underlying type (the type
+ * of the property, collection)
*
* <p>
- * For a property or action parameter, is the type. For a collection is the element type.
- * For an action it is always <tt>null</tt>.
+ * For a property or action parameter, is the type. For a collection is the element type. For an action it is always
+ * <tt>null</tt>.
*/
-public interface ObjectFeature extends Specification {
+public interface ObjectFeature extends Specification {
/**
* Return the name for this member - the field or action. This is based on the name of this member.
@@ -50,23 +48,21 @@ public interface ObjectFeature extends S
@Override
String getDescription();
-
/**
* The specification of the underlying type.
*
* <p>
* For example:
* <ul>
- * <li>for a {@link OneToOneAssociation property}, will return the {@link ObjectSpecification}
- * of the type that the accessor returns.
- * <li>for a {@link OneToManyAssociation collection} it will be the type of element
- * the collection holds (not the type of collection).
- * <li>for a {@link ObjectAction action}, will always return <tt>null</tt>. See instead {@link ObjectAction#getReturnType()} and {@link ObjectAction#getParameterTypes()}.
+ * <li>for a {@link OneToOneAssociation property}, will return the {@link ObjectSpecification} of the type that the
+ * accessor returns.
+ * <li>for a {@link OneToManyAssociation collection} it will be the type of element the collection holds (not the
+ * type of collection).
+ * <li>for a {@link ObjectAction action}, will always return <tt>null</tt>. See instead
+ * {@link ObjectAction#getReturnType()} and {@link ObjectAction#getParameterTypes()}.
* <li>for a {@link ObjectActionParameter action}, will return the type of the parameter}.
* </ul>
*/
ObjectSpecification getSpecification();
-
-
-}
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java Tue Apr 26 18:24:05 2011
@@ -17,9 +17,8 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.consent.Consent;
@@ -29,140 +28,130 @@ import org.apache.isis.core.metamodel.in
import org.apache.isis.core.metamodel.interactions.InteractionContext;
import org.apache.isis.core.metamodel.interactions.UsabilityContext;
import org.apache.isis.core.metamodel.interactions.VisibilityContext;
-
-
-/**
- * Provides reflective access to an action or a field on a domain object.
- */
-public interface ObjectMember extends ObjectFeature {
-
- // /////////////////////////////////////////////////////////////
- // Identifiers
- // /////////////////////////////////////////////////////////////
-
- /**
- * Returns the identifier of the member, which must not change. This should be all camel-case with no
- * spaces: so if the member is called 'Return Date' then the a suitable id would be 'ReturnDate'.
- */
- String getId();
-
- // /////////////////////////////////////////////////////////////
- // Name, Description, Help (convenience for facets)
- // /////////////////////////////////////////////////////////////
-
- /**
- * Return the help text for this member - the field or action - to complement the description.
- *
- * @see #getDescription()
- */
- String getHelp();
-
- // /////////////////////////////////////////////////////////////
- // Hidden (or visible)
- // /////////////////////////////////////////////////////////////
-
- /**
- * Determines if a member is always hidden.
- */
- boolean isAlwaysHidden();
-
- /**
- * Create an {@link InteractionContext} to represent an attempt to view this member (that is, to check if
- * it is visible or not).
- *
- * <p>
- * Typically it is easier to just call {@link #isVisible(AuthenticationSession, ObjectAdapter)} or
- * {@link #isVisibleResult(AuthenticationSession, ObjectAdapter)}; this is provided as API for symmetry with interactions
- * (such as {@link AccessContext} accesses) have no corresponding vetoing methods.
- */
- VisibilityContext<?> createVisibleInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter targetObjectAdapter);
-
- /**
- * Determines if this member is visible, represented as a {@link Consent}.
- *
- * @param target
- * may be <tt>null</tt> if just checking for authorization.
- *
- * @see #isVisibleResult(AuthenticationSession, ObjectAdapter)
- */
- Consent isVisible(AuthenticationSession session, ObjectAdapter target);
-
- // /////////////////////////////////////////////////////////////
- // Disabled (or enabled)
- // /////////////////////////////////////////////////////////////
-
- /**
- * Create an {@link InteractionContext} to represent an attempt to {@link InteractionContextType#MEMBER_USABLE
- * use this member} (that is, to check if it is usable or not).
- *
- * <p>
- * Typically it is easier to just call {@link #isUsable(AuthenticationSession, ObjectAdapter)} or
- * {@link #isUsableResult(AuthenticationSession, ObjectAdapter)}; this is provided as API for symmetry with interactions
- * (such as {@link AccessContext} accesses) have no corresponding vetoing methods.
- */
- UsabilityContext<?> createUsableInteractionContext(
- AuthenticationSession session,
- InteractionInvocationMethod invocationMethod,
- ObjectAdapter target);
-
- /**
- * Determines whether this member is usable, represented as a {@link Consent}.
- *
- * @param target
- * may be <tt>null</tt> if just checking for authorization.
- *
- * @see #isUsableResult(AuthenticationSession, ObjectAdapter)
- */
- Consent isUsable(AuthenticationSession session, ObjectAdapter target);
-
-
- // /////////////////////////////////////////////////////////////
- // isAssociation, isAction
- // /////////////////////////////////////////////////////////////
-
- /**
- * Whether this member represents a {@link ObjectAssociation}.
- *
- * <p>
- * If so, can be safely downcast to {@link ObjectAssociation}.
- */
- boolean isPropertyOrCollection();
-
- /**
- * Whether this member represents a {@link OneToManyAssociation}.
- *
- * <p>
- * If so, can be safely downcast to {@link OneToManyAssociation}.
- */
- boolean isOneToManyAssociation();
-
- /**
- * Whether this member represents a {@link OneToOneAssociation}.
- *
- * <p>
- * If so, can be safely downcast to {@link OneToOneAssociation}.
- */
- boolean isOneToOneAssociation();
-
- /**
- * Whether this member represents a {@link ObjectAction}.
- *
- * <p>
- * If so, can be safely downcast to {@link ObjectAction}.
- */
- boolean isAction();
-
-
- // /////////////////////////////////////////////////////////////
- // Debugging
- // /////////////////////////////////////////////////////////////
-
- String debugData();
-
-
-
-
-}
+
+/**
+ * Provides reflective access to an action or a field on a domain object.
+ */
+public interface ObjectMember extends ObjectFeature {
+
+ // /////////////////////////////////////////////////////////////
+ // Identifiers
+ // /////////////////////////////////////////////////////////////
+
+ /**
+ * Returns the identifier of the member, which must not change. This should be all camel-case with no spaces: so if
+ * the member is called 'Return Date' then the a suitable id would be 'ReturnDate'.
+ */
+ String getId();
+
+ // /////////////////////////////////////////////////////////////
+ // Name, Description, Help (convenience for facets)
+ // /////////////////////////////////////////////////////////////
+
+ /**
+ * Return the help text for this member - the field or action - to complement the description.
+ *
+ * @see #getDescription()
+ */
+ String getHelp();
+
+ // /////////////////////////////////////////////////////////////
+ // Hidden (or visible)
+ // /////////////////////////////////////////////////////////////
+
+ /**
+ * Determines if a member is always hidden.
+ */
+ boolean isAlwaysHidden();
+
+ /**
+ * Create an {@link InteractionContext} to represent an attempt to view this member (that is, to check if it is
+ * visible or not).
+ *
+ * <p>
+ * Typically it is easier to just call {@link #isVisible(AuthenticationSession, ObjectAdapter)} or
+ * {@link #isVisibleResult(AuthenticationSession, ObjectAdapter)}; this is provided as API for symmetry with
+ * interactions (such as {@link AccessContext} accesses) have no corresponding vetoing methods.
+ */
+ VisibilityContext<?> createVisibleInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter);
+
+ /**
+ * Determines if this member is visible, represented as a {@link Consent}.
+ *
+ * @param target
+ * may be <tt>null</tt> if just checking for authorization.
+ *
+ * @see #isVisibleResult(AuthenticationSession, ObjectAdapter)
+ */
+ Consent isVisible(AuthenticationSession session, ObjectAdapter target);
+
+ // /////////////////////////////////////////////////////////////
+ // Disabled (or enabled)
+ // /////////////////////////////////////////////////////////////
+
+ /**
+ * Create an {@link InteractionContext} to represent an attempt to {@link InteractionContextType#MEMBER_USABLE use
+ * this member} (that is, to check if it is usable or not).
+ *
+ * <p>
+ * Typically it is easier to just call {@link #isUsable(AuthenticationSession, ObjectAdapter)} or
+ * {@link #isUsableResult(AuthenticationSession, ObjectAdapter)}; this is provided as API for symmetry with
+ * interactions (such as {@link AccessContext} accesses) have no corresponding vetoing methods.
+ */
+ UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session,
+ InteractionInvocationMethod invocationMethod, ObjectAdapter target);
+
+ /**
+ * Determines whether this member is usable, represented as a {@link Consent}.
+ *
+ * @param target
+ * may be <tt>null</tt> if just checking for authorization.
+ *
+ * @see #isUsableResult(AuthenticationSession, ObjectAdapter)
+ */
+ Consent isUsable(AuthenticationSession session, ObjectAdapter target);
+
+ // /////////////////////////////////////////////////////////////
+ // isAssociation, isAction
+ // /////////////////////////////////////////////////////////////
+
+ /**
+ * Whether this member represents a {@link ObjectAssociation}.
+ *
+ * <p>
+ * If so, can be safely downcast to {@link ObjectAssociation}.
+ */
+ boolean isPropertyOrCollection();
+
+ /**
+ * Whether this member represents a {@link OneToManyAssociation}.
+ *
+ * <p>
+ * If so, can be safely downcast to {@link OneToManyAssociation}.
+ */
+ boolean isOneToManyAssociation();
+
+ /**
+ * Whether this member represents a {@link OneToOneAssociation}.
+ *
+ * <p>
+ * If so, can be safely downcast to {@link OneToOneAssociation}.
+ */
+ boolean isOneToOneAssociation();
+
+ /**
+ * Whether this member represents a {@link ObjectAction}.
+ *
+ * <p>
+ * If so, can be safely downcast to {@link ObjectAction}.
+ */
+ boolean isAction();
+
+ // /////////////////////////////////////////////////////////////
+ // Debugging
+ // /////////////////////////////////////////////////////////////
+
+ String debugData();
+
+}
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMemberContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMemberContext.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMemberContext.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMemberContext.java Tue Apr 26 18:24:05 2011
@@ -28,8 +28,9 @@ public class ObjectMemberContext {
private final AdapterMap adapterManager;
private final QuerySubmitter querySubmitter;
- public ObjectMemberContext(AuthenticationSessionProvider authenticationSessionProvider,
- SpecificationLookup specificationLookup, AdapterMap adapterManager, QuerySubmitter querySubmitter) {
+ public ObjectMemberContext(final AuthenticationSessionProvider authenticationSessionProvider,
+ final SpecificationLookup specificationLookup, final AdapterMap adapterManager,
+ final QuerySubmitter querySubmitter) {
this.authenticationSessionProvider = authenticationSessionProvider;
this.specificationLookup = specificationLookup;
this.adapterManager = adapterManager;
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectParameterFilters.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectParameterFilters.java?rev=1096837&r1=1096836&r2=1096837&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectParameterFilters.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectParameterFilters.java Tue Apr 26 18:24:05 2011
@@ -17,24 +17,23 @@
* under the License.
*/
+package org.apache.isis.core.metamodel.spec.feature;
-package org.apache.isis.core.metamodel.spec.feature;
-
import org.apache.isis.applib.filter.Filter;
-
-
-public class ObjectParameterFilters {
-
- /**
- * Filters only parameters that are for objects (ie 1:1 associations)
- */
- public static final Filter<ObjectActionParameter> PARAMETER_ASSOCIATIONS = new Filter<ObjectActionParameter>() {
- @Override
- public boolean accept(final ObjectActionParameter parameter) {
- return parameter.getSpecification().isNotCollection();
- }
- };
-
- private ObjectParameterFilters() {}
-
-}
+
+public class ObjectParameterFilters {
+
+ /**
+ * Filters only parameters that are for objects (ie 1:1 associations)
+ */
+ public static final Filter<ObjectActionParameter> PARAMETER_ASSOCIATIONS = new Filter<ObjectActionParameter>() {
+ @Override
+ public boolean accept(final ObjectActionParameter parameter) {
+ return parameter.getSpecification().isNotCollection();
+ }
+ };
+
+ private ObjectParameterFilters() {
+ }
+
+}