Author: maksimkaszynski
Date: 2008-03-07 07:17:16 -0500 (Fri, 07 Mar 2008)
New Revision: 6617
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java
trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
trunk/framework/api/src/main/java/org/richfaces/component/Row.java
trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
Log:
fixed syntax for J5
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-07 12:16:51 UTC
(rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-07 12:17:16 UTC
(rev 6617)
@@ -30,7 +30,7 @@
public class Messages {
private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
- private static Map bundles = new HashMap();
+ private static Map<ClassLoader, ResourceBundle> bundles = new
HashMap<ClassLoader, ResourceBundle>();
private static synchronized ResourceBundle getBundle() {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -11,8 +11,10 @@
*/
public class AjaxSingleException extends RuntimeException {
- private UIComponent component;
+ private static final long serialVersionUID = 6624397496732241667L;
+ private UIComponent component;
+
/**
* @param component
*/
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -159,9 +159,9 @@
_log.debug(Messages.getMessage(Messages.CREATE_ALTERNATE_HANDLER, handlerClass));
}
try {
- Class clazz = classLoader.loadClass(handlerClass);
+ Class<?> clazz = classLoader.loadClass(handlerClass);
try {
- Constructor constructor = clazz
+ Constructor<?> constructor = clazz
.getConstructor(new Class[] { ViewHandler.class });
_handler = (ViewHandler) constructor
.newInstance(new Object[] { _handler });
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -49,7 +49,7 @@
* @throws IOException
*/
public void encodeAjaxChild(FacesContext context,
- String path,Set ids,Set renderedAreas) throws IOException ;
+ String path,Set<String> ids,Set<String> renderedAreas) throws
IOException ;
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -21,11 +21,8 @@
package org.ajax4jsf.component;
-import java.util.Collection;
-import java.util.Set;
+import javax.el.MethodExpression;
-import javax.faces.el.MethodBinding;
-
/**
* Base interface for controller component, managed AJAX Requests.
* Component, implemented this interface, must always return
<code>true</code> for
@@ -42,7 +39,7 @@
*
* @see javax.faces.component.ActionSource#getActionListener()
*/
- public MethodBinding getAjaxListener();
+ public MethodExpression getAjaxListener();
/**
* setter for AjaxListener <code>MethodBinding</code>
@@ -52,7 +49,7 @@
*
* @see
javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
*/
- public void setAjaxListener(MethodBinding AjaxListener);
+ public void setAjaxListener(MethodExpression AjaxListener);
/**
* getter for flag immediate call Listener's on PhaseId.APPLY_REQUEST_VALUES
phase.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -35,9 +35,9 @@
/**
* @return Set for values of {@link ExtendedDataModel} keys, encoded in ajax response by
this component.
*/
- public Set getAjaxKeys();
+ public Set<Object> getAjaxKeys();
- public void setAjaxKeys(Set ajaxKeys);
+ public void setAjaxKeys(Set<Object> ajaxKeys);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -11,7 +11,6 @@
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.el.VariableResolver;
import org.ajax4jsf.resource.util.URLToStreamHelper;
@@ -22,7 +21,7 @@
*/
public static final String AJAX_CONTEXT_KEY = "ajaxContext";
- public abstract Map getCommonAjaxParameters();
+ public abstract Map<String, Object> getCommonAjaxParameters();
public abstract String getAjaxActionURL(FacesContext context);
@@ -44,7 +43,7 @@
public abstract void addRenderedArea(String id);
- public abstract Set getAjaxRenderedAreas();
+ public abstract Set<String> getAjaxRenderedAreas();
public abstract void addComponentToAjaxRender(UIComponent base, String id);
@@ -52,7 +51,7 @@
public abstract void addRegionsFromComponent(UIComponent component);
- public abstract Set getAjaxAreasToRender();
+ public abstract Set<String> getAjaxAreasToRender();
public abstract boolean isAjaxRequest(FacesContext context);
@@ -86,7 +85,6 @@
/**
* Get instance of current AJAX Context. Instance get by
- * {@link VariableResolver#resolveVariable(FacesContext, String)} for
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
*
* @return memento instance for current request
@@ -100,13 +98,13 @@
/**
* Get instance of current AJAX Context. Instance get by
- * {@link VariableResolver#resolveVariable(FacesContext, String)} for
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
*
* @param context
* current FacesContext
* @return instance of AjaxContext.
*/
+ @SuppressWarnings("unchecked")
public static AjaxContext getCurrentInstance(FacesContext context) {
if (null == context) {
throw new NullPointerException("FacesContext is null");
@@ -179,7 +177,7 @@
public abstract void release();
- public abstract Map getResponseDataMap();
+ public abstract Map<String, Object> getResponseDataMap();
public abstract void setAjaxRequest(boolean b);
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -30,7 +30,7 @@
*/
public interface AjaxListener extends FacesListener {
- public static final Class[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
+ public static final Class<?>[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
/**
* @param event - to process
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -33,6 +33,11 @@
public class AjaxRenderEvent extends FacesEvent {
/**
+ *
+ */
+ private static final long serialVersionUID = 5877851431032645762L;
+
+ /**
* @param component
*/
public AjaxRenderEvent(UIComponent component) {
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -15,6 +15,11 @@
public class AjaxSingleEvent extends FacesEvent {
/**
+ *
+ */
+ private static final long serialVersionUID = -3730999641944478334L;
+
+ /**
* @param arg0
*/
public AjaxSingleEvent(UIComponent arg0) {
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -26,9 +26,6 @@
import javax.faces.component.UIComponent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* @author shura
*
@@ -56,17 +53,17 @@
*/
public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
- private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
+ //private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
- private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+ //private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
private UIComponent component;
- private Map options = new HashMap();
+ private Map<String, Object> options = new HashMap<String, Object>();
- private Map requestParameters = new HashMap();
+ private Map<String, String> requestParameters = new HashMap<String,
String>();
/**
*
@@ -85,14 +82,17 @@
/**
* @return the options
*/
- public Map getOptions() {
+ public Map<String, Object> getOptions() {
return this.options;
}
/**
* @return the requestParameters
*/
- public Map getRequestParameters() {
+ public Map<String, String> getRequestParameters() {
return this.requestParameters;
}
+ public UIComponent getComponent() {
+ return component;
+ }
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -26,7 +26,7 @@
* Encode chars as JavaScript sequences
*/
public class JSEncoder {
- private char APOSTROPHE[] = { '\\', '\'' };
+ //private char APOSTROPHE[] = { '\\', '\'' };
private static final char ENCODE_HEX[] = "0123456789ABCDEF".toCharArray();
@@ -44,7 +44,7 @@
private static final char ENCODE_BS[] = "\\\\".toCharArray();
- private static final char ENCODE_ESC[] = "\\e".toCharArray();
+ //private static final char ENCODE_ESC[] = "\\e".toCharArray();
/**
* Create a new instance of this <code>XMLEncoder</code>.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -22,6 +22,7 @@
package org.ajax4jsf.javascript;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -34,36 +35,17 @@
private String name;
- private List<Object> parameters = null;
+ private List<Object> parameters = new ArrayList<Object>();
/**
* @param name
- */
- public JSFunction(String name) {
- // TODO Auto-generated constructor stub
- this.name = name;
- }
-
- /**
- * @param name
* @param parameters
*/
- public JSFunction(String name, List<Object> parameters) {
- // TODO Auto-generated constructor stub
+ public JSFunction(String name, Object ... parameters) {
this.name = name;
- this.parameters = parameters;
+ this.parameters.addAll(Arrays.asList(parameters));
}
- /**
- * @param name
- * @param parameters
- */
- public JSFunction(String name, Object parameter) {
- // TODO Auto-generated constructor stub
- this.name = name;
- this.parameters = new ArrayList<Object>(1);
- this.parameters.add(parameter);
- }
public JSFunction addParameter(Object parameter) {
getParameters().add(parameter);
@@ -96,9 +78,6 @@
* @return the parameters
*/
public List<Object> getParameters() {
- if (this.parameters == null) {
- this.parameters = new ArrayList<Object>();
- }
return this.parameters;
}
}
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -22,6 +22,7 @@
package org.ajax4jsf.javascript;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -35,38 +36,24 @@
- private List parameters = new ArrayList();
+ private List<Object> parameters = new ArrayList<Object>();
private StringBuffer body = new StringBuffer();
private String name ;
-
- public JSFunctionDefinition(){
- }
-
- public JSFunctionDefinition( List parameters)
- {
-
- this.parameters = parameters;
- }
-
/**
- * @param body
- * @param parameters
+ * Construct {@link JSFunctionDefinition} with arbitrary list of params
+ * @param params
*/
- public JSFunctionDefinition( Object parameter)
- {
- this.parameters.add(parameter);
- }
-
-
- public JSFunctionDefinition addParameter(Object parameter)
- {
- this.parameters.add(parameter);
- return this;
- }
-
+ public JSFunctionDefinition(Object ... params) {
+ parameters.addAll(Arrays.asList(params));
+ }
+
+ public void addParameter(Object param) {
+ parameters.add(param);
+ }
+
public JSFunctionDefinition addToBody(Object body)
{
this.body.append(body);
@@ -83,7 +70,7 @@
}
functionString.append("(");
boolean first = true;
- for (Iterator param = parameters.iterator(); param.hasNext();)
+ for (Iterator<Object> param = parameters.iterator(); param.hasNext();)
{
Object element = param.next();
if(!first){
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -21,7 +21,6 @@
package org.ajax4jsf.javascript;
-import java.util.List;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -33,33 +32,14 @@
/**
* @param name
+ * @param parameter
*/
- public JSObject(String name)
+ public JSObject(String name, Object ... parameters)
{
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param name
- * @param parameters
- */
- public JSObject(String name, List parameters)
- {
super(name, parameters);
// TODO Auto-generated constructor stub
}
- /**
- * @param name
- * @param parameter
- */
- public JSObject(String name, Object parameter)
- {
- super(name, parameter);
- // TODO Auto-generated constructor stub
- }
-
public void appendScript(StringBuffer functionString)
{
functionString.append("new ");
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -56,7 +56,7 @@
} else if (obj instanceof ScriptString) {
return ((ScriptString) obj).toScript();
} else if (obj.getClass().isArray()) {
- StringBuffer ret = new StringBuffer("[");
+ StringBuilder ret = new StringBuilder("[");
boolean first = true;
for (int i = 0; i < Array.getLength(obj); i++) {
Object element = Array.get(obj, i);
@@ -69,10 +69,15 @@
return ret.append("] ").toString();
} else if (obj instanceof Collection) {
// Collections put as JavaScript array.
- Collection collection = (Collection) obj;
- StringBuffer ret = new StringBuffer("[");
+
+
+ @SuppressWarnings("unchecked")
+ Collection<Object> collection = (Collection<Object>) obj;
+
+
+ StringBuilder ret = new StringBuilder("[");
boolean first = true;
- for (Iterator iter = collection.iterator(); iter.hasNext();) {
+ for (Iterator<Object> iter = collection.iterator(); iter.hasNext();) {
Object element = iter.next();
if (!first) {
ret.append(',');
@@ -82,13 +87,15 @@
}
return ret.append("] ").toString();
} else if (obj instanceof Map) {
+
// Maps put as JavaScript hash.
- Map map = (Map) obj;
+ @SuppressWarnings("unchecked")
+ Map<Object, Object> map = (Map<Object, Object>) obj;
- StringBuffer ret = new StringBuffer("{");
+ StringBuilder ret = new StringBuilder("{");
boolean first = true;
- for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
+ for (Iterator<Map.Entry<Object, Object>> iter = map.entrySet().iterator();
iter.hasNext();) {
+ Map.Entry<Object, Object> entry = iter.next();
if (!first) {
ret.append(',');
}
@@ -104,13 +111,13 @@
return obj.toString();
} else if (obj instanceof String) {
// all other put as encoded strings.
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
addEncodedString(ret, obj);
return ret.toString();
}
// All other objects threaded as Java Beans.
try {
- StringBuffer ret = new StringBuffer("{");
+ StringBuilder ret = new StringBuilder("{");
PropertyDescriptor[] propertyDescriptors = PropertyUtils
.getPropertyDescriptors(obj);
boolean first = true;
@@ -135,14 +142,14 @@
}
}
- public static void addEncodedString(StringBuffer buff, Object obj) {
+ public static void addEncodedString(StringBuilder buff, Object obj) {
buff.append("'");
addEncoded(buff, obj);
buff.append("'");
}
- public static void addEncoded(StringBuffer buff, Object obj) {
+ public static void addEncoded(StringBuilder buff, Object obj) {
JSEncoder encoder = new JSEncoder();
char chars[] = obj.toString().toCharArray();
for (int i = 0; i < chars.length; i++) {
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -21,7 +21,6 @@
package org.ajax4jsf.model;
-import javax.faces.component.StateHolder;
/**
* Interface for classes keeped current iterable component state, as :
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -23,8 +23,6 @@
import java.io.Serializable;
-import javax.faces.context.FacesContext;
-
/**
* @author shura
*
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -29,6 +29,7 @@
* @author shura
*
*/
+@SuppressWarnings("serial")
public abstract class SerializableDataModel extends ExtendedDataModel implements
Serializable {
/**
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -23,7 +23,7 @@
* @throws IOException
*/
public void encodeAjaxChildren(FacesContext context, UIComponent component,
- String path, Set ids, Set renderedAreas) throws IOException;
+ String path, Set<String> ids, Set<String> renderedAreas) throws
IOException;
/**
* @param context
@@ -34,7 +34,7 @@
* @throws IOException
*/
public void encodeAjaxComponent(FacesContext context,
- UIComponent component, String currentPath, Set ids,
- Set renderedAreas) throws IOException;
+ UIComponent component, String currentPath, Set<String> ids,
+ Set<String> renderedAreas) throws IOException;
}
\ No newline at end of file
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -41,7 +41,7 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderScripts(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent
component);
/**
* Return set of strings with URI's of nessesary CSS styles.
@@ -50,6 +50,6 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderStyles(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent
component);
}
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -20,7 +20,7 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderScripts(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent
component);
/**
* Return set of strings with URI's of nessesary CSS styles.
@@ -29,6 +29,6 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderStyles(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent
component);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -107,7 +107,7 @@
* @param attributes
* @throws IOException
*/
- public void encode(FacesContext context, Object data,Map attributes) throws
IOException;
+ public void encode(FacesContext context, Object data, Map<String, Object>
attributes) throws IOException;
/**
* Encode start tag, attributes and body ( for inline script or style )
@@ -116,7 +116,7 @@
* @param attrs
* @throws IOException
*/
- public void encodeBegin(FacesContext context, Object component, Map attrs) throws
IOException;
+ public void encodeBegin(FacesContext context, Object component, Map<String,
Object> attrs) throws IOException;
/**
* Encode closed tag.
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -131,7 +131,8 @@
/**
* static instance variable.
*/
- private static Map instances = Collections.synchronizedMap(new HashMap());
+ private static Map<ClassLoader, InternetResourceBuilder> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, InternetResourceBuilder>
());
/**
* Get ( or create if nessesary ) instance of builder for current
@@ -161,7 +162,7 @@
reader.close();
in.close();
}
- Class builderClass = loader.loadClass(serviceClassName);
+ Class<?> builderClass = loader.loadClass(serviceClassName);
instance = (InternetResourceBuilder) builderClass.newInstance();
if (log.isDebugEnabled()) {
log.debug("Create instance of InternetBuilder from class "
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -23,7 +23,7 @@
import java.util.Date;
-import javax.faces.el.MethodBinding;
+import javax.el.MethodExpression;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -111,11 +111,11 @@
* Get El binding to method in user bean to send resource. Method will called with two
parameters - restored data object and servlet output stream.
* @return
*/
- public abstract MethodBinding getCreateContent();
+ public abstract MethodExpression getCreateContent();
/**
* Set El binding to method in user bean to send resource. Method will called with two
parameters - restored data object and servlet output stream.
* @param newvalue
*/
- public abstract void setCreateContent(MethodBinding newvalue);
+ public abstract void setCreateContent(MethodExpression newvalue);
}
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -34,6 +34,11 @@
/**
*
*/
+ private static final long serialVersionUID = -3263301605684963184L;
+
+ /**
+ *
+ */
public ResourceNotFoundException() {
super();
// TODO Auto-generated constructor stub
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -53,9 +53,9 @@
* @param data
* @throws IOException
*/
- void encode(InternetResource resource, FacesContext context, Object data, Map
attributes) throws IOException;
+ void encode(InternetResource resource, FacesContext context, Object data, Map<String,
Object> attributes) throws IOException;
- void encodeBegin(InternetResource base, FacesContext context, Object data, Map
attributes) throws IOException;
+ void encodeBegin(InternetResource base, FacesContext context, Object data,
Map<String, Object> attributes) throws IOException;
void encodeEnd(InternetResource base, FacesContext context, Object data) throws
IOException;
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Row.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:16:51
UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:17:16
UTC (rev 6617)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* Marker interface for table columns, rendered as entire row.
* @author shura
@@ -34,6 +36,6 @@
* Get iterator for all columns contained in this row.
* @return
*/
- public Iterator columns();
+ public Iterator<UIComponent> columns();
}
Modified: trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -42,9 +42,9 @@
private String text;
- private Map attributes = new HashMap();
+ private Map<String, Object> attributes = new HashMap<String, Object>();
- public Map getAttributes() {
+ public Map<String, Object> getAttributes() {
return attributes;
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -34,6 +34,11 @@
public class AjaxExpandedEvent extends NodeExpandedEvent {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5191468583939051390L;
+
public AjaxExpandedEvent(UIComponent component) {
super(component);
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -37,13 +37,15 @@
*/
public abstract class AttributedEvent extends FacesEvent implements AttributeHolder{
- private Map attributes = new HashMap();
+ private static final long serialVersionUID = 1L;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
public AttributedEvent(UIComponent component) {
super(component);
}
- public AttributedEvent(UIComponent component, Map attributes) {
+ public AttributedEvent(UIComponent component, Map<String, Object> attributes) {
super(component);
this.attributes.putAll(attributes);
}
@@ -67,14 +69,14 @@
*/
public void applyAttributes(UIComponent component) {
- Map attrs = component.getAttributes();
+ Map<String, Object> attrs = component.getAttributes();
- for(Iterator iterator = attributes.entrySet().iterator();
+ for(Iterator<Map.Entry<String, Object>> iterator =
attributes.entrySet().iterator();
iterator.hasNext(); ) {
- Map.Entry entry = (Map.Entry) iterator.next();
+ Map.Entry<String, Object> entry = iterator.next();
- String key = entry.getKey().toString();
+ String key = entry.getKey();
Object value = entry.getValue();
if (value == null) {
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -32,7 +32,11 @@
*/
public class DataFilterSliderEvent extends AjaxEvent {
- private Integer oldSliderVal;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Integer oldSliderVal;
private Integer newSliderVal;
/**
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -32,6 +32,10 @@
/**
+ *
+ */
+ private static final long serialVersionUID = -7417387605074667926L;
+ /**
* number of rows to update
*/
protected int rows;
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -32,7 +32,7 @@
*/
public class ListRowKey extends TreeRowKey {
- private ArrayList path;
+ private ArrayList<Object> path;
/**
*
@@ -48,7 +48,7 @@
*/
public ListRowKey() {
super();
- this.path = new ArrayList();
+ this.path = new ArrayList<Object>();
}
/**
@@ -58,9 +58,9 @@
public ListRowKey(ListRowKey parentRowKey) {
super();
if (parentRowKey != null) {
- this.path = (ArrayList) parentRowKey.path.clone();
+ this.path = (ArrayList<Object>) parentRowKey.path.clone();
} else {
- this.path = new ArrayList();
+ this.path = new ArrayList<Object>();
}
}
@@ -74,8 +74,8 @@
this.path.add(pathElement);
}
- private static ArrayList parsePath(String path) {
- ArrayList result = new ArrayList();
+ private static ArrayList<Object> parsePath(String path) {
+ ArrayList<Object> result = new ArrayList<Object>();
String trimmedPath = path.trim();
@@ -119,10 +119,10 @@
* List constructor
* @param list List of strings to create corresponding row key from
*/
- public ListRowKey(List list) {
+ public ListRowKey(List<Object> list) {
super();
- this.path = new ArrayList(list);
+ this.path = new ArrayList<Object>(list);
}
/**
@@ -131,7 +131,7 @@
*/
public ListRowKey(Object path) {
super();
- this.path = new ArrayList(1);
+ this.path = new ArrayList<Object>(1);
this.path.add(path);
}
@@ -148,7 +148,7 @@
return path.size();
}
- public Iterator iterator() {
+ public Iterator<Object> iterator() {
return path.iterator();
}
@@ -175,7 +175,7 @@
return true;
}
- public Iterator getSubPathIterator(int fromIndex) {
+ public Iterator<Object> getSubPathIterator(int fromIndex) {
return path.listIterator(fromIndex);
}
@@ -195,7 +195,7 @@
public String getPath() {
StringBuffer result = new StringBuffer();
- Iterator iterator = path.iterator();
+ Iterator<Object> iterator = path.iterator();
boolean hasNext = iterator.hasNext();
while (hasNext) {
@@ -228,8 +228,8 @@
public int getCommonPathLength(TreeRowKey otherRowKey) {
if (otherRowKey == null)
return 0;
- Iterator iterator = this.iterator();
- Iterator otherIterator = otherRowKey.iterator();
+ Iterator<Object> iterator = this.iterator();
+ Iterator<?> otherIterator = otherRowKey.iterator();
int length = 0;
while (iterator.hasNext() && otherIterator.hasNext()
&& iterator.next().equals(otherIterator.next()))
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -28,7 +28,7 @@
private SequenceDataModel sourceModel;
private SequenceDataModel targetModel;
- private Map data;
+ private Map<Object, Object> data;
private Object wrappedData;
@@ -49,10 +49,10 @@
public void walk(final FacesContext context, final DataVisitor visitor, final Range
range,
final Object argument) throws IOException {
if (data != null) {
- Iterator iterator = data.entrySet().iterator();
+ Iterator<Entry<Object, Object>> iterator = data.entrySet().iterator();
while (iterator.hasNext()) {
- Entry entry =(Map.Entry) iterator.next();
+ Entry<Object, Object> entry = iterator.next();
visitor.process(context, entry.getKey(), argument);
}
@@ -140,7 +140,7 @@
this.wrappedData = data;
if (data instanceof Map) {
- this.data = (Map) data;
+ this.data = (Map<Object, Object>) data;
} else {
DataModel[] models = (DataModel[]) data;
this.sourceModel = new SequenceDataModel(models[0]);
Modified: trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -26,7 +26,7 @@
*/
public class MapDataModel extends ExtendedDataModel {
- private Map map;
+ private Map<Object, Object> map;
private Object rowKey;
private Object wrappedData;
@@ -60,7 +60,7 @@
public void walk(FacesContext context, DataVisitor visitor, Range range,
Object argument) throws IOException {
if (map != null) {
- for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
+ for (Iterator<Object> iterator = map.keySet().iterator(); iterator.hasNext();)
{
Object key = (Object) iterator.next();
visitor.process(context, key, argument);
@@ -132,24 +132,24 @@
public void setWrappedData(Object data) {
this.wrappedData = data;
if (data instanceof NamedNodeMap) {
- this.map = new AbstractMap() {
+ this.map = new AbstractMap<Object, Object>() {
- private Set entrySet = new AbstractSet() {
+ private Set<Entry<Object, Object>> entrySet = new
AbstractSet<Entry<Object, Object>>() {
- public Iterator iterator() {
- return new Iterator() {
+ public Iterator<Entry<Object, Object>> iterator() {
+ return new Iterator<Entry<Object, Object>>() {
private int index = 0;
public boolean hasNext() {
return index < ((NamedNodeMap) getWrappedData()).getLength();
}
- public Object next() {
+ public Entry<Object, Object> next() {
final Node node = ((NamedNodeMap) getWrappedData()).item(index++);
if (node == null) {
throw new NoSuchElementException();
} else {
- return new Map.Entry() {
+ return new Map.Entry<Object, Object>() {
public Object getKey() {
return node.getNodeName();
@@ -187,13 +187,13 @@
return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key);
}
- public Set entrySet() {
+ public Set<Entry<Object, Object>> entrySet() {
return entrySet;
}
};
} else if (data != null) {
- this.map = (Map) data;
+ this.map = (Map<Object, Object>) data;
} else {
this.map = null;
}
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -7,6 +7,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.context.FacesContext;
@@ -24,7 +25,7 @@
*/
public class OrderingListDataModel extends ExtendedDataModel {
- private Map data;
+ private Map<Object, Object> data;
private Object rowKey;
@@ -39,11 +40,11 @@
public void walk(FacesContext context, DataVisitor visitor, Range range,
Object argument) throws IOException {
- Set entrySet = data.entrySet();
- Iterator iterator = entrySet.iterator();
+ Set<Entry<Object,Object>> entrySet = data.entrySet();
+ Iterator<Entry<Object, Object>> iterator = entrySet.iterator();
while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry) iterator.next();
+ Entry<Object, Object> entry = iterator.next();
visitor.process(context, entry.getKey(), argument);
}
@@ -77,7 +78,7 @@
public void setWrappedData(Object data) {
this.rowKey = null;
- this.data = (Map) data;
+ this.data = (Map<Object, Object>) data;
}
}
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -27,7 +27,7 @@
* @author Maksim Kaszynski
*
*/
-public abstract class ScrollableTableDataModel extends ExtendedDataModel {
+public abstract class ScrollableTableDataModel<T> extends ExtendedDataModel {
/**
* Simple implementation - index-based row key
@@ -91,7 +91,7 @@
private Object rowKey;
- private Map mapping;
+ private Map<Object, T> mapping;
private SortOrder lastSortOrder;
@@ -104,7 +104,7 @@
* @param sortOrder
* @return list of ordered data
*/
- public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
+ public abstract List<T> loadData(int startRow, int endRow, SortOrder sortOrder);
/**
@@ -124,12 +124,12 @@
lastSortOrder = sequenceRange.getSortOrder();
- List objects = loadData(startIndex, last, lastSortOrder);
+ List<T> objects = loadData(startIndex, last, lastSortOrder);
- mapping = new HashMap();
+ mapping = new HashMap<Object, T>();
for (int i = 0; i < objects.size(); i++,startIndex++) {
- Object data = objects.get(i);
+ T data = objects.get(i);
Object key = getId(data);
if (key == null) {
@@ -155,12 +155,12 @@
* @param id
* @return
*/
- public Object getObjectById(Object id) {
+ public T getObjectById(Object id) {
if (id instanceof SimpleRowKey) {
int i = ((SimpleRowKey) id).intValue();
- List<?> l = loadData(i, i + 1, lastSortOrder);
+ List<T> l = loadData(i, i + 1, lastSortOrder);
return l.get(0);
@@ -177,7 +177,7 @@
* @param o
* @return
*/
- public Object getId(Object o) {
+ public Object getId(T o) {
return null;
}
@@ -229,14 +229,14 @@
log.trace("loadAndMap " + id);
}
- Object o = getObjectById(id);
- if (o != null) {
+ T t = getObjectById(id);
+ if (t != null) {
if (mapping == null) {
- mapping = new HashMap();
+ mapping = new HashMap<Object, T>();
}
- mapping.put(id, o);
+ mapping.put(id, t);
}
- return o;
+ return t;
}
/*
* FIXME: This method is most likely redundant
Modified: trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -12,7 +12,7 @@
*/
public interface Selection extends Serializable {
- public Iterator getKeys();
+ public Iterator<Object> getKeys();
public int size();
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -3,7 +3,6 @@
*/
package org.richfaces.model.selection;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -16,7 +15,7 @@
private static final long serialVersionUID = 1L;
- private Set keys = new LinkedHashSet();
+ private Set<Object> keys = new LinkedHashSet<Object>();
public boolean addKey(Object rowKey) {
return keys.add(rowKey);
@@ -26,7 +25,7 @@
return keys.remove(rowKey);
}
- public Iterator getKeys() {
+ public Iterator<Object> getKeys() {
return keys.iterator();
}
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2008-03-07
12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -51,13 +51,14 @@
/**
* static instance variable.
*/
- private static Map instances = Collections.synchronizedMap(new HashMap());
+ private static Map<ClassLoader, SkinFactory> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
private static final Log log = LogFactory.getLog(SkinFactory.class);
public static void reset() {
- instances = Collections.synchronizedMap(new HashMap());
+ instances = Collections.synchronizedMap(new HashMap<ClassLoader,
SkinFactory>());
}
/**
@@ -88,10 +89,10 @@
Messages.SET_SKIN_FACTORY_INFO,
factoryClassName));
}
- Class clazz = Class.forName(factoryClassName, false, loader);
+ Class<?> clazz = Class.forName(factoryClassName, false, loader);
try {
// try construct factory chain.
- Constructor factoryConstructor = clazz
+ Constructor<?> factoryConstructor = clazz
.getConstructor(new Class[] { SkinFactory.class });
instance = (SkinFactory) factoryConstructor
.newInstance(new Object[] { instance });
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -25,6 +25,11 @@
public class SkinNotFoundException extends FacesException {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2498031536712930735L;
+
public SkinNotFoundException() {
super();
// TODO Auto-generated constructor stub
Modified:
trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
===================================================================
---
trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2008-03-07
12:16:51 UTC (rev 6616)
+++
trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2008-03-07
12:17:16 UTC (rev 6617)
@@ -200,7 +200,7 @@
* Test method for {@link
org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer,
java.lang.Object)}.
*/
public void testAddEncodedString() {
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
ScriptUtils.addEncodedString(buff, "foo");
assertEquals("'foo'", buff.toString());
}
@@ -209,7 +209,7 @@
* Test method for {@link
org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer,
java.lang.Object)}.
*/
public void testAddEncoded() {
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
ScriptUtils.addEncoded(buff, "foo\"\'");
assertEquals("foo\\\"\\\'", buff.toString());
}