Author: julien(a)jboss.com
Date: 2007-11-15 12:17:11 -0500 (Thu, 15 Nov 2007)
New Revision: 8954
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
Log:
minor update
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java 2007-11-15
17:02:02 UTC (rev 8953)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java 2007-11-15
17:17:11 UTC (rev 8954)
@@ -151,12 +151,27 @@
}
return filteredList;
}
+
+ protected Class<? extends UIObjectImpl> getImplementationType(Class<? extends
UIObject> type)
+ {
+ return null;
+ }
+
+ protected abstract boolean isChildTypeAccepted(Class<? extends UIObject> type);
/**
*
*/
public <T extends UIObject> T createChild(String name, Class<T> type)
throws IllegalArgumentException
{
+ if (!isChildTypeAccepted(type))
+ {
+ throw new IllegalArgumentException("Blah");
+ }
+
+ //
+ Class<? extends UIObjectImpl> implType = getImplementationType(type);
+
try
{
T child = null;
@@ -166,7 +181,7 @@
throw new IllegalArgumentException("UIContext must be the root of the
UIObject tree. It should not be added to any UIObject as a child");
}
- child = type.newInstance();
+ child = type.newInstance();
//Name
((UIObjectImpl)child).name = name;
Show replies by date