Author: julien(a)jboss.com
Date: 2008-07-04 10:45:35 -0400 (Fri, 04 Jul 2008)
New Revision: 11296
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
Log:
refactor object visits for cleaner semantic
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-04
14:44:10 UTC (rev 11295)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-07-04
14:45:35 UTC (rev 11296)
@@ -28,7 +28,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class ObjectVisit
+public abstract class ObjectVisit
{
static ObjectVisit createEvict(UIObjectImpl object)
@@ -51,9 +51,33 @@
return new Update(object, children);
}
+ /** . */
+ private final UIObjectImpl object;
+
+ private ObjectVisit(UIObjectImpl object)
+ {
+ if (object == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.object = object;
+ }
+
+ public String getObjectId()
+ {
+ return object.getId();
+ }
+
+ public UIObjectImpl getObject()
+ {
+ return object;
+ }
+
public static class Skip extends ObjectVisit
{
- public Skip(UIObjectImpl object)
+ private Skip(UIObjectImpl object)
{
super(object);
}
@@ -65,7 +89,7 @@
/** . */
private final ChildrenVisit children;
- public Load(UIObjectImpl object, ChildrenVisit children)
+ private Load(UIObjectImpl object, ChildrenVisit children)
{
super(object);
@@ -85,7 +109,7 @@
/** . */
private final ChildrenVisit children;
- public Update(UIObjectImpl object, ChildrenVisit children)
+ private Update(UIObjectImpl object, ChildrenVisit children)
{
super(object);
@@ -101,33 +125,9 @@
public static class Evict extends ObjectVisit
{
- public Evict(UIObjectImpl object)
+ private Evict(UIObjectImpl object)
{
super(object);
}
}
-
- /** . */
- private final UIObjectImpl object;
-
- public ObjectVisit(UIObjectImpl object)
- {
- if (object == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.object = object;
- }
-
- public String getObjectId()
- {
- return object.getId();
- }
-
- public UIObjectImpl getObject()
- {
- return object;
- }
}