Author: julien(a)jboss.com
Date: 2008-04-03 15:45:14 -0400 (Thu, 03 Apr 2008)
New Revision: 10494
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
Log:
removed unused class that should already have been removed (grrr)
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java 2008-04-03
18:08:55 UTC (rev 10493)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model2/UIObjectImpl.java 2008-04-03
19:45:14 UTC (rev 10494)
@@ -1,109 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.impl.model2;
-
-import org.jboss.portal.presentation.model2.ui.UIObject;
-import org.jboss.portal.presentation.state.StateException;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class UIObjectImpl implements UIObject
-{
-
- /** . */
- public StructuralObject structuralObject;
-
- /** We keep track of what was loaded by the scope. */
- public Map<String, UIObjectRef> childRefs;
-
- public UIObjectImpl(StructuralObject structuralObject)
- {
- this.structuralObject = structuralObject;
- }
-
- public String getId()
- {
- return structuralObject.getId();
- }
-
- public String getName()
- {
- return structuralObject.getState().getName();
- }
-
- public <T> T getProperty(String propertyName, Class<T> propertyType)
throws IllegalArgumentException, StateException
- {
- return safeCast(getProperty(propertyName), propertyType);
- }
-
- public Set<String> getPropertyNames()
- {
- return structuralObject.getState().getProperties().keySet();
- }
-
- public Object getProperty(String propertyName) throws IllegalArgumentException,
StateException
- {
- if (propertyName == null)
- {
- throw new IllegalArgumentException();
- }
- return structuralObject.getState().getProperties().get(propertyName);
- }
-
- /**
- * Attempt to cast the value argument to the provided type argument. If the value
argument type is assignable
- * to the provided type, the value is returned, otherwise if it is not or the value is
null, null is returned.
- *
- * @param value the value to cast
- * @param type the type to downcast
- * @return the casted value or null
- */
- private <T> T safeCast(Object value, Class<T> type)
- {
- if (type == null)
- {
- throw new IllegalArgumentException();
- }
- if (value == null)
- {
- return null;
- }
- else
- {
- if (type.isAssignableFrom(value.getClass()))
- {
- return type.cast(value);
- }
- else
- {
- return null;
- }
- }
- }
-}
\ No newline at end of file