JBoss Rich Faces SVN: r16076 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-12-04 15:58:58 -0500 (Fri, 04 Dec 2009)
New Revision: 16076
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
Log:
https://jira.jboss.org/jira/browse/RF-7732
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-12-04 20:55:31 UTC (rev 16075)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-12-04 20:58:58 UTC (rev 16076)
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
@@ -28,6 +30,20 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.util.HtmlDimensions;
+import java.io.IOException;
+
+import java.lang.reflect.Array;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
import javax.faces.component.EditableValueHolder;
@@ -42,17 +58,6 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
-import java.io.IOException;
-import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
/**
* Util class for common render operations - render passthru html attributes,
@@ -60,6 +65,7 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.6 $ $Date: 2007/02/08 19:07:16 $
+ *
*/
public class RendererUtils {
public static final String DUMMY_FORM_ID = ":_form";
@@ -130,7 +136,6 @@
/**
* Use this method to get singleton instance of RendererUtils
- *
* @return singleton instance
*/
public static RendererUtils getInstance() {
@@ -168,7 +173,7 @@
if (null != clientId) {
context.getResponseWriter().writeAttribute(attribute, clientId,
- (String) getComponentAttributeName(attribute));
+ (String) getComponentAttributeName(attribute));
}
}
@@ -183,7 +188,7 @@
public void encodeCustomId(FacesContext context, UIComponent component) throws IOException {
if ((component.getId() != null) && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
context.getResponseWriter().writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context),
- HTML.ID_ATTRIBUTE);
+ HTML.ID_ATTRIBUTE);
}
}
@@ -199,7 +204,7 @@
if (null == name) {
throw new IllegalArgumentException(Messages.getMessage(Messages.UNNAMED_PARAMETER_ERROR,
- component.getClientId(context)));
+ component.getClientId(context)));
}
boolean escape = true;
@@ -245,7 +250,7 @@
UIComponent component = (UIComponent) behaviorHolder;
ResponseWriter writer = context.getResponseWriter();
Collection<Parameter> parametersList = HandlersChain.createParametersList(createParametersMap(context,
- component));
+ component));
for (String behaviorEventName : eventNames) {
if (behaviorEventName.equals(defaultEventName)) {
@@ -300,8 +305,8 @@
* @throws IOException
*/
public void encodePassThruWithExclusions(FacesContext context, UIComponent component, String exclusions,
- String defaultHtmlEvent) throws IOException {
-
+ String defaultHtmlEvent) throws IOException {
+
if (null != exclusions) {
String[] exclusionsArray = exclusions.split(",");
@@ -310,8 +315,8 @@
}
public void encodePassThruWithExclusionsArray(FacesContext context, UIComponent component, String[] exclusions,
- String defaultHtmlEvent) throws IOException {
-
+ String defaultHtmlEvent) throws IOException {
+
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
@@ -350,7 +355,7 @@
* @throws IOException
*/
public void encodePassThruAttribute(FacesContext context, Map<String, Object> attributes, ResponseWriter writer,
- String attribute) throws IOException {
+ String attribute) throws IOException {
Object value = attributeValue(attribute, attributes.get(getComponentAttributeName(attribute)));
@@ -368,7 +373,7 @@
public void encodeAttributesFromArray(FacesContext context, UIComponent component, String[] attrs)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
@@ -382,9 +387,12 @@
/**
* Encode attributes given by comma-separated string list.
*
- * @param context current JSF context
- * @param component for with render attributes values
- * @param attrs comma separated list of attributes
+ * @param context
+ * current JSF context
+ * @param component
+ * for with render attributes values
+ * @param attrs
+ * comma separated list of attributes
* @throws IOException
*/
public void encodeAttributes(FacesContext context, UIComponent component, String attrs) throws IOException {
@@ -400,11 +408,12 @@
* @param component
* @param property
* @param attributeName
+ *
* @throws IOException
*/
public void encodeAttribute(FacesContext context, UIComponent component, Object property, String attributeName)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Object value = component.getAttributes().get(property);
@@ -417,12 +426,6 @@
encodeAttribute(context, component, getComponentAttributeName(attribute), attribute);
}
- public void writeText(ResponseWriter writer, Object value, String property) throws IOException {
- if (value != null) {
- writer.writeText(value, property);
- }
- }
-
/**
* Write html-attribute
*
@@ -446,7 +449,7 @@
if (null == attributeVal) {
return false;
} else if ((attributeVal instanceof Boolean)
- && ((Boolean) attributeVal).booleanValue() == Boolean.FALSE.booleanValue()) {
+ && ((Boolean) attributeVal).booleanValue() == Boolean.FALSE.booleanValue()) {
return false;
} else if (attributeVal.toString().length() == 0) {
return false;
@@ -472,8 +475,8 @@
* with Java primitive types of JSF component return appropriate MIN_VALUE .
*
* @param property -
- * value of property returned from
- * {@link UIComponent#getAttributes()}
+ * value of property returned from
+ * {@link UIComponent#getAttributes()}
* @return true for setted property, false otherthise.
*/
public boolean isValidProperty(Object property) {
@@ -501,15 +504,15 @@
/**
* Checks if the argument passed in is empty or not.
* Object is empty if it is: <br />
- * - <code>null<code><br />
- * - zero-length string<br />
- * - empty collection<br />
- * - empty map<br />
- * - zero-length array<br />
+ * - <code>null<code><br />
+ * - zero-length string<br />
+ * - empty collection<br />
+ * - empty map<br />
+ * - zero-length array<br />
*
* @param o object to check for emptiness
+ * @since 3.3.2
* @return <code>true</code> if the argument is empty, <code>false</code> otherwise
- * @since 3.3.2
*/
public boolean isEmpty(Object o) {
if (null == o) {
@@ -544,6 +547,7 @@
* @param value
* @param defaultValue
* @param wrapper
+ *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value, String defaultValue,
@@ -571,6 +575,7 @@
* @param name
* @param value
* @param defaultValue
+ *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value, String defaultValue) {
@@ -584,6 +589,7 @@
* @param hash
* @param name
* @param value
+ *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value) {
@@ -611,7 +617,8 @@
* attributes return name for true value, otherthise - null. For non-boolean
* attributes return same value.
*
- * @param name attribute name.
+ * @param name
+ * attribute name.
* @param value
* @return
*/
@@ -635,7 +642,8 @@
* Get boolean value of logical attribute
*
* @param component
- * @param name attribute name
+ * @param name
+ * attribute name
* @return true if attribute is equals Boolean.TRUE or String "true" , false
* otherwise.
*/
@@ -733,6 +741,7 @@
* formats given value to
*
* @param value
+ *
* @return
*/
public String encodePctOrPx(String value) {
@@ -796,7 +805,7 @@
*/
public void encodeBeginForm(FacesContext context, UIComponent component, ResponseWriter writer, String clientId)
throws IOException {
-
+
String actionURL = getActionUrl(context);
String encodeActionURL = context.getExternalContext().encodeActionURL(actionURL);
@@ -884,39 +893,40 @@
/**
* @param ids
* @param keyword
+ * @since 4.0
+ *
* @return
- * @since 4.0
*/
private static boolean checkKeyword(Collection<String> ids, String keyword) {
- if (ids.contains(keyword)) {
- if (ids.size() != 1) {
- //TODO log
- }
-
- return true;
- }
-
- return false;
+ if (ids.contains(keyword)) {
+ if (ids.size() != 1) {
+ //TODO log
+ }
+
+ return true;
+ }
+
+ return false;
}
/**
* @param context
* @param component
* @param shortIds
+ * @since 4.0
* @return
- * @since 4.0
*/
public Collection<String> findComponentsFor(FacesContext context, UIComponent component,
- Collection<String> shortIds) {
+ Collection<String> shortIds) {
// TODO - implement
// TODO add support for @*
Set<String> result = new LinkedHashSet<String>(shortIds.size());
if (checkKeyword(shortIds, AjaxRendererUtils.ALL)) {
- result.add(AjaxRendererUtils.ALL);
+ result.add(AjaxRendererUtils.ALL);
} else if (checkKeyword(shortIds, AjaxRendererUtils.NONE)) {
- //do nothing, use empty set
+ //do nothing, use empty set
} else {
for (String id : shortIds) {
if (AjaxRendererUtils.THIS.equals(id)) {
@@ -971,9 +981,9 @@
/**
* If target component contains generated id and for doesn't, correct for id
- *
* @param forAttr
* @param component
+ *
*/
public String correctForIdReference(String forAttr, UIComponent component) {
int contains = forAttr.indexOf(UIViewRoot.UNIQUE_ID_PREFIX);
@@ -993,7 +1003,7 @@
private UIComponent findUIComponentBelow(UIComponent root, String id) {
UIComponent target = null;
- for (Iterator<UIComponent> iter = root.getFacetsAndChildren(); iter.hasNext();) {
+ for (Iterator<UIComponent> iter = root.getFacetsAndChildren(); iter.hasNext(); ) {
UIComponent child = (UIComponent) iter.next();
if (child instanceof NamingContainer) {
@@ -1020,7 +1030,7 @@
public static void writeEventHandlerFunction(FacesContext context, UIComponent component, String eventName)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Object script = component.getAttributes().get(eventName);
@@ -1036,7 +1046,7 @@
}
public JSFunctionDefinition getAsEventHandler(FacesContext context, UIComponent component, String attributeName,
- String append) {
+ String append) {
String event = (String) component.getAttributes().get(attributeName);
if (event != null) {
@@ -1100,6 +1110,7 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.6 $ $Date: 2007/02/08 19:07:16 $
+ *
*/
public interface HTML {
public static final String ACCEPT_ATTRIBUTE = "accept";
@@ -1195,7 +1206,7 @@
"onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onreset", "onselect", "onsubmit",
"onunload"
};
- public static final String[] PASS_THRU_STYLES = {"style", "class",};
+ public static final String[] PASS_THRU_STYLES = {"style", "class", };
/**
* all HTML attributes with URI value.
14 years, 5 months
JBoss Rich Faces SVN: r16075 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/parser/el/node and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-12-04 15:55:31 -0500 (Fri, 04 Dec 2009)
New Revision: 16075
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELParserUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/NullType.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractBinaryOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticIntegerOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryBooleanOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/TypeUtilsTest.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-text.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/Bean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7732
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -45,18 +45,14 @@
public static final String TRUE_VALUE = "true";
//
- public static final String ARRAY_INDICATOR = "[L";
public static final String COLON = " : ";
public static final String COMMA = ",";
public static final String CONVERT_TO_STRING_FUNCTION = "convertToString";
public static final String DOT = ".";
public static final String DOUBLE_VALUE_OF_FUNCTION = "Double.valueOf";
public static final String EXCLAMATION_MARK = "!";
- public static final String GET_ELEMENT_BY_INDEX_FUNCTION = "getElementByIndex";
public static final String GET_FUNCTION = "get";
public static final String GET_UTILS_FUNCTION = "getUtils";
- public static final String JAVA_UTIL_LIST = "java.util.List";
- public static final String JAVA_UTIL_MAP = "java.util.Map";
public static final String LEFT_BRACKET = "(";
public static final String LEFT_SQUARE_BRACKET = "[";
public static final String NEGATIVE = "-";
@@ -66,8 +62,8 @@
public static final String RIGHT_SQUARE_BRACKET = "]";
public static final String THIS_GET_UTILS_IS_EMPTY_FUNCTION = "this.getUtils().isEmpty";
public static final String THIS_PREFIX = "this";
- public static final String UTILS_PREFIX = "utils";
-
+ public static final String GETTER_PREFIX = "get";
+
private ELNodeConstants() {
}
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELParserUtils.java (from rev 16062, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELParserUtils.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELParserUtils.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,617 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+
+package org.richfaces.cdk.parser.el;
+
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import org.jboss.el.parser.AstAnd;
+import org.jboss.el.parser.AstBracketSuffix;
+import org.jboss.el.parser.AstChoice;
+import org.jboss.el.parser.AstDeferredExpression;
+import org.jboss.el.parser.AstDiv;
+import org.jboss.el.parser.AstDynamicExpression;
+import org.jboss.el.parser.AstEmpty;
+import org.jboss.el.parser.AstEqual;
+import org.jboss.el.parser.AstFalse;
+import org.jboss.el.parser.AstFloatingPoint;
+import org.jboss.el.parser.AstFunction;
+import org.jboss.el.parser.AstGreaterThan;
+import org.jboss.el.parser.AstGreaterThanEqual;
+import org.jboss.el.parser.AstIdentifier;
+import org.jboss.el.parser.AstInteger;
+import org.jboss.el.parser.AstLessThan;
+import org.jboss.el.parser.AstLessThanEqual;
+import org.jboss.el.parser.AstLiteralExpression;
+import org.jboss.el.parser.AstMethodSuffix;
+import org.jboss.el.parser.AstMinus;
+import org.jboss.el.parser.AstMod;
+import org.jboss.el.parser.AstMult;
+import org.jboss.el.parser.AstNegative;
+import org.jboss.el.parser.AstNot;
+import org.jboss.el.parser.AstNotEqual;
+import org.jboss.el.parser.AstNull;
+import org.jboss.el.parser.AstOr;
+import org.jboss.el.parser.AstPlus;
+import org.jboss.el.parser.AstPropertySuffix;
+import org.jboss.el.parser.AstString;
+import org.jboss.el.parser.AstTrue;
+import org.jboss.el.parser.AstValue;
+import org.jboss.el.parser.Node;
+import org.richfaces.cdk.parser.el.node.AstBracketSuffixTreeNode;
+import org.richfaces.cdk.parser.el.node.AstChoiceTreeNode;
+import org.richfaces.cdk.parser.el.node.AstDeferredOrDynamicExpressionTreeNode;
+import org.richfaces.cdk.parser.el.node.AstEmptyTreeNode;
+import org.richfaces.cdk.parser.el.node.AstFloatingPointTreeNode;
+import org.richfaces.cdk.parser.el.node.AstFunctionTreeNode;
+import org.richfaces.cdk.parser.el.node.AstIdentifierTreeNode;
+import org.richfaces.cdk.parser.el.node.AstIntegerTreeNode;
+import org.richfaces.cdk.parser.el.node.AstLiteralTreeNode;
+import org.richfaces.cdk.parser.el.node.AstMethodSuffixTreeNode;
+import org.richfaces.cdk.parser.el.node.AstNegativeTreeNode;
+import org.richfaces.cdk.parser.el.node.AstNotTreeNode;
+import org.richfaces.cdk.parser.el.node.AstPropertySuffixTreeNode;
+import org.richfaces.cdk.parser.el.node.AstStringTreeNode;
+import org.richfaces.cdk.parser.el.node.AstValueTreeNode;
+import org.richfaces.cdk.parser.el.node.BinaryArithmeticIntegerOperationTreeNode;
+import org.richfaces.cdk.parser.el.node.BinaryArithmeticOperationTreeNode;
+import org.richfaces.cdk.parser.el.node.BinaryBooleanOperationTreeNode;
+import org.richfaces.cdk.parser.el.node.ConstantValueTreeNode;
+import org.richfaces.cdk.parser.el.node.ITreeNode;
+
+/**
+ * Class, that encapsulate all functionality, related to Reflection calls, such as loading classes, get property
+ * descriptors etc...
+ * @author amarkhel
+ *
+ */
+public final class ELParserUtils {
+
+ private static final class ClassDataHolder implements ClassVisitor {
+
+ private Map<String, PropertyDescriptor> resolvedProperties;
+
+ private List<Method> resolvedMethods;
+
+ public ClassDataHolder() {
+ super();
+
+ this.resolvedProperties = new HashMap<String, PropertyDescriptor>();
+ this.resolvedMethods = new ArrayList<Method>();
+ }
+
+ public Map<String, PropertyDescriptor> getResolvedProperties() {
+ return resolvedProperties;
+ }
+
+ public List<Method> getResolvedMethods() {
+ return resolvedMethods;
+ }
+
+ @Override
+ public void visit(Class<?> clazz) throws ParsingException {
+ PropertyDescriptor[] pds;
+ Method[] declaredMethods;
+
+ try {
+ pds = getPropertyDescriptors(clazz);
+ declaredMethods = clazz.getDeclaredMethods();
+ } catch (LinkageError e) {
+ throw new ParsingException(e.getMessage(), e);
+ }
+
+ for (PropertyDescriptor descriptor : pds) {
+ String descriptorName = descriptor.getName();
+ if (resolvedProperties.get(descriptorName) == null) {
+ resolvedProperties.put(descriptorName, descriptor);
+ }
+ }
+
+ for (Method declaredMethod : declaredMethods) {
+ resolvedMethods.add(declaredMethod);
+ }
+ }
+ }
+
+ private static Map<Class<?>, ClassDataHolder> classDataCache =
+ new WeakHashMap<Class<?>, ClassDataHolder>();
+
+ private ELParserUtils() { }
+
+ public static void verifyClassPropertiesAndMethods(Class<?> initialClass) throws ParsingException {
+ resolveClassPropertiesAndMethods(initialClass);
+ }
+
+ private static ClassDataHolder resolveClassPropertiesAndMethods(Class<?> initialClass) throws ParsingException {
+ ClassDataHolder classDataHolder = classDataCache.get(initialClass);
+ if (classDataHolder == null) {
+ classDataHolder = new ClassDataHolder();
+ new ClassWalkingLogic(initialClass).walk(classDataHolder);
+ classDataCache.put(initialClass, classDataHolder);
+ }
+
+ return classDataHolder;
+ }
+
+ /**
+ * This method determine type of parsed node and create wrapper for them, that extends AbstractTreeNode.
+ * If node type is not recognized - throws ParsingException.
+ * @param child - parsed node
+ * @throws ParsingException - if node type is not recognized.
+ * @return wrapper for parsed node(if node type is recognized), that implement ITreeNode interface.
+ */
+ public static ITreeNode determineNodeType(Node child) throws ParsingException {
+ ITreeNode treeNode = null;
+
+ if (child instanceof AstIdentifier) {
+ treeNode = new AstIdentifierTreeNode(child);
+ } else if (child instanceof AstValue) {
+ treeNode = new AstValueTreeNode(child);
+ } else if (child instanceof AstInteger) {
+ treeNode = new AstIntegerTreeNode(child);
+ } else if (child instanceof AstString) {
+ treeNode = new AstStringTreeNode(child);
+ } else if (child instanceof AstFunction) {
+ treeNode = new AstFunctionTreeNode(child);
+ } else if (child instanceof AstDeferredExpression || child instanceof AstDynamicExpression) {
+ treeNode = new AstDeferredOrDynamicExpressionTreeNode(child);
+ } else if (child instanceof AstNot) {
+ treeNode = new AstNotTreeNode(child);
+ } else if (child instanceof AstChoice) {
+ treeNode = new AstChoiceTreeNode(child);
+ } else if (child instanceof AstEmpty) {
+ treeNode = new AstEmptyTreeNode(child);
+ } else if (child instanceof AstLiteralExpression) {
+ treeNode = new AstLiteralTreeNode(child);
+ } else if (child instanceof AstFalse) {
+ treeNode = ConstantValueTreeNode.FALSE_NODE;
+ } else if (child instanceof AstTrue) {
+ treeNode = ConstantValueTreeNode.TRUE_NODE;
+ } else if (child instanceof AstNull) {
+ treeNode = ConstantValueTreeNode.NULL_NODE;
+ } else if (child instanceof AstAnd) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.AND_OPERATOR);
+ } else if (child instanceof AstEqual) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.EQUALITY_OPERATOR);
+ } else if (child instanceof AstGreaterThan) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.GREATER_THEN_OPERATOR);
+ } else if (child instanceof AstGreaterThanEqual) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.GREATER_THEN_OR_EQUALITY_OPERATOR);
+ } else if (child instanceof AstLessThan) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.LESS_THEN_OPERATOR);
+ } else if (child instanceof AstLessThanEqual) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.LESS_THEN_OR_EQUALITY_OPERATOR);
+ } else if (child instanceof AstNotEqual) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.INEQUALITY_OPERATOR);
+ } else if (child instanceof AstOr) {
+ treeNode = new BinaryBooleanOperationTreeNode(child, ELNodeConstants.OR_OPERATOR);
+ } else if (child instanceof AstDiv) {
+ treeNode = new BinaryArithmeticOperationTreeNode(child, ELNodeConstants.DIV_OPERATOR);
+ } else if (child instanceof AstMult) {
+ treeNode = new BinaryArithmeticOperationTreeNode(child, ELNodeConstants.MULT_OPERATOR);
+ } else if (child instanceof AstMod) {
+ treeNode = new BinaryArithmeticIntegerOperationTreeNode(child, ELNodeConstants.MOD_OPERATOR);
+ } else if (child instanceof AstPlus) {
+ treeNode = new BinaryArithmeticOperationTreeNode(child, ELNodeConstants.PLUS_OPERATOR);
+ } else if (child instanceof AstMinus) {
+ treeNode = new BinaryArithmeticOperationTreeNode(child, ELNodeConstants.MINUS_OPERATOR);
+ } else if (child instanceof AstBracketSuffix) {
+ treeNode = new AstBracketSuffixTreeNode(child);
+ } else if (child instanceof AstNegative) {
+ treeNode = new AstNegativeTreeNode(child);
+ } else if (child instanceof AstFloatingPoint) {
+ treeNode = new AstFloatingPointTreeNode(child);
+ } else if (child instanceof AstMethodSuffix) {
+ treeNode = new AstMethodSuffixTreeNode(child);
+ } else if (child instanceof AstPropertySuffix) {
+ treeNode = new AstPropertySuffixTreeNode(child);
+ } else if (child instanceof AstBracketSuffix) {
+ treeNode = new AstBracketSuffixTreeNode(child);
+ } else {
+ throw new ParsingException("Node " + child.getClass().getSimpleName() + "[" + child.getImage() + "] is not recognized;");
+ }
+
+ //TODO: add support for closures
+
+ return treeNode;
+ }
+
+ /**
+ * This method return PropertyDescriptor by specified propertyName and clazz.
+ * @param clazz - class to search
+ * @param propertyName - propertyName to search
+ * @return property descriptor if found.
+ * @throws ParsingException if error occured.
+ */
+ public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, String propertyName)
+ throws ParsingException {
+ if (clazz == null) {
+ return null;
+ }
+
+ ClassDataHolder classDataHolder = resolveClassPropertiesAndMethods(clazz);
+ return classDataHolder.getResolvedProperties().get(propertyName);
+ }
+
+ /**
+ * Returns wrapper classes for passed-in class. If type is primitive, then corresponding
+ * wrapper class is returned (e.g. boolean -> Boolean), otherwise does nothing and returns
+ * passed-in class.
+ *
+ * @return wrapper for primitive types, or passed-in class
+ */
+ private static Class<?> getWrapperClass(Class<?> inClazz) {
+ if (inClazz == null) {
+ return null;
+ }
+
+ if (inClazz.isPrimitive()) {
+ return getPrimitiveWrapper(inClazz);
+ } else {
+ return inClazz;
+ }
+ }
+
+ /**
+ * <p>Retrieve the property descriptors for the specified class,
+ * introspecting and caching them the first time a particular bean class
+ * is encountered.</p>
+ *
+ * <p><strong>FIXME</strong> - Does not work with DynaBeans.</p>
+ *
+ * @param beanClass Bean class for which property descriptors are requested
+ * @return the property descriptors
+ * @throws ParsingException if error occured.
+ *
+ * @exception IllegalArgumentException if <code>beanClass</code> is null
+ */
+ private static PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) throws ParsingException {
+ if (beanClass == null) {
+ throw new IllegalArgumentException("No bean class specified");
+ }
+
+ // Look up any cached descriptors for this bean class
+ PropertyDescriptor[] descriptors = null;
+
+ // Introspect the bean and cache the generated descriptors
+ BeanInfo beanInfo = null;
+
+ try {
+ beanInfo = Introspector.getBeanInfo(beanClass);
+ descriptors = beanInfo.getPropertyDescriptors();
+ } catch (IntrospectionException e) {
+ return new PropertyDescriptor[0];
+ }
+
+ if (descriptors == null) {
+ descriptors = new PropertyDescriptor[0];
+ }
+
+ return descriptors;
+ }
+
+ private static boolean isMethodVisible(Method method) {
+ return !Modifier.isPrivate(method.getModifiers());
+ }
+
+ /**
+ * <p>Find an accessible method that matches the given name and has compatible parameters.
+ * Compatible parameters mean that every method parameter is assignable from
+ * the given parameters.
+ * In other words, it finds a method with the given name
+ * that will take the parameters given.<p>
+ *
+ * <p>This method is slightly undeterminstic since it loops
+ * through methods names and return the first matching method.</p>
+ *
+ * <p>This method is used by
+ * {@link
+ * #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)}.
+ *
+ * <p>This method can match primitive parameter by passing in wrapper classes.
+ * For example, a <code>Boolean</code> will match a primitive <code>boolean</code>
+ * parameter.
+ *
+ * @param clazz find method in this class
+ * @param methodName find method with this name
+ * @param parameterTypes find method with compatible parameters
+ * @return The accessible method
+ * @throws ParsingException if error occured.
+ */
+ public static Type getMatchingVisibleMethodReturnType(Class<?> clazz, final String methodName,
+ Type[] parameterTypes) throws ParsingException {
+
+ if (clazz == null) {
+ return Object.class;
+ }
+
+ ClassDataHolder classDataHolder = resolveClassPropertiesAndMethods(clazz);
+ List<Method> resolvedMethods = classDataHolder.getResolvedMethods();
+
+ // search through all methods
+ int paramSize = parameterTypes.length;
+ Method bestMatch = null;
+ float bestMatchCost = Float.MAX_VALUE;
+ float myCost = Float.MAX_VALUE;
+
+ for (Method resolvedMethod: resolvedMethods) {
+ if (!isMethodVisible(resolvedMethod)) {
+ continue;
+ }
+
+ if (!resolvedMethod.getName().equals(methodName)) {
+ continue;
+ }
+
+ // compare parameters
+ Class<?>[] methodsParams = resolvedMethod.getParameterTypes();
+ int methodParamSize = methodsParams.length;
+
+ if (methodParamSize == paramSize) {
+ boolean match = true;
+
+ for (int n = 0; n < methodParamSize; n++) {
+ if (!isAssignmentCompatible(methodsParams[n], parameterTypes[n])) {
+ match = false;
+
+ break;
+ }
+ }
+
+ if (match) {
+ myCost = getTotalTransformationCost(methodsParams, parameterTypes);
+
+ if (myCost < bestMatchCost) {
+ bestMatch = resolvedMethod;
+ bestMatchCost = myCost;
+ }
+ }
+ }
+ }
+
+ if (bestMatch != null) {
+ return bestMatch.getGenericReturnType();
+ } else {
+ return Object.class;
+ }
+ }
+
+ /**
+ * Returns the sum of the object transformation cost for each class in the source
+ * argument list.
+ * @param srcArgs The source arguments
+ * @param destArgs The destination arguments
+ * @return The total transformation cost
+ */
+ private static float getTotalTransformationCost(Type[] destArgs, Type[] srcArgs) {
+ float totalCost = 0.0f;
+
+ for (int i = 0; i < srcArgs.length; i++) {
+ Type destType = destArgs[i];
+ Type srcType = srcArgs[i];
+
+ totalCost += getObjectTransformationCost(destType, srcType);
+ }
+
+ return totalCost;
+ }
+
+ /**
+ * Gets the number of steps required needed to turn the source class into the
+ * destination class. This represents the number of steps in the object hierarchy
+ * graph.
+ * @param srcClass The source class
+ * @param destClass The destination class
+ * @return The cost of transforming an object
+ */
+ private static float getObjectTransformationCost(Type destType, Type srcType) {
+ float cost = 0.0f;
+
+ if (ELParserUtils.isNullType(srcType)) {
+ return cost;
+ }
+
+ Class<?> srcClass = ELParserUtils.getRawType(srcType);
+ Class<?> destClass = ELParserUtils.getRawType(destType);
+
+ while (srcClass != null && !getWrapperClass(destClass).equals(getWrapperClass(srcClass))) {
+ if (destClass.isInterface() && isAssignmentCompatible(destClass, srcClass)) {
+
+ // slight penalty for interface match.
+ // we still want an exact match to override an interface match, but
+ // an interface match should override anything where we have to get a
+ // superclass.
+ cost += 0.25f;
+
+ break;
+ }
+
+ cost++;
+ srcClass = srcClass.getSuperclass();
+ }
+
+ /*
+ * If the destination class is null, we've travelled all the way up to
+ * an Object match. We'll penalize this by adding 1.5 to the cost.
+ */
+ if (srcClass == null) {
+ cost += 1.5f;
+ }
+
+ return cost;
+ }
+
+ /**
+ * <p>Determine whether a type can be used as a parameter in a method invocation.
+ * This method handles primitive conversions correctly.</p>
+ *
+ * <p>In order words, it will match a <code>Boolean</code> to a <code>boolean</code>,
+ * a <code>Long</code> to a <code>long</code>,
+ * a <code>Float</code> to a <code>float</code>,
+ * a <code>Integer</code> to a <code>int</code>,
+ * and a <code>Double</code> to a <code>double</code>.
+ * Now logic widening matches are allowed.
+ * For example, a <code>Long</code> will not match a <code>int</code>.
+ *
+ * @param parameterType the type of parameter accepted by the method
+ * @param parameterization the type of parameter being tested
+ *
+ * @return true if the assignement is compatible.
+ */
+ public static boolean isAssignmentCompatible(Type parameterType, Type parameterization) {
+ Class<?> parameterClass = ELParserUtils.getRawType(parameterType);
+
+ if (ELParserUtils.isNullType(parameterization)) {
+ //null value can be assigned to any class except primitive
+ return !parameterClass.isPrimitive();
+ } else {
+ Class<?> parameterWrappedClass = getWrapperClass(parameterClass);
+ Class<?> parameterizationWrappedClass = getWrapperClass(ELParserUtils.getRawType(parameterization));
+ return parameterWrappedClass.isAssignableFrom(parameterizationWrappedClass);
+ }
+ }
+
+ /**
+ * Gets the wrapper object class for the given primitive type class.
+ * For example, passing <code>boolean.class</code> returns <code>Boolean.class</code>
+ * @param primitiveType the primitive type class for which a match is to be found
+ * @return the wrapper type associated with the given primitive
+ * or null if no match is found
+ */
+ private static Class<?> getPrimitiveWrapper(Class<?> primitiveType) {
+
+ // does anyone know a better strategy than comparing names?
+ if (boolean.class.equals(primitiveType)) {
+ return Boolean.class;
+ } else if (float.class.equals(primitiveType)) {
+ return Float.class;
+ } else if (long.class.equals(primitiveType)) {
+ return Long.class;
+ } else if (int.class.equals(primitiveType)) {
+ return Integer.class;
+ } else if (short.class.equals(primitiveType)) {
+ return Short.class;
+ } else if (byte.class.equals(primitiveType)) {
+ return Byte.class;
+ } else if (double.class.equals(primitiveType)) {
+ return Double.class;
+ } else if (char.class.equals(primitiveType)) {
+ return Character.class;
+ } else {
+ throw new IllegalArgumentException(
+ MessageFormat.format("Type {0} is not primitive!", primitiveType.getName()));
+ }
+ }
+
+ interface ClassVisitor {
+ public void visit(Class<?> clazz) throws ParsingException;
+ }
+
+ static class ClassWalkingLogic {
+ private Queue<Class<?>> classesList = new LinkedList<Class<?>>();
+
+ private Set<Class<?>> visitedClasses = new HashSet<Class<?>>();
+
+ public ClassWalkingLogic(Class<?> clazz) {
+ super();
+
+ this.classesList.add(clazz);
+ }
+
+ public void walk(ClassVisitor visitor) throws ParsingException {
+ //BFS algorithm
+ while (!classesList.isEmpty()) {
+ Class<?> clazz = classesList.remove();
+
+ visitor.visit(clazz);
+
+ Class<?> superclass = clazz.getSuperclass();
+ if (superclass != null) {
+ if (visitedClasses.add(superclass)) {
+ classesList.add(superclass);
+ }
+ }
+
+ Class<?>[] interfaces = clazz.getInterfaces();
+ if (interfaces != null) {
+ for (Class<?> iface : interfaces) {
+ if (visitedClasses.add(superclass)) {
+ classesList.add(iface);
+ }
+ }
+ }
+ }
+
+ //this is for the case when we started just from interface, not class
+ if (visitedClasses.add(Object.class)) {
+ visitor.visit(Object.class);
+ }
+ }
+ }
+
+ public static boolean isNullType(Type type) {
+ return type instanceof NullType;
+ }
+
+ public static Type getLastTypeArgument(Type type) {
+ Type[] actualTypeArguments = null;
+ if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ actualTypeArguments = parameterizedType.getActualTypeArguments();
+ }
+
+ if (actualTypeArguments != null && actualTypeArguments.length != 0) {
+ return actualTypeArguments[actualTypeArguments.length - 1];
+ } else {
+ return null;
+ }
+ }
+
+ public static Class<?> getRawType(Type type) {
+ if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ return (Class<?>) parameterizedType.getRawType();
+ } else if (type instanceof Class<?>) {
+ return (Class<?>) type;
+ } else {
+ return null;
+ }
+ }
+}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -1,785 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk.parser.el;
-
-import org.jboss.el.parser.*;
-import org.richfaces.cdk.parser.el.node.*;
-
-import java.beans.BeanInfo;
-import java.beans.IndexedPropertyDescriptor;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Class, that encapsulate all functionality, related to Reflection calls, such as loading classes, get property
- * descriptors etc...
- *
- * @author amarkhel
- */
-public final class ELReflectionUtils {
- private static final Class<?>[] EMPTY_CLASS_PARAMETERS = new Class<?>[0];
- private static Map<String, Map<String, PropertyDescriptor>> resolvedProperties =
- new HashMap<String, Map<String, PropertyDescriptor>>();
-
- private ELReflectionUtils() {
- }
-
- /**
- * This method determine type of parsed node and create wrapper for them, that extends AbstractTreeNode.
- * If node type is not recognized - throws ParsingException.
- *
- * @param child - parsed node
- * @return wrapper for parsed node(if node type is recognized), that implement ITreeNode interface.
- * @throws ParsingException - if node type is not recognized.
- */
- public static ITreeNode determineNodeType(Node child) throws ParsingException {
- ITreeNode treeNode = null;
-
- if (child instanceof AstIdentifier) {
- treeNode = new AstIdentifierTreeNode(child);
- } else if (child instanceof AstValue) {
- treeNode = new AstValueTreeNode(child);
- } else if (child instanceof AstInteger) {
- treeNode = new AstIntegerTreeNode(child);
- } else if (child instanceof AstString) {
- treeNode = new AstStringTreeNode(child);
- } else if (child instanceof AstFunction) {
- treeNode = new AstFunctionTreeNode(child);
- } else if (child instanceof AstDeferredExpression || child instanceof AstDynamicExpression) {
- treeNode = new AstDeferredOrDynamicExpressionTreeNode(child);
- } else if (child instanceof AstNot) {
- treeNode = new AstNotTreeNode(child);
- } else if (child instanceof AstChoice) {
- treeNode = new AstChoiceTreeNode(child);
- } else if (child instanceof AstEmpty) {
- treeNode = new AstEmptyTreeNode(child);
- } else if (child instanceof AstLiteralExpression) {
- treeNode = new AstLiteralTreeNode(child);
- } else if (child instanceof AstFalse) {
- treeNode = ConstantValueTreeNode.FALSE_NODE;
- } else if (child instanceof AstTrue) {
- treeNode = ConstantValueTreeNode.TRUE_NODE;
- } else if (child instanceof AstNull) {
- treeNode = ConstantValueTreeNode.NULL_NODE;
- } else if (child instanceof AstAnd) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.AND_OPERATOR);
- } else if (child instanceof AstEqual) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.EQUALITY_OPERATOR);
- } else if (child instanceof AstGreaterThan) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.GREATER_THEN_OPERATOR);
- } else if (child instanceof AstGreaterThanEqual) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.GREATER_THEN_OR_EQUALITY_OPERATOR);
- } else if (child instanceof AstLessThan) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.LESS_THEN_OPERATOR);
- } else if (child instanceof AstLessThanEqual) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.LESS_THEN_OR_EQUALITY_OPERATOR);
- } else if (child instanceof AstNotEqual) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.INEQUALITY_OPERATOR);
- } else if (child instanceof AstOr) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.OR_OPERATOR);
- } else if (child instanceof AstDiv) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.DIV_OPERATOR);
- } else if (child instanceof AstMult) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.MULT_OPERATOR);
- } else if (child instanceof AstMod) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.MOD_OPERATOR);
- } else if (child instanceof AstPlus) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.PLUS_OPERATOR);
- } else if (child instanceof AstMinus) {
- treeNode = new BinaryOperationTreeNode(child, ELNodeConstants.MINUS_OPERATOR);
- } else if (child instanceof AstBracketSuffix) {
- treeNode = new AstBracketSuffixTreeNode(child);
- } else if (child instanceof AstNegative) {
- treeNode = new AstNegativeTreeNode(child);
- } else if (child instanceof AstFloatingPoint) {
- treeNode = new AstFloatingPointTreeNode(child);
- } else if (child instanceof AstMethodSuffix) {
- treeNode = new AstMethodSuffixTreeNode(child);
- } else if (child instanceof AstPropertySuffix) {
- treeNode = new AstPropertySuffixTreeNode(child);
- } else if (child instanceof AstBracketSuffix) {
- treeNode = new AstBracketSuffixTreeNode(child);
- } else {
- throw new ParsingException("Node " + child.getClass().getSimpleName() + "[" + child.getImage() + "] is not recognized;");
- }
-
- //TODO: add support for closures
-
- return treeNode;
- }
-
- /**
- * This method return PropertyDescriptor by specified propertyName and clazz.
- *
- * @param clazz - class to search
- * @param propertyName - propertyName to search
- * @return property descriptor if found.
- * @throws ParsingException if error occured.
- */
- private static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, String propertyName)
- throws ParsingException {
-
- Map<String, PropertyDescriptor> descriptors = resolvedProperties.get(clazz.getName());
-
- if (descriptors == null) {
- descriptors = resolveProperties(clazz);
- resolvedProperties.put(clazz.getName(), descriptors);
- }
-
- return descriptors.get(propertyName);
- }
-
- /**
- * This method resolve all properties of specified class.
- *
- * @param clazz - class to resolve
- * @return Map<String, PropertyDescriptor>, populated by property descriptors.
- * @throws ParsingException if error occured.
- */
- private static Map<String, PropertyDescriptor> resolveProperties(Class<?> clazz) throws ParsingException {
- final Map<String, PropertyDescriptor> descriptors = new HashMap<String, PropertyDescriptor>();
-
- new ClassWalkingLogic(clazz).walk(new ClassVisitor() {
- public void visit(Class<?> clazz) throws ParsingException {
- PropertyDescriptor[] pds = getPropertyDescriptors(clazz);
-
- for (PropertyDescriptor descriptor : pds) {
- descriptors.put(descriptor.getName(), descriptor);
- }
- }
- });
-
- return descriptors;
- }
-
- /**
- * This method load specified class.
- *
- * @param className - class to load.
- * @return loaded class.
- * @throws ClassNotFoundException if class not found.
- */
- private static Class<?> loadClass(Class<?> className) throws ClassNotFoundException {
- Class<?> clazz = null;
-
- try {
- if (className.isPrimitive()) {
- clazz = getPrimitiveWrapper(className);
- } else {
- clazz = loadClass(className.getName());
- }
- } catch (ClassNotFoundException e) {
- throw e;
- }
-
- if (null == clazz) {
- throw new ClassNotFoundException(className.getName());
- }
-
- return clazz;
- }
-
- /**
- * This method load class by specified representation of class name..
- *
- * @param className - string representation of class.
- * @return loaded class.
- * @throws ClassNotFoundException if class not found.
- */
- private static Class<?> loadClass(String className) throws ClassNotFoundException {
- Class<?> clazz = null;
-
- try {
- clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
- } catch (ClassNotFoundException e) {
- throw e;
- }
-
- if (null == clazz) {
- throw new ClassNotFoundException(className);
- }
-
- return clazz;
- }
-
- /**
- * <p>Retrieve the property descriptors for the specified class,
- * introspecting and caching them the first time a particular bean class
- * is encountered.</p>
- * <p/>
- * <p><strong>FIXME</strong> - Does not work with DynaBeans.</p>
- *
- * @param beanClass Bean class for which property descriptors are requested
- * @return the property descriptors
- * @throws ParsingException if error occured.
- * @throws IllegalArgumentException if <code>beanClass</code> is null
- */
- private static PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) throws ParsingException {
- if (beanClass == null) {
- throw new IllegalArgumentException("No bean class specified");
- }
-
- // Look up any cached descriptors for this bean class
- PropertyDescriptor[] descriptors = null;
-
- // Introspect the bean and cache the generated descriptors
- BeanInfo beanInfo = null;
-
- try {
- beanInfo = Introspector.getBeanInfo(beanClass);
- } catch (IntrospectionException e) {
- return new PropertyDescriptor[0];
- }
-
- descriptors = beanInfo.getPropertyDescriptors();
-
- if (descriptors == null) {
- descriptors = new PropertyDescriptor[0];
- }
-
- for (int i = 0; i < descriptors.length; i++) {
- if (descriptors[i] instanceof IndexedPropertyDescriptor) {
- IndexedPropertyDescriptor descriptor = (IndexedPropertyDescriptor) descriptors[i];
- String propName = descriptor.getName().substring(0, 1).toUpperCase()
- + descriptor.getName().substring(1);
-
- if (descriptor.getReadMethod() == null) {
- String methodName = descriptor.getIndexedReadMethod() != null
- ? descriptor.getIndexedReadMethod().getName() : "get" + propName;
- Method readMethod = getMatchingAccessibleMethod(beanClass, methodName, EMPTY_CLASS_PARAMETERS);
-
- if (readMethod != null) {
- try {
- descriptor.setReadMethod(readMethod);
- } catch (Exception e) {
-
- // TODO Refactoring
- }
- }
- }
- }
- }
-
- return descriptors;
- }
-
- /**
- * <p>Find an accessible method that matches the given name and has compatible parameters.
- * Compatible parameters mean that every method parameter is assignable from
- * the given parameters.
- * In other words, it finds a method with the given name
- * that will take the parameters given.<p>
- * <p/>
- * <p>This method is slightly undeterminstic since it loops
- * through methods names and return the first matching method.</p>
- * <p/>
- * <p>This method is used by
- * {@link
- * #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)}.
- * <p/>
- * <p>This method can match primitive parameter by passing in wrapper classes.
- * For example, a <code>Boolean</code> will match a primitive <code>boolean</code>
- * parameter.
- *
- * @param clazz find method in this class
- * @param methodName find method with this name
- * @param parameterTypes find method with compatible parameters
- * @return The accessible method
- * @throws ParsingException if error occured.
- */
- private static Method getMatchingAccessibleMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes)
- throws ParsingException {
-
- // see if we can find the method directly
- // most of the time this works and it's much faster
- try {
- Method method = clazz.getMethod(methodName, parameterTypes);
-
- setMethodAccessible(method); // Default access superclass workaround
-
- return method;
- } catch (NoSuchMethodException e) {
-
- /* SWALLOW */
- }
-
- // search through all methods
- int paramSize = parameterTypes.length;
- Method bestMatch = null;
- Method[] methods = clazz.getMethods();
- float bestMatchCost = Float.MAX_VALUE;
- float myCost = Float.MAX_VALUE;
- int size = methods.length;
-
- for (int i = 0; i < size; i++) {
- if (methods[i].getName().equals(methodName)) {
-
- // compare parameters
- Class<?>[] methodsParams = methods[i].getParameterTypes();
- int methodParamSize = methodsParams.length;
-
- if (methodParamSize == paramSize) {
- boolean match = true;
-
- for (int n = 0; n < methodParamSize; n++) {
- if (!isAssignmentCompatible(methodsParams[n], parameterTypes[n])) {
- match = false;
-
- break;
- }
- }
-
- if (match) {
-
- // get accessible version of method
- Method method = getAccessibleMethod(clazz, methods[i]);
-
- if (method != null) {
- setMethodAccessible(method); // Default access superclass workaround
- myCost = getTotalTransformationCost(parameterTypes, method.getParameterTypes());
-
- if (myCost < bestMatchCost) {
- bestMatch = method;
- bestMatchCost = myCost;
- }
- }
- }
- }
- }
- }
-
- return bestMatch;
- }
-
- /**
- * <p>Return an accessible method (that is, one that can be invoked via
- * reflection) that implements the specified Method. If no such method
- * can be found, return <code>null</code>.</p>
- *
- * @param clazz The class of the object
- * @param method The method that we wish to call
- * @return The accessible method
- * @throws ParsingException if error occured.
- */
- private static Method getAccessibleMethod(Class<?> clazz, Method method) throws ParsingException {
-
- // Make sure we have a method to check
- if (method == null) {
- return null;
- }
-
- // If the requested method is not public we cannot call it
- if (!Modifier.isPublic(method.getModifiers())) {
- return null;
- }
-
- boolean sameClass = true;
-
- if (clazz == null) {
- clazz = method.getDeclaringClass();
- } else {
- sameClass = clazz.equals(method.getDeclaringClass());
-
- if (!method.getDeclaringClass().isAssignableFrom(clazz)) {
- throw new IllegalArgumentException(clazz.getName() + " is not assignable from "
- + method.getDeclaringClass().getName());
- }
- }
-
- // If the class is public, we are done
- if (Modifier.isPublic(clazz.getModifiers())) {
- if (!sameClass && !Modifier.isPublic(method.getDeclaringClass().getModifiers())) {
- setMethodAccessible(method); // Default access superclass workaround
- }
-
- return method;
- }
-
- String methodName = method.getName();
- Class<?>[] parameterTypes = method.getParameterTypes();
-
- // Check the implemented interfaces and subinterfaces
- method = getAccessibleMethodFromInterfaceNest(clazz, methodName, parameterTypes);
-
- // Check the superclass chain
- if (method == null) {
- method = getAccessibleMethodFromSuperclass(clazz, methodName, parameterTypes);
- }
-
- return method;
- }
-
- /**
- * <p>Return an accessible method (that is, one that can be invoked via
- * reflection) by scanning through the superclasses. If no such method
- * can be found, return <code>null</code>.</p>
- *
- * @param clazz Class to be checked
- * @param methodName Method name of the method we wish to call
- * @param parameterTypes The parameter type signatures
- */
- private static Method getAccessibleMethodFromSuperclass(Class<?> clazz, String methodName,
- Class<?>[] parameterTypes) {
- Class<?> parentClazz = clazz.getSuperclass();
-
- while (parentClazz != null) {
- if (Modifier.isPublic(parentClazz.getModifiers())) {
- try {
- return parentClazz.getMethod(methodName, parameterTypes);
- } catch (NoSuchMethodException e) {
- return null;
- }
- }
-
- parentClazz = parentClazz.getSuperclass();
- }
-
- return null;
- }
-
- /**
- * <p>Return an accessible method (that is, one that can be invoked via
- * reflection) that implements the specified method, by scanning through
- * all implemented interfaces and subinterfaces. If no such method
- * can be found, return <code>null</code>.</p>
- * <p/>
- * <p> There isn't any good reason why this method must be private.
- * It is because there doesn't seem any reason why other classes should
- * call this rather than the higher level methods.</p>
- *
- * @param clazz Parent class for the interfaces to be checked
- * @param methodName Method name of the method we wish to call
- * @param parameterTypes The parameter type signatures
- */
- private static Method getAccessibleMethodFromInterfaceNest(Class<?> clazz, String methodName,
- Class<?>[] parameterTypes) {
- Method method = null;
-
- // Search up the superclass chain
- for (; clazz != null; clazz = clazz.getSuperclass()) {
-
- // Check the implemented interfaces of the parent class
- Class<?>[] interfaces = clazz.getInterfaces();
-
- for (int i = 0; i < interfaces.length; i++) {
-
- // Is this interface public?
- if (!Modifier.isPublic(interfaces[i].getModifiers())) {
- continue;
- }
-
- // Does the method exist on this interface?
- try {
- method = interfaces[i].getDeclaredMethod(methodName, parameterTypes);
- } catch (NoSuchMethodException e) {
-
- /*
- * Swallow, if no method is found after the loop then this
- * method returns null.
- */
- }
-
- if (method != null) {
- return method;
- }
-
- // Recursively check our parent interfaces
- method = getAccessibleMethodFromInterfaceNest(interfaces[i], methodName, parameterTypes);
-
- if (method != null) {
- return method;
- }
- }
- }
-
- // If we found a method return it
- if (method != null) {
- return method;
- }
-
- // We did not find anything
- return null;
- }
-
- /**
- * Returns the sum of the object transformation cost for each class in the source
- * argument list.
- *
- * @param srcArgs The source arguments
- * @param destArgs The destination arguments
- * @return The total transformation cost
- */
- private static float getTotalTransformationCost(Class<?>[] srcArgs, Class<?>[] destArgs) {
- float totalCost = 0.0f;
-
- for (int i = 0; i < srcArgs.length; i++) {
- Class<?> srcClass = srcArgs[i];
- Class<?> destClass = destArgs[i];
-
- totalCost += getObjectTransformationCost(srcClass, destClass);
- }
-
- return totalCost;
- }
-
- /**
- * Gets the number of steps required needed to turn the source class into the
- * destination class. This represents the number of steps in the object hierarchy
- * graph.
- *
- * @param srcClass The source class
- * @param destClass The destination class
- * @return The cost of transforming an object
- */
- private static float getObjectTransformationCost(Class<?> srcClass, Class<?> destClass) {
- float cost = 0.0f;
-
- while (destClass != null && !destClass.equals(srcClass)) {
- if (destClass.isInterface() && isAssignmentCompatible(destClass, srcClass)) {
-
- // slight penalty for interface match.
- // we still want an exact match to override an interface match, but
- // an interface match should override anything where we have to get a
- // superclass.
- cost += 0.25f;
-
- break;
- }
-
- cost++;
- destClass = destClass.getSuperclass();
- }
-
- /*
- * If the destination class is null, we've travelled all the way up to
- * an Object match. We'll penalize this by adding 1.5 to the cost.
- */
- if (destClass == null) {
- cost += 1.5f;
- }
-
- return cost;
- }
-
- /**
- * <p>Determine whether a type can be used as a parameter in a method invocation.
- * This method handles primitive conversions correctly.</p>
- * <p/>
- * <p>In order words, it will match a <code>Boolean</code> to a <code>boolean</code>,
- * a <code>Long</code> to a <code>long</code>,
- * a <code>Float</code> to a <code>float</code>,
- * a <code>Integer</code> to a <code>int</code>,
- * and a <code>Double</code> to a <code>double</code>.
- * Now logic widening matches are allowed.
- * For example, a <code>Long</code> will not match a <code>int</code>.
- *
- * @param parameterType the type of parameter accepted by the method
- * @param parameterization the type of parameter being tested
- * @return true if the assignement is compatible.
- */
- private static boolean isAssignmentCompatible(Class<?> parameterType, Class<?> parameterization) {
-
- // try plain assignment
- if (parameterType.isAssignableFrom(parameterization)) {
- return true;
- }
-
- if (parameterType.isPrimitive()) {
-
- // this method does *not* do widening - you must specify exactly
- // is this the right behaviour?
- Class<?> parameterWrapperClazz = getPrimitiveWrapper(parameterType);
-
- if (parameterWrapperClazz != null) {
- return parameterWrapperClazz.equals(parameterization);
- }
- }
-
- return false;
- }
-
- /**
- * Gets the wrapper object class for the given primitive type class.
- * For example, passing <code>boolean.class</code> returns <code>Boolean.class</code>
- *
- * @param primitiveType the primitive type class for which a match is to be found
- * @return the wrapper type associated with the given primitive
- * or null if no match is found
- */
- private static Class<?> getPrimitiveWrapper(Class<?> primitiveType) {
-
- // does anyone know a better strategy than comparing names?
- if (boolean.class.equals(primitiveType)) {
- return Boolean.class;
- } else if (float.class.equals(primitiveType)) {
- return Float.class;
- } else if (long.class.equals(primitiveType)) {
- return Long.class;
- } else if (int.class.equals(primitiveType)) {
- return Integer.class;
- } else if (short.class.equals(primitiveType)) {
- return Short.class;
- } else if (byte.class.equals(primitiveType)) {
- return Byte.class;
- } else if (double.class.equals(primitiveType)) {
- return Double.class;
- } else if (char.class.equals(primitiveType)) {
- return Character.class;
- } else {
- return null;
- }
- }
-
- /**
- * Try to make the method accessible
- *
- * @param method The source arguments
- * @throws ParsingException if error occured during call setAccessible method.
- */
- private static void setMethodAccessible(Method method) throws ParsingException {
- try {
-
- //
- // XXX Default access superclass workaround
- //
- // When a public class has a default access superclass
- // with public methods, these methods are accessible.
- // Calling them from compiled code works fine.
- //
- // Unfortunately, using reflection to invoke these methods
- // seems to (wrongly) to prevent access even when the method
- // modifer is public.
- //
- // The following workaround solves the problem but will only
- // work from sufficiently privilages code.
- //
- // Better workarounds would be greatfully accepted.
- //
- method.setAccessible(true);
- } catch (SecurityException se) {
- throw new ParsingException(
- "Cannot setAccessible on method. Therefore cannot use jvm access bug workaround.", se);
- }
- }
-
- /**
- * Gets the name of read method for specified property name.
- *
- * @param propertyName - property to lookup
- * @param visitor - ELVisitor instance
- * @return String representation of read method of specified property.
- * @throws ParsingException - if property not found or class not found.
- */
- public static String getReadMethodName(String propertyName, ELVisitor visitor) throws ParsingException {
- try {
- Class<?> clazz = loadClass(visitor.getLastVariableType());
- PropertyDescriptor propertyDescriptor = getPropertyDescriptor(clazz, propertyName);
-
- if (propertyDescriptor == null) {
- throw new ParsingException("property: " + propertyName + " not found in class: "
- + visitor.getLastVariableType());
- }
-
- Class<?> propertyType = propertyDescriptor.getPropertyType();
-
- visitor.setLastVariableType(propertyType);
-
- if (visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_MAP) == 0) {
- Method readMethod = propertyDescriptor.getReadMethod();
- Type genericReturnType = readMethod.getGenericReturnType();
-
- if (genericReturnType instanceof ParameterizedType) {
- ParameterizedType type = (ParameterizedType) genericReturnType;
- Type[] typeArguments = type.getActualTypeArguments();
-
- visitor.setCollectionVariableType((Class<?>) typeArguments[1]);
- }
- }
-
- if (visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_LIST) == 0) {
- Method readMethod = propertyDescriptor.getReadMethod();
- Type genericReturnType = readMethod.getGenericReturnType();
-
- if (genericReturnType instanceof ParameterizedType) {
- ParameterizedType type = (ParameterizedType) genericReturnType;
- Type[] typeArguments = type.getActualTypeArguments();
-
- visitor.setCollectionVariableType((Class<?>) typeArguments[0]);
- }
- }
-
- if (visitor.getLastVariableType().getName().startsWith(ELNodeConstants.ARRAY_INDICATOR)) {
- Method readMethod = propertyDescriptor.getReadMethod();
-
- visitor.setCollectionVariableType(readMethod.getReturnType());
-
- String className = visitor.getCollectionVariableType().getName().substring(0,
- visitor.getCollectionVariableType().getName().length() - 1).substring(2);
-
- visitor.setCollectionVariableType(loadClass(className));
- }
-
- return propertyDescriptor.getReadMethod().getName();
- } catch (ClassNotFoundException cnfe) {
- throw new ParsingException(cnfe.getMessage());
- }
- }
-
- interface ClassVisitor {
- public void visit(Class<?> clazz) throws ParsingException;
- }
-
- static class ClassWalkingLogic {
- private Class<?> clazz;
-
- public ClassWalkingLogic(Class<?> clazz) {
- super();
- this.clazz = clazz;
- }
-
- public void walk(ClassVisitor visitor) throws ParsingException {
- walkClass(clazz, visitor);
- }
-
- private void walkClass(Class<?> c, ClassVisitor visitor) throws ParsingException {
- if (c == null || Object.class.getName().equals(c.getName())) {
- return;
- }
-
- Class<?>[] interfaces = c.getInterfaces();
-
- for (Class<?> class1 : interfaces) {
- walkClass(class1, visitor);
- }
-
- walkClass(c.getSuperclass(), visitor);
- visitor.visit(c);
- }
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,41 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.AstCompositeExpression;
import org.jboss.el.parser.ELParser;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.node.ITreeNode;
-import java.util.Map;
-
/**
* Entry point for parsing EL expressions. @see parse() method.
- *
* @author amarkhel
+ *
*/
public final class ELVisitor {
- private static ELVisitor elVisitor;
- Class<?> collectionVariableType = null;
- String lastIndexValue = "null";
- Class<?> lastVariableType = null;
+
+ private String parsedExpression = null;
+ private Type variableType = null;
boolean useConversionToString;
boolean useEmptinessCheck;
-
- private ELVisitor() {
- }
-
- public static ELVisitor getInstance() {
- if (elVisitor == null) {
- elVisitor = new ELVisitor();
- }
-
- elVisitor.refresh();
-
- return elVisitor;
- }
-
+
public boolean isUseConversionToString() {
return useConversionToString;
}
@@ -62,65 +51,57 @@
this.useConversionToString = needConversion;
}
- public boolean isUseEmptinessCheck() {
- return useEmptinessCheck;
+ public boolean isUseEmptinessCheck() {
+ return useEmptinessCheck;
+ }
+
+ public void setUseEmptinessCheck(boolean useCheckForEmpty) {
+ this.useEmptinessCheck = useCheckForEmpty;
+ }
+
+ public Type getVariableType() {
+ return variableType;
}
- public void setUseEmptinessCheck(boolean useCheckForEmpty) {
- this.useEmptinessCheck = useCheckForEmpty;
+ public void setVariableType(Type variableType) {
+ this.variableType = variableType;
}
- public String getLastIndexValue() {
- return lastIndexValue;
- }
-
- public void setLastIndexValue(String lastIndexValue) {
- this.lastIndexValue = lastIndexValue;
- }
-
- public Class<?> getLastVariableType() {
- return lastVariableType;
- }
-
- public void setLastVariableType(Class<?> lastVariableType) {
- this.lastVariableType = lastVariableType;
- }
-
- public Class<?> getCollectionVariableType() {
- return collectionVariableType;
- }
-
- public void setCollectionVariableType(Class<?> collectionVariableType) {
- this.collectionVariableType = collectionVariableType;
- }
-
/**
+ * @return the parsedExpression
+ */
+ public String getParsedExpression() {
+ return parsedExpression;
+ }
+
+ /**
* Parse specified EL expression and return Java code, that represent this expression
- *
* @param expression - expression to resolve
* @param contextMap - Map<String, Class<?>> - context for search classes.
* @return generated Java code.
* @throws ParsingException - if error occurred during parsing.
*/
- public String parse(String expression, Map<String, Class<?>> contextMap) throws ParsingException {
+ public void parse(String expression, Map<String, Type> contextMap) throws ParsingException {
+ reset();
+
Node ret = ELParser.parse(expression);
if (ret instanceof AstCompositeExpression && ret.jjtGetNumChildren() >= 2) {
- //AstCompositeExpression with 2+ children is a mixed expression
- this.setUseConversionToString(true);
+ //AstCompositeExpression with 2+ children is a mixed expression
+ this.setUseConversionToString(true);
}
-
- return this.visit(ret, contextMap);
+
+ parsedExpression = this.visit(ret, contextMap);
}
- private String visit(Node node, Map<String, Class<?>> context) throws ParsingException {
+ private String visit(Node node, Map<String, Type> context) throws ParsingException {
int numChildren = node.jjtGetNumChildren();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < numChildren; i++) {
Node child = node.jjtGetChild(i);
- ITreeNode treeNode = ELReflectionUtils.determineNodeType(child);
+ ITreeNode treeNode = ELParserUtils.determineNodeType(child);
treeNode.visit(sb, context, this);
@@ -131,22 +112,11 @@
return sb.toString();
}
-
- /**
- * Reset internal state of elVisitor instance. Called after each AstValue resolved and parsed.
- */
- public void reset() {
- lastIndexValue = "null";
- lastVariableType = null;
- collectionVariableType = null;
+
+ private void reset() {
+ parsedExpression = null;
+ useConversionToString = false;
+ useEmptinessCheck = false;
+ variableType = null;
}
-
- private void refresh() {
- lastIndexValue = "null";
- lastVariableType = null;
- collectionVariableType = null;
- useConversionToString = false;
- useEmptinessCheck = false;
- }
-
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/NullType.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/NullType.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/NullType.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el;
+
+import java.lang.reflect.Type;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class NullType implements Type {
+
+ public static final NullType INSTANCE = new NullType();
+
+ private NullType() {}
+}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractBinaryOperationTreeNode.java (from rev 16062, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractBinaryOperationTreeNode.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractBinaryOperationTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el.node;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import org.jboss.el.parser.Node;
+import org.richfaces.cdk.parser.el.ELNodeConstants;
+import org.richfaces.cdk.parser.el.ELVisitor;
+import org.richfaces.cdk.parser.el.ParsingException;
+
+/**
+ * <p>Abstract class for all binary (having two operands) operation expression nodes</p>
+ * <p>For operands <code>A</code> and <code>B</code> and operator <code>x</code> output is <code>(A x B)</code></p>
+ *
+ * @author Nick Belaevski
+ */
+public abstract class AbstractBinaryOperationTreeNode extends AbstractTreeNode {
+
+ private final String operatorString;
+
+ public AbstractBinaryOperationTreeNode(Node node, String operatorString) {
+ super(node);
+
+ this.operatorString = operatorString;
+ }
+
+ protected abstract Type getOperationType(Type firstArgumentType, Type secondArgumentType);
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
+ */
+ @Override
+ public void visit(StringBuilder sb, Map<String, Type> context,
+ ELVisitor visitor) throws ParsingException {
+ String firstChildOutput = getChildOutput(0, context, visitor);
+ Type firstChildType = visitor.getVariableType();
+ String secondChildOutput = getChildOutput(1, context, visitor);
+ Type secondChildType = visitor.getVariableType();
+
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+
+ sb.append(firstChildOutput);
+ sb.append(operatorString);
+ sb.append(secondChildOutput);
+
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ visitor.setVariableType(getOperationType(firstChildType, secondChildType));
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELReflectionUtils;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This abstract class implement some methods of ITreeNode interface to using in subclasses.
*
* @author amarkhel
+ *
*/
public abstract class AbstractTreeNode implements ITreeNode {
private Node node;
@@ -39,30 +43,30 @@
public AbstractTreeNode(Node node) {
this.node = node;
}
-
+
/**
- * Collects output from visiting child of the current node with the specified index and returns
+ * Collects output from visiting child of the current node with the specified index and returns
* collected string.
- *
+ *
* @param childIndex
* @param context
* @param visitor
* @return
* @throws ParsingException
*/
- protected String getChildOutput(int childIndex, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
-
- StringBuilder sb = new StringBuilder();
- getChild(childIndex).visit(sb, context, visitor);
-
- return sb.toString();
+ protected String getChildOutput(int childIndex, Map<String, Type> context,
+ ELVisitor visitor) throws ParsingException {
+
+ StringBuilder sb = new StringBuilder();
+ getChild(childIndex).visit(sb, context, visitor);
+
+ return sb.toString();
}
/**
* Return node of current wrapper.
+ * @return instance of org.jboss.el.parser.Node
*
- * @return instance of org.jboss.el.parser.Node
*/
public Node getNode() {
return node;
@@ -70,18 +74,18 @@
/**
* Visit current node. Generate Java code, that represent current node.
- *
* @param stringBuilder instance to collect information.
- * @param context - context to resolve beans
- * @param visitor - ELVisitor
+ * @param context - context to resolve beans
+ * @param visitor - ELVisitor
+ * @throws ParsingException - if error occurred during parsing process.
* @return instance of org.jboss.el.parser.Node
- * @throws ParsingException - if error occurred during parsing process.
+ *
*/
public ITreeNode getChild(int index) throws ParsingException {
Node childNode = getNode().jjtGetChild(index);
if (null != childNode) {
- ITreeNode treeNode = ELReflectionUtils.determineNodeType(childNode);
+ ITreeNode treeNode = ELParserUtils.determineNodeType(childNode);
return treeNode;
} else {
@@ -90,13 +94,21 @@
}
/**
+ * Returns count of children for this node
+ * @return children count
+ */
+ public int getChildrenCount() {
+ return getNode().jjtGetNumChildren();
+ }
+
+ /**
* Return child of wrapped node by specified index. Abstract operation to override in subclasses.
- *
* @param index - index of child.
+ * @throws ParsingException - if error occurred(child not found).
* @return wrapper for child
- * @throws ParsingException - if error occurred(child not found).
+ *
*/
- public abstract void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor)
+ public abstract void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor)
throws ParsingException;
-
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstBracketSuffix node.
*
* @author amarkhel
+ *
*/
public class AstBracketSuffixTreeNode extends AbstractTreeNode {
public AstBracketSuffixTreeNode(Node node) {
@@ -39,32 +45,38 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ Type lastVariableType = visitor.getVariableType();
+ Class<?> rawType = ELParserUtils.getRawType(lastVariableType);
+
String suffixValue = getChildOutput(0, context, visitor);
- if (visitor.getLastVariableType() != null) {
- if (visitor.getLastVariableType().getName().startsWith(ELNodeConstants.ARRAY_INDICATOR)) {
- sb.append(ELNodeConstants.LEFT_SQUARE_BRACKET);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_SQUARE_BRACKET);
- visitor.setLastVariableType(visitor.getCollectionVariableType());
+ if (rawType != null && rawType.isArray()) {
+ sb.append(ELNodeConstants.LEFT_SQUARE_BRACKET);
+ sb.append(suffixValue);
+ sb.append(ELNodeConstants.RIGHT_SQUARE_BRACKET);
+
+ //TODO: support for generified arrays
+ visitor.setVariableType(rawType.getComponentType());
+ } else {
+ Type collectionValueType = null;
+ if (rawType != null &&
+ (List.class.isAssignableFrom(rawType) || Map.class.isAssignableFrom(rawType))) {
+
+ collectionValueType = ELParserUtils.getLastTypeArgument(lastVariableType);
}
-
- if ((visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_LIST) == 0)
- || (visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_MAP) == 0)) {
- sb.append(ELNodeConstants.GET_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
- visitor.setLastVariableType(visitor.getCollectionVariableType());
+
+ if (collectionValueType == null) {
+ collectionValueType = Object.class;
}
- } else {
- sb.append(ELNodeConstants.GET_ELEMENT_BY_INDEX_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(visitor.getLastIndexValue());
- sb.append(ELNodeConstants.COMMA);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ sb.append(ELNodeConstants.DOT);
+ sb.append(ELNodeConstants.GET_FUNCTION);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(suffixValue);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ visitor.setVariableType(collectionValueType);
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstChoice node.
*
* @author amarkhel
+ *
*/
public class AstChoiceTreeNode extends AbstractTreeNode {
public AstChoiceTreeNode(Node node) {
@@ -39,20 +44,28 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- sb.append(ELNodeConstants.LEFT_BRACKET);
-
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
//condition ? correctConditionBranch : incorrectConditionBranch
String condition = getChildOutput(0, context, visitor);
String correctConditionBranch = getChildOutput(1, context, visitor);
+ Type correctConditionBranchType = visitor.getVariableType();
String incorrectConditionBranch = getChildOutput(2, context, visitor);
+ Type incorrectConditionBranchType = visitor.getVariableType();
+
+ sb.append(ELNodeConstants.LEFT_BRACKET);
sb.append(condition);
sb.append(ELNodeConstants.QUESTION_SIGN);
sb.append(correctConditionBranch);
sb.append(ELNodeConstants.COLON);
sb.append(incorrectConditionBranch);
-
+
sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ if (!ELParserUtils.isNullType(correctConditionBranchType)) {
+ visitor.setVariableType(correctConditionBranchType);
+ } else {
+ visitor.setVariableType(incorrectConditionBranchType);
+ }
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,31 +19,36 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
+
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstDeferredExpression node.
*
* @author amarkhel
+ *
*/
public class AstDeferredOrDynamicExpressionTreeNode extends AbstractTreeNode {
-
- public AstDeferredOrDynamicExpressionTreeNode(Node node) {
+
+ public AstDeferredOrDynamicExpressionTreeNode(Node node) {
super(node);
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- int numChildren = getNode().jjtGetNumChildren();
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ int childrenCount = getChildrenCount();
- for (int i = 0; i < numChildren; i++) {
+ for (int i = 0; i < childrenCount; i++) {
if (visitor.isUseConversionToString()) {
sb.append(ELNodeConstants.CONVERT_TO_STRING_FUNCTION);
sb.append(ELNodeConstants.LEFT_BRACKET);
@@ -55,7 +60,8 @@
if (visitor.isUseConversionToString()) {
sb.append(ELNodeConstants.RIGHT_BRACKET);
- }
+ visitor.setVariableType(String.class);
+ } /* otherwise variableType will be set in child's visit invocation */
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
+
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstEmpty node.
*
* @author amarkhel
+ *
*/
public class AstEmptyTreeNode extends AbstractTreeNode {
public AstEmptyTreeNode(Node node) {
@@ -39,16 +44,17 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
visitor.setUseEmptinessCheck(true);
-
- StringBuilder sb1 = new StringBuilder();
- ITreeNode treeNode = getChild(0);
-
- treeNode.visit(sb1, context, visitor);
+
sb.append(ELNodeConstants.THIS_GET_UTILS_IS_EMPTY_FUNCTION);
sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(sb1);
+
+ String childOutput = getChildOutput(0, context, visitor);
+ sb.append(childOutput);
+
sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ visitor.setVariableType(Boolean.TYPE);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstFloatingPoint node.
*
* @author amarkhel
+ *
*/
public class AstFloatingPointTreeNode extends AbstractTreeNode {
public AstFloatingPointTreeNode(Node node) {
@@ -39,10 +43,12 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
sb.append(ELNodeConstants.DOUBLE_VALUE_OF_FUNCTION);
sb.append(ELNodeConstants.LEFT_BRACKET);
sb.append(getNode().getImage());
sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ visitor.setVariableType(Double.TYPE);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,20 +19,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.AstFunction;
import org.jboss.el.parser.Node;
+
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstFunction node.
*
* @author amarkhel
+ *
*/
public class AstFunctionTreeNode extends AbstractTreeNode {
public AstFunctionTreeNode(Node node) {
@@ -40,27 +45,32 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- String functionName = ((AstFunction) getNode()).getOutputName();
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ AstFunction functionNode = (AstFunction) getNode();
+ String functionPrefix = functionNode.getPrefix();
+ String functionName = functionNode.getLocalName();
- sb.append(ELNodeConstants.THIS_PREFIX);
- sb.append(ELNodeConstants.DOT);
- sb.append(functionName.substring(1));
+ if (functionPrefix != null && functionPrefix.length() != 0) {
+ //TODO: this should be a property getter, not property name
+ //TODO: support "super" keyword
+ sb.append(functionPrefix);
+ } else {
+ sb.append(ELNodeConstants.THIS_PREFIX);
+ }
+ sb.append(ELNodeConstants.DOT);
+
+ sb.append(functionName);
sb.append(ELNodeConstants.LEFT_BRACKET);
- int numChildren = getNode().jjtGetNumChildren();
+ int childrenCount = getChildrenCount();
- for (int i = 0; i < numChildren; i++) {
- ITreeNode childNode = getChild(i);
- StringBuilder sb1 = new StringBuilder();
-
- childNode.visit(sb1, context, visitor);
-
+ for (int i = 0; i < childrenCount; i++) {
if (i != 0) {
sb.append(ELNodeConstants.COMMA);
}
- sb.append(sb1);
+ String childOutput = getChildOutput(i, context, visitor);
+ sb.append(childOutput);
}
sb.append(ELNodeConstants.RIGHT_BRACKET);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,45 +19,39 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstIdentifier node.
*
* @author amarkhel
+ *
*/
public class AstIdentifierTreeNode extends AbstractTreeNode {
- public AstIdentifierTreeNode(Node node) {
- super(node);
- }
+ public AstIdentifierTreeNode(Node node) {
+ super(node);
+ }
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- String variableName = getNode().getImage();
+ @Override
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ String variableName = getNode().getImage();
- if (context.containsKey(variableName)) {
- visitor.setLastVariableType(context.get(variableName));
- sb.append(variableName);
- } else {
- //TODO - what's then?
- if (variableName.equals(ELNodeConstants.THIS_PREFIX)) {
- sb.append(variableName);
- } else if (variableName.equals(ELNodeConstants.UTILS_PREFIX)) {
- sb.append(ELNodeConstants.THIS_PREFIX);
- sb.append(ELNodeConstants.DOT);
- sb.append(ELNodeConstants.GET_UTILS_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
- } else {
-// throw new ParsingException("No instance found in context for identifier " + variableName);
- }
- }
- }
+ Type variableType = context.get(variableName);
+ if (variableType == null) {
+ throw new ParsingException("No instance found in context for identifier " + variableName);
+ }
+
+ //TODO: implement variable mapper like "utils" -> "this.getUtils()"
+ visitor.setVariableType(variableType);
+ sb.append(variableName);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,18 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
+
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstInteger node.
*
* @author amarkhel
+ *
*/
public class AstIntegerTreeNode extends AbstractTreeNode {
public AstIntegerTreeNode(Node node) {
@@ -38,7 +43,8 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
sb.append(getNode().getImage());
+ visitor.setVariableType(Integer.TYPE);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,20 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstLiteral node.
*
* @author amarkhel
+ *
*/
public class AstLiteralTreeNode extends AbstractTreeNode {
public AstLiteralTreeNode(Node node) {
@@ -40,11 +44,13 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
if (getNode().getImage() != null) {
sb.append(ELNodeConstants.QUOTE);
sb.append(StringUtils.getEscapedString(getNode().getImage()));
sb.append(ELNodeConstants.QUOTE);
+
+ visitor.setVariableType(String.class);
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,50 +19,64 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstMethodSuffix node.
*
* @author amarkhel
+ *
*/
public class AstMethodSuffixTreeNode extends AbstractTreeNode {
- public AstMethodSuffixTreeNode(Node node) {
+
+ private static final Type[] EMPTY_TYPES_ARRAY = new Type[0];
+
+ public AstMethodSuffixTreeNode(Node node) {
super(node);
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- StringBuilder sb1 = new StringBuilder();
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ String methodName = getNode().getImage();
+
+ Class<?> objectClass = ELParserUtils.getRawType(visitor.getVariableType());
+ List<Type> argumentTypes = new ArrayList<Type>();
+
+ sb.append(ELNodeConstants.DOT);
+ sb.append(methodName);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
- sb1.append(getNode().getImage());
- sb1.append(ELNodeConstants.LEFT_BRACKET);
+ int childrenCount = getChildrenCount();
- int numChildren = getNode().jjtGetNumChildren();
-
- for (int k = 0; k < numChildren; k++) {
- StringBuilder sb2 = new StringBuilder();
- ITreeNode treeNode = getChild(k);
-
- treeNode.visit(sb2, context, visitor);
- sb1.append(sb2);
-
- if (k == numChildren - 1) {
-
- // Do nothing. Last argument.
- } else {
- sb1.append(ELNodeConstants.COMMA);
+ for (int k = 0; k < childrenCount; k++) {
+ if (k != 0) {
+ sb.append(ELNodeConstants.COMMA);
}
+ String childOutput = getChildOutput(k, context, visitor);
+ sb.append(childOutput);
+
+ //TODO: handle generic matches -?
+ argumentTypes.add(visitor.getVariableType());
}
- sb1.append(ELNodeConstants.RIGHT_BRACKET);
- sb.append(sb1);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ Type returnType = ELParserUtils.getMatchingVisibleMethodReturnType(objectClass, methodName,
+ argumentTypes.toArray(EMPTY_TYPES_ARRAY));
+
+ visitor.setVariableType(returnType);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
+
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstNegative node.
*
* @author amarkhel
+ *
*/
public class AstNegativeTreeNode extends AbstractTreeNode {
public AstNegativeTreeNode(Node node) {
@@ -39,12 +44,12 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- ITreeNode node = getChild(0);
- StringBuilder sb1 = new StringBuilder();
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ sb.append(ELNodeConstants.NEGATIVE);
- sb.append(ELNodeConstants.NEGATIVE);
- node.visit(sb1, context, visitor);
- sb.append(sb1);
+ String childOutput = getChildOutput(0, context, visitor);
+ sb.append(childOutput);
+
+ //variable type has been already set by getChildOuput()
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,19 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstNot node.
*
* @author amarkhel
+ *
*/
public class AstNotTreeNode extends AbstractTreeNode {
public AstNotTreeNode(Node node) {
@@ -39,14 +43,14 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- StringBuilder sb1 = new StringBuilder();
- ITreeNode node1 = getChild(0);
-
- node1.visit(sb1, context, visitor);
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
sb.append(ELNodeConstants.LEFT_BRACKET);
sb.append(ELNodeConstants.EXCLAMATION_MARK);
- sb.append(sb1);
+ String childOutput = getChildOutput(0, context, visitor);
+ sb.append(childOutput);
sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ //variable type has been already set by getChildOuput()
}
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,39 +19,76 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
-import org.richfaces.cdk.parser.el.ELReflectionUtils;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstPropertySuffix node.
*
* @author amarkhel
+ *
*/
public class AstPropertySuffixTreeNode extends AbstractTreeNode {
- public AstPropertySuffixTreeNode(Node node) {
+
+ public AstPropertySuffixTreeNode(Node node) {
super(node);
}
+ private final String capitalize(String propertyName) {
+ char[] chars = propertyName.toCharArray();
+ chars[0] = Character.toUpperCase(chars[0]);
+ return new String(chars);
+ }
+
+ private final Method getReadMethod(Class<?> clazz, String propertyName) throws ParsingException {
+ if (clazz == null) {
+ return null;
+ }
+
+ PropertyDescriptor propertyDescriptor = ELParserUtils.getPropertyDescriptor(clazz, propertyName);
+ if (propertyDescriptor == null) {
+ return null;
+ }
+
+ return propertyDescriptor.getReadMethod();
+ }
+
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
String propertyName = getNode().getImage();
- if (visitor.getLastVariableType() != null) {
- StringBuilder sb1 = new StringBuilder();
-
- sb1.append(ELReflectionUtils.getReadMethodName(propertyName, visitor));
- sb1.append(ELNodeConstants.LEFT_BRACKET);
- sb1.append(ELNodeConstants.RIGHT_BRACKET);
- sb.append(sb1);
+ Type variableType = visitor.getVariableType();
+ Class<?> clazz = ELParserUtils.getRawType(variableType);
+
+ String readMethodName;
+ Type readMethodReturnType;
+
+ Method readMethod = getReadMethod(clazz, propertyName);
+ if (readMethod != null) {
+ readMethodName = readMethod.getName();
+ readMethodReturnType = readMethod.getGenericReturnType();
} else {
- throw new ParsingException("Property not found: " + propertyName);
+ readMethodName = ELNodeConstants.GETTER_PREFIX + capitalize(propertyName);
+ readMethodReturnType = Object.class;
}
+
+ visitor.setVariableType(readMethodReturnType);
+
+ sb.append(ELNodeConstants.DOT);
+ sb.append(readMethodName);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,8 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.AstString;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
@@ -28,12 +33,11 @@
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstString node.
*
* @author amarkhel
+ *
*/
public class AstStringTreeNode extends AbstractTreeNode {
public AstStringTreeNode(Node node) {
@@ -41,9 +45,11 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
sb.append(ELNodeConstants.QUOTE);
sb.append(StringUtils.getEscapedString(((AstString) getNode()).getString()));
sb.append(ELNodeConstants.QUOTE);
+
+ visitor.setVariableType(String.class);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -19,21 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
/**
* This class extend AbstractTreeNode and wrap AstValue node.
*
* @author amarkhel
+ *
*/
public class AstValueTreeNode extends AbstractTreeNode {
public AstValueTreeNode(Node node) {
@@ -41,33 +42,13 @@
}
@Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- List<String> tokens = new ArrayList<String>();
-
- for (int i = 0; i < getNode().jjtGetNumChildren(); i++) {
- StringBuilder sb1 = new StringBuilder();
- ITreeNode subChild = getChild(i);
-
- subChild.visit(sb1, context, visitor);
- tokens.add(sb1.toString());
+ public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
+ int childrenCount = getChildrenCount();
+ for (int i = 0; i < childrenCount; i++) {
+ String childOutput = getChildOutput(i, context, visitor);
+ sb.append(childOutput);
}
- if (tokens.size() != 0) {
- StringBuilder sb2 = new StringBuilder();
-
- for (String element : tokens) {
- if (sb2.length() != 0 && !element.startsWith(ELNodeConstants.LEFT_SQUARE_BRACKET)) {
- sb2.append(ELNodeConstants.DOT);
- }
-
- sb2.append(element);
- }
-
- sb.append(sb2);
- } else {
- sb.append(visitor.getLastIndexValue());
- }
-
- visitor.reset();
+ //variable type has been already set by getChildOuput()
}
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticIntegerOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticIntegerOperationTreeNode.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticIntegerOperationTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el.node;
+
+import java.lang.reflect.Type;
+
+import org.jboss.el.parser.Node;
+
+/**
+ * @author Nick Belaevski
+ * @since 4.0
+ */
+public class BinaryArithmeticIntegerOperationTreeNode extends AbstractBinaryOperationTreeNode {
+
+ /**
+ * @param node
+ * @param operatorString
+ */
+ public BinaryArithmeticIntegerOperationTreeNode(Node node, String operatorString) {
+ super(node, operatorString);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractBinaryOperationTreeNode#getOperationType(java.lang.reflect.Type, java.lang.reflect.Type)
+ */
+ @Override
+ protected Type getOperationType(Type firstArgumentType,
+ Type secondArgumentType) {
+ return Integer.TYPE;
+ }
+
+}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticOperationTreeNode.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryArithmeticOperationTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el.node;
+
+import java.lang.reflect.Type;
+
+import org.jboss.el.parser.Node;
+import org.richfaces.cdk.parser.el.ELParserUtils;
+
+/**
+ * @author Nick Belaevski
+ * @since 4.0
+ */
+public class BinaryArithmeticOperationTreeNode extends AbstractBinaryOperationTreeNode {
+
+ /**
+ * @param node
+ * @param operatorString
+ */
+ public BinaryArithmeticOperationTreeNode(Node node, String operatorString) {
+ super(node, operatorString);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractBinaryOperationTreeNode#getOperationType(java.lang.reflect.Type, java.lang.reflect.Type)
+ */
+ @Override
+ protected Type getOperationType(Type firstArgumentType,
+ Type secondArgumentType) {
+
+ if (ELParserUtils.isAssignmentCompatible(firstArgumentType, Double.class) ||
+ ELParserUtils.isAssignmentCompatible(secondArgumentType, Double.class)) {
+
+ return Double.TYPE;
+ }
+
+ return Integer.TYPE;
+ }
+
+}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryBooleanOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryBooleanOperationTreeNode.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryBooleanOperationTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el.node;
+
+import java.lang.reflect.Type;
+
+import org.jboss.el.parser.Node;
+
+/**
+ * @author Nick Belaevski
+ * @since 4.0
+ */
+public class BinaryBooleanOperationTreeNode extends AbstractBinaryOperationTreeNode {
+
+ /**
+ * @param node
+ * @param operatorString
+ */
+ public BinaryBooleanOperationTreeNode(Node node, String operatorString) {
+ super(node, operatorString);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractBinaryOperationTreeNode#getOperationType(java.lang.reflect.Type, java.lang.reflect.Type)
+ */
+ @Override
+ protected Type getOperationType(Type firstArgumentType,
+ Type secondArgumentType) {
+ return Boolean.TYPE;
+ }
+
+}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat, Inc. and individual contributors
- * 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.richfaces.cdk.parser.el.node;
-
-import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELNodeConstants;
-import org.richfaces.cdk.parser.el.ELVisitor;
-import org.richfaces.cdk.parser.el.ParsingException;
-
-import java.util.Map;
-
-/**
- * <p>Abstract class for all binary (having two operands) operation expression nodes</p>
- * <p>For operands <code>A</code> and <code>B</code> and operator <code>x</code> output is <code>(A x B)</code></p>
- *
- * @author Nick Belaevski
- */
-public class BinaryOperationTreeNode extends AbstractTreeNode {
-
- private final String operatorString;
-
- public BinaryOperationTreeNode(Node node, String operatorString) {
- super(node);
-
- this.operatorString = operatorString;
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
- */
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
-
- sb.append(ELNodeConstants.LEFT_BRACKET);
-
- String firstChildOutput = getChildOutput(0, context, visitor);
- String secondChildOutput = getChildOutput(1, context, visitor);
-
- sb.append(firstChildOutput);
- sb.append(operatorString);
- sb.append(secondChildOutput);
-
- sb.append(ELNodeConstants.RIGHT_BRACKET);
-
- }
-
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -21,39 +21,47 @@
*/
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
+import org.richfaces.cdk.parser.el.NullType;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* @author Nick Belaevski
+ *
*/
-public final class ConstantValueTreeNode extends AbstractTreeNode {
+public class ConstantValueTreeNode extends AbstractTreeNode {
- public static final ConstantValueTreeNode NULL_NODE = new ConstantValueTreeNode(ELNodeConstants.NULL_VALUE);
+ private final String value;
- public static final ConstantValueTreeNode TRUE_NODE = new ConstantValueTreeNode(ELNodeConstants.TRUE_VALUE);
+ private final Type type;
+
+ //XXX what class to use for null object: Void.class or null - null will be used
+ public static final ConstantValueTreeNode NULL_NODE = new ConstantValueTreeNode(ELNodeConstants.NULL_VALUE, NullType.INSTANCE);
+
+ public static final ConstantValueTreeNode TRUE_NODE = new ConstantValueTreeNode(ELNodeConstants.TRUE_VALUE, Boolean.TYPE);
+
+ public static final ConstantValueTreeNode FALSE_NODE = new ConstantValueTreeNode(ELNodeConstants.FALSE_VALUE, Boolean.TYPE);
- public static final ConstantValueTreeNode FALSE_NODE = new ConstantValueTreeNode(ELNodeConstants.FALSE_VALUE);
+ private ConstantValueTreeNode(String value, Type type) {
+ super(null);
+
+ this.value = value;
+ this.type = type;
+ }
- private final String value;
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
+ */
+ @Override
+ public void visit(StringBuilder sb, Map<String, Type> context,
+ ELVisitor visitor) throws ParsingException {
- private ConstantValueTreeNode(String value) {
- super(null);
- this.value = value;
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map,
- * org.richfaces.cdk.parser.el.ELVisitor)
- */
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
-
- sb.append(value);
- }
-
+ sb.append(value);
+ visitor.setVariableType(type);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -21,12 +21,13 @@
package org.richfaces.cdk.parser.el.node;
+import java.lang.reflect.Type;
+import java.util.Map;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
-import java.util.Map;
-
/**
* Interface for all wrappers of org.jboss.el.parser.Node class.
*
@@ -50,7 +51,7 @@
* @return instance of org.jboss.el.parser.Node
* @throws ParsingException - if error occurred during parsing process.
*/
- void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException;
+ void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException;
/**
* Return child of wrapped node by specified index
@@ -60,4 +61,11 @@
* @throws ParsingException - if error occurred(child not found).
*/
ITreeNode getChild(int index) throws ParsingException;
+
+ /**
+ * Returns count of children for this node
+ * @return children count
+ */
+ int getChildrenCount();
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -23,7 +23,27 @@
package org.richfaces.cdk.templatecompiler;
-import com.google.common.collect.Lists;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.annotation.Generated;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.Behavior;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.convert.Converter;
+import javax.faces.render.Renderer;
+import javax.xml.namespace.QName;
+
import org.richfaces.builder.model.Argument;
import org.richfaces.builder.model.JavaClass;
import org.richfaces.builder.model.JavaMethod;
@@ -47,97 +67,82 @@
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.templatecompiler.model.TemplateVisitor;
-import javax.annotation.Generated;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.Behavior;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.convert.Converter;
-import javax.xml.namespace.QName;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import com.google.common.collect.Lists;
/**
* <p class="changed_added_4_0"></p>
- *
* @author asmirnov(a)exadel.com
+ *
*/
public class RendererClassVisitor implements TemplateVisitor {
- /**
- *
- */
- static final String RESPONSE_WRITER_VARIABLE = "responseWriter";
- /**
- *
- */
- static final String COMPONENT_VARIABLE = "cc";
- /**
- *
- */
- static final String FACES_CONTEXT_VARIABLE = "facesContext";
- /**
- *
- */
- static final String CLIENT_ID_VARIABLE = "clientId";
- /**
- *
- */
- static final String RENDERER_UTILS_VARIABLE = "utils";
+ /**
+ *
+ */
+ static final String RESPONSE_WRITER_VARIABLE = "responseWriter";
+ /**
+ *
+ */
+ static final String COMPONENT_VARIABLE = "cc";
+ /**
+ *
+ */
+ static final String THIS_VARIABLE = "this";
+ /**
+ *
+ */
+ static final String FACES_CONTEXT_VARIABLE = "facesContext";
+ /**
+ *
+ */
+ static final String CLIENT_ID_VARIABLE = "clientId";
+ /**
+ *
+ */
+ static final String RENDERER_UTILS_VARIABLE = "utils";
+
+ static final String RENDERER_UTILS_CLASS_NAME = "org.ajax4jsf.renderkit.RendererUtils";
+
+ private static final Set<String> DEFAULT_NAMESPACES = new HashSet<String>();
+
+ static {
+ DEFAULT_NAMESPACES.add("http://richfaces.org/xhtml-el");
+ DEFAULT_NAMESPACES.add("http://www.w3.org/1999/xhtml");
+ }
- static final String RENDERER_UTILS_CLASS_NAME = "org.ajax4jsf.renderkit.RendererUtils";
-
- private static final Set<String> DEFAULT_NAMESPACES = new HashSet<String>();
-
- static {
- DEFAULT_NAMESPACES.add("http://richfaces.org/xhtml-el");
- DEFAULT_NAMESPACES.add("http://www.w3.org/1999/xhtml");
- }
-
- private static final String[] GUESS_PACKAGES;
-
- static {
- Class<?>[] guessPackagesClasses = {
- UIComponent.class,
- Behavior.class,
- Converter.class,
- FacesContext.class,
- Collection.class,
- Object.class,
- };
-
- GUESS_PACKAGES = new String[guessPackagesClasses.length];
- int i = 0;
- for (Class<?> guessPackageClass : guessPackagesClasses) {
- GUESS_PACKAGES[i++] = guessPackageClass.getPackage().getName();
- }
- }
-
+ private static final String[] GUESS_PACKAGES;
+
+ static {
+ Class<?>[] GUESS_PACKAGES_CLASSES = {
+ UIComponent.class,
+ Behavior.class,
+ Converter.class,
+ FacesContext.class,
+ Collection.class,
+ Object.class
+ };
+
+ GUESS_PACKAGES = new String[GUESS_PACKAGES_CLASSES.length];
+ int i = 0;
+ for (Class<?> guessPackageClass : GUESS_PACKAGES_CLASSES) {
+ GUESS_PACKAGES[i++] = guessPackageClass.getPackage().getName();
+ }
+ }
+
private static final Map<String, Set<String>> ELEMENTS_ATTRIBUTES;
-
- protected MethodBodyStatementsContainer currentStatement;
-
private JavaClass rendererClass;
private CompositeInterface compositeInterface;
+ protected MethodBodyStatementsContainer currentStatement;
private final LinkedList<MethodBodyStatementsContainer> statements = Lists.newLinkedList();
- private Map<String, Class<?>> localsTypesMap;
- private ClassLoader classLoader;
- private boolean isAddedMethodForConversionToString;
- private boolean isAddedMethodForCheckingEmptiness;
-
+ private Map<String, Type> localsTypesMap;
+ private ClassLoader classLoader;
+ private boolean isAddedMethodForConversionToString;
+ private boolean isAddedMethodForCheckingEmptiness;
+
static {
- InputStream serializedAttributesStream =
- RendererClassVisitor.class.getResourceAsStream("/META-INF/schema/attributes.ser");
+ InputStream serializedAttributesStream = RendererClassVisitor.class.getResourceAsStream("/META-INF/schema/attributes.ser");
try {
@@ -158,84 +163,80 @@
}
}
}
-
- public RendererClassVisitor(CompositeInterface compositeInterface, ClassLoader classLoader) {
- this.compositeInterface = compositeInterface;
- this.classLoader = classLoader;
- }
-
- private void initializeJavaClass() {
- this.rendererClass = createJavaClassByName(compositeInterface.getJavaClass());
- this.rendererClass.addModifier(JavaModifier.PUBLIC);
+
+ private void initializeJavaClass() {
+ this.rendererClass = createJavaClassByName(compositeInterface.getJavaClass());
+ this.rendererClass.addModifier(JavaModifier.PUBLIC);
this.rendererClass.setSuperClass(createJavaClassByName(compositeInterface.getBaseClass()));
this.rendererClass.addImport(FacesContext.class);
- this.rendererClass.addImport(ResponseWriter.class);
+ this.rendererClass.addImport(ResponseWriter.class);
this.rendererClass.addImport(UIComponent.class);
- this.rendererClass.addImport(RENDERER_UTILS_CLASS_NAME);
+ this.rendererClass.addImport(RENDERER_UTILS_CLASS_NAME);
- this.rendererClass.addAnnotation(Generated.class, "\"RichFaces CDK\"");
- //TODO remove this after improving Java model
- this.rendererClass.addImport(Generated.class);
-
+ this.rendererClass.addAnnotation(Generated.class, "\"RichFaces CDK\"");
+ //TODO remove this after improving Java model
+ this.rendererClass.addImport(Generated.class);
+
this.createMethodContext();
- }
+ }
private void addMethodForConversionToString() {
- if (!isAddedMethodForConversionToString) {
- isAddedMethodForConversionToString = true;
+ if (!isAddedMethodForConversionToString) {
+ isAddedMethodForConversionToString = true;
+
+ JavaMethod conversionMethod = new JavaMethod("convertToString", String.class,
+ new Argument("object", Object.class));
+
+ conversionMethod.addModifier(JavaModifier.PRIVATE);
+ conversionMethod.addModifier(JavaModifier.FINAL);
- JavaMethod conversionMethod = new JavaMethod("convertToString", String.class,
- new Argument("object", Object.class));
-
- conversionMethod.addModifier(JavaModifier.PRIVATE);
- conversionMethod.addModifier(JavaModifier.FINAL);
-
- MethodBody conversionMethodBody = new MethodBody(conversionMethod);
- conversionMethod.setMethodBody(conversionMethodBody);
- conversionMethodBody.addStatement(new ConversionToStringMethodBodyStatement());
-
- rendererClass.addMethod(conversionMethod);
- }
+ MethodBody conversionMethodBody = new MethodBody(conversionMethod);
+ conversionMethod.setMethodBody(conversionMethodBody);
+ conversionMethodBody.addStatement(new ConversionToStringMethodBodyStatement());
+
+ rendererClass.addMethod(conversionMethod);
+ }
}
private void addMethodForCheckingEmptiness() {
- if (!isAddedMethodForCheckingEmptiness) {
- isAddedMethodForCheckingEmptiness = true;
+ if (!isAddedMethodForCheckingEmptiness) {
+ isAddedMethodForCheckingEmptiness = true;
- JavaMethod checkingMethod = new JavaMethod("isEmpty", boolean.class,
- new Argument("object", Object.class));
+ JavaMethod checkingMethod = new JavaMethod("isEmpty", boolean.class,
+ new Argument("object", Object.class));
+
+ checkingMethod.addModifier(JavaModifier.PRIVATE);
+ checkingMethod.addModifier(JavaModifier.FINAL);
- checkingMethod.addModifier(JavaModifier.PRIVATE);
- checkingMethod.addModifier(JavaModifier.FINAL);
-
- MethodBody checkingMethodBody = new MethodBody(checkingMethod);
- checkingMethod.setMethodBody(checkingMethodBody);
- checkingMethodBody.addStatement(new EmptinessCheckingMethodBodyStatement());
-
- rendererClass.addMethod(checkingMethod);
- }
+ MethodBody checkingMethodBody = new MethodBody(checkingMethod);
+ checkingMethod.setMethodBody(checkingMethodBody);
+ checkingMethodBody.addStatement(new EmptinessCheckingMethodBodyStatement());
+
+ rendererClass.addMethod(checkingMethod);
+ }
}
-
+
private String compileEl(String expression, Class<?> type) {
- try {
- ELVisitor elVisitor = ELVisitor.getInstance();
- String parsedExpression = elVisitor.parse(expression, localsTypesMap);
-
- if (elVisitor.isUseConversionToString()) {
- addMethodForConversionToString();
- }
-
- if (elVisitor.isUseEmptinessCheck()) {
- addMethodForCheckingEmptiness();
- }
-
- return parsedExpression + "/* " + expression.trim() + " */";
- } catch (ParsingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- throw new RuntimeException(e.getMessage());
- }
+ try {
+ ELVisitor elVisitor = new ELVisitor();
+ elVisitor.parse(expression, localsTypesMap);
+ String parsedExpression = elVisitor.getParsedExpression();
+
+ if (elVisitor.isUseConversionToString()) {
+ addMethodForConversionToString();
+ }
+
+ if (elVisitor.isUseEmptinessCheck()) {
+ addMethodForCheckingEmptiness();
+ }
+
+ return parsedExpression + "/* " + expression.trim() + " */";
+ } catch (ParsingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ throw new RuntimeException(e.getMessage());
+ }
//
// if (Boolean.class.isAssignableFrom(type)) {
// //TODO just a stub!
@@ -244,59 +245,63 @@
//
// return quote(expression) + " /* " + expression.trim() + " */";
}
+
+ private String getElExpressionContainerType(String value) {
+ // TODO Auto-generated method stub
+ return Object.class.getName();
+ }
- private String getElExpressionContainerType(String value) {
- // TODO Auto-generated method stub
- return Object.class.getName();
- }
-
- private String getElExpressionType(String value) {
- // TODO Auto-generated method stub
- return String.class.getName();
- }
-
+ private String getElExpressionType(String value) {
+ // TODO Auto-generated method stub
+ return String.class.getName();
+ }
+
private boolean isDefaultNamespace(String namespaceURI) {
- //TODO - another namespaces
- if (namespaceURI == null || namespaceURI.length() == 0) {
- return true;
- }
-
- if (DEFAULT_NAMESPACES.contains(namespaceURI)) {
- return true;
- }
-
- return false;
+ //TODO - another namespaces
+ if (namespaceURI == null || namespaceURI.length() == 0) {
+ return true;
+ }
+
+ if (DEFAULT_NAMESPACES.contains(namespaceURI)) {
+ return true;
+ }
+
+ return false;
}
private void createMethodContext() {
- this.currentStatement = new MethodBody();
- this.localsTypesMap = new HashMap<String, Class<?>>();
- localsTypesMap.put(FACES_CONTEXT_VARIABLE, FacesContext.class);
- localsTypesMap.put(RESPONSE_WRITER_VARIABLE, ResponseWriter.class);
- localsTypesMap.put(COMPONENT_VARIABLE, UIComponent.class);
- localsTypesMap.put(CLIENT_ID_VARIABLE, String.class);
+ this.currentStatement = new MethodBody();
+ this.localsTypesMap = new HashMap<String, Type>();
+ localsTypesMap.put(FACES_CONTEXT_VARIABLE, FacesContext.class);
+ localsTypesMap.put(RESPONSE_WRITER_VARIABLE, ResponseWriter.class);
+ localsTypesMap.put(CLIENT_ID_VARIABLE, String.class);
+
+ //TODO: try load component class
+ localsTypesMap.put(COMPONENT_VARIABLE, UIComponent.class);
+ //TODO: try load renderer class
+ localsTypesMap.put(THIS_VARIABLE, Renderer.class);
}
-
+
private void flushToEncodeMethod(String encodeMethodName) {
- if (!this.currentStatement.isEmpty()) {
- Argument facesContextArgument = new Argument(FACES_CONTEXT_VARIABLE, FacesContext.class);
- Argument componentArgument = new Argument(COMPONENT_VARIABLE, UIComponent.class);
+ if (!this.currentStatement.isEmpty()) {
+ Argument facesContextArgument = new Argument(FACES_CONTEXT_VARIABLE, FacesContext.class);
+ Argument componentArgument = new Argument(COMPONENT_VARIABLE, UIComponent.class);
+
+ JavaMethod javaMethod = new JavaMethod(encodeMethodName, facesContextArgument, componentArgument);
+ javaMethod.addModifier(JavaModifier.PUBLIC);
+ javaMethod.addAnnotation(Override.class);
+ javaMethod.getExceptions().add(IOException.class);
+
+ MethodBody methodBody = (MethodBody) currentStatement;
+ javaMethod.setMethodBody(methodBody);
+
+ methodBody.addStatement(0, new EncodeMethodPrefaceStatement());
+ rendererClass.addMethod(javaMethod);
+ }
- JavaMethod javaMethod = new JavaMethod(encodeMethodName, facesContextArgument, componentArgument);
- javaMethod.addModifier(JavaModifier.PUBLIC);
- javaMethod.addAnnotation(Override.class);
- javaMethod.getExceptions().add(IOException.class);
-
- MethodBody methodBody = (MethodBody) currentStatement;
- javaMethod.setMethodBody(methodBody);
-
- methodBody.addStatement(0, new EncodeMethodPrefaceStatement());
- rendererClass.addMethod(javaMethod);
- }
-
- createMethodContext();
+ createMethodContext();
}
-
+
private JavaClass createJavaClassByName(String fullName) {
String simpleName = null;
String packageName = "";
@@ -311,142 +316,144 @@
return new JavaClass(simpleName, new JavaPackage(packageName));
}
+
+ //TODO handle arrays and generics
+ private Class<?> getClasByObjectTypeName(String type) {
+ Class<?> result = null;
+
+ int dotIndex = type.indexOf('.');
+ if (dotIndex < 0) {
+ //guess type
+ for (String guessPackage : GUESS_PACKAGES) {
+ try {
+ result = classLoader.loadClass(guessPackage + "." + type);
+ break;
+ } catch (ClassNotFoundException e) {
+ //ignore
+ }
+ }
+ }
+
+ if (result == null) {
+ try {
+ classLoader.loadClass(type);
+ } catch (ClassNotFoundException e) {
+ //ignore
+ }
+ }
- private Class<?> getClasByObjectTypeByName(String type) {
- Class<?> result = null;
+ if (result == null) {
+ result = Object.class;
+ }
- int dotIndex = type.indexOf('.');
- if (dotIndex < 0) {
- //guess type
- for (String guessPackage : GUESS_PACKAGES) {
- try {
- result = classLoader.loadClass(guessPackage + "." + type);
- break;
- } catch (ClassNotFoundException e) {
- //ignore
- }
- }
- }
+ return result;
+ }
- if (result == null) {
- try {
- classLoader.loadClass(type);
- } catch (ClassNotFoundException e) {
- //ignore
- }
- }
+ private void defineObject(String type, String name, String initializationExpression) {
+ currentStatement.addStatement(new DefineObjectStatement(type, name, initializationExpression));
+ localsTypesMap.put(name, getClasByObjectTypeName(type));
+ }
+
- if (result == null) {
- result = Object.class;
- }
-
- return result;
- }
-
- private void defineObject(String type, String name, String initializationExpression) {
- currentStatement.addStatement(new DefineObjectStatement(type, name, initializationExpression));
- localsTypesMap.put(name, getClasByObjectTypeByName(type));
- }
-
protected void pushStatement(MethodBodyStatementsContainer container) {
- currentStatement.addStatement(container);
- statements.push(currentStatement);
- currentStatement = container;
+ currentStatement.addStatement(container);
+ statements.push(currentStatement);
+ currentStatement = container;
}
-
+
protected void popStatement() {
- currentStatement = statements.pop();
+ currentStatement = statements.pop();
}
+ public RendererClassVisitor(CompositeInterface compositeInterface, ClassLoader classLoader) {
+ this.compositeInterface = compositeInterface;
+ this.classLoader = classLoader;
+ }
+
/**
* <p class="changed_added_4_0"></p>
- *
* @return the rendererClass
*/
public JavaClass getRendererClass() {
return this.rendererClass;
}
-
+
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(
- * org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
- */
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
+ */
@Override
public void startElement(CdkBodyElement cdkBodyElement) throws CdkException {
- flushToEncodeMethod("encodeBegin");
+ flushToEncodeMethod("encodeBegin");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(
- * org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
@Override
public void endElement(CdkBodyElement cdkBodyElement) throws CdkException {
- flushToEncodeMethod("encodeChildren");
+ flushToEncodeMethod("encodeChildren");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(
- * org.richfaces.cdk.templatecompiler.model.AnyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
@Override
public void startElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
Map<QName, Object> elementAttributes = anyElement.getAttributes();
-
+
if (!isDefaultNamespace(elementName.getNamespaceURI())) {
- //TODO: add support
+ //TODO: add support
}
-
+
currentStatement.addStatement(new StartElementStatement(elementName.getLocalPart()));
-
+
if (elementAttributes != null) {
for (Map.Entry<QName, Object> attribute : elementAttributes.entrySet()) {
- QName attributeName = attribute.getKey();
- Object attributeValue = attribute.getValue();
-
- if (!isDefaultNamespace(attributeName.getNamespaceURI())) {
- //TODO: add support
-
- //TODO: optimize batch attributes encoding
- if (Template.CDK_NAMESPACE.equals(attributeName.getNamespaceURI())
- && "passThroughWithExclusions".equals(attributeName.getLocalPart())) {
-
- //TODO check element namespace
- Set<String> attributeSet = ELEMENTS_ATTRIBUTES.get(elementName.getLocalPart());
- if (attributeSet != null) {
- //make a copy of original set
- TreeSet<String> actualAttributesSet = new TreeSet<String>(attributeSet);
-
- if (attributeValue != null) {
- String[] exclusions = attributeValue.toString().split("\\s+");
- for (String exclusion : exclusions) {
- actualAttributesSet.remove(exclusion);
- }
- }
-
- if (!actualAttributesSet.isEmpty()) {
- currentStatement.addStatement(new WriteAttributesSetStatement(actualAttributesSet));
- }
- }
- }
-
- //TODO: cdk:passThrough
+ QName attributeName = attribute.getKey();
+ Object attributeValue = attribute.getValue();
+
+ if (!isDefaultNamespace(attributeName.getNamespaceURI())) {
+ //TODO: add support
+
+ //TODO: optimize batch attributes encoding
+ if (Template.CDK_NAMESPACE.equals(attributeName.getNamespaceURI()) &&
+ "passThroughWithExclusions".equals(attributeName.getLocalPart())) {
+
+ //TODO check element namespace
+ Set<String> attributeSet = ELEMENTS_ATTRIBUTES.get(elementName.getLocalPart());
+ if (attributeSet != null) {
+ //make a copy of original set
+ TreeSet<String> actualAttributesSet = new TreeSet<String>(attributeSet);
+
+ if (attributeValue != null) {
+ String[] exclusions = attributeValue.toString().split("\\s+");
+ for (String exclusion : exclusions) {
+ actualAttributesSet.remove(exclusion);
+ }
+ }
+
+ if (!actualAttributesSet.isEmpty()) {
+ currentStatement.addStatement(new WriteAttributesSetStatement(actualAttributesSet));
+ }
+ }
+ }
+
+ //TODO: cdk:passThrough
} else {
- currentStatement.addStatement(new WriteAttributeStatement(attributeName.getLocalPart(),
- compileEl(attributeValue.toString(), String.class)));
+ currentStatement.addStatement(new WriteAttributeStatement(attributeName.getLocalPart(),
+ compileEl(attributeValue.toString(), String.class)));
}
- }
+ }
}
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.AnyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
@Override
public void endElement(AnyElement anyElement) throws CdkException {
- QName elementName = anyElement.getName();
+ QName elementName = anyElement.getName();
currentStatement.addStatement(new EndElementStatement(elementName.getLocalPart()));
}
@@ -455,160 +462,148 @@
*/
@Override
public void visitElement(String text) throws CdkException {
- if (text != null) {
- String trimmedText = text.trim();
- if (trimmedText.length() != 0) {
- currentStatement.addStatement(new WriteTextStatement(compileEl(trimmedText, String.class)));
- }
- }
+ if (text != null) {
+ String trimmedText = text.trim();
+ if (trimmedText.length() != 0) {
+ currentStatement.addStatement(new WriteTextStatement(compileEl(trimmedText, String.class)));
+ }
+ }
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler
- * .model.CdkCallElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler.model.CdkCallElement)
*/
@Override
public void visitElement(CdkCallElement cdkCallElement) throws CdkException {
- currentStatement.addStatement(cdkCallElement.getExpression() + ";");
+ currentStatement.addStatement(cdkCallElement.getExpression() + ";");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
- * .model.CdkIfElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
*/
- @Override
- public void startElement(CdkIfElement cdkIfElement) {
- String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.class);
+ @Override
+ public void startElement(CdkIfElement cdkIfElement) {
+ String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.class);
+
+ pushStatement(new IfElseStatement());
+ pushStatement(new IfStatement(compiledTestExpression));
+ }
- pushStatement(new IfElseStatement());
- pushStatement(new IfStatement(compiledTestExpression));
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
+ */
+ @Override
+ public void endElement(CdkIfElement cdkIfElement) {
+ popStatement();
+ popStatement();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
+ */
+ @Override
+ public void startElement(CdkChooseElement cdkChooseElement) {
+ pushStatement(new IfElseStatement());
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.CdkIfElement)
- */
- @Override
- public void endElement(CdkIfElement cdkIfElement) {
- popStatement();
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
+ */
+ @Override
+ public void endElement(CdkChooseElement cdkChooseElement) {
+ popStatement();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
- * .model.CdkChooseElement)
- */
- @Override
- public void startElement(CdkChooseElement cdkChooseElement) {
- pushStatement(new IfElseStatement());
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
+ */
+ @Override
+ public void startElement(CdkWhenElement cdkWhenElement) {
+ String compiledTestExpression = compileEl(cdkWhenElement.getTest(), Boolean.class);
+
+ pushStatement(new IfStatement(compiledTestExpression));
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.CdkChooseElement)
- */
- @Override
- public void endElement(CdkChooseElement cdkChooseElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
+ */
+ @Override
+ public void endElement(CdkWhenElement cdkWhenElement) {
+ popStatement();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
- * .model.CdkWhenElement)
- */
- @Override
- public void startElement(CdkWhenElement cdkWhenElement) {
- String compiledTestExpression = compileEl(cdkWhenElement.getTest(), Boolean.class);
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
+ */
+ @Override
+ public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
+ pushStatement(new IfStatement(""));
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
+ */
+ @Override
+ public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
+ popStatement();
+ }
- pushStatement(new IfStatement(compiledTestExpression));
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler.model.CdkObjectElement)
+ */
+ @Override
+ public void visitElement(CdkObjectElement cdkObjectElement) {
+ String name = cdkObjectElement.getName();
+
+ String value = cdkObjectElement.getValue();
+ if (value == null || value.length() == 0) {
+ value = cdkObjectElement.getBodyValue();
+ }
+
+ String type = cdkObjectElement.getType();
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.CdkWhenElement)
- */
- @Override
- public void endElement(CdkWhenElement cdkWhenElement) {
- popStatement();
- }
+ if (value != null && value.length() != 0) {
+ if (type == null || type.length() == 0) {
+ type = getElExpressionType(value);
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
- * .model.CdkOtherwiseElement)
- */
- @Override
- public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
- pushStatement(new IfStatement(""));
- }
+ value = compileEl(value, Object.class);
+ }
+
+ defineObject(type, name, value);
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.CdkOtherwiseElement)
- */
- @Override
- public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
+ */
+ @Override
+ public void startElement(CdkForEachElement cdkForEachElement) {
+ String items = cdkForEachElement.getItems();
+ String itemsExpression = compileEl(items, Iterable.class);
+ pushStatement(new ForEachStatement(itemsExpression, cdkForEachElement.getVar(),
+ getElExpressionContainerType(items)));
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler
- * .model.CdkObjectElement)
- */
- @Override
- public void visitElement(CdkObjectElement cdkObjectElement) {
- String name = cdkObjectElement.getName();
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
+ */
+ @Override
+ public void endElement(CdkForEachElement cdkForEachElement) {
+ popStatement();
+ }
- String value = cdkObjectElement.getValue();
- if (value == null || value.length() == 0) {
- value = cdkObjectElement.getBodyValue();
- }
-
- String type = cdkObjectElement.getType();
-
- if (value != null && value.length() != 0) {
- if (type == null || type.length() == 0) {
- type = getElExpressionType(value);
- }
-
- value = compileEl(value, Object.class);
- }
-
- defineObject(type, name, value);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
- * .model.CdkForEachElement)
- */
- @Override
- public void startElement(CdkForEachElement cdkForEachElement) {
- String items = cdkForEachElement.getItems();
- String itemsExpression = compileEl(items, Iterable.class);
- pushStatement(new ForEachStatement(itemsExpression, cdkForEachElement.getVar(),
- getElExpressionContainerType(items)));
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
- * .model.CdkForEachElement)
- */
- @Override
- public void endElement(CdkForEachElement cdkForEachElement) {
- popStatement();
- }
-
- /**
- *
- */
- public void preProcess() {
+ /**
+ *
+ */
+ public void preProcess() {
initializeJavaClass();
- }
+ }
- /**
- *
- */
- public void postProcess() {
- flushToEncodeMethod("encodeEnd");
- }
+ /**
+ *
+ */
+ public void postProcess() {
+ flushToEncodeMethod("encodeEnd");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-text.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-text.ftl 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-text.ftl 2009-12-04 20:55:31 UTC (rev 16075)
@@ -1 +1,6 @@
-${rendererUtilsVariable}.writeText(${responseWriterVariable}, ${modelItem.textExpression}, null);
\ No newline at end of file
+{
+ Object text = ${modelItem.textExpression};
+ if (text != null) {
+ ${responseWriterVariable}.writeText(text, null);
+ }
+}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/Bean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/Bean.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/Bean.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -32,12 +32,14 @@
private UIComponent[] array = new UIComponent[] {new UIComponent()};
private List<UIComponent> components;
private Map<String, UIComponent> facets;
+ private Map rawMap;
private boolean readOnly;
private Bean2 testBean2;
- public Bean() {
+ public Bean() {
facets = new HashMap<String, UIComponent>();
-
+ rawMap = new HashMap();
+
UIComponent value = new UIComponent();
facets.put("header", value);
@@ -71,6 +73,10 @@
this.components = components;
}
+ public UIComponent getFacet(String name) {
+ return facets.get(name);
+ }
+
public Map<String, UIComponent> getFacets() {
return facets;
}
@@ -79,6 +85,15 @@
this.facets = facets;
}
+ public Map getRawMap() {
+ return rawMap;
+ }
+
+ public void setRawMap(Map rawMap) {
+ this.rawMap = rawMap;
+ }
+
+
public boolean isReadOnly() {
return readOnly;
}
@@ -86,4 +101,12 @@
public void setReadOnly(boolean readOnly) {
this.readOnly = readOnly;
}
+
+ public Object count(Object o) {
+ return null;
+ }
+
+ public Integer count(Integer i) {
+ return null;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2009-12-04 20:54:42 UTC (rev 16074)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -24,249 +24,452 @@
package org.richfaces.cdk.parser.el.test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.lang.reflect.Type;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
+import org.richfaces.cdk.parser.el.ELParserUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
public class ELParserTest {
+ private ELVisitor visitor;
+
+ @Before
+ public void setUp() {
+ visitor = new ELVisitor();
+ }
+
+ @After
+ public void tearDown() {
+ visitor = null;
+ }
+
@Test
public void testNull() throws Exception {
- assertEquals(resolveExpression("#{null}"), "null");
+ parseExpression("#{null}");
+ assertEquals("null", visitor.getParsedExpression());
+ assertTrue(ELParserUtils.isNullType(visitor.getVariableType()));
}
@Test
public void testTrue() throws Exception {
- assertEquals(resolveExpression("#{true}"), "true");
+ parseExpression("#{true}");
+ assertEquals("true", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testFalse() throws Exception {
- assertEquals(resolveExpression("#{false}"), "false");
+ parseExpression("#{false}");
+ assertEquals("false", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testFloat() throws Exception {
- assertEquals(resolveExpression("#{5.0}"), "Double.valueOf(5.0)");
- assertEquals(resolveExpression("#{5.012e+34}"), "Double.valueOf(5.012e+34)");
+ parseExpression("#{5.0}");
+ assertEquals("Double.valueOf(5.0)", visitor.getParsedExpression());
+ assertEquals(Double.TYPE, visitor.getVariableType());
+
+ parseExpression("#{5.012e+34}");
+ assertEquals("Double.valueOf(5.012e+34)", visitor.getParsedExpression());
+ assertEquals(Double.TYPE, visitor.getVariableType());
}
@Test
public void testNegative() throws Exception {
- assertEquals(resolveExpression("#{-5}"), "-5");
+ parseExpression("#{-5}");
+ assertEquals("-5", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testNegativeFloat() throws Exception {
- assertEquals(resolveExpression("#{-5.0}"), "-Double.valueOf(5.0)");
+ parseExpression("#{-5.0}");
+ assertEquals("-Double.valueOf(5.0)", visitor.getParsedExpression());
+ assertEquals(Double.TYPE, visitor.getVariableType());
}
@Test
public void testNotEqual() throws Exception {
- assertEquals(resolveExpression("#{1 ne 3}"), "(1 != 3)");
- assertEquals(resolveExpression("#{1 != 3}"), "(1 != 3)");
+ parseExpression("#{1 ne 3}");
+ assertEquals("(1 != 3)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{2 != 3}");
+ assertEquals("(2 != 3)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testNot() throws Exception {
- assertEquals(resolveExpression("#{not 1}"), "(!1)");
- assertEquals(resolveExpression("#{!1}"), "(!1)");
+ parseExpression("#{not test}");
+ assertEquals("(!test)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{!otherTest}");
+ assertEquals("(!otherTest)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testPlus() throws Exception {
- assertEquals(resolveExpression("#{1+2}"), "(1 + 2)");
+ //TODO: tests involving double values
+ parseExpression("#{1+2}");
+ assertEquals("(1 + 2)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testMinus() throws Exception {
- assertEquals(resolveExpression("#{1-2}"), "(1 - 2)");
+ parseExpression("#{1-2}");
+ assertEquals("(1 - 2)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testDiv() throws Exception {
- assertEquals(resolveExpression("#{1/2}"), "(1 / 2)");
+ parseExpression("#{1/2}");
+ assertEquals("(1 / 2)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testMult() throws Exception {
- assertEquals(resolveExpression("#{1*2}"), "(1 * 2)");
+ parseExpression("#{1*2}");
+ assertEquals("(1 * 2)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testMod() throws Exception {
- assertEquals(resolveExpression("#{1%2}"), "(1 % 2)");
+ parseExpression("#{1%2}");
+ assertEquals("(1 % 2)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testAnd() throws Exception {
- assertEquals(resolveExpression("#{1 and 2}"), "(1 && 2)");
- assertEquals(resolveExpression("#{1 && 2}"), "(1 && 2)");
+ parseExpression("#{test and otherTest}");
+ assertEquals("(test && otherTest)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{otherTest && test}");
+ assertEquals("(otherTest && test)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testOr() throws Exception {
- assertEquals(resolveExpression("#{1 or 2}"), "(1 || 2)");
- assertEquals(resolveExpression("#{1 || 2}"), "(1 || 2)");
+ parseExpression("#{test or otherTest}");
+ assertEquals("(test || otherTest)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{otherTest || test}");
+ assertEquals("(otherTest || test)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testEquals() throws Exception {
- assertEquals(resolveExpression("#{1 eq 2}"), "(1 == 2)");
- assertEquals(resolveExpression("#{1 == 2}"), "(1 == 2)");
+ parseExpression("#{1 eq 2}");
+ assertEquals("(1 == 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{3 == 2}");
+ assertEquals("(3 == 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testGreatThen() throws Exception {
- assertEquals(resolveExpression("#{1 gt 2}"), "(1 > 2)");
- assertEquals(resolveExpression("#{1 > 2}"), "(1 > 2)");
+ parseExpression("#{1 gt 2}");
+ assertEquals("(1 > 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{3 > 2}");
+ assertEquals("(3 > 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testLessThen() throws Exception {
- assertEquals(resolveExpression("#{1 lt 2}"), "(1 < 2)");
- assertEquals(resolveExpression("#{1 < 2}"), "(1 < 2)");
+ parseExpression("#{1 lt 2}");
+ assertEquals("(1 < 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{3 < 2}");
+ assertEquals("(3 < 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testLessThenEquals() throws Exception {
- assertEquals(resolveExpression("#{1 le 2}"), "(1 <= 2)");
- assertEquals(resolveExpression("#{1 <= 2}"), "(1 <= 2)");
+ parseExpression("#{1 le 2}");
+ assertEquals("(1 <= 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{3 <= 2}");
+ assertEquals("(3 <= 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testGreatThenEquals() throws Exception {
- assertEquals(resolveExpression("#{1 ge 2}"), "(1 >= 2)");
- assertEquals(resolveExpression("#{1 >= 2}"), "(1 >= 2)");
+ parseExpression("#{1 ge 2}");
+ assertEquals("(1 >= 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+
+ parseExpression("#{3 >= 2}");
+ assertEquals("(3 >= 2)", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testChoice() throws Exception {
- assertEquals(resolveExpression("#{1 ? 2 : 3}"), "(1 ? 2 : 3)");
+ parseExpression("#{test ? 2 : 3}");
+ assertEquals("(test ? 2 : 3)", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
+
+ parseExpression("#{test ? null : 'string'}");
+ assertEquals("(test ? null : \"string\")", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testInteger() throws Exception {
- assertEquals(resolveExpression("#{152}"), "152");
+ parseExpression("#{152}");
+ assertEquals("152", visitor.getParsedExpression());
+ assertEquals(Integer.TYPE, visitor.getVariableType());
}
@Test
public void testString() throws Exception {
- assertEquals(resolveExpression("#{\"nabc\"}"), "\"nabc\"");
- assertEquals(resolveExpression("#{'nabc'}"), "\"nabc\"");
- assertEquals(resolveExpression("#{'\tabc'}"), "\"\\tabc\"");
- assertEquals(resolveExpression("#{'/nabc'}"), "\"/nabc\"");
- assertEquals(resolveExpression("#{'na\"bc'}"), "\"na\\\"bc\"");
- assertEquals(resolveExpression("#{'na\\\\bc'}"), "\"na\\\\bc\"");
+ parseExpression("#{\"nabc\"}");
+ assertEquals("\"nabc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("#{'nabc'}");
+ assertEquals("\"nabc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("#{'\tabc'}");
+ assertEquals("\"\\tabc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("#{'/nabc'}");
+ assertEquals("\"/nabc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("#{'na\"bc'}");
+ assertEquals("\"na\\\"bc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("#{'na\\\\bc'}");
+ assertEquals("\"na\\\\bc\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testIdentifier() throws Exception {
- assertEquals(resolveExpression("#{clientId}"), "clientId");
+ parseExpression("#{clientId}");
+ assertEquals("clientId", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testLiteral() throws Exception {
- assertEquals(resolveExpression("clientId"), "\"clientId\"");
+ parseExpression("clientId");
+ assertEquals("\"clientId\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testMethodReturnMap() throws Exception {
- assertEquals(resolveExpression("#{action.facets}"), "action.getFacets()");
+ parseExpression("#{action.facets}");
+ assertEquals("action.getFacets()", visitor.getParsedExpression());
+ Type variableType = visitor.getVariableType();
+ assertEquals(Map.class, ELParserUtils.getRawType(variableType));
+ assertEquals(UIComponent.class, ELParserUtils.getLastTypeArgument(variableType));
+
+ parseExpression("#{action.rawMap}");
+ assertEquals("action.getRawMap()", visitor.getParsedExpression());
}
@Test
public void testMethodReturnMapElement() throws Exception {
- assertEquals(resolveExpression("#{action.facets['header']}"), "action.getFacets().get(\"header\")");
+ parseExpression("#{action.getFacet('header')}");
+ assertEquals("action.getFacet(\"header\")", visitor.getParsedExpression());
+ assertEquals(UIComponent.class, visitor.getVariableType());
+
+ parseExpression("#{action.facets['header']}");
+ assertEquals("action.getFacets().get(\"header\")", visitor.getParsedExpression());
+ assertEquals(UIComponent.class, visitor.getVariableType());
+
+ parseExpression("#{action.rawMap['something']}");
+ assertEquals("action.getRawMap().get(\"something\")", visitor.getParsedExpression());
+ assertEquals(Object.class, visitor.getVariableType());
}
+// @Test
+// public void testMethodReturnMapElement1() throws Exception {
+// assertEquals("action.getFacets().get(\"header\")", resolveExpression("#{action.facets.header}"));
+// }
+
@Test
public void testMethodReturnMapElement2() throws Exception {
- assertEquals(resolveExpression("#{action.facets['header'].rendered}"),
- "action.getFacets().get(\"header\").isRendered()");
+ parseExpression("#{action.facets.toString()}");
+ assertEquals("action.getFacets().toString()", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
+
+ @Test
+ public void testMethodReturnMapElement3() throws Exception {
+// assertEquals("action.getFacet(\"header\").isRendered()",
+// resolveExpression("#{action.getFacet('header').rendered}"));
+ parseExpression("#{action.facets['header'].rendered}");
+ assertEquals("action.getFacets().get(\"header\").isRendered()",
+ visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
+ }
@Test
public void testMethod() throws Exception {
- assertEquals(resolveExpression("#{action.readOnly}"), "action.isReadOnly()");
+ parseExpression("#{action.readOnly}");
+ assertEquals("action.isReadOnly()", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testNestedMethod() throws Exception {
- assertEquals(resolveExpression("#{action.testBean2.string}"), "action.getTestBean2().getString()");
+ parseExpression("#{action.testBean2.string}");
+ assertEquals("action.getTestBean2().getString()", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testMethodReturnList() throws Exception {
- assertEquals(resolveExpression("#{action.components}"), "action.getComponents()");
+ parseExpression("#{action.components}");
+ assertEquals("action.getComponents()", visitor.getParsedExpression());
+ Type variableType = visitor.getVariableType();
+ assertEquals(List.class, ELParserUtils.getRawType(variableType));
+ assertEquals(UIComponent.class, ELParserUtils.getLastTypeArgument(variableType));
}
@Test
public void testMethodReturnListElement() throws Exception {
- assertEquals(resolveExpression("#{action.components[0]}"), "action.getComponents().get(0)");
+ parseExpression("#{action.components[0]}");
+ assertEquals("action.getComponents().get(0)", visitor.getParsedExpression());
+ assertEquals(UIComponent.class, visitor.getVariableType());
}
@Test
public void testMethodReturnListElement2() throws Exception {
- assertEquals(resolveExpression("#{action.components[0].rendered}"),
- "action.getComponents().get(0).isRendered()");
+ parseExpression("#{action.components[0].rendered}");
+ assertEquals("action.getComponents().get(0).isRendered()", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testMethodReturnArray() throws Exception {
- assertEquals(resolveExpression("#{action.array}"), "action.getArray()");
+ parseExpression("#{action.array}");
+ assertEquals("action.getArray()", visitor.getParsedExpression());
+ assertEquals(UIComponent[].class, visitor.getVariableType());
}
@Test
public void testMethodReturnArrayElement() throws Exception {
- assertEquals(resolveExpression("#{action.array[0]}"), "action.getArray()[0]");
+ parseExpression("#{action.array[0]}");
+ assertEquals("action.getArray()[0]", visitor.getParsedExpression());
+ assertEquals(UIComponent.class, visitor.getVariableType());
}
@Test
public void testMethodWithParam() throws Exception {
- assertEquals(resolveExpression("#{getType(action.array[0].rendered, action.readOnly, true)}"),
- "this.getType(action.getArray()[0].isRendered(),action.isReadOnly(),true)");
+ parseExpression("#{getType(action.array[0].rendered, action.readOnly, true)}");
+ assertEquals("this.getType(action.getArray()[0].isRendered(),action.isReadOnly(),true)",
+ visitor.getParsedExpression());
+
+ Type variableType = visitor.getVariableType();
+
+ parseExpression("#{action.count(123)}");
+ assertEquals("action.count(123)", visitor.getParsedExpression());
+ assertEquals(Integer.class, visitor.getVariableType());
+
+ parseExpression("#{action.count(clientId)}");
+ assertEquals("action.count(clientId)", visitor.getParsedExpression());
+ assertEquals(Object.class, visitor.getVariableType());
}
@Test
public void testEmpty() throws Exception {
- assertEquals(resolveExpression("#{empty action.array}"), "this.getUtils().isEmpty(action.getArray())");
+ parseExpression("#{empty action.array}");
+ assertEquals("this.getUtils().isEmpty(action.getArray())", visitor.getParsedExpression());
+ assertEquals(Boolean.TYPE, visitor.getVariableType());
}
@Test
public void testFunction() throws Exception {
- assertEquals(resolveExpression("#{getType()}"), "this.getType()");
+ parseExpression("#{super:getType()}");
+ assertEquals("super.getType()", visitor.getParsedExpression());
+ Type variableType = visitor.getVariableType();
}
@Test
public void testLiteralWithDeferred() throws Exception {
- assertEquals(resolveExpression("abs #{getType()}"), "\"abs \" + convertToString(this.getType())");
+ parseExpression("#{1}#{2}");
+ assertEquals("convertToString(1) + convertToString(2)", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
+
+ parseExpression("abs #{getType()}");
+ assertEquals("\"abs \" + convertToString(this.getType())", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testLiteralWithDeferred2() throws Exception {
- assertEquals(resolveExpression("#{getType()} abs "), "convertToString(this.getType()) + \" abs \"");
+ parseExpression("#{getType()} abs ");
+ assertEquals("convertToString(this.getType()) + \" abs \"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType());
}
@Test
public void testThisFunction() throws Exception {
- assertEquals(resolveExpression("#{this.getType()}"), "this.getType()");
+ parseExpression("#{getType()}");
+ assertEquals("this.getType()", visitor.getParsedExpression());
+ Type variableType = visitor.getVariableType();
+
+ parseExpression("#{this.getType()}");
+ assertEquals("this.getType()", visitor.getParsedExpression());
}
@Test
- public void testUtilsFunction() throws Exception {
- assertEquals(resolveExpression("#{utils.getType()}"), "this.getUtils().getType()");
+ public void testVariableFunction() throws Exception {
+ parseExpression("#{objectVar.getType()}");
+ assertEquals("objectVar.getType()", visitor.getParsedExpression());
+ Type variableType = visitor.getVariableType();
}
@Test
+ public void testNonExistingMethod() throws Exception {
+ parseExpression("#{action.doSomething(clientId, 123)}");
+ assertEquals("action.doSomething(clientId,123)", visitor.getParsedExpression());
+ assertEquals(Object.class, visitor.getVariableType());
+ }
+
+ @Test
public void testWrongExpression() throws Exception {
try {
- resolveExpression("#{bean.property}");
+ parseExpression("#{bean.property}");
fail("Parsing Exception is not thrown");
} catch (ParsingException pe) {
//TODO - check message
@@ -276,23 +479,21 @@
@Test
public void testWrongExpression2() throws Exception {
- try {
- resolveExpression("#{action.property}");
- fail("Parsing Exception is not thrown");
- } catch (ParsingException pe) {
- assertEquals(pe.getMessage(),
- "property: property not found in class: class org.richfaces.cdk.parser.el.test.Bean");
- }
+ parseExpression("#{action.property}");
+ assertEquals("action.getProperty()", visitor.getParsedExpression());
+ assertEquals(Object.class, visitor.getVariableType());
}
- private static String resolveExpression(String expression) throws ParsingException {
- Map<String, Class<?>> contextMap = new HashMap<String, Class<?>>();
+ private void parseExpression(String expression) throws ParsingException {
+ Map<String, Type> contextMap = new HashMap<String, Type>();
contextMap.put("action", org.richfaces.cdk.parser.el.test.Bean.class);
contextMap.put("clientId", String.class);
+ contextMap.put("test", boolean.class);
+ contextMap.put("otherTest", boolean.class);
+ contextMap.put("this", Object.class);
+ contextMap.put("objectVar", Object.class);
- String code = ELVisitor.getInstance().parse(expression, contextMap);
-
- return code;
+ visitor.parse(expression, contextMap);
}
}
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/TypeUtilsTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/TypeUtilsTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/TypeUtilsTest.java 2009-12-04 20:55:31 UTC (rev 16075)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * 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.richfaces.cdk.parser.el.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.cdk.parser.el.ELParserUtils;
+
+/**
+ * @author Nick Belaevski
+ * @since 4.0
+ */
+public class TypeUtilsTest {
+
+ public static final class PropertyClass {
+
+ public String getString() {
+ return null;
+ }
+
+ public Integer[] getIntegerArray() {
+ return null;
+ }
+
+ public Map<String, Object> getParameterizedMap() {
+ return null;
+ }
+
+ public List<Float> getParameterizedList() {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getRawMap() {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List getRawList() {
+ return null;
+ }
+ }
+
+ private Type stringType;
+
+ private Type integerArrayType;
+
+ private Type parameterizedMapType;
+
+ private Type parameterizedListType;
+
+ private Type rawMapType;
+
+ private Type rawListType;
+
+ @Before
+ public void setUp() throws Exception {
+ stringType = PropertyClass.class.getMethod("getString")
+ .getGenericReturnType();
+ integerArrayType = PropertyClass.class.getMethod("getIntegerArray")
+ .getGenericReturnType();
+ parameterizedMapType = PropertyClass.class.getMethod(
+ "getParameterizedMap").getGenericReturnType();
+ parameterizedListType = PropertyClass.class.getMethod(
+ "getParameterizedList").getGenericReturnType();
+ rawMapType = PropertyClass.class.getMethod("getRawMap")
+ .getGenericReturnType();
+ rawListType = PropertyClass.class.getMethod("getRawList")
+ .getGenericReturnType();
+ }
+
+ @After
+ public void tearDown() {
+ stringType = null;
+ integerArrayType = null;
+ parameterizedMapType = null;
+ parameterizedListType = null;
+ rawMapType = null;
+ rawListType = null;
+ }
+
+ @Test
+ public void testGetRawType() throws Exception {
+ assertEquals(String.class, ELParserUtils.getRawType(stringType));
+ assertEquals(Integer[].class, ELParserUtils.getRawType(integerArrayType));
+ assertEquals(Map.class, ELParserUtils.getRawType(parameterizedMapType));
+ assertEquals(List.class, ELParserUtils.getRawType(parameterizedListType));
+ assertEquals(Map.class, ELParserUtils.getRawType(rawMapType));
+ assertEquals(List.class, ELParserUtils.getRawType(rawListType));
+ }
+
+ @Test
+ public void testGetActualTypeArguments() throws Exception {
+ assertNull(ELParserUtils.getLastTypeArgument(stringType));
+ assertNull(ELParserUtils.getLastTypeArgument(integerArrayType));
+ assertEquals(Object.class, ELParserUtils.getLastTypeArgument(parameterizedMapType));
+ assertEquals(Float.class, ELParserUtils.getLastTypeArgument(parameterizedListType));
+ assertNull(ELParserUtils.getLastTypeArgument(rawMapType));
+ assertNull(ELParserUtils.getLastTypeArgument(rawListType));
+ }
+}
14 years, 5 months
JBoss Rich Faces SVN: r16074 - in root: ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:54:42 -0500 (Fri, 04 Dec 2009)
New Revision: 16074
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -15,10 +15,11 @@
@ManagedBean(name = "choicesBean")
@SessionScoped
public class ChoicesBean implements Runnable {
+ PushEventListener listener;
+
private boolean enabled = false;
private List<Choice> choices;
private List<Choice> lastVotes;
- PushEventListener listener;
private Date startDate;
private Thread thread;
private String updateInfo;
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -111,26 +111,26 @@
}
public void setData(Object data) {
- this.data = data;
- clearInitialState();
+ this.data = data;
+ clearInitialState();
}
-
+
public Object getData() {
- if (this.data != null) {
- return this.data;
- }
-
- ValueExpression ve = getValueExpression(Attributes.data.toString());
-
- if (ve != null) {
+ if (this.data != null) {
+ return this.data;
+ }
+
+ ValueExpression ve = getValueExpression(Attributes.data.toString());
+
+ if (ve != null) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
return ve.getValue(elContext);
- }
-
- return this.data;
+ }
+
+ return this.data;
}
-
+
@Override
public void setRender(Collection<String> render) {
this.render = asSet(render);
@@ -266,47 +266,47 @@
Object value = getExpressionLiteralValue(expression);
switch (Attributes.toAttribute(name)) {
- case limitRender :
+ case limitRender:
this.limitRender = value != null ? (Boolean) value : Boolean.FALSE;
break;
- case execute :
+ case execute:
this.execute = value != null ? asSet(value) : null;
break;
- case render :
+ case render:
this.render = value != null ? asSet(value) : null;
break;
- case queueId :
+ case queueId:
this.queueId = value != null ? (String) value : null;
break;
- case status :
+ case status:
this.statusId = value != null ? (String) value : null;
break;
- case similarityGroupingId :
+ case similarityGroupingId:
this.similarityGroupingId = value != null ? (String) value : null;
break;
- case onbeforedomupdate :
+ case onbeforedomupdate:
this.onbeforedomupdate = value != null ? (String) value : null;
break;
- case onbegin :
+ case onbegin:
this.onbegin = value != null ? (String) value : null;
break;
- case oncomplete :
+ case oncomplete:
this.oncomplete = value != null ? (String) value : null;
break;
@@ -316,7 +316,7 @@
break;
- default :
+ default:
break;
}
}
@@ -337,7 +337,7 @@
if (superState == null) {
values = null;
} else {
- values = new Object[] {superState};
+ values = new Object[]{superState};
}
} else {
values = new Object[11];
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxOutputPanelRenderer.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -34,116 +34,124 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIAjaxOutputPanel;
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:27 $
- *
*/
public class AjaxOutputPanelRenderer extends RendererBase {
-
- private final String[] STYLE_ATTRIBUTES = new String[]{"style","class"};
- private boolean hasNoneLayout(UIComponent component) {
- //TODO - A1 won't support 'none' layout
- return false;//"none".equals(component.getAttributes().get("layout"));
- }
-
- /* (non-Javadoc)
- * @see javax.faces.render.Renderer#encodeChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
- //
- UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
- if (hasNoneLayout(panel)) {
- if (component.getChildCount() > 0) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- boolean ajaxRequest = ajaxContext.isAjaxRequest();
- Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
- for (UIComponent child : component.getChildren()) {
- String childId = child.getClientId(context);
- if (child.isRendered()) {
- renderChild(context, child);
- } else {
- // Render "dummy" span.
- ResponseWriter out = context.getResponseWriter();
- out.startElement(HTML.SPAN_ELEM,child);
- out.writeAttribute(HTML.ID_ATTRIBUTE, childId,HTML.ID_ATTRIBUTE);
- out.writeAttribute(HTML.STYLE_ATTRIBUTE, "display: none;","style");
- out.endElement(HTML.SPAN_ELEM);
- }
- // register child as rendered
- if(ajaxRequest && null != ajaxRenderedAreas) {
- ajaxRenderedAreas.add(childId);
- }
- }
- }
- } else {
- renderChildren(context,component);
- }
- }
+ private static final String[] STYLE_ATTRIBUTES = new String[]{"style", "class"};
- /* (non-Javadoc)
- * @see javax.faces.render.Renderer#getRendersChildren()
- */
- public boolean getRendersChildren() {
- return true;
- }
+ private boolean hasNoneLayout(UIComponent component) {
+ //TODO - A1 won't support 'none' layout
+ return false; //"none".equals(component.getAttributes().get("layout"));
+ }
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
- protected Class<? extends UIComponent> getComponentClass() {
- return UIAjaxOutputPanel.class;
- }
+ /* (non-Javadoc)
+ * @see javax.faces.render.Renderer#encodeChildren(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
+ //
+ UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
+ if (hasNoneLayout(panel)) {
+ if (component.getChildCount() > 0) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ boolean ajaxRequest = ajaxContext.isAjaxRequest();
+ Set<String> ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
+ for (UIComponent child : component.getChildren()) {
+ String childId = child.getClientId(context);
+ if (child.isRendered()) {
+ renderChild(context, child);
+ } else {
+ // Render "dummy" span.
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement(HTML.SPAN_ELEM, child);
+ out.writeAttribute(HTML.ID_ATTRIBUTE, childId, HTML.ID_ATTRIBUTE);
+ out.writeAttribute(HTML.STYLE_ATTRIBUTE, "display: none;", "style");
+ out.endElement(HTML.SPAN_ELEM);
+ }
+ // register child as rendered
+ if (ajaxRequest && null != ajaxRenderedAreas) {
+ ajaxRenderedAreas.add(childId);
+ }
+ }
+ }
+ } else {
+ renderChildren(context, component);
+ }
+ }
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
- if (!hasNoneLayout(component)) {
- writer.startElement(getTag(panel), panel);
- getUtils().encodeId(context, component);
- getUtils().encodePassThru(context, component, null);
- getUtils().encodeAttributesFromArray(context,component,STYLE_ATTRIBUTES);
- }
- }
+ /* (non-Javadoc)
+ * @see javax.faces.render.Renderer#getRendersChildren()
+ */
+ @Override
+ public boolean getRendersChildren() {
+ return true;
+ }
- /**
- * @param panel
- * @return
- */
- private String getTag(UIAjaxOutputPanel panel) {
- Object layout = panel.getAttributes().get("layout");
- return "block".equals(layout) ? HTML.DIV_ELEM : HTML.SPAN_ELEM;
- }
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIAjaxOutputPanel.class;
+ }
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
- if (!hasNoneLayout(component)) {
- writer.endElement(getTag(panel));
- }
- if (panel.isKeepTransient()) {
- markNoTransient(component);
- }
- }
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component)
+ throws IOException {
- /**
- * Set "transient" flag to false for component and all its children ( recursive ).
- * @param component
- */
- private void markNoTransient(UIComponent component) {
- for (Iterator<UIComponent> iter = component.getFacetsAndChildren(); iter.hasNext();) {
- UIComponent element = iter.next();
- markNoTransient(element);
- element.setTransient(false);
- }
-
- }
+ UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
+ if (!hasNoneLayout(component)) {
+ writer.startElement(getTag(panel), panel);
+ getUtils().encodeId(context, component);
+ getUtils().encodePassThru(context, component, null);
+ getUtils().encodeAttributesFromArray(context, component, STYLE_ATTRIBUTES);
+ }
+ }
-
+ /**
+ * @param panel
+ * @return
+ */
+ private String getTag(UIAjaxOutputPanel panel) {
+ Object layout = panel.getAttributes().get("layout");
+ return "block".equals(layout) ? HTML.DIV_ELEM : HTML.SPAN_ELEM;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ UIAjaxOutputPanel panel = (UIAjaxOutputPanel) component;
+ if (!hasNoneLayout(component)) {
+ writer.endElement(getTag(panel));
+ }
+ if (panel.isKeepTransient()) {
+ markNoTransient(component);
+ }
+ }
+
+ /**
+ * Set "transient" flag to false for component and all its children ( recursive ).
+ *
+ * @param component
+ */
+ private void markNoTransient(UIComponent component) {
+ for (Iterator<UIComponent> iter = component.getFacetsAndChildren(); iter.hasNext();) {
+ UIComponent element = iter.next();
+ markNoTransient(element);
+ element.setTransient(false);
+ }
+
+ }
+
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -21,17 +21,6 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.event.ActionEvent;
-
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSReference;
@@ -44,116 +33,127 @@
import org.richfaces.component.html.HtmlPush;
import org.richfaces.resource.PushResource;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.event.ActionEvent;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author shura
- *
*/
@ResourceDependencies(value = {
- @ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(name = "jquery.js"),
- @ResourceDependency(name = "richfaces.js")
-})
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js")
+ })
public class AjaxPushRenderer extends RendererBase {
- public static final String PUSH_INTERVAL_PARAMETER = "A4J.AJAX.Push.INTERVAL";
+ public static final String PUSH_INTERVAL_PARAMETER = "A4J.AJAX.Push.INTERVAL";
- public static final String PUSH_WAIT_PARAMETER = "A4J.AJAX.Push.WAIT";
+ public static final String PUSH_WAIT_PARAMETER = "A4J.AJAX.Push.WAIT";
- @Deprecated
- public static final String PUSH_URL_PARAMETER = "A4J.AJAX.Push.URL";
+ @Deprecated
+ public static final String PUSH_URL_PARAMETER = "A4J.AJAX.Push.URL";
- public static final int DEFAULT_PUSH_INTERVAL = 1000;
+ public static final int DEFAULT_PUSH_INTERVAL = 1000;
- public static final int DEFAULT_PUSH_WAIT = Integer.MIN_VALUE;
+ public static final int DEFAULT_PUSH_WAIT = Integer.MIN_VALUE;
- private static final String AJAX_PUSH_FUNCTION = "A4J.AJAX.Push";
+ private static final String AJAX_PUSH_FUNCTION = "A4J.AJAX.Push";
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- UIPush push = (UIPush) component;
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.STYLE_ATTRIBUTE, "display:none;", null);
- getUtils().encodeId(context, component);
-
- //TODO - ?
- getUtils().encodeBeginFormIfNessesary(context, component);
- // pushing script.
- writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
- StringBuffer script = new StringBuffer("\n");
- if (push.isEnabled()) {
- JSFunction function = new JSFunction("RichFaces.startPush");
- // Set dummy form id, if nessesary.
- Map<String, Object> options = new HashMap<String, Object>();
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ UIPush push = (UIPush) component;
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.STYLE_ATTRIBUTE, "display:none;", null);
+ getUtils().encodeId(context, component);
- int interval = push.getInterval();
- if (!getUtils().shouldRenderAttribute(interval)) {
- String intervalInitParameter = context.getExternalContext().getInitParameter(PUSH_INTERVAL_PARAMETER);
- if(null != intervalInitParameter){
- interval = Integer.parseInt(intervalInitParameter);
- } else {
- interval = DEFAULT_PUSH_INTERVAL;
- }
- }
+ //TODO - ?
+ getUtils().encodeBeginFormIfNessesary(context, component);
+ // pushing script.
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
+ StringBuffer script = new StringBuffer("\n");
+ if (push.isEnabled()) {
+ JSFunction function = new JSFunction("RichFaces.startPush");
+ // Set dummy form id, if nessesary.
+ Map<String, Object> options = new HashMap<String, Object>();
- options.put("interval", new Integer(interval));
- options.put("pushResourceUrl", new PushResource().getRequestPath());
- options.put("pushId", push.getListenerId(context));
- options.put("clientId", component.getClientId(context));
-
- HandlersChain handlersChain = new HandlersChain(push);
- handlersChain.addInlineHandlerFromAttribute(context, HtmlPush.ON_DATA_AVAILABLE);
- handlersChain.addBehaviors(context, HtmlPush.DATA_AVAILABLE);
-
- if (!handlersChain.hasSubmittingBehavior()) {
- JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, push, AjaxRendererUtils.AJAX_FUNCTION_NAME);
- AjaxEventOptions eventOptions = AjaxRendererUtils.buildEventOptions(context, push);
- if (!eventOptions.isEmpty()) {
- ajaxFunction.addParameter(eventOptions);
- }
- handlersChain.addInlineHandlerAsValue(context, ajaxFunction.toScript());
- }
-
- String handler = handlersChain.toScript();
-
- if (handler != null) {
- JSFunctionDefinition dataAvailableHandler = new JSFunctionDefinition(JSReference.EVENT);
- dataAvailableHandler.addToBody(handler);
- options.put(HtmlPush.ON_DATA_AVAILABLE, dataAvailableHandler);
- }
- function.addParameter(options);
- script.append(function.toScript());
- } else {
- script.append("RichFaces.stopPush('").append(push.getListenerId(context)).append("')");
- }
- script.append(";\n");
- writer.writeText(script.toString(),null);
- writer.endElement(HTML.SCRIPT_ELEM);
- getUtils().encodeEndFormIfNessesary(context, component);
- writer.endElement(HTML.SPAN_ELEM);
- }
+ int interval = push.getInterval();
+ if (!getUtils().shouldRenderAttribute(interval)) {
+ String intervalInitParameter = context.getExternalContext().getInitParameter(PUSH_INTERVAL_PARAMETER);
+ if (null != intervalInitParameter) {
+ interval = Integer.parseInt(intervalInitParameter);
+ } else {
+ interval = DEFAULT_PUSH_INTERVAL;
+ }
+ }
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
- protected Class<? extends UIComponent> getComponentClass() {
- // only push component is allowed.
- return UIPush.class;
- }
-
- @Override
- protected void doDecode(FacesContext context, UIComponent component) {
- super.doDecode(context, component);
-
- UIPush push = (UIPush) component;
- if (push.isEnabled()) {
- Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
- if (requestParameterMap.get(push.getClientId(context)) != null || push.isHasActiveBehavior()) {
- new ActionEvent(push).queue();
- }
- }
- }
+ options.put("interval", new Integer(interval));
+ options.put("pushResourceUrl", new PushResource().getRequestPath());
+ options.put("pushId", push.getListenerId(context));
+ options.put("clientId", component.getClientId(context));
+ HandlersChain handlersChain = new HandlersChain(push);
+ handlersChain.addInlineHandlerFromAttribute(context, HtmlPush.ON_DATA_AVAILABLE);
+ handlersChain.addBehaviors(context, HtmlPush.DATA_AVAILABLE);
+
+ if (!handlersChain.hasSubmittingBehavior()) {
+ JSFunction ajaxFunction = AjaxRendererUtils
+ .buildAjaxFunction(context, push, AjaxRendererUtils.AJAX_FUNCTION_NAME);
+ AjaxEventOptions eventOptions = AjaxRendererUtils.buildEventOptions(context, push);
+ if (!eventOptions.isEmpty()) {
+ ajaxFunction.addParameter(eventOptions);
+ }
+ handlersChain.addInlineHandlerAsValue(context, ajaxFunction.toScript());
+ }
+
+ String handler = handlersChain.toScript();
+
+ if (handler != null) {
+ JSFunctionDefinition dataAvailableHandler = new JSFunctionDefinition(JSReference.EVENT);
+ dataAvailableHandler.addToBody(handler);
+ options.put(HtmlPush.ON_DATA_AVAILABLE, dataAvailableHandler);
+ }
+ function.addParameter(options);
+ script.append(function.toScript());
+ } else {
+ script.append("RichFaces.stopPush('").append(push.getListenerId(context)).append("')");
+ }
+ script.append(";\n");
+ writer.writeText(script.toString(), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
+ getUtils().encodeEndFormIfNessesary(context, component);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ protected Class<? extends UIComponent> getComponentClass() {
+ // only push component is allowed.
+ return UIPush.class;
+ }
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+
+ UIPush push = (UIPush) component;
+ if (push.isEnabled()) {
+ Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
+ if (requestParameterMap.get(push.getClientId(context)) != null || push.isHasActiveBehavior()) {
+ new ActionEvent(push).queue();
+ }
+ }
+ }
+
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxStatusRenderer.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -21,16 +21,6 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.HandlersChain;
import org.ajax4jsf.renderkit.RendererBase;
@@ -40,193 +30,201 @@
import org.richfaces.component.UIAjaxStatus;
import org.richfaces.component.util.HtmlUtil;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author Nick Belaevski
- *
*/
-@ResourceDependencies( {
- @ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(name = "jquery.js"),
- @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name = "richfaces-queue.js") })
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-queue.js")})
public class AjaxStatusRenderer extends RendererBase {
- private static final String START = "start";
- private static final String STOP = "stop";
- private static final String ERROR = "error";
+ private static final String START = "start";
+ private static final String STOP = "stop";
+ private static final String ERROR = "error";
- private static final String[] EVENT_NAMES = {
- "start", "stop", "error", "success"
- };
+ private static final String[] EVENT_NAMES = {
+ "start", "stop", "error", "success"
+ };
- private static enum StatusState {
- // NOTE: states encode order is important for script!
- start(START),
- error(ERROR) {
- {
- this.setOptional();
- }
- },
- stop(STOP) {
- {
- this.setInitial();
- }
- };
+ private static enum StatusState {
+ // NOTE: states encode order is important for script!
+ start(START),
+ error(ERROR) {
+ {
+ this.setOptional();
+ }
+ },
+ stop(STOP) {
+ {
+ this.setInitial();
+ }
+ };
- private String stateName;
+ private String stateName;
- private String styleAttributeName;
+ private String styleAttributeName;
- private String styleClassAttributeName;
+ private String styleClassAttributeName;
- private String textAttributeName;
+ private String textAttributeName;
- private String defaultStyleClass;
+ private String defaultStyleClass;
- private boolean initial;
+ private boolean initial;
- private boolean optional;
+ private boolean optional;
- private StatusState(String stateName) {
- this.stateName = stateName;
- this.styleAttributeName = stateName + "Style";
- this.styleClassAttributeName = stateName + "StyleClass";
- this.textAttributeName = stateName + "Text";
- this.defaultStyleClass = "rich-status-" + stateName;
- }
+ private StatusState(String stateName) {
+ this.stateName = stateName;
+ this.styleAttributeName = stateName + "Style";
+ this.styleClassAttributeName = stateName + "StyleClass";
+ this.textAttributeName = stateName + "Text";
+ this.defaultStyleClass = "rich-status-" + stateName;
+ }
- public String getStyleAttributeName() {
- return styleAttributeName;
- }
+ public String getStyleAttributeName() {
+ return styleAttributeName;
+ }
- public String getStyleClassAttributeName() {
- return styleClassAttributeName;
- }
+ public String getStyleClassAttributeName() {
+ return styleClassAttributeName;
+ }
- public String getFacetName() {
- return stateName;
- }
+ public String getFacetName() {
+ return stateName;
+ }
- public String getTextAttributeName() {
- return textAttributeName;
- }
+ public String getTextAttributeName() {
+ return textAttributeName;
+ }
- public String getDefaultStyleClass() {
- return defaultStyleClass;
- }
+ public String getDefaultStyleClass() {
+ return defaultStyleClass;
+ }
- public boolean isInitial() {
- return initial;
- }
+ public boolean isInitial() {
+ return initial;
+ }
- public boolean isOptional() {
- return optional;
- }
+ public boolean isOptional() {
+ return optional;
+ }
- protected void setOptional() {
- this.optional = true;
- }
+ protected void setOptional() {
+ this.optional = true;
+ }
- protected void setInitial() {
- this.initial = true;
- }
- }
+ protected void setInitial() {
+ this.initial = true;
+ }
+ }
- private RendererUtils rendererUtils = RendererUtils.getInstance();
+ private RendererUtils rendererUtils = RendererUtils.getInstance();
- protected void encodeState(FacesContext facesContext, UIAjaxStatus status,
- StatusState state) throws IOException {
+ protected void encodeState(FacesContext facesContext, UIAjaxStatus status,
+ StatusState state) throws IOException {
- Map<String, Object> statusAttributes = status.getAttributes();
- UIComponent stateFacet = status.getFacet(state.getFacetName());
- String stateText = null;
-
- if (stateFacet == null) {
- stateText = (String) statusAttributes.get(state.getTextAttributeName());
- }
-
- if (state.isOptional() && stateFacet == null && stateText == null) {
- return ;
- }
-
- ResponseWriter writer = facesContext.getResponseWriter();
- writer.startElement(HTML.SPAN_ELEM, status);
+ Map<String, Object> statusAttributes = status.getAttributes();
+ UIComponent stateFacet = status.getFacet(state.getFacetName());
+ String stateText = null;
- String stateStyle = (String) statusAttributes.get(state.getStyleAttributeName());
+ if (stateFacet == null) {
+ stateText = (String) statusAttributes.get(state.getTextAttributeName());
+ }
- rendererUtils.writeAttribute(writer, HTML.STYLE_ATTRIBUTE,
- HtmlUtil.concatStyles(stateStyle,
- state.isInitial() ? null : "display:none")
- );
+ if (state.isOptional() && stateFacet == null && stateText == null) {
+ return;
+ }
- String stateStyleClass = (String) statusAttributes.get(state.getStyleClassAttributeName());
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HTML.SPAN_ELEM, status);
- rendererUtils.writeAttribute(writer, HTML.CLASS_ATTRIBUTE,
- HtmlUtil.concatClasses(state.getDefaultStyleClass(),
- stateStyleClass));
+ String stateStyle = (String) statusAttributes.get(state.getStyleAttributeName());
- if (stateFacet != null && stateFacet.isRendered()) {
- stateFacet.encodeAll(facesContext);
- } else {
- if (stateText != null) {
- writer.writeText(stateText, null);
- }
- }
+ rendererUtils.writeAttribute(writer, HTML.STYLE_ATTRIBUTE,
+ HtmlUtil.concatStyles(stateStyle,
+ state.isInitial() ? null : "display:none")
+ );
- writer.endElement(HTML.SPAN_ELEM);
- }
+ String stateStyleClass = (String) statusAttributes.get(state.getStyleClassAttributeName());
- @Override
- public void encodeEnd(FacesContext context, UIComponent component)
- throws IOException {
- super.encodeEnd(context, component);
+ rendererUtils.writeAttribute(writer, HTML.CLASS_ATTRIBUTE,
+ HtmlUtil.concatClasses(state.getDefaultStyleClass(),
+ stateStyleClass));
- UIAjaxStatus ajaxStatus = (UIAjaxStatus) component;
- ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.SPAN_ELEM, component);
- String clientId = component.getClientId(context);
- writer.writeAttribute(HTML.ID_ATTRIBUTE, clientId, "id");
+ if (stateFacet != null && stateFacet.isRendered()) {
+ stateFacet.encodeAll(facesContext);
+ } else {
+ if (stateText != null) {
+ writer.writeText(stateText, null);
+ }
+ }
- for (StatusState state : StatusState.values()) {
- encodeState(context, ajaxStatus, state);
- }
+ writer.endElement(HTML.SPAN_ELEM);
+ }
- writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeAttribute(HTML.TYPE_ATTR, HTML.TEXT_JAVASCRIPT_TYPE, null);
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeEnd(context, component);
- JSFunction statusConstructor = new JSFunction("new RichFaces.status",
- clientId);
+ UIAjaxStatus ajaxStatus = (UIAjaxStatus) component;
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SPAN_ELEM, component);
+ String clientId = component.getClientId(context);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, clientId, "id");
- Map<String, Object> options = new HashMap<String, Object>();
+ for (StatusState state : StatusState.values()) {
+ encodeState(context, ajaxStatus, state);
+ }
- Map<String, Object> attributes = ajaxStatus.getAttributes();
- for (String eventName : EVENT_NAMES) {
- String eventAttribute = "on" + eventName;
- HandlersChain handlersChain = new HandlersChain(component, true);
- handlersChain.addInlineHandlerFromAttribute(context, eventAttribute);
- handlersChain.addBehaviors(context, eventName);
- rendererUtils.addToScriptHash(options, eventAttribute,
- handlersChain.toScript(), null,
- ScriptHashVariableWrapper.EVENT_HANDLER);
- }
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute(HTML.TYPE_ATTR, HTML.TEXT_JAVASCRIPT_TYPE, null);
- rendererUtils.addToScriptHash(options, "statusName", attributes.get("name"));
-
- if (!options.isEmpty()) {
- statusConstructor.addParameter(options);
- }
+ JSFunction statusConstructor = new JSFunction("new RichFaces.status",
+ clientId);
- writer.writeText(statusConstructor.toScript(), null);
- writer.endElement(HTML.SCRIPT_ELEM);
+ Map<String, Object> options = new HashMap<String, Object>();
- writer.endElement(HTML.SPAN_ELEM);
- }
+ Map<String, Object> attributes = ajaxStatus.getAttributes();
+ for (String eventName : EVENT_NAMES) {
+ String eventAttribute = "on" + eventName;
+ HandlersChain handlersChain = new HandlersChain(component, true);
+ handlersChain.addInlineHandlerFromAttribute(context, eventAttribute);
+ handlersChain.addBehaviors(context, eventName);
+ rendererUtils.addToScriptHash(options, eventAttribute,
+ handlersChain.toScript(), null,
+ ScriptHashVariableWrapper.EVENT_HANDLER);
+ }
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
- @Override
- protected Class<? extends UIComponent> getComponentClass() {
- return UIAjaxStatus.class;
- }
+ rendererUtils.addToScriptHash(options, "statusName", attributes.get("name"));
+
+ if (!options.isEmpty()) {
+ statusConstructor.addParameter(options);
+ }
+
+ writer.writeText(statusConstructor.toScript(), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
+
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIAjaxStatus.class;
+ }
}
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java 2009-12-04 20:53:17 UTC (rev 16073)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java 2009-12-04 20:54:42 UTC (rev 16074)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import org.richfaces.component.PushEventTracker;
@@ -40,8 +38,8 @@
//TODO make this a singleton
public class PushResource extends AbstractBaseResource {
-
- @Override
+
+ @Override
public boolean isCacheable(FacesContext context) {
return false;
}
14 years, 5 months
JBoss Rich Faces SVN: r16073 - in root/framework/trunk/impl/src/main/java/org/richfaces: renderkit and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:53:17 -0500 (Fri, 04 Dec 2009)
New Revision: 16073
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java
root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/AttributeParametersEncoder.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/Expression.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/InputRendererBase.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptions.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptionsContributor.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/Base2WayGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonDisabledBackgroundImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientType.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonBgImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonPressedBgImage.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceUtils.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/BaseSkinImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/DefaultSkinImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/DummySkinConfiguration.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/ThemeImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/skin/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/CollectionsUtils.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/RequestStateManager.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,15 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces;
/**
* Vendor and version information for A4J project
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author$)
* @version $Revision$ $Date$
- *
*/
public class VersionBean {
public static final int MAJOR_VERSION = 4;
@@ -72,13 +70,13 @@
/**
* Class for incapsulate version info.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author$)
* @version $Revision$ $Date$
- *
*/
public static class Version {
public static final String VERSION_INFO = "v." + MAJOR_VERSION + '.' + MINOR_VERSION + '.' + REVISION
- + SCM_REVISION;
+ + SCM_REVISION;
public static final String RESOURCE_VERSION_INFO = MAJOR_VERSION + "_" + MINOR_VERSION + "_" + REVISION;
public int getMajor() {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Base package for RichFaces classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/AttributeParametersEncoder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/AttributeParametersEncoder.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/AttributeParametersEncoder.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
-import java.io.IOException;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import java.io.IOException;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 30.01.2007
- *
+ * created 30.01.2007
*/
public interface AttributeParametersEncoder {
public void doEncode(FacesContext context, UIComponent component) throws IOException;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,25 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import org.ajax4jsf.renderkit.AjaxChildrenRenderer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import java.io.IOException;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 18.12.2006
- *
+ * created 18.12.2006
*/
public abstract class CompositeRenderer extends AjaxChildrenRenderer {
private static final Command MERGE_OPTIONS_COMMAND = new Command() {
@@ -93,15 +88,15 @@
}
protected String getScriptContributions(String varString, FacesContext context, UIComponent component,
- Class<?> acceptableClass) {
+ Class<?> acceptableClass) {
List<String> scriptContributions = new ArrayList<String>();
GET_SCRIPT_CONTRIBUTIONS.execute(renderers.iterator(), context, component, scriptContributions,
- acceptableClass);
+ acceptableClass);
StringBuffer result = new StringBuffer();
- for (Iterator<String> itr = scriptContributions.iterator(); itr.hasNext(); ) {
+ for (Iterator<String> itr = scriptContributions.iterator(); itr.hasNext();) {
result.append(varString);
result.append(itr.next());
}
@@ -127,7 +122,7 @@
}
public void encodeAttributeParameters(FacesContext context, UIComponent component) throws IOException {
- for (Iterator<AttributeParametersEncoder> iterator = parameterEncoders.iterator(); iterator.hasNext(); ) {
+ for (Iterator<AttributeParametersEncoder> iterator = parameterEncoders.iterator(); iterator.hasNext();) {
AttributeParametersEncoder encoder = iterator.next();
encoder.doEncode(context, component);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/Expression.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/Expression.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/Expression.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
/**
* @author Nick Belaevski - mailto:nbelaevski@exadel.com
- * created 20.06.2007
- *
+ * created 20.06.2007
*/
public class Expression {
private Object expression;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/InputRendererBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/InputRendererBase.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/InputRendererBase.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,25 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
import org.ajax4jsf.util.SelectUtils;
-import java.util.Map;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
+import java.util.Map;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 23.01.2007
- *
+ * created 23.01.2007
*/
public class InputRendererBase extends AjaxComponentRendererBase {
protected Class getComponentClass() {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/MacroDefinitionJSContentHandler.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import org.richfaces.javacc.RichMacroDefinition;
import org.richfaces.json.JSContentHandler;
-
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -33,14 +30,12 @@
import java.io.IOException;
import java.io.StringReader;
import java.io.Writer;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author Nick Belaevski - mailto:nbelaevski@exadel.com created 21.06.2007
- *
*/
public class MacroDefinitionJSContentHandler extends JSContentHandler {
private String epilog;
@@ -80,7 +75,7 @@
List<?> parsedExpressiion = parseExpressiion(string);
boolean isExpression = false;
- for (Iterator<?> iterator = parsedExpressiion.iterator(); iterator.hasNext(); ) {
+ for (Iterator<?> iterator = parsedExpressiion.iterator(); iterator.hasNext();) {
Object next = (Object) iterator.next();
if (next instanceof Expression) {
@@ -96,7 +91,7 @@
boolean first = true;
- for (Iterator<?> iterator = parsedExpressiion.iterator(); iterator.hasNext(); ) {
+ for (Iterator<?> iterator = parsedExpressiion.iterator(); iterator.hasNext();) {
Object next = (Object) iterator.next();
if (next == null) {
@@ -144,7 +139,7 @@
try {
List<?> parsedExpression = parseExpressiion(new String(ch, start, length));
- for (Iterator<?> iterator = parsedExpression.iterator(); iterator.hasNext(); ) {
+ for (Iterator<?> iterator = parsedExpression.iterator(); iterator.hasNext();) {
Object next = iterator.next();
if (next instanceof Expression) {
@@ -209,8 +204,8 @@
/**
* Writer will not output duplicate commas
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
static class WellFormedWriter extends FilterWriter {
private char lastChar;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import javax.faces.component.UIComponent;
@@ -28,8 +26,7 @@
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 18.12.2006
- *
+ * created 18.12.2006
*/
public interface RendererContributor extends ScriptOptionsContributor {
public String getScriptContribution(FacesContext context, UIComponent component);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptions.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptions.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptions.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,24 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.ScriptStringBase;
import org.ajax4jsf.javascript.ScriptUtils;
+import javax.faces.component.UIComponent;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
-import javax.faces.component.UIComponent;
-
/**
* @author Maksim Kaszynski
- *
*/
public class ScriptOptions extends ScriptStringBase {
protected Map<String, Object> opts = new HashMap<String, Object>();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptionsContributor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptionsContributor.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/ScriptOptionsContributor.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import javax.faces.component.UIComponent;
@@ -28,13 +26,13 @@
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 18.12.2006
- *
+ * created 18.12.2006
*/
public interface ScriptOptionsContributor {
/**
* Create script options if component class is known for renderer to contribute
+ *
* @param context
* @param component
* @return Built {@link ScriptOptions} instance or null if component is not acceptable
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,28 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit;
import org.ajax4jsf.io.SAXResponseWriter;
import org.ajax4jsf.renderkit.RendererBase;
-
import org.richfaces.component.TemplateComponent;
-
import org.xml.sax.ContentHandler;
-import java.io.IOException;
-import java.io.Writer;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.io.Writer;
/**
* @author Nick Belaevski - mailto:nbelaevski@exadel.com
- * created 22.06.2007
- *
+ * created 22.06.2007
*/
public abstract class TemplateEncoderRendererBase extends RendererBase {
public final boolean getRendersChildren() {
@@ -94,7 +88,7 @@
writer.write("var evaluator = ");
writeScriptBody(context, component, true);
writer.write(";\n new Insertion.Top($('" + component.getClientId(context)
- + "'), evaluator.invoke('getContent', window).join(''));");
+ + "'), evaluator.invoke('getContent', window).join(''));");
writer.endElement("script");
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/Base2WayGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/Base2WayGradient.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/Base2WayGradient.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
*
*/
@@ -13,7 +12,6 @@
/**
* @author asmirnov
- *
*/
public class Base2WayGradient extends BaseGradient {
@@ -147,8 +145,8 @@
protected void drawBackGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height) {
if (colors != null) {
GradientPaint gragient = new GradientPaint(0, (float) (rectangle.getHeight() - height),
- colors.getBottomColor(), 0, (float) rectangle.getHeight(),
- colors.getTopColor());
+ colors.getBottomColor(), 0, (float) rectangle.getHeight(),
+ colors.getTopColor());
g2d.setPaint(gragient);
g2d.fill(rectangle);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,16 +21,6 @@
package org.richfaces.renderkit.html;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.HtmlDimensions;
@@ -41,267 +31,273 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
+import javax.faces.context.FacesContext;
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 02.02.2007
- *
+ * created 02.02.2007
*/
public class BaseGradient extends Java2Dresource {
- private final int width;
- private final int height;
- private final int gradientHeight;
- private final String baseColor;
- private final String gradientColor;
- private final boolean horizontal;
+ protected Integer headerBackgroundColor;
+ protected Integer headerGradientColor;
+ protected GradientType gradientType;
- protected Integer headerBackgroundColor;
- protected Integer headerGradientColor;
- protected GradientType gradientType;
+ private final int width;
+ private final int height;
+ private final int gradientHeight;
+ private final String baseColor;
+ private final String gradientColor;
+ private final boolean horizontal;
- private void initialize() {
- FacesContext context = FacesContext.getCurrentInstance();
-
- Integer baseIntColor = null;
- Integer headerIntColor = null;
- String gradientTypeString = null;
+ public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor,
+ boolean horizontal) {
+ super(ImageType.PNG);
+ this.width = width;
+ this.height = height;
+ this.gradientHeight = gradientHeight;
+ this.baseColor = baseColor != null ? baseColor : Skin.HEADER_BACKGROUND_COLOR;
+ this.gradientColor = gradientColor != null ? gradientColor : Skin.HEADER_GRADIENT_COLOR;
+ this.horizontal = horizontal;
- if (baseIntColor == null) {
- baseIntColor = getColorValueParameter(context, baseColor, false);
- }
+ initialize();
+ }
- if (headerIntColor == null) {
- headerIntColor = getColorValueParameter(context, gradientColor, false);
- }
+ public BaseGradient(int width, int height, int gradientHeight) {
+ this(width, height, gradientHeight, null, null, false);
+ }
- if (!(baseIntColor == null && headerIntColor == null)) {
- if (baseIntColor == null) {
- baseIntColor = getColorValueParameter(context, baseColor, true);
- }
+ public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor) {
+ this(width, height, gradientHeight, baseColor, gradientColor, false);
+ }
- if (headerIntColor == null) {
- headerIntColor = getColorValueParameter(context, gradientColor, true);
- }
- }
+ public BaseGradient(int width, int height) {
+ this(width, height, height);
+ }
- this.headerBackgroundColor = baseIntColor;
- this.headerGradientColor = headerIntColor;
+ public BaseGradient(int width, int height, String baseColor, String gradientColor) {
+ this(width, height, height, baseColor, gradientColor);
+ }
- if (gradientTypeString == null || gradientTypeString.length() == 0) {
- gradientTypeString = getValueParameter(context, Skin.GRADIENT_TYPE);
- }
+ public BaseGradient() {
+ this(30, 50, 20);
+ }
- this.gradientType = GradientType.getByParameter(gradientTypeString);
- }
-
- public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor, boolean horizontal) {
- super(ImageType.PNG);
- this.width = width;
- this.height = height;
- this.gradientHeight = gradientHeight;
- this.baseColor = baseColor != null ? baseColor : Skin.HEADER_BACKGROUND_COLOR;
- this.gradientColor = gradientColor != null ? gradientColor : Skin.HEADER_GRADIENT_COLOR;
- this.horizontal = horizontal;
+ public BaseGradient(String baseColor, String gradientColor) {
+ this(30, 50, 20, baseColor, gradientColor);
+ }
- initialize();
- }
+ public BaseGradient(int width, int height, int gradientHeight, boolean horizontal) {
+ this(width, height, gradientHeight, null, null, horizontal);
+ }
- public BaseGradient(int width, int height, int gradientHeight) {
- this(width, height, gradientHeight, null, null, false);
- }
+ public BaseGradient(int width, int height, boolean horizontal) {
+ this(width, height, horizontal ? width : height, null, null, horizontal);
+ }
- public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor) {
- this(width, height, gradientHeight, baseColor, gradientColor, false);
- }
+ public BaseGradient(int width, int height, String baseColor, String gradientColor, boolean horizontal) {
+ this(width, height, horizontal ? width : height, baseColor, gradientColor, horizontal);
+ }
- public BaseGradient(int width, int height) {
- this(width, height, height);
- }
+ public BaseGradient(boolean horizontal) {
+ this(30, 50, 20, null, null, horizontal);
+ }
- public BaseGradient(int width, int height, String baseColor, String gradientColor) {
- this(width, height, height, baseColor, gradientColor);
- }
+ public BaseGradient(String baseColor, String gradientColor, boolean horizontal) {
+ this(30, 50, 20, baseColor, gradientColor, horizontal);
+ }
- public BaseGradient() {
- this(30, 50, 20);
- }
+ private void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
- public BaseGradient(String baseColor, String gradientColor) {
- this(30, 50, 20, baseColor, gradientColor);
- }
+ Integer baseIntColor = null;
+ Integer headerIntColor = null;
+ String gradientTypeString = null;
- public BaseGradient(int width, int height, int gradientHeight, boolean horizontal) {
- this(width, height, gradientHeight, null, null, horizontal);
- }
+ if (baseIntColor == null) {
+ baseIntColor = getColorValueParameter(context, baseColor, false);
+ }
- public BaseGradient(int width, int height, boolean horizontal) {
- this(width, height, horizontal ? width : height, null, null, horizontal);
- }
+ if (headerIntColor == null) {
+ headerIntColor = getColorValueParameter(context, gradientColor, false);
+ }
- public BaseGradient(int width, int height, String baseColor, String gradientColor, boolean horizontal) {
- this(width, height, horizontal ? width : height, baseColor, gradientColor, horizontal);
- }
+ if (!(baseIntColor == null && headerIntColor == null)) {
+ if (baseIntColor == null) {
+ baseIntColor = getColorValueParameter(context, baseColor, true);
+ }
- public BaseGradient(boolean horizontal) {
- this(30, 50, 20, null, null, horizontal);
- }
+ if (headerIntColor == null) {
+ headerIntColor = getColorValueParameter(context, gradientColor, true);
+ }
+ }
- public BaseGradient(String baseColor, String gradientColor, boolean horizontal) {
- this(30, 50, 20, baseColor, gradientColor, horizontal);
- }
+ this.headerBackgroundColor = baseIntColor;
+ this.headerGradientColor = headerIntColor;
- public Dimension getDimension() {
- return new Dimension(width, height);
- }
+ if (gradientTypeString == null || gradientTypeString.length() == 0) {
+ gradientTypeString = getValueParameter(context, Skin.GRADIENT_TYPE);
+ }
- /**
- * @return the gradientHeight
- */
- protected int getGradientHeight() {
- return gradientHeight;
- }
+ this.gradientType = GradientType.getByParameter(gradientTypeString);
+ }
- /**
- * @return the baseColor
- */
- protected String getBaseColor() {
- return baseColor;
- }
+ public Dimension getDimension() {
+ return new Dimension(width, height);
+ }
- /**
- * @return the gradientColor
- */
- protected String getGradientColor() {
- return gradientColor;
- }
+ /**
+ * @return the gradientHeight
+ */
+ protected int getGradientHeight() {
+ return gradientHeight;
+ }
- /**
- * @return the horizontal
- */
- protected boolean isHorizontal() {
- return horizontal;
- }
+ /**
+ * @return the baseColor
+ */
+ protected String getBaseColor() {
+ return baseColor;
+ }
- protected void drawGradient(Graphics2D g2d, Shape shape, BiColor colors, int height) {
- if (colors != null) {
- GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
- g2d.setPaint(gragient);
- g2d.fill(shape);
- }
- }
+ /**
+ * @return the gradientColor
+ */
+ protected String getGradientColor() {
+ return gradientColor;
+ }
- @Override
- protected void paint(Graphics2D graphics2d, Dimension dimension) {
- super.paint(graphics2d, dimension);
+ /**
+ * @return the horizontal
+ */
+ protected boolean isHorizontal() {
+ return horizontal;
+ }
- graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- graphics2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+ protected void drawGradient(Graphics2D g2d, Shape shape, BiColor colors, int height) {
+ if (colors != null) {
+ GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
+ g2d.setPaint(gragient);
+ g2d.fill(shape);
+ }
+ }
- graphics2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- graphics2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- graphics2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+ @Override
+ protected void paint(Graphics2D graphics2d, Dimension dimension) {
+ super.paint(graphics2d, dimension);
- paintGradient(graphics2d, dimension);
- }
-
- /**
- * @param g2d
- * @param data
- */
- protected void paintGradient(Graphics2D g2d, Dimension dim) {
- if ((headerBackgroundColor != null || headerGradientColor != null) && gradientType != null) {
- BiColor biColor = new GradientType.BiColor(headerBackgroundColor, headerGradientColor);
+ graphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ graphics2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
- BiColor firstLayer = gradientType.getFirstLayerColors(biColor);
- BiColor secondLayer = gradientType.getSecondLayerColors(biColor);
+ graphics2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
+ RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ graphics2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ graphics2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
- if (horizontal) {
- //x -> y, y -> x
- g2d.transform(new AffineTransform(0, 1, 1, 0, 0, 0));
- dim.setSize(dim.height, dim.width);
- }
+ paintGradient(graphics2d, dimension);
+ }
- int localGradientHeight = this.gradientHeight;
- if (localGradientHeight < 0) {
- localGradientHeight = dim.height;
- }
+ /**
+ * @param g2d
+ * @param dim
+ */
+ protected void paintGradient(Graphics2D g2d, Dimension dim) {
+ if ((headerBackgroundColor != null || headerGradientColor != null) && gradientType != null) {
+ BiColor biColor = new GradientType.BiColor(headerBackgroundColor, headerGradientColor);
- Rectangle2D rect = new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- dim.height);
+ BiColor firstLayer = gradientType.getFirstLayerColors(biColor);
+ BiColor secondLayer = gradientType.getSecondLayerColors(biColor);
- drawGradient(g2d, rect, firstLayer, localGradientHeight);
+ if (horizontal) {
+ //x -> y, y -> x
+ g2d.transform(new AffineTransform(0, 1, 1, 0, 0, 0));
+ dim.setSize(dim.height, dim.width);
+ }
- int smallGradientHeight = localGradientHeight / 2;
+ int localGradientHeight = this.gradientHeight;
+ if (localGradientHeight < 0) {
+ localGradientHeight = dim.height;
+ }
- rect = new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- smallGradientHeight);
+ Rectangle2D rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
- drawGradient(g2d, rect, secondLayer, smallGradientHeight);
- }
- }
+ drawGradient(g2d, rect, firstLayer, localGradientHeight);
- @Override
- protected void readState(FacesContext context, NumericDataInputStream stream) {
- super.readState(context, stream);
+ int smallGradientHeight = localGradientHeight / 2;
- this.headerBackgroundColor = stream.readInt();
- this.headerGradientColor = stream.readInt();
- this.gradientType = GradientType.values()[stream.readByte()];
- }
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ smallGradientHeight);
- @Override
- protected void writeState(FacesContext context,
- NumericDataOutputStream stream) {
- super.writeState(context, stream);
+ drawGradient(g2d, rect, secondLayer, smallGradientHeight);
+ }
+ }
- stream.writeInt(this.headerBackgroundColor);
- stream.writeInt(this.headerGradientColor);
- stream.writeByte((byte) this.gradientType.ordinal());
- }
-
- private Integer decodeColor(String value) {
- if (value !=null && value.length() != 0) {
- return Integer.valueOf(HtmlColor.decode(value).getRGB());
- } else {
- return null;
- }
- }
+ @Override
+ protected void readState(FacesContext context, NumericDataInputStream stream) {
+ super.readState(context, stream);
- public boolean isCacheable() {
- return true;
- }
+ this.headerBackgroundColor = stream.readInt();
+ this.headerGradientColor = stream.readInt();
+ this.gradientType = GradientType.values()[stream.readByte()];
+ }
- protected String getValueParameter(FacesContext context, String name) {
- SkinFactory skinFactory = SkinFactory.getInstance();
+ @Override
+ protected void writeState(FacesContext context,
+ NumericDataOutputStream stream) {
+ super.writeState(context, stream);
- Skin skin = skinFactory.getSkin(context);
- String value = (String) skin.getParameter(context, name);
+ stream.writeInt(this.headerBackgroundColor);
+ stream.writeInt(this.headerGradientColor);
+ stream.writeByte((byte) this.gradientType.ordinal());
+ }
- if (value == null || value.length() == 0) {
- skin = skinFactory.getDefaultSkin(context);
- value = (String) skin.getParameter(context, name);
- }
+ private Integer decodeColor(String value) {
+ if (value != null && value.length() != 0) {
+ return Integer.valueOf(HtmlColor.decode(value).getRGB());
+ } else {
+ return null;
+ }
+ }
- return value;
- }
+ public boolean isCacheable() {
+ return true;
+ }
- protected Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
- Skin skin;
- if (useDefault) {
- skin = SkinFactory.getInstance().getDefaultSkin(context);
- } else {
- skin = SkinFactory.getInstance().getSkin(context);
- }
+ protected String getValueParameter(FacesContext context, String name) {
+ SkinFactory skinFactory = SkinFactory.getInstance();
- return decodeColor((String) skin.getParameter(context,name));
- }
+ Skin skin = skinFactory.getSkin(context);
+ String value = (String) skin.getParameter(context, name);
+ if (value == null || value.length() == 0) {
+ skin = skinFactory.getDefaultSkin(context);
+ value = (String) skin.getParameter(context, name);
+ }
+
+ return value;
+ }
+
+ protected Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
+ Skin skin;
+ if (useDefault) {
+ skin = SkinFactory.getInstance().getDefaultSkin(context);
+ } else {
+ skin = SkinFactory.getInstance().getSkin(context);
+ }
+
+ return decodeColor((String) skin.getParameter(context, name));
+ }
+
protected Integer getHeight(FacesContext context, String heightParamName) {
SkinFactory skinFactory = SkinFactory.getInstance();
Skin skin = skinFactory.getSkin(context);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,16 +21,6 @@
package org.richfaces.renderkit.html;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.NumericDataInputStream;
@@ -40,216 +30,219 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
+import javax.faces.context.FacesContext;
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 02.02.2007
- *
+ * created 02.02.2007
*/
public class CustomizeableGradient extends Java2Dresource {
- protected Dimension dimension = new Dimension(20, 500);
+ protected Dimension dimension = new Dimension(20, 500);
- protected Integer gradientColor;
- protected Integer baseColor;
- protected Integer gradientHeight = 22;
+ protected Integer gradientColor;
+ protected Integer baseColor;
+ protected Integer gradientHeight = 22;
- protected GradientType gradientType;
- protected GradientAlignment gradientAlignment;
+ protected GradientType gradientType;
+ protected GradientAlignment gradientAlignment;
- public CustomizeableGradient() {
- super(ImageType.PNG);
-
- String gradientTypeString = safeTrim(getValueParameter(FacesContext.getCurrentInstance(), Skin.GRADIENT_TYPE));
- if (gradientTypeString != null && gradientTypeString.length() != 0) {
- gradientType = GradientType.getByParameter(gradientTypeString);
- }
- }
+ public CustomizeableGradient() {
+ super(ImageType.PNG);
- public Dimension getDimension() {
- return dimension;
- }
+ String gradientTypeString = safeTrim(getValueParameter(FacesContext.getCurrentInstance(), Skin.GRADIENT_TYPE));
+ if (gradientTypeString != null && gradientTypeString.length() != 0) {
+ gradientType = GradientType.getByParameter(gradientTypeString);
+ }
+ }
- private void drawRectangle(Graphics2D g2d, Rectangle2D rect, BiColor biColor, boolean useTop) {
- if (biColor != null) {
- Color color = useTop ? biColor.getTopColor() : biColor.getBottomColor();
- g2d.setColor(color);
- g2d.fill(rect);
- }
- }
+ public Dimension getDimension() {
+ return dimension;
+ }
- private void drawGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height) {
- if (colors != null) {
- GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
- g2d.setPaint(gragient);
- g2d.fill(rectangle);
- }
- }
+ private void drawRectangle(Graphics2D g2d, Rectangle2D rect, BiColor biColor, boolean useTop) {
+ if (biColor != null) {
+ Color color = useTop ? biColor.getTopColor() : biColor.getBottomColor();
+ g2d.setColor(color);
+ g2d.fill(rect);
+ }
+ }
- protected void paint(Graphics2D g2d, Dimension dim) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+ private void drawGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height) {
+ if (colors != null) {
+ GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
+ g2d.setPaint(gragient);
+ g2d.fill(rectangle);
+ }
+ }
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+ protected void paint(Graphics2D g2d, Dimension dim) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
- if ((gradientColor != null || baseColor != null) && gradientType != null &&
- gradientAlignment != null) {
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
- paintGradient(g2d, dim);
- }
- }
+ if ((gradientColor != null || baseColor != null) && gradientType != null
+ && gradientAlignment != null) {
- protected void paintGradient(Graphics2D g2d, Dimension dim) {
- BiColor biColor = new GradientType.BiColor(gradientColor, baseColor);
- BiColor firstLayer = gradientType.getFirstLayerColors(biColor);
- BiColor secondLayer = gradientType.getSecondLayerColors(biColor);
+ paintGradient(g2d, dim);
+ }
+ }
- Rectangle2D rect =
- new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- dim.height);
+ protected void paintGradient(Graphics2D g2d, Dimension dim) {
+ BiColor biColor = new GradientType.BiColor(gradientColor, baseColor);
+ BiColor firstLayer = gradientType.getFirstLayerColors(biColor);
+ BiColor secondLayer = gradientType.getSecondLayerColors(biColor);
- int topRectangleHeight = gradientAlignment.getTopRectangleHeight(dim.height, gradientHeight);
- int bottomRectangleHeight = gradientAlignment.getBottomRectangleHeight(dim.height, gradientHeight);
+ Rectangle2D rect =
+ new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
- rect = new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- topRectangleHeight);
+ int topRectangleHeight = gradientAlignment.getTopRectangleHeight(dim.height, gradientHeight);
+ int bottomRectangleHeight = gradientAlignment.getBottomRectangleHeight(dim.height, gradientHeight);
- drawRectangle(g2d, rect, firstLayer, true);
- drawRectangle(g2d, rect, secondLayer, true);
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ topRectangleHeight);
- rect = new Rectangle2D.Float(
- 0,
- dim.height - bottomRectangleHeight,
- dim.width,
- dim.height);
+ drawRectangle(g2d, rect, firstLayer, true);
+ drawRectangle(g2d, rect, secondLayer, true);
- drawRectangle(g2d, rect, firstLayer, false);
- drawRectangle(g2d, rect, secondLayer, false);
+ rect = new Rectangle2D.Float(
+ 0,
+ dim.height - bottomRectangleHeight,
+ dim.width,
+ dim.height);
- g2d.transform(AffineTransform.getTranslateInstance(0, topRectangleHeight));
+ drawRectangle(g2d, rect, firstLayer, false);
+ drawRectangle(g2d, rect, secondLayer, false);
- rect = new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- dim.height);
+ g2d.transform(AffineTransform.getTranslateInstance(0, topRectangleHeight));
- drawGradient(g2d, rect, firstLayer, gradientHeight);
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
- rect = new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- gradientHeight / 2);
+ drawGradient(g2d, rect, firstLayer, gradientHeight);
- drawGradient(g2d, rect, secondLayer, gradientHeight / 2);
- }
-
- private Integer decodeColor(String value) {
- if (value !=null && value.length() != 0) {
- return Integer.valueOf(HtmlColor.decode(value).getRGB());
- } else {
- return null;
- }
- }
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ gradientHeight / 2);
- @Override
- protected void readState(FacesContext context, NumericDataInputStream stream) {
- super.readState(context, stream);
+ drawGradient(g2d, rect, secondLayer, gradientHeight / 2);
+ }
- this.baseColor = stream.readIntColor();
- this.gradientColor = stream.readIntColor();
- this.gradientHeight = stream.readInt();
- this.gradientAlignment = GradientAlignment.values()[stream.readByte()];
- this.gradientType = GradientType.values()[stream.readByte()];
- }
+ private Integer decodeColor(String value) {
+ if (value != null && value.length() != 0) {
+ return Integer.valueOf(HtmlColor.decode(value).getRGB());
+ } else {
+ return null;
+ }
+ }
- protected void writeState(FacesContext context, org.ajax4jsf.util.NumericDataOutputStream stream) {
- super.writeState(context, stream);
-
- stream.writeIntColor(this.baseColor);
- stream.writeIntColor(this.gradientColor);
- stream.writeInt(this.gradientHeight);
- stream.writeByte((byte) this.gradientAlignment.ordinal());
- stream.writeByte((byte) this.gradientType.ordinal());
- };
-
- protected static String safeTrim(String s) {
- return s != null ? s.trim() : null;
- }
+ @Override
+ protected void readState(FacesContext context, NumericDataInputStream stream) {
+ super.readState(context, stream);
- public boolean isCacheable() {
- return true;
- }
+ this.baseColor = stream.readIntColor();
+ this.gradientColor = stream.readIntColor();
+ this.gradientHeight = stream.readInt();
+ this.gradientAlignment = GradientAlignment.values()[stream.readByte()];
+ this.gradientType = GradientType.values()[stream.readByte()];
+ }
- protected String getValueParameter(FacesContext context, String name) {
- SkinFactory skinFactory = SkinFactory.getInstance();
+ protected void writeState(FacesContext context, org.ajax4jsf.util.NumericDataOutputStream stream) {
+ super.writeState(context, stream);
- Skin skin = skinFactory.getSkin(context);
- String value = (String) skin.getParameter(context, name);
+ stream.writeIntColor(this.baseColor);
+ stream.writeIntColor(this.gradientColor);
+ stream.writeInt(this.gradientHeight);
+ stream.writeByte((byte) this.gradientAlignment.ordinal());
+ stream.writeByte((byte) this.gradientType.ordinal());
+ }
- if (value == null || value.length() == 0) {
- skin = skinFactory.getDefaultSkin(context);
- value = (String) skin.getParameter(context, name);
- }
+ protected static String safeTrim(String s) {
+ return s != null ? s.trim() : null;
+ }
- return value;
- }
+ public boolean isCacheable() {
+ return true;
+ }
- public Integer getGradientColor() {
- return gradientColor;
- }
+ protected String getValueParameter(FacesContext context, String name) {
+ SkinFactory skinFactory = SkinFactory.getInstance();
- public void setGradientColor(Integer headerBackgroundColor) {
- this.gradientColor = headerBackgroundColor;
- }
+ Skin skin = skinFactory.getSkin(context);
+ String value = (String) skin.getParameter(context, name);
- public void setGradientColorString(String colorString) {
- setGradientColor(decodeColor(colorString));
- }
+ if (value == null || value.length() == 0) {
+ skin = skinFactory.getDefaultSkin(context);
+ value = (String) skin.getParameter(context, name);
+ }
- public Integer getBaseColor() {
- return baseColor;
- }
+ return value;
+ }
- public void setBaseColor(Integer headerGradientColor) {
- this.baseColor = headerGradientColor;
- }
-
- public void setBaseColorString(String colorString) {
- setBaseColor(decodeColor(colorString));
- }
-
- public GradientType getGradientType() {
- return gradientType;
- }
+ public Integer getGradientColor() {
+ return gradientColor;
+ }
- public void setGradientType(GradientType gradientType) {
- this.gradientType = gradientType;
- }
+ public void setGradientColor(Integer headerBackgroundColor) {
+ this.gradientColor = headerBackgroundColor;
+ }
- public GradientAlignment getGradientAlignment() {
- return gradientAlignment;
- }
+ public void setGradientColorString(String colorString) {
+ setGradientColor(decodeColor(colorString));
+ }
- public void setGradientAlignment(GradientAlignment gradientAlignment) {
- this.gradientAlignment = gradientAlignment;
- }
+ public Integer getBaseColor() {
+ return baseColor;
+ }
- public Integer getGradientHeight() {
- return gradientHeight;
- }
+ public void setBaseColor(Integer headerGradientColor) {
+ this.baseColor = headerGradientColor;
+ }
- public void setGradientHeight(Integer gradientHeight) {
- this.gradientHeight = gradientHeight;
- }
+ public void setBaseColorString(String colorString) {
+ setBaseColor(decodeColor(colorString));
+ }
+ public GradientType getGradientType() {
+ return gradientType;
+ }
+ public void setGradientType(GradientType gradientType) {
+ this.gradientType = gradientType;
+ }
+
+ public GradientAlignment getGradientAlignment() {
+ return gradientAlignment;
+ }
+
+ public void setGradientAlignment(GradientAlignment gradientAlignment) {
+ this.gradientAlignment = gradientAlignment;
+ }
+
+ public Integer getGradientHeight() {
+ return gradientHeight;
+ }
+
+ public void setGradientHeight(Integer gradientHeight) {
+ this.gradientHeight = gradientHeight;
+ }
+
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/GradientA.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html;
public class GradientA extends BaseGradient {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,18 +21,17 @@
package org.richfaces.renderkit.html.images;
-import java.awt.Dimension;
-
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.util.NumericDataInputStream;
import org.ajax4jsf.util.NumericDataOutputStream;
import org.richfaces.renderkit.html.BaseGradient;
import org.richfaces.skin.Skin;
+import javax.faces.context.FacesContext;
+import java.awt.*;
+
/**
* Created 23.02.2008
- *
+ *
* @author Nick Belaevski
* @since 3.2
*/
@@ -42,49 +41,49 @@
private static final Dimension DEFAULT_DIMENSION = new Dimension(1, 1);
private Dimension dimension = null;
-
- //TODO - lazy initialize?
- private Integer height = getHeight(FacesContext.getCurrentInstance(), Skin.GENERAL_SIZE_FONT);
- public BaseControlBackgroundImage(String baseColor, String gradientColor, int width) {
+ //TODO - lazy initialize?
+ private Integer height = getHeight(FacesContext.getCurrentInstance(), Skin.GENERAL_SIZE_FONT);
+
+ public BaseControlBackgroundImage(String baseColor, String gradientColor, int width) {
super(width, -1, baseColor, gradientColor);
}
@Override
public Dimension getDimension() {
- if (dimension != null) {
- return dimension;
- }
+ if (dimension != null) {
+ return dimension;
+ }
- return DEFAULT_DIMENSION;
+ return DEFAULT_DIMENSION;
}
-
+
@Override
protected void writeState(FacesContext context,
- NumericDataOutputStream stream) {
- super.writeState(context, stream);
-
- stream.writeInt(this.height);
+ NumericDataOutputStream stream) {
+ super.writeState(context, stream);
+
+ stream.writeInt(this.height);
}
@Override
protected void readState(FacesContext context, NumericDataInputStream stream) {
- super.readState(context, stream);
-
- this.height = stream.readInt();
+ super.readState(context, stream);
+
+ this.height = stream.readInt();
}
@Override
public void restoreState(FacesContext context, Object state) {
- super.restoreState(context, state);
-
- //TODO - create a special method?
- this.gradientType = GradientType.PLAIN;
+ super.restoreState(context, state);
+
+ //TODO - create a special method?
+ this.gradientType = GradientType.PLAIN;
}
@Override
public Object saveState(FacesContext context) {
- return super.saveState(context);
+ return super.saveState(context);
}
-
+
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonBackgroundImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -25,12 +25,13 @@
/**
* Created 23.02.2008
+ *
* @author Nick Belaevski
* @since 3.2
*/
public class ButtonBackgroundImage extends BaseControlBackgroundImage {
- public ButtonBackgroundImage() {
- super(Skin.HEADER_GRADIENT_COLOR, Skin.HEADER_BACKGROUND_COLOR, 1);
- }
+ public ButtonBackgroundImage() {
+ super(Skin.HEADER_GRADIENT_COLOR, Skin.HEADER_BACKGROUND_COLOR, 1);
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonDisabledBackgroundImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonDisabledBackgroundImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/ButtonDisabledBackgroundImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html.images;
/**
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,16 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html.images;
+import static java.lang.Math.max;
import java.util.Locale;
-import static java.lang.Math.max;
-
/**
* Created 22.04.2008
+ *
* @author Nick Belaevski
* @since 3.2
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientType.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientType.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/GradientType.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html.images;
-import java.awt.Color;
-
+import java.awt.*;
import java.util.Locale;
/**
* @author Nick Belaevski
* mailto:nbelaevski@exadel.com
* created 16.04.2008
- *
*/
public enum GradientType {
GLASS {
@@ -104,7 +100,7 @@
};
private static final BiColor WHITE = new BiColor(new Color(0xff, 0xff, 0xff, (int) (0.65f * 0xff)),
- new Color(0xff, 0xff, 0xff, (int) (0.20f * 0xff)));
+ new Color(0xff, 0xff, 0xff, (int) (0.20f * 0xff)));
public static final GradientType getByParameter(String string) {
if ((string == null) || (string.length() == 0)) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/InputBackgroundImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -25,14 +25,15 @@
/**
* Created 23.02.2008
+ *
* @author Nick Belaevski
* @since 3.2
*/
public class InputBackgroundImage extends BaseControlBackgroundImage {
- public InputBackgroundImage() {
- super(Skin.ADDITIONAL_BACKGROUND_COLOR, Skin.CONTROL_BACKGROUND_COLOR, 2000);
- }
+ public InputBackgroundImage() {
+ super(Skin.ADDITIONAL_BACKGROUND_COLOR, Skin.CONTROL_BACKGROUND_COLOR, 2000);
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonBgImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonBgImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonBgImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html.images;
import org.richfaces.skin.Skin;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonPressedBgImage.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonPressedBgImage.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/StandardButtonPressedBgImage.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.renderkit.html.images;
import org.richfaces.skin.Skin;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Control and background images
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/html/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* HTML-specific renderer classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/renderkit/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Classes participating in components rendering
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,39 +19,31 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import org.ajax4jsf.resource.InternetResource;
-
import org.richfaces.context.SingletonsContext;
import org.richfaces.log.RichfacesLogger;
+import static org.richfaces.resource.ResourceUtils.millisToSecond;
+import static org.richfaces.resource.ResourceUtils.secondToMillis;
import org.richfaces.util.Util;
-
import org.slf4j.Logger;
-import static org.richfaces.resource.ResourceUtils.*;
-
+import javax.faces.FacesException;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
-
import java.text.MessageFormat;
-
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import javax.faces.FacesException;
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -75,6 +67,7 @@
/**
* <b>IMPORTANT:</b> this method returned TTL in RF 3.x, now it returns expiration time
+ *
* @return Returns the expired.
*/
protected Date getExpires(FacesContext context) {
@@ -87,6 +80,7 @@
/**
* TODO optimize/review?
+ *
* @return Returns the lastModified.
*/
@Override
@@ -211,13 +205,13 @@
String resourceVersion = getVersion();
String resourceUri = ResourceHandlerImpl.RICHFACES_RESOURCE_IDENTIFIER
- + resourceCodec.encodeResource(resourceName, resourceData, resourceVersion);
+ + resourceCodec.encodeResource(resourceName, resourceData, resourceVersion);
resourceUri = Util.encodeResourceURL(context, resourceUri);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(MessageFormat.format("Request path for {0} resource is: {1}", String.valueOf(resourceName),
- String.valueOf(resourceUri)));
+ String.valueOf(resourceUri)));
}
return resourceUri;
@@ -335,7 +329,8 @@
}
@Override
- public void connect() throws IOException {}
+ public void connect() throws IOException {
+ }
@Override
public int getContentLength() {
@@ -385,7 +380,6 @@
}
}
-
private class MyURLStreamHandler extends URLStreamHandler {
@Override
protected URLConnection openConnection(URL u) throws IOException {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,21 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-
import org.slf4j.Logger;
-import java.util.Date;
-import java.util.Map;
-
import javax.faces.application.Resource;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import java.util.Date;
+import java.util.Map;
/**
* @author Nick Belaevski
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,22 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.GraphicsEnvironment;
-import java.awt.color.ColorSpace;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
+import org.w3c.dom.Node;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
@@ -44,9 +31,15 @@
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.stream.ImageOutputStream;
+import java.awt.*;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
-import org.w3c.dom.Node;
-
public class AnimatedTestResource extends TestResource2 {
private static final int DELAY_TIME = 50;
private static final int FRAMES_COUNT = 10;
@@ -110,11 +103,11 @@
ImageWriteParam defaultImageWriteParam = sequenceCapableImageWriter.getDefaultWriteParam();
ImageTypeSpecifier imageTypeSpecifier = ImageTypeSpecifier.createFromBufferedImageType(image.getType());
IIOMetadata imageMetaData = sequenceCapableImageWriter.getDefaultImageMetadata(imageTypeSpecifier,
- defaultImageWriteParam);
+ defaultImageWriteParam);
String metaFormatName = imageMetaData.getNativeMetadataFormatName();
Node root = imageMetaData.getAsTree(metaFormatName);
IIOMetadataNode graphicsControlExtensionNode = (IIOMetadataNode) getOrCreateChild(root,
- "GraphicControlExtension");
+ "GraphicControlExtension");
// http://java.sun.com/javase/6/docs/api/javax/imageio/metadata/doc-files/gi...
graphicsControlExtensionNode.setAttribute("disposalMethod", "none");
@@ -132,17 +125,17 @@
byte numLoops = (byte) (loopContinuously ? 0x0 : 0x1);
- netscapeExtension.setUserObject(new byte[] {0x1, numLoops, 0x0});
+ netscapeExtension.setUserObject(new byte[]{0x1, numLoops, 0x0});
applicationExtensionsNode.appendChild(netscapeExtension);
imageMetaData.setFromTree(metaFormatName, root);
sequenceCapableImageWriter.prepareWriteSequence(null);
for (int i = 1; i <= FRAMES_COUNT; i++) {
g2d.setPaint(new GradientPaint(0, i * dimension.height / FRAMES_COUNT, Color.WHITE, 0,
- dimension.height, getColor()));
+ dimension.height, getColor()));
g2d.fillRect(0, 0, dimension.width, dimension.height);
sequenceCapableImageWriter.writeToSequence(new IIOImage(image, null, imageMetaData),
- defaultImageWriteParam);
+ defaultImageWriteParam);
}
sequenceCapableImageWriter.endWriteSequence();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,17 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
+import org.ajax4jsf.io.ByteBuffer;
+import org.ajax4jsf.io.FastBufferInputStream;
+import org.ajax4jsf.io.FastBufferOutputStream;
+import org.richfaces.log.RichfacesLogger;
+import static org.richfaces.resource.ResourceUtils.secondToMillis;
+import org.richfaces.util.Util;
+import org.slf4j.Logger;
+
+import javax.faces.application.Resource;
+import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
-
import java.text.MessageFormat;
-
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
@@ -38,20 +43,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.faces.application.Resource;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.io.ByteBuffer;
-import org.ajax4jsf.io.FastBufferInputStream;
-import org.ajax4jsf.io.FastBufferOutputStream;
-
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.util.Util;
-
-import org.slf4j.Logger;
-
-import static org.richfaces.resource.ResourceUtils.*;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -132,7 +123,7 @@
// ttl = expireTime - currentTime
// CACHE_EXPIRATION_COEFFICIENT * ttl + currentTime
this.expired = new Date((long) (CACHE_EXPIRATION_COEFFICIENT * expiredFromHeader.getTime()
- + (1 - CACHE_EXPIRATION_COEFFICIENT) * currentTime));
+ + (1 - CACHE_EXPIRATION_COEFFICIENT) * currentTime));
} else {
// TODO throw exception or modify headers?
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import org.richfaces.util.Util;
@@ -28,7 +26,8 @@
final class DefaultResourceCodec implements ResourceCodec {
private static final ResourceCodec CODEC = new DefaultResourceCodec();
- private DefaultResourceCodec() {}
+ private DefaultResourceCodec() {
+ }
public String decodeResourceName(String resourceKey) {
return Util.getResourceName(resourceKey);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
*
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,46 +19,36 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.cache.CacheManager;
-
import org.richfaces.context.AttributesContext;
import org.richfaces.context.SingletonsContext;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.RequestStateManager.BooleanRequestStateVariable;
import org.richfaces.util.Util;
-
import org.slf4j.Logger;
+import javax.faces.application.ProjectStage;
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.component.StateHolder;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
import java.net.URL;
-
import java.text.MessageFormat;
-
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
-import javax.faces.application.ProjectStage;
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.faces.component.StateHolder;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import javax.imageio.ImageIO;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -122,7 +112,7 @@
Object oldCodec = applicationMap.put(RESOURCE_CODEC_ATTRIBUTE_NAME, codec);
if ((oldCodec != null) && (codec != null) && !oldCodec.equals(codec)
- && facesContext.isProjectStage(ProjectStage.Development)) {
+ && facesContext.isProjectStage(ProjectStage.Development)) {
LOGGER.warn("Resource codec should be typically set once per application lifetime");
}
}
@@ -271,9 +261,9 @@
}
if ((existingVersion != null) && (requestedVersion != null)
- && !existingVersion.equals(requestedVersion)) {
+ && !existingVersion.equals(requestedVersion)) {
logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
- requestedVersion);
+ requestedVersion);
sendResourceNotFound(context);
return;
@@ -321,7 +311,7 @@
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(new MessageFormat(
"Storing {0} resource in cache until {1,date,dd MMM yyyy HH:mm:ss zzz}", Locale.US).
- format(new Object[] {resourceKey, cacheExpirationDate}));
+ format(new Object[]{resourceKey, cacheExpirationDate}));
}
cache.put(resourceKey, cachedResource, cacheExpirationDate);
@@ -431,6 +421,7 @@
/**
* Should be called only if {@link #isResourceExists(String)} returns <code>true</code>
+ *
* @param resourceName
* @return
*/
@@ -448,7 +439,7 @@
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(MessageFormat.format("Successfully created instance of {0} resource",
- resourceName));
+ resourceName));
}
} else {
throw new ClassCastException(resourceClass.getName());
@@ -466,7 +457,7 @@
Resource result;
if ((resourceName != null) && ((libraryName == null) || (libraryName.length() == 0))
- && isResourceExists(resourceName)) {
+ && isResourceExists(resourceName)) {
result = createHandlerDependentResource(resourceName);
} else {
result = defaultHandler.createResource(resourceName, libraryName, contentType);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceUtils.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceUtils.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.resource;
import java.util.regex.Matcher;
@@ -35,7 +33,8 @@
private static final String QUOTED_STRING_REGEX = "(?:\\\\[\\x00-\\x7F]|[^\"\\\\])+";
private static final Pattern ETAG_PATTERN = Pattern.compile("(?:W/)?\"(" + QUOTED_STRING_REGEX + ")\"(?:,\\s*)?");
- private ResourceUtils() {}
+ private ResourceUtils() {
+ }
public static String formatWeakTag(String eTag) {
String formattedTag = formatTag(eTag);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,13 +21,6 @@
package org.richfaces.resource;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.NumericDataInputStream;
@@ -36,6 +29,9 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
+import javax.faces.context.FacesContext;
+import java.awt.*;
+
public class TestResource2 extends Java2Dresource {
private static final int MASK_FOR_COLOR_WITHOUT_ALPHA_CHANNEL = 0x00FFFFFF;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,16 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import org.ajax4jsf.Messages;
-import java.util.Map;
-
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
+import java.util.Map;
/**
* @author nick belaevski
@@ -42,6 +39,7 @@
// won't be caught
return impl.getParameter(context, name);
}
+
public Object doLocalCall(FacesContext context, AbstractChainableSkinImpl impl, String name) {
return impl.localResolveSkinParameter(context, name);
}
@@ -50,9 +48,11 @@
private Object wrapBoolean(boolean value) {
return value ? Boolean.TRUE : null;
}
+
public Object doExternalCall(FacesContext context, Skin impl, String name) {
return wrapBoolean(impl.containsProperty(name));
}
+
public Object doLocalCall(FacesContext context, AbstractChainableSkinImpl impl, String name) {
return wrapBoolean(impl.localContainsProperty(context, name));
}
@@ -105,7 +105,7 @@
}
protected Object resolveSkinParameter(FacesContext context, String name) {
- int[] singleInt = new int[] {0};
+ int[] singleInt = new int[]{0};
Object resolvedParameter = resolveSkinParameter(context, name, singleInt);
while (resolvedParameter instanceof String) {
@@ -130,7 +130,7 @@
* @see org.richfaces.skin.Skin#containsProperty(java.lang.String)
*/
public boolean containsProperty(String name) {
- return containsProperty(FacesContext.getCurrentInstance(), name, new int[] {0});
+ return containsProperty(FacesContext.getCurrentInstance(), name, new int[]{0});
}
@Override
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/BaseSkinImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/BaseSkinImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/BaseSkinImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,10 +21,9 @@
package org.richfaces.skin;
+import javax.faces.context.FacesContext;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* @author nick belaevski
* @since 3.2
@@ -33,26 +32,26 @@
public class BaseSkinImpl extends AbstractChainableSkinImpl {
private SkinFactoryImpl factoryImpl;
-
+
BaseSkinImpl(Map properties, SkinFactoryImpl factory) {
- super(properties);
-
- this.factoryImpl = factory;
+ super(properties);
+
+ this.factoryImpl = factory;
}
protected Skin getBaseSkin(FacesContext context) {
- Object object = getLocalParameter(context, Skin.BASE_SKIN);
- Skin skin = null;
-
- if (object != null) {
- skin = factoryImpl.getSkinByName(context, object, true);
- }
-
- if (skin == null) {
- skin = factoryImpl.getDefaultSkin(context);
- }
+ Object object = getLocalParameter(context, Skin.BASE_SKIN);
+ Skin skin = null;
- return skin;
+ if (object != null) {
+ skin = factoryImpl.getSkinByName(context, object, true);
+ }
+
+ if (skin == null) {
+ skin = factoryImpl.getDefaultSkin(context);
+ }
+
+ return skin;
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,28 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
+import javax.el.ValueExpression;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import javax.el.ValueExpression;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
/**
* Singleton ( in respect as collection of different skins ) for produce
* instances properties for all used skins.
*
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:41 $
- *
*/
public abstract class BasicSkinImpl implements Skin {
public static final String RENDER_KIT_PARAMETER = "render.kit";
@@ -99,6 +94,7 @@
/**
* Calculate concrete value for property - if it stored as @see ValueBinding ,
* return interpreted value.
+ *
* @param context
* @param property
* @return
@@ -120,7 +116,7 @@
protected int computeHashCode(FacesContext context) {
int hash = 0;
- for (Iterator iter = skinParams.keySet().iterator(); iter.hasNext(); ) {
+ for (Iterator iter = skinParams.keySet().iterator(); iter.hasNext();) {
String key = (String) iter.next();
Object parameter = getLocalParameter(context, key);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/DefaultSkinImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/DefaultSkinImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/DefaultSkinImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
+import javax.faces.context.FacesContext;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* @author nick belaevski
* @since 3.2
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/DummySkinConfiguration.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/DummySkinConfiguration.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/DummySkinConfiguration.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,15 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import javax.faces.context.FacesContext;
/**
* @author shura
- *
*/
public class DummySkinConfiguration implements SkinConfiguration {
private Skin skin;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinBean.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,14 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import javax.faces.context.FacesContext;
-
import java.nio.ByteBuffer;
-
import java.util.AbstractMap;
import java.util.Collections;
import java.util.Set;
@@ -34,7 +30,6 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:40 $
- *
*/
public class SkinBean extends AbstractMap implements Skin {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,32 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import org.ajax4jsf.Messages;
import org.ajax4jsf.resource.util.URLToStreamHelper;
import org.ajax4jsf.util.ELUtils;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
-
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.context.FacesContext;
-
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
-
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@@ -56,9 +48,15 @@
* files.
*
* @author shura
- *
*/
public class SkinFactoryImpl extends SkinFactory {
+ /**
+ * Name of web application init parameter for current default
+ * {@link javax.faces.render.RenderKit } interaction. by default -
+ * org.exadel.chameleon.RENDERKIT_DEFINITION . TODO Possible Values
+ */
+ public static final String RENDER_KIT_PARAMETER = "org.ajax4jsf.RENDERKIT_DEFINITION";
+
private static final String A4J_BASE_SKIN_PARAMETER = "org.ajax4jsf.BASE_SKIN";
private static final String A4J_SKIN_PARAMETER = "org.ajax4jsf.SKIN";
@@ -74,15 +72,9 @@
*/
private static final String DEFAULT_SKIN_PATH = "META-INF/skins/%s.skin.properties";
- /**
- * Name of web application init parameter for current default
- * {@link javax.faces.render.RenderKit } interaction. by default -
- * org.exadel.chameleon.RENDERKIT_DEFINITION . TODO Possible Values
- */
- public static final String RENDER_KIT_PARAMETER = "org.ajax4jsf.RENDERKIT_DEFINITION";
private static final String[] THEME_PATHS = {"META-INF/themes/%s.theme.properties", "%s.theme.properties"};
-// private static final String[] DEFAULT_SKIN_PATHS = { DEFAULT_SKIN_PATH };
+ // private static final String[] DEFAULT_SKIN_PATHS = { DEFAULT_SKIN_PATH };
private static final String USER_SKIN_PATH = "%s.skin.properties";
/**
@@ -96,13 +88,13 @@
private String baseSkinName = null;
private ValueExpression skinBinding = null;
-// private Properties defaultSkinProperties = null;
+ // private Properties defaultSkinProperties = null;
private String skinName = null;
// private static final String[] CONFIGURATIONS_PATHS = {
// "META-INF/skins/%s.configuration.properties",
// "%s.configuration.properties" };
-// private static final String[] DEFAULT_CONFIGURATION_PATHS = { "META-INF/skins/DEFAULT.configuration.properties" };
+ // private static final String[] DEFAULT_CONFIGURATION_PATHS = { "META-INF/skins/DEFAULT.configuration.properties" };
private Map<String, Skin> skins = new HashMap<String, Skin>();
private Map<String, Skin> baseSkins = new HashMap<String, Skin>();
private Map<String, Properties> sourceProperties = new HashMap<String, Properties>();
@@ -194,17 +186,17 @@
if ((binding == null) && (skin == null)) {
String currentSkinName = context.getExternalContext().getInitParameter(useBase
- ? BASE_SKIN_PARAMETER : SKIN_PARAMETER);
+ ? BASE_SKIN_PARAMETER : SKIN_PARAMETER);
if (null == currentSkinName) {
// Check for a old ( deprecated ) parameter name.
currentSkinName = context.getExternalContext().getInitParameter(useBase
- ? A4J_BASE_SKIN_PARAMETER : A4J_SKIN_PARAMETER);
+ ? A4J_BASE_SKIN_PARAMETER : A4J_SKIN_PARAMETER);
if (null != currentSkinName) {
LOG.warn("Init parameter for a skin name changed to "
- + (useBase ? BASE_SKIN_PARAMETER : SKIN_PARAMETER));
+ + (useBase ? BASE_SKIN_PARAMETER : SKIN_PARAMETER));
}
}
@@ -273,13 +265,12 @@
* append in content to default properties. First, get it from
* META-INF/skins/ , next - from root package. for any place search order
* determined by {@link java.lang.ClassLoader } realisation.
- * @param name
- * name for builded skin.
- * @param defaultProperties
*
+ * @param name name for builded skin.
+ * @param defaultProperties
* @return skin instance for current name
* @throws SkinNotFoundException -
- * if no skin properies found for name.
+ * if no skin properies found for name.
*/
protected Skin buildSkin(FacesContext context, String name, boolean isBase) throws SkinNotFoundException {
Properties skinParams;
@@ -312,9 +303,7 @@
/**
* @param name
* @param paths
- *
* @return
- *
* @throws SkinNotFoundException
*/
protected Properties loadProperties(String name, String[] paths) throws SkinNotFoundException {
@@ -398,7 +387,7 @@
properties = loadProperties(name, THEME_PATHS);
} catch (SkinNotFoundException e) {
throw new ThemeNotFoundException(Messages.getMessage(Messages.THEME_NOT_FOUND_ERROR, name),
- e.getCause());
+ e.getCause());
}
processProperties(facesContext, properties);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -21,11 +21,9 @@
package org.richfaces.skin;
+import javax.faces.context.FacesContext;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
-
/**
* @author nick belaevski
* @since 3.2
@@ -35,23 +33,23 @@
private SkinFactoryImpl factoryImpl;
SkinImpl(Map properties, SkinFactoryImpl factoryImpl) {
- super(properties);
-
- this.factoryImpl = factoryImpl;
+ super(properties);
+
+ this.factoryImpl = factoryImpl;
}
protected Skin getBaseSkin(FacesContext context) {
- Object object = getLocalParameter(context, Skin.BASE_SKIN);
- Skin skin = null;
-
- if (object != null) {
- skin = factoryImpl.getSkinByName(context, object, false);
- }
-
- if (skin == null) {
- skin = factoryImpl.getBaseSkin(context);
- }
+ Object object = getLocalParameter(context, Skin.BASE_SKIN);
+ Skin skin = null;
- return skin;
+ if (object != null) {
+ skin = factoryImpl.getSkinByName(context, object, false);
+ }
+
+ if (skin == null) {
+ skin = factoryImpl.getBaseSkin(context);
+ }
+
+ return skin;
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinPropertyResolver.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,14 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import org.ajax4jsf.Messages;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import javax.faces.context.FacesContext;
@@ -35,9 +31,9 @@
/**
* Resolve Skin propertyes.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:41 $
- *
*/
public class SkinPropertyResolver extends PropertyResolver {
private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/SkinVariableResolver.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
import org.richfaces.VersionBean;
@@ -32,9 +30,9 @@
/**
* Resolve current skin as EL Variable. e.g. #{chameleonSkin['color'] } #{chameleonSkin.color}
* must be evaluated as Skin.getProperty(context,"color");
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:41 $
- *
*/
public class SkinVariableResolver extends VariableResolver {
public static final String CHAMELEON_VARIABLE_NAME = "vcp";
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/ThemeImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/ThemeImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/ThemeImpl.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,18 +1,14 @@
-
/**
*
*/
package org.richfaces.skin;
-import java.util.Properties;
-
import javax.el.ValueExpression;
-
import javax.faces.context.FacesContext;
+import java.util.Properties;
/**
* @author asmirnov
- *
*/
public class ThemeImpl implements Theme {
private final Properties themeProperties;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/skin/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/skin/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/skin/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Implementation of RichFaces skinning
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/CollectionsUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/CollectionsUtils.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/CollectionsUtils.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,7 +1,6 @@
-
/*
* $Id$
- */
+*/
package org.richfaces.util;
import java.util.Arrays;
@@ -14,8 +13,8 @@
/**
* <p class="changed_added_2_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public final class CollectionsUtils {
private CollectionsUtils() {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.util;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/RequestStateManager.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/RequestStateManager.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/RequestStateManager.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,15 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.util;
+import javax.faces.context.FacesContext;
import java.util.HashMap;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -35,7 +32,8 @@
public final class RequestStateManager {
private static final String CONTEXT_ATTRIBUTE_NAME = RequestStateManager.class.getName();
- private RequestStateManager() {}
+ private RequestStateManager() {
+ }
// TODO remove this stuff
public static enum BooleanRequestStateVariable {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/Util.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -39,28 +39,33 @@
* GPL Version 2 license.
*/
-
-
package org.richfaces.util;
import org.ajax4jsf.Messages;
import org.ajax4jsf.util.base64.Codec;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.*;
-
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.StreamCorruptedException;
+import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
-
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
@@ -69,11 +74,6 @@
import java.util.zip.Deflater;
import java.util.zip.Inflater;
-import javax.faces.FacesException;
-import javax.faces.application.ViewHandler;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -105,7 +105,8 @@
RFC1123_DATE_FORMATTER = format;
}
- private Util() {}
+ private Util() {
+ }
public static String getMappingForRequest(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Utility classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.webapp.taglib;
import javax.el.ELException;
import javax.el.MethodExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
@@ -34,8 +31,8 @@
/**
* Maps {@link MethodExpression} to {@link MethodBinding}
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
@SuppressWarnings("deprecation")
public class MethodBindingMethodExpressionAdaptor extends MethodBinding implements StateHolder {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,27 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.webapp.taglib;
-import java.io.Serializable;
-
import javax.el.ELContext;
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
-
import javax.faces.FacesException;
import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
import javax.faces.el.MethodNotFoundException;
+import java.io.Serializable;
/**
* @author Maksim Kaszynski
- *
*/
@SuppressWarnings("deprecation")
public class MethodExpressionMethodBindingAdaptor extends MethodExpression implements StateHolder, Serializable {
@@ -47,7 +42,8 @@
private MethodBinding binding;
private boolean tranzient;
- public MethodExpressionMethodBindingAdaptor() {}
+ public MethodExpressionMethodBindingAdaptor() {
+ }
public MethodExpressionMethodBindingAdaptor(MethodBinding binding) {
this.binding = binding;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.webapp.taglib;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIInput;
@@ -33,7 +30,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public class SimpleComponentTag extends UIComponentELTagBase {
private MethodExpression action;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,17 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.webapp.taglib;
import org.ajax4jsf.Messages;
-
import org.richfaces.component.UIDataAdaptor;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.ActionSource2;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
@@ -43,7 +39,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public abstract class UIComponentELTagBase extends UIComponentELTag {
protected void setActionListenerProperty(UIComponent component, MethodExpression actionListener) {
@@ -54,7 +49,7 @@
actionSource2.addActionListener(new MethodExpressionActionListener(actionListener));
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE2_ERROR,
- component.getClientId(getFacesContext())));
+ component.getClientId(getFacesContext())));
}
}
}
@@ -67,7 +62,7 @@
actionSource2.setActionExpression(action);
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE2_ERROR,
- component.getClientId(getFacesContext())));
+ component.getClientId(getFacesContext())));
}
}
}
@@ -81,13 +76,13 @@
component.setValueExpression("converter", converter);
} else {
Converter conv = FacesContext.getCurrentInstance().getApplication().createConverter(
- converter.getExpressionString());
+ converter.getExpressionString());
output.setConverter(conv);
}
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
- component.getClass().getName()));
+ component.getClass().getName()));
}
}
}
@@ -101,13 +96,13 @@
component.setValueExpression("rowKeyConverter", converter);
} else {
Converter conv = FacesContext.getCurrentInstance().getApplication().createConverter(
- converter.getExpressionString());
+ converter.getExpressionString());
data.setRowKeyConverter(conv);
}
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_DATA_ADAPTOR,
- component.getClass().getName()));
+ component.getClass().getName()));
}
}
}
@@ -120,7 +115,7 @@
input.addValidator(new MethodExpressionValidator(validator));
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
- component.getId()));
+ component.getId()));
}
}
}
@@ -133,7 +128,7 @@
input.addValueChangeListener(new MethodExpressionValueChangeListener(valueChangeListener));
} else {
throw new IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
- component.getId()));
+ component.getId()));
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.webapp.taglib;
import javax.el.ELException;
import javax.el.ValueExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
@@ -34,7 +31,6 @@
/**
* @author Maksim Kaszynski
- *
*/
@SuppressWarnings("deprecation")
public class ValueBindingValueExpressionAdaptor extends ValueBinding implements StateHolder {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java 2009-12-04 20:53:17 UTC (rev 16073)
@@ -1,4 +1,3 @@
-
/**
* Basic tag classes
*/
14 years, 5 months
JBoss Rich Faces SVN: r16072 - in root/framework/trunk/impl/src/main/java/org/richfaces: component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:49:13 -0500 (Fri, 04 Dec 2009)
New Revision: 16072
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/application/InitializationListener.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/EnclosingFormRequiredException.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/FileUploadConstants.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/SavedState.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/UISequence.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/NSUtils.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/AbstractMessageUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentMessageUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/FormUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ViewUtil.java
root/framework/trunk/impl/src/main/java/org/richfaces/component/util/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentCallback.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/ContextProvider.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextAjaxOutputTracker.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/SingletonsContext.java
root/framework/trunk/impl/src/main/java/org/richfaces/event/SwitchablePanelSwitchEvent.java
root/framework/trunk/impl/src/main/java/org/richfaces/event/package-info.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/CDL.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/Cookie.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/CookieList.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTP.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTPTokener.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSContentHandler.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONAccessor.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONArray.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONCollection.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONException.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONMap.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONObject.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONString.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONStringer.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONTokener.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONWriter.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/XML.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/XMLTokener.java
root/framework/trunk/impl/src/main/java/org/richfaces/json/package-info.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/application/InitializationListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/application/InitializationListener.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/application/InitializationListener.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -21,13 +21,13 @@
*/
package org.richfaces.application;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
+import org.ajax4jsf.cache.CacheManager;
+import org.ajax4jsf.renderkit.AJAXDataSerializer;
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.skin.SkinFactory;
+import org.richfaces.skin.SkinFactoryImpl;
+import org.slf4j.Logger;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
@@ -36,90 +36,95 @@
import javax.faces.event.PreDestroyApplicationEvent;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
-import org.ajax4jsf.cache.CacheManager;
-import org.ajax4jsf.renderkit.AJAXDataSerializer;
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.skin.SkinFactory;
-import org.richfaces.skin.SkinFactoryImpl;
-import org.slf4j.Logger;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
public class InitializationListener implements SystemEventListener {
- private static final String META_INF_SERVICES = "META-INF/services/";
-
- private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
-
- /* (non-Javadoc)
- * @see javax.faces.event.SystemEventListener#isListenerForSource(java.lang.Object)
- */
- public boolean isListenerForSource(Object source) {
- return true;
- }
+ private static final String META_INF_SERVICES = "META-INF/services/";
- private static <T> T instantiate(Class<T> interfaceClass,
- Class<? extends T> implementationClass,
- Class<? extends T> defaultImplementationClass) {
+ private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
- Constructor<? extends T> constructor = null;
- Object[] constructorArguments = null;
+ /* (non-Javadoc)
+ * @see javax.faces.event.SystemEventListener#isListenerForSource(java.lang.Object)
+ */
+ public boolean isListenerForSource(Object source) {
+ return true;
+ }
- if (implementationClass != null) {
- if (defaultImplementationClass != null && !defaultImplementationClass.equals(implementationClass)) {
- try {
- constructor = implementationClass.getConstructor(interfaceClass);
- T defaultImplementation = instantiate(interfaceClass, defaultImplementationClass, null);
- constructorArguments = new Object[]{defaultImplementation};
- } catch (NoSuchMethodException e) {
- /* ignore */
- }
- }
+ private static <T> T instantiate(Class<T> interfaceClass,
+ Class<? extends T> implementationClass,
+ Class<? extends T> defaultImplementationClass) {
- if (constructor == null) {
- try {
- constructor = implementationClass.getConstructor();
- } catch (NoSuchMethodException e) {
- throw new FacesException(MessageFormat.format("Class {0} has no public no-arg constructor", implementationClass.getName()), e);
- }
- }
+ Constructor<? extends T> constructor = null;
+ Object[] constructorArguments = null;
- } else {
- try {
- constructor = defaultImplementationClass.getConstructor();
- } catch (NoSuchMethodException e) {
- throw new FacesException(MessageFormat.format("Class {0} has no public no-arg constructor",
- defaultImplementationClass.getName()), e);
- }
- }
+ if (implementationClass != null) {
+ if (defaultImplementationClass != null && !defaultImplementationClass.equals(implementationClass)) {
+ try {
+ constructor = implementationClass.getConstructor(interfaceClass);
+ T defaultImplementation = instantiate(interfaceClass, defaultImplementationClass, null);
+ constructorArguments = new Object[]{defaultImplementation};
+ } catch (NoSuchMethodException e) {
+ /* ignore */
+ }
+ }
- try {
- return constructor.newInstance(constructorArguments);
- } catch (IllegalArgumentException e) {
- throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}", constructor.getDeclaringClass(), e.getMessage()), e);
- } catch (InstantiationException e) {
- throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}", constructor.getDeclaringClass(), e.getMessage()), e);
- } catch (IllegalAccessException e) {
- throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}", constructor.getDeclaringClass(), e.getMessage()), e);
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- if (cause == null) {
- cause = e;
- }
- throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}", constructor.getDeclaringClass(), cause.getMessage()), cause);
- }
- }
-
- private static final <T> T createServiceInstance(Class<T> interfaceClass, Class<? extends T> defaultImplementationClass) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- InputStream input = URLToStreamHelper.urlToStreamSafe(loader.getResource(META_INF_SERVICES + interfaceClass.getName()));
+ if (constructor == null) {
+ try {
+ constructor = implementationClass.getConstructor();
+ } catch (NoSuchMethodException e) {
+ throw new FacesException(MessageFormat.format("Class {0} has no public no-arg constructor",
+ implementationClass.getName()), e);
+ }
+ }
- Class<? extends T> implementationClass = null;
+ } else {
+ try {
+ constructor = defaultImplementationClass.getConstructor();
+ } catch (NoSuchMethodException e) {
+ throw new FacesException(MessageFormat.format("Class {0} has no public no-arg constructor",
+ defaultImplementationClass.getName()), e);
+ }
+ }
+ try {
+ return constructor.newInstance(constructorArguments);
+ } catch (IllegalArgumentException e) {
+ throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}",
+ constructor.getDeclaringClass(), e.getMessage()), e);
+ } catch (InstantiationException e) {
+ throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}",
+ constructor.getDeclaringClass(), e.getMessage()), e);
+ } catch (IllegalAccessException e) {
+ throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}",
+ constructor.getDeclaringClass(), e.getMessage()), e);
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause == null) {
+ cause = e;
+ }
+ throw new FacesException(MessageFormat.format("Cannot instantiate {0} class, error was: {1}",
+ constructor.getDeclaringClass(), cause.getMessage()), cause);
+ }
+ }
+
+ private static <T> T createServiceInstance(Class<T> interfaceClass, Class<? extends T> defaultImplementationClass) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ InputStream input = URLToStreamHelper.urlToStreamSafe(
+ loader.getResource(META_INF_SERVICES + interfaceClass.getName()));
+
+ Class<? extends T> implementationClass = null;
+
// have services file.
if (input != null) {
try {
@@ -128,10 +133,10 @@
implementationClass = Class.forName(factoryClassName, false, loader).asSubclass(interfaceClass);
} catch (Exception e) {
- LOG.warn(MessageFormat.format("Error loading class for {0} service: {1} ",
- interfaceClass.getName(), e.getMessage()), e);
- } finally {
- try {
+ LOG.warn(MessageFormat.format("Error loading class for {0} service: {1} ",
+ interfaceClass.getName(), e.getMessage()), e);
+ } finally {
+ try {
input.close();
} catch (IOException e) {
// can be ignored
@@ -143,34 +148,33 @@
}
protected void onStart() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
- SkinFactory skinFactory = createServiceInstance(SkinFactory.class, SkinFactoryImpl.class);
- ServiceTracker.setService(facesContext, SkinFactory.class, skinFactory);
-
- AJAXDataSerializer dataSerializer = createServiceInstance(AJAXDataSerializer.class, AJAXDataSerializer.class);
- ServiceTracker.setService(facesContext, AJAXDataSerializer.class, dataSerializer);
+ SkinFactory skinFactory = createServiceInstance(SkinFactory.class, SkinFactoryImpl.class);
+ ServiceTracker.setService(facesContext, SkinFactory.class, skinFactory);
+
+ AJAXDataSerializer dataSerializer = createServiceInstance(AJAXDataSerializer.class, AJAXDataSerializer.class);
+ ServiceTracker.setService(facesContext, AJAXDataSerializer.class, dataSerializer);
}
-
+
protected void onStop() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
- ServiceTracker.release(facesContext);
+ ServiceTracker.release(facesContext);
CacheManager.getInstance().destroy();
}
-
-
- /* (non-Javadoc)
- * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.SystemEvent)
- */
- public void processEvent(SystemEvent event) throws AbortProcessingException {
- if (event instanceof PostConstructApplicationEvent) {
- onStart();
- } else if (event instanceof PreDestroyApplicationEvent) {
- onStop();
- } else {
- throw new IllegalArgumentException(MessageFormat.format("Event {0} is not supported!", event));
- }
- }
+ /* (non-Javadoc)
+ * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.SystemEvent)
+ */
+ public void processEvent(SystemEvent event) throws AbortProcessingException {
+ if (event instanceof PostConstructApplicationEvent) {
+ onStart();
+ } else if (event instanceof PreDestroyApplicationEvent) {
+ onStop();
+ } else {
+ throw new IllegalArgumentException(MessageFormat.format("Event {0} is not supported!", event));
+ }
+ }
+
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/EnclosingFormRequiredException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/EnclosingFormRequiredException.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/EnclosingFormRequiredException.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,16 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component;
import javax.faces.FacesException;
/**
* @author Filip Antonov - mailto:fantonov@exadel.com
- * created 08.02.2007
- *
+ * created 08.02.2007
*/
public class EnclosingFormRequiredException extends FacesException {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/FileUploadConstants.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/FileUploadConstants.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/FileUploadConstants.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component;
import org.ajax4jsf.request.MultipartRequest;
@@ -34,19 +32,29 @@
public static final String FILE_UPLOAD_ACTION_PROGRESS = "progress";
public static final String FILE_UPLOAD_ACTION_STOP = "richfaces_file_upload_action_stop";
- /** Request parameter name indicated that file was uploaded by RF component */
+ /**
+ * Request parameter name indicated that file was uploaded by RF component
+ */
public static final String FILE_UPLOAD_INDICATOR = "_richfaces_upload_file_indicator";
- /** Session bean name where progress bar's percent map will be stored */
+ /**
+ * Session bean name where progress bar's percent map will be stored
+ */
public static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
- /** Session bean name where stop keys will be stored */
+ /**
+ * Session bean name where stop keys will be stored
+ */
public static final String REQUEST_KEYS_BEAN_NAME = "_richfaces_request_keys";
- /** Session bean name where request size will be stored */
+ /**
+ * Session bean name where request size will be stored
+ */
public static final String REQUEST_SIZE_BEAN_NAME = "_richfaces_request_size";
- /** Session bean name to store max files count allowed to upload */
+ /**
+ * Session bean name to store max files count allowed to upload
+ */
public static final String UPLOADED_COUNTER = "_richfaces_uploaded_file_counter";
/**
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -20,8 +20,6 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
-
package org.richfaces.component;
import javax.faces.component.UIComponent;
@@ -31,7 +29,6 @@
/**
* @author Nick Belaevski
- *
*/
class RowKeyContextEventWrapper extends FacesEvent {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/SavedState.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/SavedState.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/SavedState.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -20,16 +20,13 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
-
package org.richfaces.component;
import org.ajax4jsf.component.IterationStateHolder;
-import java.io.Serializable;
-
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIForm;
+import java.io.Serializable;
//from RI
@@ -38,7 +35,6 @@
* fields.
*
* @author shura
- *
*/
final class SavedState implements Serializable {
public static final SavedState EMPTY = new SavedState();
@@ -118,7 +114,7 @@
return "iterationState: " + iterationState;
} else {
return "submittedValue: " + submittedValue + " value: " + value + " localValueSet: " + localValueSet
- + " submitted: " + submitted;
+ + " submitted: " + submitted;
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -20,8 +20,6 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
-
package org.richfaces.component;
import org.ajax4jsf.component.AjaxDataEncoder;
@@ -32,25 +30,10 @@
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
import org.ajax4jsf.model.SerializableDataModel;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-import java.io.Serializable;
-
-import java.text.MessageFormat;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
import javax.el.ValueExpression;
-
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.component.ContextCallback;
@@ -75,6 +58,15 @@
import javax.faces.event.BehaviorEvent;
import javax.faces.event.FacesEvent;
import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
/**
* Base class for iterable components, like dataTable, Tomahawk dataList,
@@ -82,12 +74,11 @@
* responces for one or more selected iterations.
*
* @author shura
- *
*/
//TODO check AjaxDataEncoder
public abstract class UIDataAdaptor extends UIComponentBase
- implements AjaxDataEncoder, NamingContainer, UniqueIdVendor, IterationStateHolder {
+ implements AjaxDataEncoder, NamingContainer, UniqueIdVendor, IterationStateHolder {
/**
* <p>The standard component family for this component.</p>
@@ -101,7 +92,6 @@
private static final Logger LOG = RichfacesLogger.COMPONENTS.getLogger();
-
/**
* Visitor for process decode on children components.
*/
@@ -221,9 +211,8 @@
* tree.
*
* @param faces -
- * current FacesContext
- * @param key
- * new key value.
+ * current FacesContext
+ * @param key new key value.
*/
public void setRowKey(FacesContext facesContext, Object rowKey) {
this.saveChildState(facesContext);
@@ -328,6 +317,7 @@
/**
* Restore values of {@link EditableValueHolder} fields after change current
* row.
+ *
* @param facesContext
* @param next
* @param childState
@@ -458,7 +448,7 @@
* from {@link #broadcast(FacesEvent)}
*
* @param event -
- * processed event.
+ * processed event.
* @return true if event processed, false if component must continue
* processing.
*/
@@ -532,11 +522,10 @@
* Setup EL variable for different iteration. Value of row data and
* component state will be put into request scope attributes with names
* given by "var" and "varState" bean properties.
- *
+ * <p/>
* Changed: does not check for row availability now
*
- * @param faces
- * current faces context
+ * @param faces current faces context
* @param localModel
* @param rowSelected
*/
@@ -578,7 +567,7 @@
componentState = createComponentState();
if ((componentStateExpression != null)
- && !componentStateExpression.isReadOnly(getFacesContext().getELContext())) {
+ && !componentStateExpression.isReadOnly(getFacesContext().getELContext())) {
componentStateExpression.setValue(getFacesContext().getELContext(), componentState);
}
}
@@ -675,8 +664,7 @@
/**
* Save current state of data variable.
*
- * @param faces
- * current faces context
+ * @param faces current faces context
*/
// TODO move into walk() method body
@@ -695,8 +683,7 @@
/**
* Restore value of data variable after processing phase.
*
- * @param faces
- * current faces context
+ * @param faces current faces context
*/
public void restoreOrigValue(FacesContext faces) {
String var = getVar();
@@ -783,10 +770,10 @@
* @param visitor
*/
public void walk(FacesContext faces, DataVisitor visitor, Object argument) {
- Object key = getRowKey();
- captureOrigValue(faces);
-
- Range range = null;
+ Object key = getRowKey();
+ captureOrigValue(faces);
+
+ Range range = null;
DataComponentState componentState = getComponentState();
if (componentState != null) {
@@ -794,11 +781,11 @@
}
getExtendedDataModel().walk(faces, visitor, range, argument);
-
- setRowKey(key);
- restoreOrigValue(faces);
+
+ setRowKey(key);
+ restoreOrigValue(faces);
}
-
+
public void processDecodes(FacesContext faces) {
if (!this.isRendered()) {
return;
@@ -849,8 +836,8 @@
StateHelper stateHelper = getStateHelper();
- return new Object[] {stateHelper.get(PropertyKeys.childState), this.componentState, this.ajaxRowKey,
- this.extendedDataModel, };
+ return new Object[]{stateHelper.get(PropertyKeys.childState), this.componentState, this.ajaxRowKey,
+ this.extendedDataModel,};
}
/*
@@ -929,7 +916,7 @@
}
}
- return new Object[] {super.saveState(context), savedComponentState, componentStateIsStateHolder};
+ return new Object[]{super.saveState(context), savedComponentState, componentStateIsStateHolder};
}
/*
@@ -966,7 +953,7 @@
// if clientId.startsWith(baseId + separatorChar)
if (clientId.startsWith(baseId) && (clientId.length() > baseId.length())
- && (clientId.charAt(baseId.length()) == separatorChar)) {
+ && (clientId.charAt(baseId.length()) == separatorChar)) {
return true;
}
@@ -976,7 +963,7 @@
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback)
throws FacesException {
-
+
if ((null == context) || (null == clientId) || (null == callback)) {
throw new NullPointerException();
}
@@ -1118,7 +1105,7 @@
private boolean visitDataChildren(final VisitContext visitContext, final VisitCallback callback) {
FacesContext facesContext = visitContext.getFacesContext();
- final boolean[] singleBoolean = new boolean[] {false};
+ final boolean[] singleBoolean = new boolean[]{false};
this.walk(facesContext, new DataVisitor() {
public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
@@ -1222,7 +1209,6 @@
* model
*
* @author shura
- *
*/
protected abstract class ComponentVisitor implements DataVisitor {
public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/UIRangedNumberInput.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component;
import org.richfaces.component.util.MessageUtil;
@@ -31,8 +29,7 @@
/**
* @author Nick - mailto:nbelaevski@exadel.com
- * created 20.02.2007
- *
+ * created 20.02.2007
*/
public abstract class UIRangedNumberInput extends UIInput {
public abstract String getMaxValue();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/UISequence.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/UISequence.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/UISequence.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -20,8 +20,6 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
-
package org.richfaces.component;
import org.ajax4jsf.model.DataComponentState;
@@ -29,11 +27,6 @@
import org.ajax4jsf.model.RepeatState;
import org.ajax4jsf.model.SequenceDataModel;
-import java.sql.ResultSet;
-
-import java.util.Collections;
-import java.util.List;
-
import javax.faces.component.UINamingContainer;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@@ -43,15 +36,18 @@
import javax.faces.model.ResultDataModel;
import javax.faces.model.ResultSetDataModel;
import javax.faces.model.ScalarDataModel;
-
import javax.servlet.jsp.jstl.sql.Result;
+import java.sql.ResultSet;
+import java.util.Collections;
+import java.util.List;
/**
* @author Nick Belaevski
- *
*/
public class UISequence extends UIDataAdaptor {
- protected enum PropertyKeys {first, rows, value}
+ protected enum PropertyKeys {
+ first, rows, value
+ }
@SuppressWarnings("unchecked")
protected DataModel<?> createFacesModel(Object value) {
@@ -111,6 +107,7 @@
public int getFirst() {
return UISequence.this.getFirst();
}
+
@Override
public int getRows() {
return UISequence.this.getRows();
@@ -124,6 +121,7 @@
*/
// TODO make this a property of model
+
@Override
public Converter getRowKeyConverter() {
return getFacesContext().getApplication().createConverter(Integer.class);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,18 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
-
import org.richfaces.event.SwitchablePanelSwitchEvent;
-import java.util.Iterator;
-
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
@@ -39,11 +33,11 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.ValueChangeEvent;
+import java.util.Iterator;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 23.01.2007
- *
+ * created 23.01.2007
*/
public abstract class UISwitchablePanel extends UIInput {
@@ -137,8 +131,8 @@
if (AjaxRendererUtils.isAjaxRequest(facesContext)
- /* && this.getSwitchType().equals(AJAX_METHOD) */
- ) { // RF-7292
+ /* && this.getSwitchType().equals(AJAX_METHOD) */
+ ) { // RF-7292
AjaxRendererUtils.addRegionByName(facesContext, this, this.getId());
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/NSUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/NSUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/NSUtils.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,26 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.nsutils;
-import java.io.IOException;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import java.io.IOException;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 21.12.2006
- *
+ * created 21.12.2006
*/
public final class NSUtils {
public static final String XMLNS_PREFIX = "rich";
public static final String XMLNS_URI = "http://richfaces.ajax4jsf.org/rich";
public static final String XMLNS_VALUE = "xmlns:" + XMLNS_PREFIX;
- private NSUtils() {}
+ private NSUtils() {
+ }
public static void writeNameSpace(FacesContext context, UIComponent component) throws IOException {
context.getResponseWriter().writeAttribute(NSUtils.XMLNS_VALUE, NSUtils.XMLNS_URI, null);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/nsutils/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -1,4 +1,3 @@
-
/**
* Custom XML namespace utility classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -1,4 +1,3 @@
-
/**
* Base RichFaces component classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/AbstractMessageUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/AbstractMessageUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/AbstractMessageUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,28 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
import java.text.MessageFormat;
-
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import javax.faces.application.Application;
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
/**
* Created 19.06.2008
+ *
* @author Nick Belaevski
* @since 3.2.2
*/
public final class AbstractMessageUtil {
- private AbstractMessageUtil() {}
+ private AbstractMessageUtil() {
+ }
private static ResourceBundle getResourceBundle(String baseName, Locale locale, ClassLoader loader) {
if (loader != null) {
@@ -51,7 +49,7 @@
}
private static FacesMessage getMessage(FacesContext context, String messageId, Object[] parameters, Locale locale,
- String baseBundleName) {
+ String baseBundleName) {
String summary = null;
String detail = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentMessageUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentMessageUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentMessageUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import javax.faces.application.FacesMessage;
@@ -33,7 +31,8 @@
public final class ComponentMessageUtil {
public static final String MESSAGE_BUNDLE_NAME = "org.richfaces.component.messages";
- private ComponentMessageUtil() {}
+ private ComponentMessageUtil() {
+ }
public static FacesMessage getMessage(FacesContext context, String messageId, Object[] parameters) {
return AbstractMessageUtil.getMessage(context, messageId, parameters, MESSAGE_BUNDLE_NAME);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ComponentUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import java.util.Collection;
@@ -30,10 +28,10 @@
* @author Nick Belaevski
* mailto:nbelaevski@exadel.com
* created 20.07.2007
- *
*/
public final class ComponentUtil {
- private ComponentUtil() {}
+ private ComponentUtil() {
+ }
public static String[] asArray(Object object) {
if (object == null) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/FormUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/FormUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/FormUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,12 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import org.ajax4jsf.renderkit.RendererUtils;
-
import org.richfaces.component.EnclosingFormRequiredException;
import javax.faces.component.UIComponent;
@@ -33,15 +30,15 @@
/**
* @author Filip Antonov - mailto:fantonov@exadel.com
- * created 08.02.2007
- *
+ * created 08.02.2007
*/
public final class FormUtil {
- private FormUtil() {}
+ private FormUtil() {
+ }
public static void throwEnclFormReqExceptionIfNeed(FacesContext context, UIComponent component)
throws EnclosingFormRequiredException {
-
+
UIForm form = RendererUtils.getInstance().getNestingForm(context, component);
// TODO nick -> nick - switchType checking can be harmful here
@@ -50,7 +47,7 @@
if ((form == null) && !isSwitchTypeClient) {
throw new EnclosingFormRequiredException(component.getClass().toString() + " (id=\"" + component.getId()
- + "\") did not find parent form.");
+ + "\") did not find parent form.");
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.util.HtmlDimensions;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com created 09.02.2007
- *
*/
public final class HtmlUtil {
public static final Pattern ID_SELECTOR_PATTERN =
@@ -44,7 +40,8 @@
private static final String ORG_AJAX4JSF = "org.ajax4jsf.";
private static final String ORG_RICHFACES = "org.richfaces.";
- private HtmlUtil() {}
+ private HtmlUtil() {
+ }
public static String qualifySize(String sizeDeclaration) {
String trimmedValue = sizeDeclaration.trim();
@@ -115,7 +112,7 @@
}
if ((rendererType != null)
- && (rendererType.startsWith(ORG_AJAX4JSF) || rendererType.startsWith(ORG_RICHFACES))) {
+ && (rendererType.startsWith(ORG_AJAX4JSF) || rendererType.startsWith(ORG_RICHFACES))) {
return true;
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/MessageUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/MessageUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import javax.faces.application.Application;
@@ -31,8 +29,7 @@
/**
* @author Nick - mailto:nbelaevski@exadel.com
- * created 06.02.2007
- *
+ * created 06.02.2007
*/
public final class MessageUtil {
private static final boolean IS_12;
@@ -50,7 +47,8 @@
IS_12 = is12;
}
- private MessageUtil() {}
+ private MessageUtil() {
+ }
public static Object getLabel(FacesContext context, UIComponent component) {
Object o = null;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ViewUtil.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ViewUtil.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/ViewUtil.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,19 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component.util;
import javax.faces.context.FacesContext;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 19.02.2007
- *
+ * created 19.02.2007
*/
public final class ViewUtil {
- private ViewUtil() {}
+ private ViewUtil() {
+ }
public static String getResourceURL(String url) {
if (null == url) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/component/util/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/component/util/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/component/util/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -1,4 +1,3 @@
-
/**
* Common utility classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentCallback.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentCallback.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ComponentCallback.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,13 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
+import org.ajax4jsf.component.AjaxClientBehavior;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
@@ -34,22 +32,21 @@
import javax.faces.component.visit.VisitContext;
import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.List;
-import org.ajax4jsf.component.AjaxClientBehavior;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.renderkit.RendererUtils;
-
/**
* User: akolonitsky
* Date: Oct 13, 2009
*/
abstract class ComponentCallback implements VisitCallback {
-
- private Collection<String> componentIds = new LinkedHashSet<String>();
-
- private final String behaviorEvent;
- private final String defaultIdAttribute;
-
+
+ private Collection<String> componentIds = new LinkedHashSet<String>();
+
+ private final String behaviorEvent;
+ private final String defaultIdAttribute;
+
ComponentCallback(String behaviorEvent, String defaultIdAttribute) {
super();
@@ -58,7 +55,7 @@
}
protected String getDefaultComponentId() {
- return null;
+ return null;
}
private AjaxClientBehavior findBehavior(UIComponent target) {
@@ -100,14 +97,14 @@
//TODO - unit tests check for "@none" element
Collection<String> attributeIds = AjaxRendererUtils.asSet(attributeObject);
if (attributeIds == null) {
- attributeIds = new LinkedHashSet<String>();
+ attributeIds = new LinkedHashSet<String>();
}
-
+
if (attributeIds.isEmpty() && defaultIdAttribute != null) {
// asSet() returns copy of original set and we're free to modify it
- attributeIds.add(defaultIdAttribute);
+ attributeIds.add(defaultIdAttribute);
}
-
+
componentIds.addAll(RendererUtils.getInstance().findComponentsFor(context, target, attributeIds));
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ContextProvider.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ContextProvider.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ContextProvider.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
+import javax.faces.context.FacesContext;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* @author akolonitsky
* @since Oct 13, 2009
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -21,18 +21,18 @@
package org.richfaces.context;
-import javax.faces.component.UIComponent;
-
import org.ajax4jsf.component.AjaxClientBehavior;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import javax.faces.component.UIComponent;
+
/**
* @author akolonitsky
* @since Oct 13, 2009
*/
class ExecuteComponentCallback extends ComponentCallback {
-
- ExecuteComponentCallback(String behaviorEvent) {
+
+ ExecuteComponentCallback(String behaviorEvent) {
super(behaviorEvent, AjaxRendererUtils.ALL);
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextAjaxOutputTracker.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextAjaxOutputTracker.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextAjaxOutputTracker.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,27 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
import org.ajax4jsf.component.AjaxOutput;
-import java.util.ArrayList;
-import java.util.Collection;
-
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
+import java.util.ArrayList;
+import java.util.Collection;
/**
* @author Nick Belaevski
- *
*/
public class PartialViewContextAjaxOutputTracker implements SystemEventListener {
private static final String AJAX_OUTPUT_COMPONENTS_SET_ATTRIBUTE = PartialViewContextAjaxOutputTracker.class
- + ":AjaxOutputComponentsSet";
+ + ":AjaxOutputComponentsSet";
static Collection<AjaxOutput> getAjaxOutputComponentsSet(FacesContext context) {
AttributesContext attributes = SingletonsContext.FACES_CONTEXT.get(context);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,18 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
-import java.util.Map;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialViewContext;
import javax.faces.context.PartialViewContextFactory;
+import java.util.Map;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -47,13 +44,13 @@
@Override
public PartialViewContext getPartialViewContext(final FacesContext context) {
Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
- String activatorComponentId = requestParameterMap.get(AjaxRendererUtils.AJAX_COMPONENT_ID_PARAMETER);
+ String activatorComponentId = requestParameterMap.get(AjaxRendererUtils.AJAX_COMPONENT_ID_PARAMETER);
if (activatorComponentId != null) {
- String behaviorEvent = requestParameterMap.get(AjaxRendererUtils.BEHAVIOR_EVENT_PARAMETER);
-
- return new PartialViewContextImpl(context, activatorComponentId, behaviorEvent);
+ String behaviorEvent = requestParameterMap.get(AjaxRendererUtils.BEHAVIOR_EVENT_PARAMETER);
+
+ return new PartialViewContextImpl(context, activatorComponentId, behaviorEvent);
} else {
- return parentFactory.getPartialViewContext(context);
+ return parentFactory.getPartialViewContext(context);
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -21,18 +21,13 @@
*/
package org.richfaces.context;
+import org.ajax4jsf.component.AjaxOutput;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import static org.ajax4jsf.renderkit.AjaxRendererUtils.ALL;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.component.visit.VisitCallback;
@@ -45,155 +40,157 @@
import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.PhaseId;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
-import org.ajax4jsf.component.AjaxOutput;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
public class PartialViewContextImpl extends PartialViewContext {
- private static final Logger LOG = RichfacesLogger.CONTEXT.getLogger();
-
- private static final String FACES_REQUEST_HEADER = "Faces-Request";
- private static final String PARTIAL_AJAX = "partial/ajax";
- private static final String PARTIAL_PROCESS = "partial/process";
-
- private static final String ORIGINAL_WRITER = "org.richfaces.PartialViewContextImpl.ORIGINAL_WRITER";
-
- private FacesContext facesContext;
- private PartialResponseWriter partialResponseWriter;
+ private static final Logger LOG = RichfacesLogger.CONTEXT.getLogger();
- private Set<String> executeIds = null;
- private Set<String> renderIds = null;
-
- private Boolean ajaxRequest = null;
- private Boolean partialRequest = null;
- private Boolean renderAll = null;
+ private static final String FACES_REQUEST_HEADER = "Faces-Request";
+ private static final String PARTIAL_AJAX = "partial/ajax";
+ private static final String PARTIAL_PROCESS = "partial/process";
- private String activatorComponentId = null;
- private String behaviorEvent = null;
-
- private boolean released = false;
+ private static final String ORIGINAL_WRITER = "org.richfaces.PartialViewContextImpl.ORIGINAL_WRITER";
- public PartialViewContextImpl(FacesContext facesContext, String activatorComponentId, String behaviorEvent) {
- super();
-
- this.facesContext = facesContext;
-
- //activatorComponentId should not be null
- this.activatorComponentId = activatorComponentId;
- this.behaviorEvent = behaviorEvent;
- }
-
- @Override
- public Collection<String> getExecuteIds() {
- assertNotReleased();
+ private FacesContext facesContext;
+ private PartialResponseWriter partialResponseWriter;
- if (executeIds == null) {
- executeIds = new LinkedHashSet<String>();
-
- setupExecuteIds(executeIds);
- }
+ private Set<String> executeIds = null;
+ private Set<String> renderIds = null;
- return executeIds;
- }
+ private Boolean ajaxRequest = null;
+ private Boolean partialRequest = null;
+ private Boolean renderAll = null;
- @Override
- public Collection<String> getRenderIds() {
- assertNotReleased();
+ private String activatorComponentId = null;
+ private String behaviorEvent = null;
- if (renderIds == null) {
- renderIds = new LinkedHashSet<String>();
- }
+ private boolean released = false;
- return renderIds;
- }
+ public PartialViewContextImpl(FacesContext facesContext, String activatorComponentId, String behaviorEvent) {
+ super();
- @Override
- public boolean isAjaxRequest() {
- assertNotReleased();
+ this.facesContext = facesContext;
- if (ajaxRequest == null) {
+ //activatorComponentId should not be null
+ this.activatorComponentId = activatorComponentId;
+ this.behaviorEvent = behaviorEvent;
+ }
+
+ @Override
+ public Collection<String> getExecuteIds() {
+ assertNotReleased();
+
+ if (executeIds == null) {
+ executeIds = new LinkedHashSet<String>();
+
+ setupExecuteIds(executeIds);
+ }
+
+ return executeIds;
+ }
+
+ @Override
+ public Collection<String> getRenderIds() {
+ assertNotReleased();
+
+ if (renderIds == null) {
+ renderIds = new LinkedHashSet<String>();
+ }
+
+ return renderIds;
+ }
+
+ @Override
+ public boolean isAjaxRequest() {
+ assertNotReleased();
+
+ if (ajaxRequest == null) {
Map<String, String> requestHeaderMap = facesContext.getExternalContext().getRequestHeaderMap();
- ajaxRequest = PARTIAL_AJAX.equals(requestHeaderMap.get(FACES_REQUEST_HEADER));
- }
-
- return ajaxRequest.booleanValue();
- }
+ ajaxRequest = PARTIAL_AJAX.equals(requestHeaderMap.get(FACES_REQUEST_HEADER));
+ }
- @Override
- public boolean isPartialRequest() {
- assertNotReleased();
+ return ajaxRequest.booleanValue();
+ }
- if (partialRequest == null) {
+ @Override
+ public boolean isPartialRequest() {
+ assertNotReleased();
+
+ if (partialRequest == null) {
if (isAjaxRequest()) {
- partialRequest = true;
+ partialRequest = true;
} else {
- Map<String, String> requestHeaderMap = facesContext.getExternalContext().getRequestHeaderMap();
- partialRequest = PARTIAL_PROCESS.equals(requestHeaderMap.get(FACES_REQUEST_HEADER));
+ Map<String, String> requestHeaderMap = facesContext.getExternalContext().getRequestHeaderMap();
+ partialRequest = PARTIAL_PROCESS.equals(requestHeaderMap.get(FACES_REQUEST_HEADER));
}
- }
-
- return partialRequest.booleanValue();
- }
+ }
- @Override
- public void setPartialRequest(boolean isPartialRequest) {
- assertNotReleased();
+ return partialRequest.booleanValue();
+ }
- partialRequest = isPartialRequest;
- }
+ @Override
+ public void setPartialRequest(boolean isPartialRequest) {
+ assertNotReleased();
+ partialRequest = isPartialRequest;
+ }
- @Override
- public boolean isExecuteAll() {
- assertNotReleased();
+ @Override
+ public boolean isExecuteAll() {
+ assertNotReleased();
- return getExecuteIds().contains(ALL);
- }
+ return getExecuteIds().contains(ALL);
+ }
- @Override
- public boolean isRenderAll() {
- assertNotReleased();
+ @Override
+ public boolean isRenderAll() {
+ assertNotReleased();
- if (renderAll == null) {
- renderAll = getRenderIds().contains(ALL);
- }
-
- return renderAll;
- }
+ if (renderAll == null) {
+ renderAll = getRenderIds().contains(ALL);
+ }
- @Override
- public void setRenderAll(boolean isRenderAll) {
- assertNotReleased();
+ return renderAll;
+ }
- renderAll = isRenderAll;
- }
+ @Override
+ public void setRenderAll(boolean isRenderAll) {
+ assertNotReleased();
- @Override
- public PartialResponseWriter getPartialResponseWriter() {
- assertNotReleased();
+ renderAll = isRenderAll;
+ }
- if (partialResponseWriter == null) {
- partialResponseWriter = new PartialDelayedInitializationResponseWriter(facesContext);
- }
-
- return partialResponseWriter;
- }
+ @Override
+ public PartialResponseWriter getPartialResponseWriter() {
+ assertNotReleased();
- @Override
- public void processPartial(PhaseId phaseId) {
+ if (partialResponseWriter == null) {
+ partialResponseWriter = new PartialDelayedInitializationResponseWriter(facesContext);
+ }
+
+ return partialResponseWriter;
+ }
+
+ @Override
+ public void processPartial(PhaseId phaseId) {
UIViewRoot viewRoot = facesContext.getViewRoot();
- if (phaseId == PhaseId.APPLY_REQUEST_VALUES ||
- phaseId == PhaseId.PROCESS_VALIDATIONS ||
- phaseId == PhaseId.UPDATE_MODEL_VALUES) {
+ if (phaseId == PhaseId.APPLY_REQUEST_VALUES
+ || phaseId == PhaseId.PROCESS_VALIDATIONS
+ || phaseId == PhaseId.UPDATE_MODEL_VALUES) {
Collection<String> ids = getExecuteIds();
@@ -203,7 +200,7 @@
// RELEASE_PENDING LOG ERROR OR WARNING
return;
}
-
+
try {
processComponents(viewRoot, phaseId, ids, facesContext);
} catch (Exception e) {
@@ -221,9 +218,9 @@
}
} else if (phaseId == PhaseId.RENDER_RESPONSE) {
Collection<String> ids = getRenderIds();
- setupRenderIds(ids);
-
- try {
+ setupRenderIds(ids);
+
+ try {
PartialResponseWriter writer = getPartialResponseWriter();
ResponseWriter orig = facesContext.getResponseWriter();
facesContext.getAttributes().put(ORIGINAL_WRITER, orig);
@@ -239,16 +236,15 @@
writer.endDocument();
return;
}
-
+
// Skip this processing if "none" is specified in the render list,
// or there were no render phase client ids.
- if (ids == null || ids.isEmpty()) {
- } else {
+ if (ids != null && !ids.isEmpty()) {
processComponents(viewRoot, phaseId, ids, facesContext);
}
renderState(facesContext);
-
+
//TODO - render extensions for renderAll?
renderExtensions(facesContext, viewRoot);
@@ -263,48 +259,48 @@
throw ex;
}
}
- }
-
- private void setupExecuteIds(Collection<String> ids) {
- ExecuteComponentCallback callback = new ExecuteComponentCallback(behaviorEvent);
+ }
- if (visitActivatorComponent(activatorComponentId, callback)) {
- ids.addAll(callback.getComponentIds());
-
- if (!ids.contains(ALL)) {
- addImplicitExecuteIds(ids);
- }
- } else {
- //TODO - log or exception?
- //TODO - process default execute value
- }
- }
-
- private void setupRenderIds(Collection<String> ids) {
- if (!isRenderAll()) {
- RenderComponentCallback callback = new RenderComponentCallback(behaviorEvent);
-
- if (visitActivatorComponent(activatorComponentId, callback)) {
- ids.addAll(callback.getComponentIds());
+ private void setupExecuteIds(Collection<String> ids) {
+ ExecuteComponentCallback callback = new ExecuteComponentCallback(behaviorEvent);
- if (!Boolean.TRUE.equals(renderAll) && !ids.contains(ALL)) {
- addImplicitRenderIds(ids, callback.isLimitRender());
-
- //TODO - review
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
- ajaxContext.setOnbeforedomupdate(callback.getOnbeforedomupdate());
- ajaxContext.setOncomplete(callback.getOncomplete());
- ajaxContext.setResponseData(callback.getData());
- }
- } else {
- //TODO - the same as for "execute"
- }
- }
- }
-
+ if (visitActivatorComponent(activatorComponentId, callback)) {
+ ids.addAll(callback.getComponentIds());
+
+ if (!ids.contains(ALL)) {
+ addImplicitExecuteIds(ids);
+ }
+ } else {
+ //TODO - log or exception?
+ //TODO - process default execute value
+ }
+ }
+
+ private void setupRenderIds(Collection<String> ids) {
+ if (!isRenderAll()) {
+ RenderComponentCallback callback = new RenderComponentCallback(behaviorEvent);
+
+ if (visitActivatorComponent(activatorComponentId, callback)) {
+ ids.addAll(callback.getComponentIds());
+
+ if (!Boolean.TRUE.equals(renderAll) && !ids.contains(ALL)) {
+ addImplicitRenderIds(ids, callback.isLimitRender());
+
+ //TODO - review
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
+ ajaxContext.setOnbeforedomupdate(callback.getOnbeforedomupdate());
+ ajaxContext.setOncomplete(callback.getOncomplete());
+ ajaxContext.setResponseData(callback.getData());
+ }
+ } else {
+ //TODO - the same as for "execute"
+ }
+ }
+ }
+
// Process the components specified in the phaseClientIds list
private void processComponents(UIComponent component, PhaseId phaseId,
- Collection<String> phaseClientIds, FacesContext context) throws IOException {
+ Collection<String> phaseClientIds, FacesContext context) throws IOException {
// We use the tree visitor mechanism to locate the components to
// process. Create our (partial) VisitContext and the
@@ -351,80 +347,80 @@
*
* @see javax.faces.context.PartialViewContext#release()
*/
- @Override
- public void release() {
- assertNotReleased();
+ @Override
+ public void release() {
+ assertNotReleased();
- released = true;
-
- facesContext = null;
- partialResponseWriter = null;
-
- executeIds = null;
- renderIds = null;
-
- ajaxRequest = null;
- partialRequest = null;
- renderAll = null;
-
- activatorComponentId = null;
- behaviorEvent = null;
- }
+ released = true;
- protected void addImplicitExecuteIds(Collection<String> ids) {
- if (!ids.isEmpty()) {
- UIViewRoot root = facesContext.getViewRoot();
- if (root.getFacetCount() > 0) {
- if (root.getFacet(UIViewRoot.METADATA_FACET_NAME) != null) {
- ids.add(UIViewRoot.METADATA_FACET_NAME);
- }
- }
- }
- }
-
- protected void addImplicitRenderIds(Collection<String> ids, boolean limitRender) {
- if (!limitRender) {
- // TODO: data table support
- Collection<AjaxOutput> ajaxOutputComponentsSet =
- PartialViewContextAjaxOutputTracker.getAjaxOutputComponentsSet(facesContext);
+ facesContext = null;
+ partialResponseWriter = null;
- for (AjaxOutput ajaxOutput : ajaxOutputComponentsSet) {
- if (ajaxOutput.isAjaxRendered()) {
- UIComponent ajaxOutputComponent = (UIComponent) ajaxOutput;
+ executeIds = null;
+ renderIds = null;
- ids.add(ajaxOutputComponent.getClientId(facesContext));
- }
- }
- }
- }
+ ajaxRequest = null;
+ partialRequest = null;
+ renderAll = null;
- protected void renderExtensions(FacesContext context, UIComponent component) throws IOException {
- AjaxRendererUtils.renderAjaxExtensions(context, component);
- }
-
- private void assertNotReleased() {
- if (released) {
- throw new IllegalStateException("PartialViewContext already released!");
- }
- }
-
- private boolean visitActivatorComponent(String componentActivatorId, VisitCallback visitCallback) {
+ activatorComponentId = null;
+ behaviorEvent = null;
+ }
+
+ protected void addImplicitExecuteIds(Collection<String> ids) {
+ if (!ids.isEmpty()) {
+ UIViewRoot root = facesContext.getViewRoot();
+ if (root.getFacetCount() > 0) {
+ if (root.getFacet(UIViewRoot.METADATA_FACET_NAME) != null) {
+ ids.add(UIViewRoot.METADATA_FACET_NAME);
+ }
+ }
+ }
+ }
+
+ protected void addImplicitRenderIds(Collection<String> ids, boolean limitRender) {
+ if (!limitRender) {
+ // TODO: data table support
+ Collection<AjaxOutput> ajaxOutputComponentsSet =
+ PartialViewContextAjaxOutputTracker.getAjaxOutputComponentsSet(facesContext);
+
+ for (AjaxOutput ajaxOutput : ajaxOutputComponentsSet) {
+ if (ajaxOutput.isAjaxRendered()) {
+ UIComponent ajaxOutputComponent = (UIComponent) ajaxOutput;
+
+ ids.add(ajaxOutputComponent.getClientId(facesContext));
+ }
+ }
+ }
+ }
+
+ protected void renderExtensions(FacesContext context, UIComponent component) throws IOException {
+ AjaxRendererUtils.renderAjaxExtensions(context, component);
+ }
+
+ private void assertNotReleased() {
+ if (released) {
+ throw new IllegalStateException("PartialViewContext already released!");
+ }
+ }
+
+ private boolean visitActivatorComponent(String componentActivatorId, VisitCallback visitCallback) {
Set<String> idsToVisit = Collections.singleton(componentActivatorId);
- Set<VisitHint> visitHints = EnumSet.of(VisitHint.SKIP_UNRENDERED);
- VisitContext visitContext = VisitContext.createVisitContext(facesContext, idsToVisit, visitHints);
+ Set<VisitHint> visitHints = EnumSet.of(VisitHint.SKIP_UNRENDERED);
+ VisitContext visitContext = VisitContext.createVisitContext(facesContext, idsToVisit, visitHints);
- boolean visitResult = facesContext.getViewRoot().visitTree(visitContext, visitCallback);
- return visitResult;
- }
-
+ boolean visitResult = facesContext.getViewRoot().visitTree(visitContext, visitCallback);
+ return visitResult;
+ }
+
private void cleanupAfterView() {
ResponseWriter orig = (ResponseWriter) facesContext.getAttributes().get(ORIGINAL_WRITER);
- assert (null != orig);
+ assert null != orig;
// move aside the PartialResponseWriter
facesContext.setResponseWriter(orig);
}
- private static class PhaseAwareVisitCallback implements VisitCallback {
+ private static final class PhaseAwareVisitCallback implements VisitCallback {
private PhaseId curPhase;
private FacesContext ctx;
@@ -432,9 +428,8 @@
private PhaseAwareVisitCallback(FacesContext ctx, PhaseId curPhase) {
this.ctx = ctx;
this.curPhase = curPhase;
- }
+ }
-
public VisitResult visit(VisitContext context, UIComponent comp) {
try {
if (curPhase == PhaseId.APPLY_REQUEST_VALUES) {
@@ -456,8 +451,7 @@
try {
// do the default behavior...
comp.encodeAll(ctx);
- }
- catch (Exception ce) {
+ } catch (Exception ce) {
if (LOG.isErrorEnabled()) {
LOG.error(ce.getMessage());
}
@@ -466,13 +460,10 @@
}
}
writer.endUpdate();
+ } else {
+ throw new IllegalStateException("I18N: Unexpected "
+ + "PhaseId passed to PhaseAwareContextCallback: " + curPhase.toString());
}
- else {
- throw new IllegalStateException("I18N: Unexpected " +
- "PhaseId passed to " +
- " PhaseAwareContextCallback: " +
- curPhase.toString());
- }
} catch (IOException ex) {
ex.printStackTrace();
}
@@ -485,57 +476,55 @@
}
}
-
private static final class PartialDelayedInitializationResponseWriter extends PartialResponseWriter {
- private static final String DEFAULT_CHARACTER_ENCODING = "ISO-8859-1";
+ private static final String DEFAULT_CHARACTER_ENCODING = "ISO-8859-1";
- private FacesContext facesContext;
+ private FacesContext facesContext;
- private ResponseWriter responseWriter;
-
- /**
- * @param writer
- */
- public PartialDelayedInitializationResponseWriter(FacesContext facesContext) {
- super(null);
- this.facesContext = facesContext;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.context.PartialResponseWriter#getWrapped()
- */
- @Override
- public ResponseWriter getWrapped() {
- if (responseWriter == null) {
- responseWriter = createResponseWriter();
- }
-
- return responseWriter;
- }
-
- private ResponseWriter createResponseWriter() {
- ResponseWriter newResponseWriter = null;
- ExternalContext externalContext = facesContext.getExternalContext();
- String characterEncoding = externalContext.getRequestCharacterEncoding();
-
- if (characterEncoding == null) {
- characterEncoding = DEFAULT_CHARACTER_ENCODING;
- }
-
- externalContext.setResponseCharacterEncoding(characterEncoding);
-
- Writer outputWriter = null;
- try {
- outputWriter = facesContext.getExternalContext().getResponseOutputWriter();
- } catch (IOException e) {
- LOG.error("Error creating partial context response writer: " + e.getMessage(), e);
- }
-
- newResponseWriter = facesContext.getRenderKit().
- createResponseWriter(outputWriter, "text/xml", characterEncoding);
+ private ResponseWriter responseWriter;
- return newResponseWriter;
- }
- }
+ /**
+ * @param facesContext
+ */
+ public PartialDelayedInitializationResponseWriter(FacesContext facesContext) {
+ super(null);
+ this.facesContext = facesContext;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.context.PartialResponseWriter#getWrapped()
+ */
+ @Override
+ public ResponseWriter getWrapped() {
+ if (responseWriter == null) {
+ responseWriter = createResponseWriter();
+ }
+
+ return responseWriter;
+ }
+
+ private ResponseWriter createResponseWriter() {
+ ExternalContext externalContext = facesContext.getExternalContext();
+ String characterEncoding = externalContext.getRequestCharacterEncoding();
+
+ if (characterEncoding == null) {
+ characterEncoding = DEFAULT_CHARACTER_ENCODING;
+ }
+
+ externalContext.setResponseCharacterEncoding(characterEncoding);
+
+ Writer outputWriter = null;
+ try {
+ outputWriter = facesContext.getExternalContext().getResponseOutputWriter();
+ } catch (IOException e) {
+ LOG.error("Error creating partial context response writer: " + e.getMessage(), e);
+ }
+
+ ResponseWriter newResponseWriter = facesContext.getRenderKit().
+ createResponseWriter(outputWriter, "text/xml", characterEncoding);
+
+ return newResponseWriter;
+ }
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
import org.ajax4jsf.component.AjaxClientBehavior;
@@ -34,16 +32,16 @@
* @since Oct 13, 2009
*/
class RenderComponentCallback extends ComponentCallback {
-
- private boolean limitRender = false;
- private String oncomplete;
-
- private String onbeforedomupdate;
+ private boolean limitRender = false;
- private Object data;
-
- RenderComponentCallback(String behaviorEvent) {
+ private String oncomplete;
+
+ private String onbeforedomupdate;
+
+ private Object data;
+
+ RenderComponentCallback(String behaviorEvent) {
super(behaviorEvent, null);
}
@@ -51,27 +49,27 @@
return limitRender;
}
- public String getOnbeforedomupdate() {
- return onbeforedomupdate;
- }
-
- public String getOncomplete() {
- return oncomplete;
- }
-
- public Object getData() {
- return data;
- }
+ public String getOnbeforedomupdate() {
+ return onbeforedomupdate;
+ }
- @Override
+ public String getOncomplete() {
+ return oncomplete;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ @Override
protected void doVisit(FacesContext context, UIComponent target, AjaxClientBehavior behavior) {
super.doVisit(context, target, behavior);
-
+
limitRender = AjaxRendererUtils.isAjaxLimitRender(target);
onbeforedomupdate = AjaxRendererUtils.getAjaxOnBeforeDomUpdate(target);
oncomplete = AjaxRendererUtils.getAjaxOncomplete(target);
data = AjaxRendererUtils.getAjaxData(target);
-
+
if (behavior != null) {
limitRender = behavior.isLimitRender();
onbeforedomupdate = behavior.getOnbeforedomupdate();
@@ -89,5 +87,5 @@
protected Object getBehaviorAttributeValue(AjaxClientBehavior behavior) {
return behavior.getRender();
}
-
+
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/SingletonsContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/SingletonsContext.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/SingletonsContext.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.context;
+import javax.faces.context.FacesContext;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -45,5 +42,6 @@
}
};
- private SingletonsContext() {}
+ private SingletonsContext() {
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/event/SwitchablePanelSwitchEvent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/event/SwitchablePanelSwitchEvent.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/event/SwitchablePanelSwitchEvent.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.event;
import javax.faces.component.UIComponent;
@@ -29,8 +27,7 @@
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 23.01.2007
- *
+ * created 23.01.2007
*/
public class SwitchablePanelSwitchEvent extends FacesEvent {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/event/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/event/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/event/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -1,4 +1,3 @@
-
/**
* Base RichFaces component events classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/CDL.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/CDL.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/CDL.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -29,26 +29,29 @@
* JSONArray, and to covert a JSONArray into comma delimited text. Comma
* delimited text is a very popular format for data interchange. It is
* understood by most database, spreadsheet, and organizer programs.
- * <p>
+ * <p/>
* Each row of text represents a row in a table or a data record. Each row
* ends with a NEWLINE character. Each row contains one or more values.
* Values are separated by commas. A value can contain any character except
* for comma, unless is is wrapped in single quotes or double quotes.
- * <p>
+ * <p/>
* The first row usually contains the names of the columns.
- * <p>
+ * <p/>
* A comma delimited list can be converted into a JSONArray of JSONObjects.
* The names for the elements in the JSONObjects can be taken from the names
* in the first row.
+ *
* @author JSON.org
* @version 2
*/
public final class CDL {
- private CDL() {}
+ private CDL() {
+ }
/**
* Get the next value. The value can be wrapped in quotes. The value can
* be empty.
+ *
* @param x A JSONTokener of the source text.
* @return The value string, or null if empty.
* @throws JSONException if the quoted string is badly formed.
@@ -61,19 +64,19 @@
} while ((c <= ' ') && (c != 0));
switch (c) {
- case 0 :
+ case 0:
return null;
- case '"' :
- case '\'' :
+ case '"':
+ case '\'':
return x.nextString(c);
- case ',' :
+ case ',':
x.back();
return "";
- default :
+ default:
x.back();
return x.nextTo(',');
@@ -82,6 +85,7 @@
/**
* Produce a JSONArray of strings from a row of comma delimited values.
+ *
* @param x A JSONTokener of the source text.
* @return A JSONArray of strings.
* @throws JSONException
@@ -119,10 +123,11 @@
/**
* Produce a JSONObject from a row of comma delimited text, using a
* parallel JSONArray of strings to provides the names of the elements.
+ *
* @param names A JSONArray of names. This is commonly obtained from the
- * first row of a comma delimited text file using the rowToJSONArray
- * method.
- * @param x A JSONTokener of the source text.
+ * first row of a comma delimited text file using the rowToJSONArray
+ * method.
+ * @param x A JSONTokener of the source text.
* @return A JSONObject combining the names and values.
* @throws JSONException
*/
@@ -135,6 +140,7 @@
/**
* Produce a JSONArray of JSONObjects from a comma delimited text string,
* using the first row as a source of names.
+ *
* @param string The comma delimited text.
* @return A JSONArray of JSONObjects.
* @throws JSONException
@@ -146,6 +152,7 @@
/**
* Produce a JSONArray of JSONObjects from a comma delimited text string,
* using the first row as a source of names.
+ *
* @param x The JSONTokener containing the comma delimited text.
* @return A JSONArray of JSONObjects.
* @throws JSONException
@@ -157,7 +164,8 @@
/**
* Produce a JSONArray of JSONObjects from a comma delimited text string
* using a supplied JSONArray as the source of element names.
- * @param names A JSONArray of strings.
+ *
+ * @param names A JSONArray of strings.
* @param string The comma delimited text.
* @return A JSONArray of JSONObjects.
* @throws JSONException
@@ -169,8 +177,9 @@
/**
* Produce a JSONArray of JSONObjects from a comma delimited text string
* using a supplied JSONArray as the source of element names.
+ *
* @param names A JSONArray of strings.
- * @param x A JSONTokener of the source text.
+ * @param x A JSONTokener of the source text.
* @return A JSONArray of JSONObjects.
* @throws JSONException
*/
@@ -201,6 +210,7 @@
/**
* Produce a comma delimited text row from a JSONArray. Values containing
* the comma character will be quoted.
+ *
* @param ja A JSONArray of strings.
* @return A string ending in NEWLINE.
*/
@@ -242,6 +252,7 @@
* Produce a comma delimited text from a JSONArray of JSONObjects. The
* first row will be a list of names obtained by inspecting the first
* JSONObject.
+ *
* @param ja A JSONArray of JSONObjects.
* @return A comma delimited text.
* @throws JSONException
@@ -264,8 +275,9 @@
* Produce a comma delimited text from a JSONArray of JSONObjects using
* a provided list of names. The list of names is not included in the
* output.
+ *
* @param names A JSONArray of strings.
- * @param ja A JSONArray of JSONObjects.
+ * @param ja A JSONArray of JSONObjects.
* @return A comma delimited text.
* @throws JSONException
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/Cookie.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/Cookie.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/Cookie.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -27,11 +27,13 @@
/**
* Convert a web browser cookie specification to a JSONObject and back.
* JSON and Cookies are both notations for name/value pairs.
+ *
* @author JSON.org
* @version 2
*/
public final class Cookie {
- private Cookie() {}
+ private Cookie() {
+ }
/**
* Produce a copy of a string in which the characters '+', '%', '=', ';'
@@ -42,8 +44,9 @@
* only a convention, not a standard. Often, cookies are expected to have
* encoded values. We encode '=' and ';' because we must. We encode '%' and
* '+' because they are meta characters in URL encoding.
+ *
* @param string The source string.
- * @return The escaped result.
+ * @return The escaped result.
*/
public static String escape(String string) {
char c;
@@ -76,9 +79,10 @@
* stored under the key "value". This method does not do checking or
* validation of the parameters. It only converts the cookie string into
* a JSONObject.
+ *
* @param string The cookie specification string.
* @return A JSONObject containing "name", "value", and possibly other
- * members.
+ * members.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException {
@@ -118,6 +122,7 @@
* If the JSONObject contains "expires", "domain", "path", or "secure"
* members, they will be appended to the cookie specification string.
* All other members are ignored.
+ *
* @param o A JSONObject
* @return A cookie specification string
* @throws JSONException
@@ -154,9 +159,10 @@
/**
* Convert <code>%</code><i>hh</i> sequences to single characters, and
* convert plus to space.
+ *
* @param s A string that may contain
- * <code>+</code> <small>(plus)</small> and
- * <code>%</code><i>hh</i> sequences.
+ * <code>+</code> <small>(plus)</small> and
+ * <code>%</code><i>hh</i> sequences.
* @return The unescaped string.
*/
public static String unescape(String s) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/CookieList.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/CookieList.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/CookieList.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,26 +23,30 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.util.Iterator;
/**
* Convert a web browser cookie list string to a JSONObject and back.
+ *
* @author JSON.org
* @version 2
*/
public final class CookieList {
- private CookieList() {}
+ private CookieList() {
+ }
/**
* Convert a cookie list into a JSONObject. A cookie list is a sequence
* of name/value pairs. The names are separated from the values by '='.
* The pairs are separated by ';'. The names and the values
* will be unescaped, possibly converting '+' and '%' sequences.
- *
+ * <p/>
* To add a cookie to a cooklist,
* cookielistJSONObject.put(cookieJSONObject.getString("name"),
- * cookieJSONObject.getString("value"));
- * @param string A cookie list string
+ * cookieJSONObject.getString("value"));
+ *
+ * @param string A cookie list string
* @return A JSONObject
* @throws JSONException
*/
@@ -66,6 +70,7 @@
* of name/value pairs. The names are separated from the values by '='.
* The pairs are separated by ';'. The characters '%', '+', '=', and ';'
* in the names and values are replaced by "%hh".
+ *
* @param o A JSONObject
* @return A cookie list string
* @throws JSONException
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTP.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTP.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTP.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,10 +23,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.util.Iterator;
/**
* Convert an HTTP header to a JSONObject and back.
+ *
* @author JSON.org
* @version 2
*/
@@ -37,7 +39,8 @@
*/
public static final String CRLF = "\r\n";
- private HTTP() {}
+ private HTTP() {
+ }
/**
* Convert an HTTP header string into a JSONObject. It can be a request
@@ -66,9 +69,10 @@
* ...}</pre>
* It does no further checking or conversion. It does not parse dates.
* It does not do '%' transforms on URLs.
+ *
* @param string An HTTP header string.
* @return A JSONObject containing the elements and attributes
- * of the XML string.
+ * of the XML string.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException {
@@ -120,10 +124,11 @@
* }</pre>
* Any other members of the JSONObject will be output as HTTP fields.
* The result will end with two CRLF pairs.
+ *
* @param o A JSONObject
* @return An HTTP header string.
* @throws JSONException if the object does not contain enough
- * information.
+ * information.
*/
public static String toString(JSONObject o) throws JSONException {
Iterator keys = o.keys();
@@ -154,7 +159,7 @@
s = keys.next().toString();
if (!s.equals("HTTP-Version") && !s.equals("Status-Code") && !s.equals("Reason-Phrase")
- && !s.equals("Method") && !s.equals("Request-URI") && !o.isNull(s)) {
+ && !s.equals("Method") && !s.equals("Request-URI") && !o.isNull(s)) {
sb.append(s);
sb.append(": ");
sb.append(o.getString(s));
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTPTokener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTPTokener.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/HTTPTokener.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -27,6 +27,7 @@
/**
* The HTTPTokener extends the JSONTokener to provide additional methods
* for the parsing of HTTP headers.
+ *
* @author JSON.org
* @version 2
*/
@@ -34,6 +35,7 @@
/**
* Construct an XMLTokener from a string.
+ *
* @param s A source string.
*/
public HTTPTokener(String s) {
@@ -42,8 +44,9 @@
/**
* Get the next token or string. This is used in parsing HTTP headers.
+ *
+ * @return A String.
* @throws JSONException
- * @return A String.
*/
public String nextToken() throws JSONException {
char c;
@@ -57,7 +60,7 @@
if ((c == '"') || (c == '\'')) {
q = c;
- for (;;) {
+ for (; ;) {
c = next();
if (c < ' ') {
@@ -72,7 +75,7 @@
}
}
- for (;;) {
+ for (; ;) {
if ((c == 0) || Character.isWhitespace(c)) {
return sb.toString();
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSContentHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSContentHandler.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSContentHandler.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
import org.ajax4jsf.Messages;
import org.ajax4jsf.javascript.JSEncoder;
-
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
@@ -34,21 +31,21 @@
import java.io.IOException;
import java.io.Writer;
-
import java.util.Arrays;
/**
* @author shura
- * SAX content handler for serialise events as JavaScript function.
+ * SAX content handler for serialise events as JavaScript function.
*/
public class JSContentHandler implements ContentHandler, LexicalHandler {
+ public static final String DEFAULT_ENCODING = "ISO-8859-1";
+
private static final char C_COMMA = ',';
private static final char C_GT = '>';
private static final char C_LT = '<';
private static final char C_NSSEP = ':';
private static final char C_QUOTE = '\'';
private static final char C_SPACE = ' ';
- public static final String DEFAULT_ENCODING = "ISO-8859-1";
private static final JSEncoder ENCODER = new JSEncoder();
private static final char[] S_TEXT_START = "new T(".toCharArray();
private static final char[] S_TEXT_END = ")".toCharArray();
@@ -71,28 +68,39 @@
private static final char[] S_ATTRIBUTES_START = ",{".toCharArray();
private static final char[] S_ATTRIBUTES_END = "}".toCharArray();
private static final boolean DEBUG = false;
+
+ // protected DocType doctype = null;
+ protected char[] indentBuffer;
+ protected int level;
+
+ protected Writer outputWriter;
+
private boolean hangingElement = false;
- /** True if we are processing the prolog. */
+ /**
+ * True if we are processing the prolog.
+ */
private boolean beforeDocumentStart = true;
- /** True if we are processing the DTD. */
+ /**
+ * True if we are processing the DTD.
+ */
private boolean processingDtd = false;
- /** True if we are processing the DTD. */
+ /**
+ * True if we are processing the DTD.
+ */
private boolean processingCdata = false;
/* ====================================================================== */
- // protected DocType doctype = null;
- protected char[] indentBuffer;
- protected int level;
-
- /** The <code>DocType</code> instance representing the document. */
+ /**
+ * The <code>DocType</code> instance representing the document.
+ */
private Locator locator;
- protected Writer outputWriter;
- public JSContentHandler() {}
+ public JSContentHandler() {
+ }
/**
* @param outputWriter
@@ -114,6 +122,7 @@
* (non-Javadoc)
* @see org.xml.sax.ContentHandler#characters(char[], int, int)
*/
+
public void characters(char[] ch, int start, int length) throws SAXException {
if (this.beforeDocumentStart || (level < 0)) {
return;
@@ -196,9 +205,8 @@
/**
* Write the end part of a start element (if necessary).
*
- * @param endElement
- * Whether this method was called because an element is being
- * closed or not.
+ * @param endElement Whether this method was called because an element is being
+ * closed or not.
* @return <b>true </b> if this call successfully closed the element (and no
* further <code></element></code> is required.
*/
@@ -226,7 +234,8 @@
* (non-Javadoc)
* @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
*/
- public void endPrefixMapping(String prefix) throws SAXException {}
+ public void endPrefixMapping(String prefix) throws SAXException {
+ }
/*
* (non-Javadoc)
@@ -321,6 +330,7 @@
* (non-Javadoc)
* @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
*/
+
public void skippedEntity(String name) throws SAXException {
// TODO Auto-generated method stub
@@ -443,7 +453,8 @@
* (non-Javadoc)
* @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
*/
- public void startPrefixMapping(String prefix, String uri) throws SAXException {}
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ }
/*
* (non-Javadoc)
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONAccessor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONAccessor.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONAccessor.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,15 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
import java.util.Collection;
import java.util.Map;
final class JSONAccessor {
- private JSONAccessor() {}
+ private JSONAccessor() {
+ }
static boolean putValue(JSONObject object, String key, Object value) {
try {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONArray.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONArray.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONArray.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,10 +23,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.io.IOException;
import java.io.Serializable;
import java.io.Writer;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
@@ -40,42 +40,42 @@
* <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
* <code>Number</code>, <code>String</code>, or the
* <code>JSONObject.NULL object</code>.
- * <p>
+ * <p/>
* The constructor can convert a JSON text into a Java object. The
* <code>toString</code> method converts to JSON text.
- * <p>
+ * <p/>
* A <code>get</code> method returns a value if one can be found, and throws an
* exception if one cannot be found. An <code>opt</code> method returns a
* default value instead of throwing an exception, and so is useful for
* obtaining optional values.
- * <p>
+ * <p/>
* The generic <code>get()</code> and <code>opt()</code> methods return an
* object which you can cast or query for type. There are also typed
* <code>get</code> and <code>opt</code> methods that do type checking and type
* coersion for you.
- * <p>
+ * <p/>
* The texts produced by the <code>toString</code> methods strictly conform to
* JSON syntax rules. The constructors are more forgiving in the texts they will
* accept:
* <ul>
* <li>An extra <code>,</code> <small>(comma)</small> may appear just
- * before the closing bracket.</li>
+ * before the closing bracket.</li>
* <li>The <code>null</code> value will be inserted when there
- * is <code>,</code> <small>(comma)</small> elision.</li>
+ * is <code>,</code> <small>(comma)</small> elision.</li>
* <li>Strings may be quoted with <code>'</code> <small>(single
- * quote)</small>.</li>
+ * quote)</small>.</li>
* <li>Strings do not need to be quoted at all if they do not begin with a quote
- * or single quote, and if they do not contain leading or trailing spaces,
- * and if they do not contain any of these characters:
- * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
- * and if they are not the reserved words <code>true</code>,
- * <code>false</code>, or <code>null</code>.</li>
+ * or single quote, and if they do not contain leading or trailing spaces,
+ * and if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
+ * and if they are not the reserved words <code>true</code>,
+ * <code>false</code>, or <code>null</code>.</li>
* <li>Values can be separated by <code>;</code> <small>(semicolon)</small> as
- * well as by <code>,</code> <small>(comma)</small>.</li>
+ * well as by <code>,</code> <small>(comma)</small>.</li>
* <li>Numbers may have the <code>0-</code> <small>(octal)</small> or
- * <code>0x-</code> <small>(hex)</small> prefix.</li>
+ * <code>0x-</code> <small>(hex)</small> prefix.</li>
* <li>Comments written in the slashshlash, slashstar, and hash conventions
- * will be ignored.</li>
+ * will be ignored.</li>
* </ul>
*
* @author JSON.org
@@ -102,7 +102,8 @@
/**
* Construct a JSONArray from a Collection.
- * @param collection A Collection.
+ *
+ * @param collection A Collection.
*/
public JSONArray(Collection collection) {
this.myArrayList = (collection == null) ? new ArrayList() : new ArrayList(collection);
@@ -110,6 +111,7 @@
/**
* Construct a JSONArray from a JSONTokener.
+ *
* @param x A JSONTokener
* @throws JSONException If there is a syntax error.
*/
@@ -136,8 +138,8 @@
}
switch (x.nextClean()) {
- case ';' :
- case ',' :
+ case ';':
+ case ',':
if (x.nextClean() == ']') {
return;
}
@@ -146,10 +148,10 @@
break;
- case ']' :
+ case ']':
return;
- default :
+ default:
throw x.syntaxError("Expected a ',' or ']'");
}
}
@@ -157,10 +159,11 @@
/**
* Construct a JSONArray from a source sJSON text.
- * @param string A string that begins with
- * <code>[</code> <small>(left bracket)</small>
- * and ends with <code>]</code> <small>(right bracket)</small>.
- * @throws JSONException If there is a syntax error.
+ *
+ * @param string A string that begins with
+ * <code>[</code> <small>(left bracket)</small>
+ * and ends with <code>]</code> <small>(right bracket)</small>.
+ * @throws JSONException If there is a syntax error.
*/
public JSONArray(String string) throws JSONException {
this(new JSONTokener(string));
@@ -168,8 +171,8 @@
/**
* Get the object value associated with an index.
- * @param index
- * The index must be between 0 and length() - 1.
+ *
+ * @param index The index must be between 0 and length() - 1.
* @return An object value.
* @throws JSONException If there is no value for the index.
*/
@@ -188,9 +191,9 @@
* The string values "true" and "false" are converted to boolean.
*
* @param index The index must be between 0 and length() - 1.
- * @return The truth.
+ * @return The truth.
* @throws JSONException If there is no value for the index or if the
- * value is not convertable to boolean.
+ * value is not convertable to boolean.
*/
public boolean getBoolean(int index) throws JSONException {
Object o = get(index);
@@ -208,9 +211,9 @@
* Get the double value associated with an index.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
- * @throws JSONException If the key is not found or if the value cannot
- * be converted to a number.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
*/
public double getDouble(int index) throws JSONException {
Object o = get(index);
@@ -226,10 +229,10 @@
* Get the int value associated with an index.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
- * @throws JSONException If the key is not found or if the value cannot
- * be converted to a number.
- * if the value cannot be converted to a number.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
+ * if the value cannot be converted to a number.
*/
public int getInt(int index) throws JSONException {
Object o = get(index);
@@ -239,10 +242,11 @@
/**
* Get the JSONArray associated with an index.
+ *
* @param index The index must be between 0 and length() - 1.
- * @return A JSONArray value.
+ * @return A JSONArray value.
* @throws JSONException If there is no value for the index. or if the
- * value is not a JSONArray
+ * value is not a JSONArray
*/
public JSONArray getJSONArray(int index) throws JSONException {
Object o = get(index);
@@ -256,10 +260,11 @@
/**
* Get the JSONObject associated with an index.
+ *
* @param index subscript
- * @return A JSONObject value.
+ * @return A JSONObject value.
* @throws JSONException If there is no value for the index or if the
- * value is not a JSONObject
+ * value is not a JSONObject
*/
public JSONObject getJSONObject(int index) throws JSONException {
Object o = get(index);
@@ -275,9 +280,9 @@
* Get the long value associated with an index.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
- * @throws JSONException If the key is not found or if the value cannot
- * be converted to a number.
+ * @return The value.
+ * @throws JSONException If the key is not found or if the value cannot
+ * be converted to a number.
*/
public long getLong(int index) throws JSONException {
Object o = get(index);
@@ -287,8 +292,9 @@
/**
* Get the string associated with an index.
+ *
* @param index The index must be between 0 and length() - 1.
- * @return A string value.
+ * @return A string value.
* @throws JSONException If there is no value for the index.
*/
public String getString(int index) throws JSONException {
@@ -297,6 +303,7 @@
/**
* Determine if the value is null.
+ *
* @param index The index must be between 0 and length() - 1.
* @return true if the value at the index is null, or if there is no value.
*/
@@ -308,6 +315,7 @@
* Make a string from the contents of this JSONArray. The
* <code>separator</code> string is inserted between each element.
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param separator A string that will be inserted between the elements.
* @return a string.
* @throws JSONException If the array contains an invalid number.
@@ -338,9 +346,10 @@
/**
* Get the optional object value associated with an index.
+ *
* @param index The index must be between 0 and length() - 1.
- * @return An object value, or null if there is no
- * object at that index.
+ * @return An object value, or null if there is no
+ * object at that index.
*/
public Object opt(int index) {
return ((index < 0) || (index >= length())) ? null : this.myArrayList.get(index);
@@ -352,7 +361,7 @@
* or if the value is not Boolean.TRUE or the String "true".
*
* @param index The index must be between 0 and length() - 1.
- * @return The truth.
+ * @return The truth.
*/
public boolean optBoolean(int index) {
return optBoolean(index, false);
@@ -363,9 +372,9 @@
* It returns the defaultValue if there is no value at that index or if
* it is not a Boolean or the String "true" or "false" (case insensitive).
*
- * @param index The index must be between 0 and length() - 1.
- * @param defaultValue A boolean default.
- * @return The truth.
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue A boolean default.
+ * @return The truth.
*/
public boolean optBoolean(int index, boolean defaultValue) {
try {
@@ -381,7 +390,7 @@
* or if the value is not a number and cannot be converted to a number.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
+ * @return The value.
*/
public double optDouble(int index) {
return optDouble(index, Double.NaN);
@@ -392,9 +401,9 @@
* The defaultValue is returned if there is no value for the index,
* or if the value is not a number and cannot be converted to a number.
*
- * @param index subscript
- * @param defaultValue The default value.
- * @return The value.
+ * @param index subscript
+ * @param defaultValue The default value.
+ * @return The value.
*/
public double optDouble(int index, double defaultValue) {
try {
@@ -410,7 +419,7 @@
* or if the value is not a number and cannot be converted to a number.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
+ * @return The value.
*/
public int optInt(int index) {
return optInt(index, 0);
@@ -420,9 +429,10 @@
* Get the optional int value associated with an index.
* The defaultValue is returned if there is no value for the index,
* or if the value is not a number and cannot be converted to a number.
- * @param index The index must be between 0 and length() - 1.
- * @param defaultValue The default value.
- * @return The value.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return The value.
*/
public int optInt(int index, int defaultValue) {
try {
@@ -434,9 +444,10 @@
/**
* Get the optional JSONArray associated with an index.
+ *
* @param index subscript
- * @return A JSONArray value, or null if the index has no value,
- * or if the value is not a JSONArray.
+ * @return A JSONArray value, or null if the index has no value,
+ * or if the value is not a JSONArray.
*/
public JSONArray optJSONArray(int index) {
Object o = opt(index);
@@ -450,7 +461,7 @@
* no value, or if the value is not a JSONObject.
*
* @param index The index must be between 0 and length() - 1.
- * @return A JSONObject value.
+ * @return A JSONObject value.
*/
public JSONObject optJSONObject(int index) {
Object o = opt(index);
@@ -464,7 +475,7 @@
* or if the value is not a number and cannot be converted to a number.
*
* @param index The index must be between 0 and length() - 1.
- * @return The value.
+ * @return The value.
*/
public long optLong(int index) {
return optLong(index, 0);
@@ -474,9 +485,10 @@
* Get the optional long value associated with an index.
* The defaultValue is returned if there is no value for the index,
* or if the value is not a number and cannot be converted to a number.
- * @param index The index must be between 0 and length() - 1.
- * @param defaultValue The default value.
- * @return The value.
+ *
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return The value.
*/
public long optLong(int index, long defaultValue) {
try {
@@ -492,7 +504,7 @@
* is not a string and is not null, then it is coverted to a string.
*
* @param index The index must be between 0 and length() - 1.
- * @return A String value.
+ * @return A String value.
*/
public String optString(int index) {
return optString(index, "");
@@ -502,9 +514,9 @@
* Get the optional string associated with an index.
* The defaultValue is returned if the key is not found.
*
- * @param index The index must be between 0 and length() - 1.
- * @param defaultValue The default value.
- * @return A String value.
+ * @param index The index must be between 0 and length() - 1.
+ * @param defaultValue The default value.
+ * @return A String value.
*/
public String optString(int index, String defaultValue) {
Object o = opt(index);
@@ -527,8 +539,9 @@
/**
* Put a value in the JSONArray, where the value will be a
* JSONArray which is produced from a Collection.
+ *
* @param value A Collection value.
- * @return this.
+ * @return this.
*/
public JSONArray put(Collection value) {
put(new JSONArray(value));
@@ -540,8 +553,8 @@
* Append a double value. This increases the array's length by one.
*
* @param value A double value.
+ * @return this.
* @throws JSONException if the value is not finite.
- * @return this.
*/
public JSONArray put(double value) throws JSONException {
Double d = new Double(value);
@@ -579,8 +592,9 @@
/**
* Put a value in the JSONArray, where the value will be a
* JSONObject which is produced from a Map.
+ *
* @param value A Map value.
- * @return this.
+ * @return this.
*/
public JSONArray put(Map value) {
put(new JSONObject(value));
@@ -590,9 +604,10 @@
/**
* Append an object value. This increases the array's length by one.
+ *
* @param value An object value. The value should be a
- * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
- * JSONObject.NULL object.
+ * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
+ * JSONObject.NULL object.
* @return this.
*/
public JSONArray put(Object value) {
@@ -605,6 +620,7 @@
* Put or replace a boolean value in the JSONArray. If the index is greater
* than the length of the JSONArray, then null elements will be added as
* necessary to pad it out.
+ *
* @param index The subscript.
* @param value A boolean value.
* @return this.
@@ -619,11 +635,12 @@
/**
* Put a value in the JSONArray, where the value will be a
* JSONArray which is produced from a Collection.
+ *
* @param index The subscript.
* @param value A Collection value.
- * @return this.
+ * @return this.
* @throws JSONException If the index is negative or if the value is
- * not finite.
+ * not finite.
*/
public JSONArray put(int index, Collection value) throws JSONException {
put(index, new JSONArray(value));
@@ -633,13 +650,14 @@
/**
* Put or replace a double value. If the index is greater than the length of
- * the JSONArray, then null elements will be added as necessary to pad
- * it out.
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
* @param index The subscript.
* @param value A double value.
* @return this.
* @throws JSONException If the index is negative or if the value is
- * not finite.
+ * not finite.
*/
public JSONArray put(int index, double value) throws JSONException {
put(index, new Double(value));
@@ -649,8 +667,9 @@
/**
* Put or replace an int value. If the index is greater than the length of
- * the JSONArray, then null elements will be added as necessary to pad
- * it out.
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
* @param index The subscript.
* @param value An int value.
* @return this.
@@ -664,8 +683,9 @@
/**
* Put or replace a long value. If the index is greater than the length of
- * the JSONArray, then null elements will be added as necessary to pad
- * it out.
+ * the JSONArray, then null elements will be added as necessary to pad
+ * it out.
+ *
* @param index The subscript.
* @param value A long value.
* @return this.
@@ -680,11 +700,12 @@
/**
* Put a value in the JSONArray, where the value will be a
* JSONObject which is produced from a Map.
+ *
* @param index The subscript.
* @param value The Map value.
- * @return this.
+ * @return this.
* @throws JSONException If the index is negative or if the the value is
- * an invalid number.
+ * an invalid number.
*/
public JSONArray put(int index, Map value) throws JSONException {
put(index, new JSONObject(value));
@@ -694,15 +715,16 @@
/**
* Put or replace an object value in the JSONArray. If the index is greater
- * than the length of the JSONArray, then null elements will be added as
- * necessary to pad it out.
+ * than the length of the JSONArray, then null elements will be added as
+ * necessary to pad it out.
+ *
* @param index The subscript.
* @param value The value to put into the array. The value should be a
- * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
- * JSONObject.NULL object.
+ * Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
+ * JSONObject.NULL object.
* @return this.
* @throws JSONException If the index is negative or if the the value is
- * an invalid number.
+ * an invalid number.
*/
public JSONArray put(int index, Object value) throws JSONException {
JSONObject.testValidity(value);
@@ -727,10 +749,11 @@
/**
* Produce a JSONObject by combining a JSONArray of names with the values
* of this JSONArray.
+ *
* @param names A JSONArray containing a list of key strings. These will be
- * paired with the values.
+ * paired with the values.
* @return A JSONObject, or null if there are no names or if this JSONArray
- * has no values.
+ * has no values.
* @throws JSONException If any of the names are null.
*/
public JSONObject toJSONObject(JSONArray names) throws JSONException {
@@ -752,11 +775,11 @@
* unnecessary whitespace is added. If it is not possible to produce a
* syntactically correct JSON text then null will be returned instead. This
* could occur if the array contains an invalid number.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
*
* @return a printable, displayable, transmittable
- * representation of the array.
+ * representation of the array.
*/
public String toString() {
try {
@@ -769,12 +792,13 @@
/**
* Make a prettyprinted JSON text of this JSONArray.
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param indentFactor The number of spaces to add to each level of
- * indentation.
+ * indentation.
* @return a printable, displayable, transmittable
- * representation of the object, beginning
- * with <code>[</code> <small>(left bracket)</small> and ending
- * with <code>]</code> <small>(right bracket)</small>.
+ * representation of the object, beginning
+ * with <code>[</code> <small>(left bracket)</small> and ending
+ * with <code>]</code> <small>(right bracket)</small>.
* @throws JSONException
*/
public String toString(int indentFactor) throws JSONException {
@@ -784,11 +808,12 @@
/**
* Make a prettyprinted JSON text of this JSONArray.
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param indentFactor The number of spaces to add to each level of
- * indentation.
- * @param indent The indention of the top level.
+ * indentation.
+ * @param indent The indention of the top level.
* @return a printable, displayable, transmittable
- * representation of the array.
+ * representation of the array.
* @throws JSONException
*/
String toString(int indentFactor, int indent) throws JSONException {
@@ -835,7 +860,7 @@
/**
* Write the contents of the JSONArray as JSON text to a writer.
* For compactness, no whitespace is added.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
*
* @return The writer.
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONCollection.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONCollection.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONCollection.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
import java.io.Serializable;
-
import java.util.AbstractCollection;
import java.util.Iterator;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 15.12.2006
- *
+ * created 15.12.2006
*/
public class JSONCollection extends AbstractCollection implements Serializable {
@@ -59,9 +55,11 @@
public Iterator iterator() {
return new Iterator() {
int index = 0;
+
public boolean hasNext() {
return index < array.length();
}
+
public Object next() {
try {
return JSONAccessor.unwrapValue(array.get(index++));
@@ -73,6 +71,7 @@
throw new RuntimeException();
}
}
+
public void remove() {
throw new UnsupportedOperationException();
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONException.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONException.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,12 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
/**
* The JSONException is thrown by the JSON.org classes then things are amiss.
+ *
* @author JSON.org
* @version 2
*/
@@ -42,6 +41,7 @@
/**
* Constructs a JSONException with an explanatory message.
+ *
* @param message Detail about the reason for the exception.
*/
public JSONException(String message) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONMap.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONMap.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,18 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
import java.io.Serializable;
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.Set;
-import java.util.*;
-
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 15.12.2006
- *
+ * created 15.12.2006
*/
public class JSONMap extends AbstractMap implements Serializable {
private static final long serialVersionUID = 2898468948832273123L;
@@ -110,9 +109,11 @@
return new Entry() {
private String key = currentName;
+
public Object getKey() {
return key;
}
+
public Object getValue() {
try {
return JSONAccessor.getValue(jsonObject, this.key);
@@ -120,6 +121,7 @@
throw new RuntimeException(e.getMessage(), e);
}
}
+
public Object setValue(Object value) {
throw new UnsupportedOperationException();
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONObject.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONObject.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONObject.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,13 +23,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.io.Writer;
-
import java.lang.reflect.Field;
-
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -52,39 +51,40 @@
* exception if one cannot be found. An <code>opt</code> method returns a
* default value instead of throwing an exception, and so is useful for
* obtaining optional values.
- * <p>
+ * <p/>
* The generic <code>get()</code> and <code>opt()</code> methods return an
* object, which you can cast or query for type. There are also typed
* <code>get</code> and <code>opt</code> methods that do type checking and type
* coersion for you.
- * <p>
+ * <p/>
* The <code>put</code> methods adds values to an object. For example, <pre>
* myString = new JSONObject().put("JSON", "Hello, World!").toString();</pre>
* produces the string <code>{"JSON": "Hello, World"}</code>.
- * <p>
+ * <p/>
* The texts produced by the <code>toString</code> methods strictly conform to
* the JSON sysntax rules.
* The constructors are more forgiving in the texts they will accept:
* <ul>
* <li>An extra <code>,</code> <small>(comma)</small> may appear just
- * before the closing brace.</li>
+ * before the closing brace.</li>
* <li>Strings may be quoted with <code>'</code> <small>(single
- * quote)</small>.</li>
+ * quote)</small>.</li>
* <li>Strings do not need to be quoted at all if they do not begin with a quote
- * or single quote, and if they do not contain leading or trailing spaces,
- * and if they do not contain any of these characters:
- * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
- * and if they are not the reserved words <code>true</code>,
- * <code>false</code>, or <code>null</code>.</li>
+ * or single quote, and if they do not contain leading or trailing spaces,
+ * and if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers
+ * and if they are not the reserved words <code>true</code>,
+ * <code>false</code>, or <code>null</code>.</li>
* <li>Keys can be followed by <code>=</code> or <code>=></code> as well as
- * by <code>:</code>.</li>
+ * by <code>:</code>.</li>
* <li>Values can be followed by <code>;</code> <small>(semicolon)</small> as
- * well as by <code>,</code> <small>(comma)</small>.</li>
+ * well as by <code>,</code> <small>(comma)</small>.</li>
* <li>Numbers may have the <code>0-</code> <small>(octal)</small> or
- * <code>0x-</code> <small>(hex)</small> prefix.</li>
+ * <code>0x-</code> <small>(hex)</small> prefix.</li>
* <li>Comments written in the slashshlash, slashstar, and hash conventions
- * will be ignored.</li>
+ * will be ignored.</li>
* </ul>
+ *
* @author JSON.org
* @version 2
*/
@@ -117,6 +117,7 @@
/**
* Construct a JSONObject from a JSONTokener.
+ *
* @param x A JSONTokener object containing the source string.
* @throws JSONException If there is a syntax error in the source string.
*/
@@ -134,13 +135,13 @@
c = x.nextClean();
switch (c) {
- case 0 :
+ case 0:
throw x.syntaxError("A JSONObject text must end with '}'");
- case '}' :
+ case '}':
return;
- default :
+ default:
x.back();
key = x.nextValue().toString();
}
@@ -164,8 +165,8 @@
* Pairs are separated by ','. We will also tolerate ';'.
*/
switch (x.nextClean()) {
- case ';' :
- case ',' :
+ case ';':
+ case ',':
if (x.nextClean() == '}') {
return;
}
@@ -174,10 +175,10 @@
break;
- case '}' :
+ case '}':
return;
- default :
+ default:
throw x.syntaxError("Expected a ',' or '}'");
}
}
@@ -185,8 +186,9 @@
/**
* Construct a JSONObject from a Map.
+ *
* @param map A map object that can be used to initialize the contents of
- * the JSONObject.
+ * the JSONObject.
*/
public JSONObject(Map map) {
this.myHashMap = (map == null) ? new HashMap() : new HashMap(map);
@@ -195,10 +197,11 @@
/**
* Construct a JSONObject from a string.
* This is the most commonly used JSONObject constructor.
- * @param string A string beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
- * @exception JSONException If there is a syntax error in the source string.
+ *
+ * @param string A string beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
+ * @throws JSONException If there is a syntax error in the source string.
*/
public JSONObject(String string) throws JSONException {
this(new JSONTokener(string));
@@ -208,9 +211,10 @@
* Construct a JSONObject from a subset of another JSONObject.
* An array of strings is used to identify the keys that should be copied.
* Missing keys are ignored.
+ *
* @param jo A JSONObject.
* @param sa An array of strings.
- * @exception JSONException If a value is a non-finite number.
+ * @throws JSONException If a value is a non-finite number.
*/
public JSONObject(JSONObject jo, String[] sa) throws JSONException {
this();
@@ -226,10 +230,11 @@
* from the names array, and the values will be the field values associated
* with those keys in the object. If a key is not found or not visible,
* then it will not be copied into the new JSONObject.
+ *
* @param object An object that has fields that should be used to make a
- * JSONObject.
- * @param names An array of strings, the names of the fields to be used
- * from the object.
+ * JSONObject.
+ * @param names An array of strings, the names of the fields to be used
+ * from the object.
*/
public JSONObject(Object object, String[] names) {
this();
@@ -256,11 +261,12 @@
* JSONArray is stored under the key to hold all of the accumulated values.
* If there is already a JSONArray, then the new value is appended to it.
* In contrast, the put method replaces the previous value.
+ *
* @param key A key string.
* @param value An object to be accumulated under the key.
* @return this.
* @throws JSONException If the value is an invalid number
- * or if the key is null.
+ * or if the key is null.
*/
public JSONObject accumulate(String key, Object value) throws JSONException {
testValidity(value);
@@ -283,11 +289,12 @@
* JSONObject, then the key is put in the JSONObject with its value being a
* JSONArray containing the value parameter. If the key was already
* associated with a JSONArray, then the value parameter is appended to it.
+ *
* @param key A key string.
* @param value An object to be accumulated under the key.
* @return this.
* @throws JSONException If the key is null or if the current value
- * associated with the key is not a JSONArray.
+ * associated with the key is not a JSONArray.
*/
public JSONObject append(String key, Object value) throws JSONException {
testValidity(value);
@@ -308,7 +315,8 @@
/**
* Produce a string from a double. The string "null" will be returned if
* the number is not finite.
- * @param d A double.
+ *
+ * @param d A double.
* @return A String.
*/
public static String doubleToString(double d) {
@@ -335,9 +343,9 @@
/**
* Get the value object associated with a key.
*
- * @param key A key string.
- * @return The object associated with the key.
- * @throws JSONException if the key is not found.
+ * @param key A key string.
+ * @return The object associated with the key.
+ * @throws JSONException if the key is not found.
*/
public Object get(String key) throws JSONException {
Object o = opt(key);
@@ -352,10 +360,9 @@
/**
* Get the boolean value associated with a key.
*
- * @param key A key string.
- * @return The truth.
- * @throws JSONException
- * if the value is not a Boolean or the String "true" or "false".
+ * @param key A key string.
+ * @return The truth.
+ * @throws JSONException if the value is not a Boolean or the String "true" or "false".
*/
public boolean getBoolean(String key) throws JSONException {
Object o = get(key);
@@ -371,10 +378,11 @@
/**
* Get the double value associated with a key.
- * @param key A key string.
- * @return The numeric value.
+ *
+ * @param key A key string.
+ * @return The numeric value.
* @throws JSONException if the key is not found or
- * if the value is not a Number object and cannot be converted to a number.
+ * if the value is not a Number object and cannot be converted to a number.
*/
public double getDouble(String key) throws JSONException {
Object o = get(key);
@@ -390,10 +398,10 @@
* Get the int value associated with a key. If the number value is too
* large for an int, it will be clipped.
*
- * @param key A key string.
- * @return The integer value.
- * @throws JSONException if the key is not found or if the value cannot
- * be converted to an integer.
+ * @param key A key string.
+ * @return The integer value.
+ * @throws JSONException if the key is not found or if the value cannot
+ * be converted to an integer.
*/
public int getInt(String key) throws JSONException {
Object o = get(key);
@@ -404,10 +412,10 @@
/**
* Get the JSONArray value associated with a key.
*
- * @param key A key string.
- * @return A JSONArray which is the value.
- * @throws JSONException if the key is not found or
- * if the value is not a JSONArray.
+ * @param key A key string.
+ * @return A JSONArray which is the value.
+ * @throws JSONException if the key is not found or
+ * if the value is not a JSONArray.
*/
public JSONArray getJSONArray(String key) throws JSONException {
Object o = get(key);
@@ -422,10 +430,10 @@
/**
* Get the JSONObject value associated with a key.
*
- * @param key A key string.
- * @return A JSONObject which is the value.
- * @throws JSONException if the key is not found or
- * if the value is not a JSONObject.
+ * @param key A key string.
+ * @return A JSONObject which is the value.
+ * @throws JSONException if the key is not found or
+ * if the value is not a JSONObject.
*/
public JSONObject getJSONObject(String key) throws JSONException {
Object o = get(key);
@@ -441,10 +449,10 @@
* Get the long value associated with a key. If the number value is too
* long for a long, it will be clipped.
*
- * @param key A key string.
- * @return The long value.
- * @throws JSONException if the key is not found or if the value cannot
- * be converted to a long.
+ * @param key A key string.
+ * @return The long value.
+ * @throws JSONException if the key is not found or if the value cannot
+ * be converted to a long.
*/
public long getLong(String key) throws JSONException {
Object o = get(key);
@@ -455,9 +463,9 @@
/**
* Get the string associated with a key.
*
- * @param key A key string.
- * @return A string which is the value.
- * @throws JSONException if the key is not found.
+ * @param key A key string.
+ * @return A string which is the value.
+ * @throws JSONException if the key is not found.
*/
public String getString(String key) throws JSONException {
return get(key).toString();
@@ -465,8 +473,9 @@
/**
* Determine if the JSONObject contains a specific key.
- * @param key A key string.
- * @return true if the key exists in the JSONObject.
+ *
+ * @param key A key string.
+ * @return true if the key exists in the JSONObject.
*/
public boolean has(String key) {
return this.myHashMap.containsKey(key);
@@ -474,10 +483,11 @@
/**
* Determine if the value associated with the key is null or if there is
- * no value.
- * @param key A key string.
- * @return true if there is no value associated with the key or if
- * the value is the JSONObject.NULL object.
+ * no value.
+ *
+ * @param key A key string.
+ * @return true if there is no value associated with the key or if
+ * the value is the JSONObject.NULL object.
*/
public boolean isNull(String key) {
return JSONObject.NULL.equals(opt(key));
@@ -504,8 +514,9 @@
/**
* Produce a JSONArray containing the names of the elements of this
* JSONObject.
+ *
* @return A JSONArray containing the key strings, or null if the JSONObject
- * is empty.
+ * is empty.
*/
public JSONArray names() {
JSONArray ja = new JSONArray();
@@ -520,7 +531,8 @@
/**
* Produce a string from a Number.
- * @param n A Number
+ *
+ * @param n A Number
* @return A String.
* @throws JSONException If n is a non-finite number.
*/
@@ -549,8 +561,9 @@
/**
* Get an optional value associated with a key.
- * @param key A key string.
- * @return An object which is the value, or null if there is no value.
+ *
+ * @param key A key string.
+ * @return An object which is the value, or null if there is no value.
*/
public Object opt(String key) {
return (key == null) ? null : this.myHashMap.get(key);
@@ -561,8 +574,8 @@
* It returns false if there is no such key, or if the value is not
* Boolean.TRUE or the String "true".
*
- * @param key A key string.
- * @return The truth.
+ * @param key A key string.
+ * @return The truth.
*/
public boolean optBoolean(String key) {
return optBoolean(key, false);
@@ -573,9 +586,9 @@
* It returns the defaultValue if there is no such key, or if it is not
* a Boolean or the String "true" or "false" (case insensitive).
*
- * @param key A key string.
- * @param defaultValue The default.
- * @return The truth.
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return The truth.
*/
public boolean optBoolean(String key, boolean defaultValue) {
try {
@@ -588,9 +601,10 @@
/**
* Put a key/value pair in the JSONObject, where the value will be a
* JSONArray which is produced from a Collection.
+ *
* @param key A key string.
* @param value A Collection value.
- * @return this.
+ * @return this.
* @throws JSONException
*/
public JSONObject put(String key, Collection value) throws JSONException {
@@ -605,8 +619,8 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A string which is the key.
- * @return An object which is the value.
+ * @param key A string which is the key.
+ * @return An object which is the value.
*/
public double optDouble(String key) {
return optDouble(key, Double.NaN);
@@ -618,9 +632,9 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A key string.
- * @param defaultValue The default.
- * @return An object which is the value.
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
*/
public double optDouble(String key, double defaultValue) {
try {
@@ -638,8 +652,8 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A key string.
- * @return An object which is the value.
+ * @param key A key string.
+ * @return An object which is the value.
*/
public int optInt(String key) {
return optInt(key, 0);
@@ -651,9 +665,9 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A key string.
- * @param defaultValue The default.
- * @return An object which is the value.
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
*/
public int optInt(String key, int defaultValue) {
try {
@@ -668,8 +682,8 @@
* It returns null if there is no such key, or if its value is not a
* JSONArray.
*
- * @param key A key string.
- * @return A JSONArray which is the value.
+ * @param key A key string.
+ * @return A JSONArray which is the value.
*/
public JSONArray optJSONArray(String key) {
Object o = opt(key);
@@ -682,8 +696,8 @@
* It returns null if there is no such key, or if its value is not a
* JSONObject.
*
- * @param key A key string.
- * @return A JSONObject which is the value.
+ * @param key A key string.
+ * @return A JSONObject which is the value.
*/
public JSONObject optJSONObject(String key) {
Object o = opt(key);
@@ -697,8 +711,8 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A key string.
- * @return An object which is the value.
+ * @param key A key string.
+ * @return An object which is the value.
*/
public long optLong(String key) {
return optLong(key, 0);
@@ -710,9 +724,9 @@
* If the value is a string, an attempt will be made to evaluate it as
* a number.
*
- * @param key A key string.
- * @param defaultValue The default.
- * @return An object which is the value.
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return An object which is the value.
*/
public long optLong(String key, long defaultValue) {
try {
@@ -727,8 +741,8 @@
* It returns an empty string if there is no such key. If the value is not
* a string and is not null, then it is coverted to a string.
*
- * @param key A key string.
- * @return A string which is the value.
+ * @param key A key string.
+ * @return A string which is the value.
*/
public String optString(String key) {
return optString(key, "");
@@ -738,9 +752,9 @@
* Get an optional string associated with a key.
* It returns the defaultValue if there is no such key.
*
- * @param key A key string.
- * @param defaultValue The default.
- * @return A string which is the value.
+ * @param key A key string.
+ * @param defaultValue The default.
+ * @return A string which is the value.
*/
public String optString(String key, String defaultValue) {
Object o = opt(key);
@@ -807,9 +821,10 @@
/**
* Put a key/value pair in the JSONObject, where the value will be a
* JSONObject which is produced from a Map.
+ *
* @param key A key string.
* @param value A Map value.
- * @return this.
+ * @return this.
* @throws JSONException
*/
public JSONObject put(String key, Map value) throws JSONException {
@@ -821,13 +836,14 @@
/**
* Put a key/value pair in the JSONObject. If the value is null,
* then the key will be removed from the JSONObject if it is present.
+ *
* @param key A key string.
* @param value An object which is the value. It should be of one of these
- * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
- * or the JSONObject.NULL object.
+ * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
+ * or the JSONObject.NULL object.
* @return this.
* @throws JSONException If the value is non-finite number
- * or if the key is null.
+ * or if the key is null.
*/
public JSONObject put(String key, Object value) throws JSONException {
if (key == null) {
@@ -847,10 +863,11 @@
/**
* Put a key/value pair in the JSONObject, but only if the
* key and the value are both non-null.
+ *
* @param key A key string.
* @param value An object which is the value. It should be of one of these
- * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
- * or the JSONObject.NULL object.
+ * types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,
+ * or the JSONObject.NULL object.
* @return this.
* @throws JSONException If the value is a non-finite number.
*/
@@ -867,8 +884,9 @@
* right places. A backslash will be inserted within </, allowing JSON
* text to be delivered in HTML. In JSON text, a string cannot contain a
* control character or an unescaped quote or backslash.
+ *
* @param string A String
- * @return A String correctly formatted for insertion in a JSON text.
+ * @return A String correctly formatted for insertion in a JSON text.
*/
public static String quote(String string) {
if ((string == null) || (string.length() == 0)) {
@@ -889,14 +907,14 @@
c = string.charAt(i);
switch (c) {
- case '\\' :
- case '"' :
+ case '\\':
+ case '"':
sb.append('\\');
sb.append(c);
break;
- case '/' :
+ case '/':
if (b == '<') {
sb.append('\\');
}
@@ -905,32 +923,32 @@
break;
- case '\b' :
+ case '\b':
sb.append("\\b");
break;
- case '\t' :
+ case '\t':
sb.append("\\t");
break;
- case '\n' :
+ case '\n':
sb.append("\\n");
break;
- case '\f' :
+ case '\f':
sb.append("\\f");
break;
- case '\r' :
+ case '\r':
sb.append("\\r");
break;
- default :
+ default:
if (c < ' ') {
t = "000" + Integer.toHexString(c);
sb.append("\\u" + t.substring(t.length() - 4));
@@ -947,9 +965,10 @@
/**
* Remove a name and its value, if present.
+ *
* @param key The name to be removed.
* @return The value that was associated with the name,
- * or null if there was no value.
+ * or null if there was no value.
*/
public Object remove(String key) {
return this.myHashMap.remove(key);
@@ -957,6 +976,7 @@
/**
* Throw an exception if the object is an NaN or infinite number.
+ *
* @param o The object to test.
* @throws JSONException If o is a non-finite number.
*/
@@ -977,8 +997,9 @@
/**
* Produce a JSONArray containing the values of the members of this
* JSONObject.
+ *
* @param names A JSONArray containing a list of key strings. This
- * determines the sequence of the values in the result.
+ * determines the sequence of the values in the result.
* @return A JSONArray of values.
* @throws JSONException If any of the values are non-finite numbers.
*/
@@ -1000,13 +1021,13 @@
* Make a JSON text of this JSONObject. For compactness, no whitespace
* is added. If this would not result in a syntactically correct JSON text,
* then null will be returned instead.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
*
* @return a printable, displayable, portable, transmittable
- * representation of the object, beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
*/
public String toString() {
try {
@@ -1035,14 +1056,15 @@
/**
* Make a prettyprinted JSON text of this JSONObject.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param indentFactor The number of spaces to add to each level of
- * indentation.
+ * indentation.
* @return a printable, displayable, portable, transmittable
- * representation of the object, beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
* @throws JSONException If the object contains an invalid number.
*/
public String toString(int indentFactor) throws JSONException {
@@ -1051,15 +1073,16 @@
/**
* Make a prettyprinted JSON text of this JSONObject.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param indentFactor The number of spaces to add to each level of
- * indentation.
- * @param indent The indentation of the top level.
+ * indentation.
+ * @param indent The indentation of the top level.
* @return a printable, displayable, transmittable
- * representation of the object, beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
* @throws JSONException If the object contains an invalid number.
*/
String toString(int indentFactor, int indent) throws JSONException {
@@ -1120,13 +1143,14 @@
* conforming text. If the object does not contain a toJSONString
* method (which is the most common case), then a text will be
* produced by the rules.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
+ *
* @param value The value to be serialized.
* @return a printable, displayable, transmittable
- * representation of the object, beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
* @throws JSONException If the value is or contains an invalid number.
*/
static String valueToString(Object value) throws JSONException {
@@ -1163,16 +1187,17 @@
/**
* Make a prettyprinted JSON text of an object value.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
- * @param value The value to be serialized.
+ *
+ * @param value The value to be serialized.
* @param indentFactor The number of spaces to add to each level of
- * indentation.
- * @param indent The indentation of the top level.
+ * indentation.
+ * @param indent The indentation of the top level.
* @return a printable, displayable, transmittable
- * representation of the object, beginning
- * with <code>{</code> <small>(left brace)</small> and ending
- * with <code>}</code> <small>(right brace)</small>.
+ * representation of the object, beginning
+ * with <code>{</code> <small>(left brace)</small> and ending
+ * with <code>}</code> <small>(right brace)</small>.
* @throws JSONException If the object contains an invalid number.
*/
static String valueToString(Object value, int indentFactor, int indent) throws JSONException {
@@ -1215,7 +1240,7 @@
/**
* Write the contents of the JSONObject as JSON text to a writer.
* For compactness, no whitespace is added.
- * <p>
+ * <p/>
* Warning: This method assumes that the data structure is acyclical.
*
* @return The writer.
@@ -1274,7 +1299,8 @@
/**
* There is only intended to be a single instance of the NULL object,
* so the clone method returns itself.
- * @return NULL.
+ *
+ * @return NULL.
*/
@Override
protected Object clone() {
@@ -1283,9 +1309,10 @@
/**
* A Null object is equal to the null value and to itself.
- * @param object An object to test for nullness.
+ *
+ * @param object An object to test for nullness.
* @return true if the object parameter is the JSONObject.NULL object
- * or null.
+ * or null.
*/
@Override
public boolean equals(Object object) {
@@ -1299,6 +1326,7 @@
/**
* Get the "null" string value.
+ *
* @return The string "null".
*/
@Override
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONString.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONString.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONString.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.json;
/**
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONStringer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONStringer.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONStringer.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,6 +23,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.io.StringWriter;
/**
@@ -30,7 +31,7 @@
* The texts produced strictly conform to JSON syntax rules. No whitespace is
* added, so the results are ready for transmission or storage. Each instance of
* JSONStringer can produce one JSON text.
- * <p>
+ * <p/>
* A JSONStringer instance provides a <code>value</code> method for appending
* values to the
* text, and a <code>key</code>
@@ -46,12 +47,13 @@
* .endObject()
* .toString();</pre> which produces the string <pre>
* {"JSON":"Hello, World!"}</pre>
- * <p>
+ * <p/>
* The first method called must be <code>array</code> or <code>object</code>.
* There are no methods for adding commas or colons. JSONStringer adds them for
* you. Objects and arrays can be nested up to 20 levels deep.
- * <p>
+ * <p/>
* This can sometimes be easier than using a JSONObject to build a string.
+ *
* @author JSON.org
* @version 2
*/
@@ -70,6 +72,7 @@
* problem in the construction of the JSON text (such as the calls to
* <code>array</code> were not properly balanced with calls to
* <code>endArray</code>).
+ *
* @return The JSON text.
*/
public String toString() {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONTokener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONTokener.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONTokener.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -28,6 +28,7 @@
* A JSONTokener takes a source string and extracts characters and tokens from
* it. It is used by the JSONObject and JSONArray constructors to parse
* JSON source strings.
+ *
* @author JSON.org
* @version 2
*/
@@ -46,7 +47,7 @@
/**
* Construct a JSONTokener from a string.
*
- * @param s A source string.
+ * @param s A source string.
*/
public JSONTokener(String s) {
this.myIndex = 0;
@@ -66,9 +67,10 @@
/**
* Get the hex value of a character (base16).
+ *
* @param c A character between '0' and '9' or between 'A' and 'F' or
- * between 'a' and 'f'.
- * @return An int between 0 and 15, or -1 if c was not a hex digit.
+ * between 'a' and 'f'.
+ * @return An int between 0 and 15, or -1 if c was not a hex digit.
*/
public static int dehexchar(char c) {
if ((c >= '0') && (c <= '9')) {
@@ -89,6 +91,7 @@
/**
* Determine if the source string still contains characters that next()
* can consume.
+ *
* @return true if not yet at the end of the source.
*/
public boolean more() {
@@ -115,6 +118,7 @@
/**
* Consume the next character, and check that it matches a specified
* character.
+ *
* @param c The character to match.
* @return The character.
* @throws JSONException if the character does not match.
@@ -132,11 +136,10 @@
/**
* Get the next n characters.
*
- * @param n The number of characters to take.
- * @return A string of n characters.
- * @throws JSONException
- * Substring bounds error if there are not
- * n characters remaining in the source string.
+ * @param n The number of characters to take.
+ * @return A string of n characters.
+ * @throws JSONException Substring bounds error if there are not
+ * n characters remaining in the source string.
*/
public String next(int n) throws JSONException {
int i = this.myIndex;
@@ -154,8 +157,9 @@
/**
* Get the next char in the string, skipping whitespace
* and comments (slashslash, slashstar, and hash).
+ *
+ * @return A character, or 0 if there are no more characters.
* @throws JSONException
- * @return A character, or 0 if there are no more characters.
*/
public char nextClean() throws JSONException {
for (;;) {
@@ -163,14 +167,14 @@
if (c == '/') {
switch (next()) {
- case '/' :
+ case '/':
do {
c = next();
} while ((c != '\n') && (c != '\r') && (c != 0));
break;
- case '*' :
+ case '*':
for (;;) {
c = next();
@@ -189,7 +193,7 @@
break;
- default :
+ default:
back();
return '/';
@@ -209,10 +213,11 @@
* Backslash processing is done. The formal JSON format does not
* allow strings in single quotes, but an implementation is allowed to
* accept them.
+ *
* @param quote The quoting character, either
- * <code>"</code> <small>(double quote)</small> or
- * <code>'</code> <small>(single quote)</small>.
- * @return A String.
+ * <code>"</code> <small>(double quote)</small> or
+ * <code>'</code> <small>(single quote)</small>.
+ * @return A String.
* @throws JSONException Unterminated string.
*/
public String nextString(char quote) throws JSONException {
@@ -223,57 +228,57 @@
c = next();
switch (c) {
- case 0 :
- case '\n' :
- case '\r' :
+ case 0:
+ case '\n':
+ case '\r':
throw syntaxError("Unterminated string");
- case '\\' :
+ case '\\':
c = next();
switch (c) {
- case 'b' :
+ case 'b':
sb.append('\b');
break;
- case 't' :
+ case 't':
sb.append('\t');
break;
- case 'n' :
+ case 'n':
sb.append('\n');
break;
- case 'f' :
+ case 'f':
sb.append('\f');
break;
- case 'r' :
+ case 'r':
sb.append('\r');
break;
- case 'u' :
+ case 'u':
sb.append((char) Integer.parseInt(next(4), 16));
break;
- case 'x' :
+ case 'x':
sb.append((char) Integer.parseInt(next(2), 16));
break;
- default :
+ default:
sb.append(c);
}
break;
- default :
+ default:
if (c == quote) {
return sb.toString();
}
@@ -286,8 +291,9 @@
/**
* Get the text up but not including the specified character or the
* end of line, whichever comes first.
- * @param d A delimiter character.
- * @return A string.
+ *
+ * @param d A delimiter character.
+ * @return A string.
*/
public String nextTo(char d) {
StringBuffer sb = new StringBuffer();
@@ -310,6 +316,7 @@
/**
* Get the text up but not including one of the specified delimeter
* characters or the end of line, whichever comes first.
+ *
* @param delimiters A set of delimiter characters.
* @return A string, trimmed.
*/
@@ -335,25 +342,25 @@
/**
* Get the next value. The value can be a Boolean, Double, Integer,
* JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
- * @throws JSONException If syntax error.
*
* @return An object.
+ * @throws JSONException If syntax error.
*/
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
- case '"' :
- case '\'' :
+ case '"':
+ case '\'':
return nextString(c);
- case '{' :
+ case '{':
back();
return new JSONObject(this);
- case '[' :
+ case '[':
back();
return new JSONArray(this);
@@ -445,9 +452,10 @@
/**
* Skip characters until the next character is the requested character.
* If the requested character is not found, no characters are skipped.
+ *
* @param to A character to skip to.
* @return The requested character, or zero if the requested character
- * is not found.
+ * is not found.
*/
public char skipTo(char to) {
char c;
@@ -471,6 +479,7 @@
/**
* Skip characters until past the requested string.
* If it is not found, we are left at the end of the source.
+ *
* @param to A string to skip past.
*/
public void skipPast(String to) {
@@ -487,7 +496,7 @@
* Make a JSONException to signal a syntax error.
*
* @param message The error message.
- * @return A JSONException object, suitable for throwing
+ * @return A JSONException object, suitable for throwing
*/
public JSONException syntaxError(String message) {
return new JSONException(message + toString());
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONWriter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONWriter.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/JSONWriter.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -32,7 +32,7 @@
* The texts produced strictly conform to JSON syntax rules. No whitespace is
* added, so the results are ready for transmission or storage. Each instance of
* JSONWriter can produce one JSON text.
- * <p>
+ * <p/>
* A JSONWriter instance provides a <code>value</code> method for appending
* values to the
* text, and a <code>key</code>
@@ -47,12 +47,13 @@
* .value("Hello, World!")
* .endObject();</pre> which writes <pre>
* {"JSON":"Hello, World!"}</pre>
- * <p>
+ * <p/>
* The first method called must be <code>array</code> or <code>object</code>.
* There are no methods for adding commas or colons. JSONWriter adds them for
* you. Objects and arrays can be nested up to 20 levels deep.
- * <p>
+ * <p/>
* This can sometimes be easier than using a JSONObject to build a string.
+ *
* @author JSON.org
* @version 2
*/
@@ -60,12 +61,6 @@
private static final int MAX_DEPTH = 20;
/**
- * The comma flag determines if a comma should be output before the next
- * value.
- */
- private boolean comma;
-
- /**
* The current mode. Values:
* 'a' (array),
* 'd' (done),
@@ -76,6 +71,17 @@
protected char mode;
/**
+ * The writer that will receive the output.
+ */
+ protected Writer writer;
+
+ /**
+ * The comma flag determines if a comma should be output before the next
+ * value.
+ */
+ private boolean comma;
+
+ /**
* The object/array stack.
*/
private char[] stack;
@@ -86,11 +92,6 @@
private int top;
/**
- * The writer that will receive the output.
- */
- protected Writer writer;
-
- /**
* Make a fresh JSONWriter. It can be used to build one JSON text.
*/
public JSONWriter(Writer w) {
@@ -103,6 +104,7 @@
/**
* Append a value.
+ *
* @param s A string value.
* @return this
* @throws JSONException If the value is out of sequence.
@@ -139,10 +141,11 @@
* Begin appending a new array. All values until the balancing
* <code>endArray</code> will be appended to this array. The
* <code>endArray</code> method must be called to mark the array's end.
+ *
* @return this
* @throws JSONException If the nesting is too deep, or if the object is
- * started in the wrong place (for example as a key or after the end of the
- * outermost array or object).
+ * started in the wrong place (for example as a key or after the end of the
+ * outermost array or object).
*/
public JSONWriter array() throws JSONException {
if ((this.mode == 'i') || (this.mode == 'o') || (this.mode == 'a')) {
@@ -158,6 +161,7 @@
/**
* End something.
+ *
* @param m Mode
* @param c Closing character
* @return this
@@ -184,6 +188,7 @@
/**
* End an array. This method most be called to balance calls to
* <code>array</code>.
+ *
* @return this
* @throws JSONException If incorrectly nested.
*/
@@ -194,6 +199,7 @@
/**
* End an object. This method most be called to balance calls to
* <code>object</code>.
+ *
* @return this
* @throws JSONException If incorrectly nested.
*/
@@ -204,10 +210,11 @@
/**
* Append a key. The key will be associated with the next value. In an
* object, every value must be preceded by a key.
+ *
* @param s A key string.
* @return this
* @throws JSONException If the key is out of place. For example, keys
- * do not belong in arrays or if the key is null.
+ * do not belong in arrays or if the key is null.
*/
public JSONWriter key(String s) throws JSONException {
if (s == null) {
@@ -238,10 +245,11 @@
* Begin appending a new object. All keys and values until the balancing
* <code>endObject</code> will be appended to this object. The
* <code>endObject</code> method must be called to mark the object's end.
+ *
* @return this
* @throws JSONException If the nesting is too deep, or if the object is
- * started in the wrong place (for example as a key or after the end of the
- * outermost array or object).
+ * started in the wrong place (for example as a key or after the end of the
+ * outermost array or object).
*/
public JSONWriter object() throws JSONException {
if (this.mode == 'i') {
@@ -261,6 +269,7 @@
/**
* Pop an array or object scope.
+ *
* @param c The scope to close.
* @throws JSONException If nesting is wrong.
*/
@@ -275,6 +284,7 @@
/**
* Push an array or object scope.
+ *
* @param c The scope to open.
* @throws JSONException If nesting is too deep.
*/
@@ -291,6 +301,7 @@
/**
* Append either the value <code>true</code> or the value
* <code>false</code>.
+ *
* @param b A boolean.
* @return this
* @throws JSONException
@@ -301,6 +312,7 @@
/**
* Append a double value.
+ *
* @param d A double.
* @return this
* @throws JSONException If the number is not finite.
@@ -311,6 +323,7 @@
/**
* Append a long value.
+ *
* @param l A long.
* @return this
* @throws JSONException
@@ -321,9 +334,10 @@
/**
* Append an object value.
+ *
* @param o The object to append. It can be null, or a Boolean, Number,
- * String, JSONObject, or JSONArray, or an object with a toJSONString()
- * method.
+ * String, JSONObject, or JSONArray, or an object with a toJSONString()
+ * method.
* @return this
* @throws JSONException If the value is out of sequence.
*/
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/XML.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/XML.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/XML.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -23,44 +23,65 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+
import java.util.Iterator;
/**
* This provides static methods to convert an XML text into a JSONObject,
* and to covert a JSONObject into an XML text.
+ *
* @author JSON.org
* @version 2
*/
public final class XML {
- /** The Character '&'. */
+ /**
+ * The Character '&'.
+ */
public static final Character AMP = new Character('&');
- /** The Character '''. */
+ /**
+ * The Character '''.
+ */
public static final Character APOS = new Character('\'');
- /** The Character '!'. */
+ /**
+ * The Character '!'.
+ */
public static final Character BANG = new Character('!');
- /** The Character '='. */
+ /**
+ * The Character '='.
+ */
public static final Character EQ = new Character('=');
- /** The Character '>'. */
+ /**
+ * The Character '>'.
+ */
public static final Character GT = new Character('>');
- /** The Character '<'. */
+ /**
+ * The Character '<'.
+ */
public static final Character LT = new Character('<');
- /** The Character '?'. */
+ /**
+ * The Character '?'.
+ */
public static final Character QUEST = new Character('?');
- /** The Character '"'. */
+ /**
+ * The Character '"'.
+ */
public static final Character QUOT = new Character('"');
- /** The Character '/'. */
+ /**
+ * The Character '/'.
+ */
public static final Character SLASH = new Character('/');
- private XML() {}
+ private XML() {
+ }
/**
* Replace special characters with XML escapes:
@@ -70,6 +91,7 @@
* > <small>(greater than)</small> is replaced by &gt;
* " <small>(double quote)</small> is replaced by &quot;
* </pre>
+ *
* @param string The string to be escaped.
* @return The escaped string.
*/
@@ -81,27 +103,27 @@
char c = string.charAt(i);
switch (c) {
- case '&' :
+ case '&':
sb.append("&");
break;
- case '<' :
+ case '<':
sb.append("<");
break;
- case '>' :
+ case '>':
sb.append(">");
break;
- case '"' :
+ case '"':
sb.append(""");
break;
- default :
+ default:
sb.append(c);
}
}
@@ -111,6 +133,7 @@
/**
* Scan the content following the named tag, attaching it to the context.
+ *
* @param x The XMLTokener containing the source string.
* @param context The JSONObject that will include the new material.
* @param name The tag name.
@@ -291,6 +314,7 @@
* Sequences of similar elements are represented as JSONArrays. Content
* text may be placed in a "content" member. Comments, prologs, DTDs, and
* <code><[ [ ]]></code> are ignored.
+ *
* @param string The source string.
* @return A JSONObject containing the structured data from the XML string.
* @throws JSONException
@@ -309,9 +333,10 @@
/**
* Convert a JSONObject into a well-formed, element-normal XML string.
+ *
* @param o A JSONObject.
- * @return A string.
- * @throws JSONException
+ * @return A string.
+ * @throws JSONException
*/
public static String toString(Object o) throws JSONException {
return toString(o, null);
@@ -319,7 +344,8 @@
/**
* Convert a JSONObject into a well-formed, element-normal XML string.
- * @param o A JSONObject.
+ *
+ * @param o A JSONObject.
* @param tagName The optional name of the enclosing tag.
* @return A string.
* @throws JSONException
@@ -419,8 +445,8 @@
s = (o == null) ? "null" : escape(o.toString());
return (tagName == null)
- ? "\"" + s + "\""
- : (s.length() == 0) ? "<" + tagName + "/>" : "<" + tagName + ">" + s + "</" + tagName + ">";
+ ? "\"" + s + "\""
+ : (s.length() == 0) ? "<" + tagName + "/>" : "<" + tagName + ">" + s + "</" + tagName + ">";
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/XMLTokener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/XMLTokener.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/XMLTokener.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -27,6 +27,7 @@
/**
* The XMLTokener extends the JSONTokener to provide additional methods
* for the parsing of XML texts.
+ *
* @author JSON.org
* @version 2
*/
@@ -49,6 +50,7 @@
/**
* Construct an XMLTokener from a string.
+ *
* @param s A source string.
*/
public XMLTokener(String s) {
@@ -57,6 +59,7 @@
/**
* Get the text in the CDATA block.
+ *
* @return The string up to the <code>]]></code>.
* @throws JSONException If the <code>]]></code> is not found.
*/
@@ -88,8 +91,8 @@
* of tokens: the '<' character which begins a markup tag, and the content
* text between markup tags.
*
- * @return A string, or a '<' Character, or null if there is no more
- * source text.
+ * @return A string, or a '<' Character, or null if there is no more
+ * source text.
* @throws JSONException
*/
public Object nextContent() throws JSONException {
@@ -129,9 +132,10 @@
/**
* Return the next entity. These entities are translated to Characters:
- * <code>& ' > < "</code>.
+ * <code>& ' > < "</code>.
+ *
* @param a An ampersand character.
- * @return A Character or an entity String if the entity is not recognized.
+ * @return A Character or an entity String if the entity is not recognized.
* @throws JSONException If missing ';' in XML entity.
*/
public Object nextEntity(char a) throws JSONException {
@@ -158,11 +162,12 @@
/**
* Returns the next XML meta token. This is used for skipping over <!...>
* and <?...?> structures.
+ *
* @return Syntax characters (<code>< > / = ! ?</code>) are returned as
- * Character, and strings and names are returned as Boolean. We don't care
- * what the values actually are.
+ * Character, and strings and names are returned as Boolean. We don't care
+ * what the values actually are.
* @throws JSONException If a string is not properly closed or if the XML
- * is badly structured.
+ * is badly structured.
*/
public Object nextMeta() throws JSONException {
char c;
@@ -173,29 +178,29 @@
} while (Character.isWhitespace(c));
switch (c) {
- case 0 :
+ case 0:
throw syntaxError("Misshaped meta tag.");
- case '<' :
+ case '<':
return XML.LT;
- case '>' :
+ case '>':
return XML.GT;
- case '/' :
+ case '/':
return XML.SLASH;
- case '=' :
+ case '=':
return XML.EQ;
- case '!' :
+ case '!':
return XML.BANG;
- case '?' :
+ case '?':
return XML.QUEST;
- case '"' :
- case '\'' :
+ case '"':
+ case '\'':
q = c;
for (;;) {
@@ -209,7 +214,7 @@
return Boolean.TRUE;
}
}
- default :
+ default:
for (;;) {
c = next();
@@ -218,22 +223,22 @@
}
switch (c) {
- case 0 :
- case '<' :
- case '>' :
- case '/' :
- case '=' :
- case '!' :
- case '?' :
- case '"' :
- case '\'' :
+ case 0:
+ case '<':
+ case '>':
+ case '/':
+ case '=':
+ case '!':
+ case '?':
+ case '"':
+ case '\'':
back();
return Boolean.TRUE;
- default :
+ default:
- // TODO Refactoring
+ // TODO Refactoring
}
}
}
@@ -244,6 +249,7 @@
* brackets. It may be one of these characters: <code>/ > = ! ?</code> or it
* may be a string wrapped in single quotes or double quotes, or it may be a
* name.
+ *
* @return a String or a Character.
* @throws JSONException If the XML is not well formed.
*/
@@ -257,30 +263,30 @@
} while (Character.isWhitespace(c));
switch (c) {
- case 0 :
+ case 0:
throw syntaxError("Misshaped element.");
- case '<' :
+ case '<':
throw syntaxError("Misplaced '<'.");
- case '>' :
+ case '>':
return XML.GT;
- case '/' :
+ case '/':
return XML.SLASH;
- case '=' :
+ case '=':
return XML.EQ;
- case '!' :
+ case '!':
return XML.BANG;
- case '?' :
+ case '?':
return XML.QUEST;
// Quoted string
- case '"' :
- case '\'' :
+ case '"':
+ case '\'':
q = c;
sb = new StringBuffer();
@@ -301,7 +307,7 @@
sb.append(c);
}
}
- default :
+ default:
// Name
sb = new StringBuffer();
@@ -315,26 +321,26 @@
}
switch (c) {
- case 0 :
- case '>' :
- case '/' :
- case '=' :
- case '!' :
- case '?' :
- case '[' :
- case ']' :
+ case 0:
+ case '>':
+ case '/':
+ case '=':
+ case '!':
+ case '?':
+ case '[':
+ case ']':
back();
return sb.toString();
- case '<' :
- case '"' :
- case '\'' :
+ case '<':
+ case '"':
+ case '\'':
throw syntaxError("Bad character in a name.");
- default :
+ default:
- // TODO Refactoring
+ // TODO Refactoring
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/json/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/json/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/json/package-info.java 2009-12-04 20:49:13 UTC (rev 16072)
@@ -1,4 +1,3 @@
-
/**
* JSON handling classes. Contains <a href="http://www.json.org">implementation</a> of JSON library together with JSON-based basic container classes implementation
*/
14 years, 5 months
JBoss Rich Faces SVN: r16071 - in root/framework/trunk/impl/src/main/java/org/ajax4jsf: exception and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:46:42 -0500 (Fri, 04 Dec 2009)
New Revision: 16071
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/FileUploadException.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/ByteBuffer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/CharBuffer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferInputStream.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferOutputStream.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferReader.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferWriter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/SAXResponseWriter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/XMLResponseWriterState.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AJAXDataSerializer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxComponentRendererBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxEventOptions.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKit.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitImpl.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentRendererBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentVariables.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentsVariableResolver.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequestRegistry.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/BaseResourceRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CacheContext.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CachedResourceContext.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CompressedScriptRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CountingOutputWriter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/FacesResourceContext.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/HTMLRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/JarResource.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/LogfileRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/MimeRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ServletResourceContext.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StaticResource.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StyleRenderer.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/URIInternetResource.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/UserResource.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/DualLRUMap.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBean.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBytesDataBean.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceDataBean.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/ImageInfo.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/package.html
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ELUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlColor.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlDimensions.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/InputUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/LRUMap.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataInputStream.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataOutputStream.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper2.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryDecoder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryEncoder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Codec.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Decoder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/DecoderException.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Encoder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/EncoderException.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URL64Codec.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URLCodec.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/FontFamily.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ParserConfig.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxReRendrRule.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/EmptyHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/package-info.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/FileUploadException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/FileUploadException.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/FileUploadException.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.exception;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/exception/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Exception classes of RichFaces components
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/ByteBuffer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/ByteBuffer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/ByteBuffer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,14 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import java.io.UnsupportedEncodingException;
/**
* A single link in chain of byte arrays.
+ *
* @author glory
*/
public class ByteBuffer {
@@ -51,6 +50,7 @@
/**
* Creates instance of ByteBuffer already filled by bytes.
+ *
* @param bytes
*/
public ByteBuffer(byte[] bytes) {
@@ -61,6 +61,7 @@
/**
* Creates instance of ByteBuffer with byte array of required length.
+ *
* @param cacheSize length of byte array
*/
public ByteBuffer(int cacheSize) {
@@ -72,6 +73,7 @@
/**
* Appends byte to array if there are unfilled positions in it.
* Otherwize creates next link in the chain, and appends the byte to it.
+ *
* @param c
* @return instance of ByteBuffer to which byte was appended.
*/
@@ -96,6 +98,7 @@
/**
* Appends segment of a byte array to array if there are unfilled positions in it.
* Otherwize creates next link in the chain, and appends data to it.
+ *
* @param c
* @return instance of ByteBuffer to which byte array was appended.
*/
@@ -128,6 +131,7 @@
/**
* Returns stored byte array.
+ *
* @return stored byte array
*/
public byte[] getBytes() {
@@ -136,6 +140,7 @@
/**
* Returns byte at index. No check is fulfilled to provide high speed.
+ *
* @param index
* @return
*/
@@ -145,6 +150,7 @@
/**
* Returns actual number of byte stored in this link.
+ *
* @return
*/
public int getUsedSize() {
@@ -153,6 +159,7 @@
/**
* Returns capacity of this link.
+ *
* @return
*/
public int getCacheSize() {
@@ -161,6 +168,7 @@
/**
* Returns total number of bytes stored in this link and all its predecessors.
+ *
* @return
*/
public int getTotalSize() {
@@ -169,6 +177,7 @@
/**
* Returns the previous link in the chain.
+ *
* @return
*/
public ByteBuffer getPrevious() {
@@ -177,6 +186,7 @@
/**
* Returns the next link in the chain.
+ *
* @return
*/
public ByteBuffer getNext() {
@@ -185,6 +195,7 @@
/**
* Sets the next link in the chain.
+ *
* @param b
*/
public void setNext(ByteBuffer b) {
@@ -197,6 +208,7 @@
/**
* Transforms this instance to instance of CharBuffer (a link of chain of char arrays).
+ *
* @param encoding
* @return link of chain of char arrays
* @throws UnsupportedEncodingException
@@ -215,6 +227,7 @@
/**
* Transforms this instance to instance of CharBuffer (a link of chain of char arrays).
+ *
* @return link of chain of char arrays
*/
public CharBuffer toCharBuffer() {
@@ -225,6 +238,7 @@
/**
* Resets this byte buffer to empty state
+ *
* @since 3.3.0
*/
public void reset() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/CharBuffer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/CharBuffer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/CharBuffer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,14 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import java.io.UnsupportedEncodingException;
/**
* A single link in chain of char arrays.
+ *
* @author glory
*/
public class CharBuffer {
@@ -52,6 +51,7 @@
/**
* Creates instance of CharBuffer already filled by chars.
+ *
* @param bytes
*/
public CharBuffer(char[] chars) {
@@ -62,6 +62,7 @@
/**
* Creates instance of CharBuffer with char array of required length.
+ *
* @param cacheSize length of char array
*/
public CharBuffer(int cacheSize) {
@@ -78,6 +79,7 @@
/**
* Appends character to array chars if there are unfilled positions in it.
* Otherwise creates next link in the chain, and appends the character to it.
+ *
* @param c
* @return instance of CharBuffer to which character was appended.
*/
@@ -102,6 +104,7 @@
/**
* Appends segment of a char array to array if there are unfilled positions in it.
* Otherwise creates next link in the chain, and appends data to it.
+ *
* @param c
* @return instance of CharBuffer to which char array was appended.
*/
@@ -134,6 +137,7 @@
/**
* Returns stored char array.
+ *
* @return stored char array
*/
public char[] getChars() {
@@ -142,6 +146,7 @@
/**
* Returns character at index. No check is fulfilled to provide high speed.
+ *
* @param index
* @return
*/
@@ -151,6 +156,7 @@
/**
* Returns actual number of characters stored in this link.
+ *
* @return
*/
public int getUsedSize() {
@@ -159,6 +165,7 @@
/**
* Returns capacity of this link.
+ *
* @return
*/
public int getCacheSize() {
@@ -167,6 +174,7 @@
/**
* Returns total number of characters stored in this link and all its predecessors.
+ *
* @return
*/
public int getTotalSize() {
@@ -175,6 +183,7 @@
/**
* Returns the previous link in the chain.
+ *
* @return
*/
public CharBuffer getPrevious() {
@@ -183,6 +192,7 @@
/**
* Returns the next link in the chain.
+ *
* @return
*/
public CharBuffer getNext() {
@@ -191,6 +201,7 @@
/**
* Sets the next link in the chain.
+ *
* @param b
*/
public void setNext(CharBuffer b) {
@@ -203,6 +214,7 @@
/**
* Transforms this instance to instance of ByteBuffer (a link of chain of byte arrays).
+ *
* @param encoding
* @return link of chain of byte arrays
* @throws UnsupportedEncodingException
@@ -215,6 +227,7 @@
/**
* Transforms this instance to instance of ByteBuffer (a link of chain of byte arrays).
+ *
* @return link of chain of byte arrays
*/
public ByteBuffer toByteBuffer() {
@@ -225,6 +238,7 @@
/**
* Resets this char buffer to empty state
+ *
* @since 3.3.0
*/
public void reset() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferInputStream.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferInputStream.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferInputStream.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import java.io.IOException;
@@ -30,7 +28,6 @@
* Class for reading from a byte array chain.
*
* @author glory
- *
*/
public class FastBufferInputStream extends InputStream {
@@ -59,6 +56,7 @@
/**
* Creates instance of FastBufferInputStream.
+ *
* @param stream
*/
@Deprecated
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferOutputStream.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferOutputStream.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferOutputStream.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import java.io.IOException;
@@ -32,7 +30,6 @@
* Class for writing to chain of byte arrays extending OutputStream.
*
* @author glory
- *
*/
public class FastBufferOutputStream extends OutputStream {
@@ -60,6 +57,7 @@
/**
* Creates instance for an already existing chain of byte arrays.
+ *
* @param firstBuffer
*/
public FastBufferOutputStream(ByteBuffer firstBuffer) {
@@ -69,6 +67,7 @@
/**
* Creates instance with required initial capacity.
+ *
* @param initialSize
*/
public FastBufferOutputStream(int initialSize) {
@@ -115,6 +114,7 @@
/**
* Returns the total number of written bytes.
+ *
* @return
*/
public int getLength() {
@@ -123,6 +123,7 @@
/**
* Returns the first link of the chain of byte arrays.
+ *
* @return
*/
public ByteBuffer getFirstBuffer() {
@@ -158,6 +159,7 @@
/**
* Writes all data written up to the moment to out.
+ *
* @param out
* @throws IOException
*/
@@ -172,6 +174,7 @@
/**
* Writes all data written up to the moment to out.
+ *
* @param out
* @throws IOException
*/
@@ -188,6 +191,7 @@
/**
* Returns instance of FastBufferWriter containing all data written to this output stream.
+ *
* @param encoding
* @return
* @throws UnsupportedEncodingException
@@ -215,6 +219,7 @@
/**
* Returns instance of FastBufferWriter containing all data written to this output stream.
+ *
* @return
*/
public FastBufferWriter convertToWriter() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferReader.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferReader.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferReader.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import java.io.IOException;
@@ -31,7 +29,6 @@
* Class for reading from a char array chain.
*
* @author glory
- *
*/
public class FastBufferReader extends Reader {
@@ -58,6 +55,7 @@
/**
* Creates instance for given writer.
+ *
* @param writer
*/
@Deprecated
@@ -67,7 +65,8 @@
index = 0;
}
- public void close() throws IOException {}
+ public void close() throws IOException {
+ }
/**
* @see java.io.Reader.read()
@@ -136,6 +135,7 @@
/**
* Returns the number of chars that may be read from this storage.
+ *
* @return
* @throws IOException
*/
@@ -157,6 +157,7 @@
/**
* Writes rest of data written up to the moment to out.
+ *
* @param out
* @throws IOException
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferWriter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferWriter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/FastBufferWriter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
+import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
-import javax.servlet.ServletOutputStream;
-
/**
* Class for writing to chain of char arrays extending Writer.
*
* @author glory
- *
*/
public class FastBufferWriter extends Writer {
@@ -61,6 +57,7 @@
/**
* Creates instance for an already existing chain of char arrays.
+ *
* @param firstBuffer
*/
public FastBufferWriter(CharBuffer firstBuffer) {
@@ -70,6 +67,7 @@
/**
* Creates instance with required initial capacity.
+ *
* @param initialSize
*/
public FastBufferWriter(int initialSize) {
@@ -116,6 +114,7 @@
/**
* Returns the total number of written chars.
+ *
* @return
*/
public int getLength() {
@@ -124,6 +123,7 @@
/**
* Returns the first link of the chain of char arrays.
+ *
* @return
*/
public CharBuffer getFirstBuffer() {
@@ -131,13 +131,16 @@
}
@Override
- public void close() throws IOException {}
+ public void close() throws IOException {
+ }
@Override
- public void flush() throws IOException {}
+ public void flush() throws IOException {
+ }
/**
* Writes all data written up to the moment to string buffer.
+ *
* @param out
* @throws IOException
*/
@@ -170,6 +173,7 @@
/**
* Writes all data written up to the moment to out.
+ *
* @param out
* @throws IOException
*/
@@ -193,6 +197,7 @@
/**
* Returns instance of FastBufferOutputStream containing all data written to this writer.
+ *
* @param encoding
* @return
* @throws UnsupportedEncodingException
@@ -220,6 +225,7 @@
/**
* Returns instance of FastBufferOutputStream containing all data written to this writer.
+ *
* @return
*/
public FastBufferOutputStream convertToOutputStream() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/SAXResponseWriter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/SAXResponseWriter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/SAXResponseWriter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
import org.xml.sax.ContentHandler;
@@ -28,20 +26,18 @@
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.AttributesImpl;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ResponseWriter;
import java.io.IOException;
import java.io.Writer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.ResponseWriter;
-
/**
* @author shura
- *
- * Realization of Faces <code>ResponseWriter</code> for Cocoon Environment.
- * Use ONLY Markup-specific calls , send it as SAX events to
- * <code>XMLConsumer</code> Use "State" pattern for control of events flow.
- * TODO - implement namespace capabilites
- *
+ * <p/>
+ * Realization of Faces <code>ResponseWriter</code> for Cocoon Environment.
+ * Use ONLY Markup-specific calls , send it as SAX events to
+ * <code>XMLConsumer</code> Use "State" pattern for control of events flow.
+ * TODO - implement namespace capabilites
*/
public class SAXResponseWriter extends ResponseWriter {
@@ -85,7 +81,7 @@
/**
* @param consumer -
- * SAX events receiver for Cocoon pipeline.
+ * SAX events receiver for Cocoon pipeline.
*/
public SAXResponseWriter(ContentHandler consumer) {
super();
@@ -276,8 +272,8 @@
/**
* @author shura
- *
- * CDATA section. allow regular write() functions, write any text.
+ * <p/>
+ * CDATA section. allow regular write() functions, write any text.
*/
private final class CDATAState extends XMLResponseWriterState {
void flushCDATA() throws IOException {
@@ -370,7 +366,6 @@
}
}
-
/**
* @author shura State in element declsration. Collect attributes, on any
* other eventss - generate SAX startElement()
@@ -395,7 +390,7 @@
void writeAttribute(String name, Object value, String property) throws IOException {
attributes.addAttribute(getNamespaceURI(), name, name, "id".equalsIgnoreCase(name) ? "ID" : "CDATA",
- value.toString());
+ value.toString());
}
void writeURIAttribute(String name, Object value, String property) throws IOException {
@@ -474,11 +469,10 @@
}
}
-
/**
* @author shura
- *
- * State in regular document. Disabled attributes & startDocument.
+ * <p/>
+ * State in regular document. Disabled attributes & startDocument.
*/
private final class InDocumentState extends XMLResponseWriterState {
void startElement(String name, UIComponent component) {
@@ -541,8 +535,8 @@
/**
* @author shura
- *
- * state before startDocument - only allow startDocument.
+ * <p/>
+ * state before startDocument - only allow startDocument.
*/
private final class NotDocumentState extends XMLResponseWriterState {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/XMLResponseWriterState.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/XMLResponseWriterState.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/XMLResponseWriterState.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.io;
+import javax.faces.component.UIComponent;
import java.io.IOException;
-import javax.faces.component.UIComponent;
-
/**
* @author shura Class to implement state pattern for
* <code>ResponseWriter</code> Real states must extend this. By
* default, block any events, ignore output.
- *
*/
class XMLResponseWriterState {
@@ -116,7 +112,6 @@
}
/**
- *
* Main hook for realise <code>Writer</code>. In document writed as
* comment, outside of document do nothing ....
*
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/io/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Implementation of I/O streams based on buffers
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -36,8 +36,6 @@
* SOFTWARE.
*/
-
-
package org.ajax4jsf.javascript;
import java.io.FileInputStream;
@@ -70,7 +68,7 @@
*/
static boolean isAlphanum(int c) {
return c >= 'a' && c <= 'z' || ((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'Z')) || (c == '_')
- || (c == '$') || (c == '\\') || (c > 126);
+ || (c == '$') || (c == '\\') || (c > 126);
}
/**
@@ -125,15 +123,15 @@
if (c == '/') {
switch (peek()) {
- case '/' :
- for (;;) {
+ case '/':
+ for (; ;) {
c = get();
if (c <= '\n') {
return c;
}
}
- case '*' :
+ case '*':
get();
if (peek() == '@') {
@@ -143,9 +141,9 @@
return c;
} else {
- for (;;) {
+ for (; ;) {
switch (get()) {
- case '*' :
+ case '*':
if (peek() == '/') {
get();
@@ -154,15 +152,15 @@
break;
- case EOF :
+ case EOF:
throw new UnterminatedCommentException(line, column);
- default :
+ default:
throw new IllegalStateException();
}
}
}
- default :
+ default:
return c;
}
}
@@ -178,16 +176,16 @@
* preceded by ( or , or =.
*/
void action(int d) throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException,
- UnterminatedStringLiteralException {
-
+ UnterminatedStringLiteralException {
+
switch (d) {
- case 1 :
+ case 1:
out.write(theA);
- case 2 :
+ case 2:
theA = theB;
if ((theA == '\'') || (theA == '"')) {
- for (;;) {
+ for (; ;) {
out.write(theA);
theA = get();
@@ -205,16 +203,16 @@
}
}
}
- case 3 :
+ case 3:
theB = next();
if ((theB == '/')
- && ((theA == '(') || (theA == '!') || (theA == '&') || (theA == '|') || (theA == ',')
- || (theA == '=') || (theA == ':') || (theA == '['))) {
+ && ((theA == '(') || (theA == '!') || (theA == '&') || (theA == '|') || (theA == ',')
+ || (theA == '=') || (theA == ':') || (theA == '['))) {
out.write(theA);
out.write(theB);
- for (;;) {
+ for (; ;) {
theA = get();
if (theA == '/') {
@@ -231,9 +229,9 @@
theB = next();
}
- default :
+ default:
- // Do nothink.
+ // Do nothink.
}
}
@@ -244,14 +242,14 @@
* Most spaces and linefeeds will be removed.
*/
public void jsmin()
- throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException,
- UnterminatedStringLiteralException {
+ throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException,
+ UnterminatedStringLiteralException {
theA = '\n';
action(3);
while (theA != EOF) {
switch (theA) {
- case ' ' :
+ case ' ':
if (isAlphanum(theB)) {
action(1);
} else {
@@ -260,23 +258,23 @@
break;
- case '\n' :
+ case '\n':
switch (theB) {
- case '{' :
- case '[' :
- case '(' :
- case '+' :
- case '-' :
+ case '{':
+ case '[':
+ case '(':
+ case '+':
+ case '-':
action(1);
break;
- case ' ' :
+ case ' ':
action(3);
break;
- default :
+ default:
if (isAlphanum(theB)) {
action(1);
} else {
@@ -286,9 +284,9 @@
break;
- default :
+ default:
switch (theB) {
- case ' ' :
+ case ' ':
if (isAlphanum(theA)) {
action(1);
@@ -299,20 +297,20 @@
break;
- case '\n' :
+ case '\n':
switch (theA) {
- case '}' :
- case ']' :
- case ')' :
- case '+' :
- case '-' :
- case '"' :
- case '\'' :
+ case '}':
+ case ']':
+ case ')':
+ case '+':
+ case '-':
+ case '"':
+ case '\'':
action(1);
break;
- default :
+ default:
if (isAlphanum(theA)) {
action(1);
} else {
@@ -322,7 +320,7 @@
break;
- default :
+ default:
action(1);
break;
@@ -335,7 +333,7 @@
/**
* Run JSMin
- *
+ * <p/>
* Get the first param on file name and
* output on console compressed file
*/
@@ -367,7 +365,6 @@
}
}
-
static class UnterminatedRegExpLiteralException extends Exception {
private static final long serialVersionUID = 8791439031230079257L;
@@ -376,7 +373,6 @@
}
}
-
static class UnterminatedStringLiteralException extends Exception {
private static final long serialVersionUID = 5256369791002619999L;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/javascript/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Javascript resource classes either as classes handling various aspects of Javascript processing
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Base package for AJAX classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AJAXDataSerializer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AJAXDataSerializer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AJAXDataSerializer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.javascript.ScriptUtils;
/**
* @author shura
- *
*/
public class AJAXDataSerializer {
public String asString(Object data) {
- return ScriptUtils.toScript(data);
+ return ScriptUtils.toScript(data);
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,32 +19,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxChildrenEncoder;
import org.ajax4jsf.component.AjaxOutput;
import org.ajax4jsf.context.AjaxContext;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import java.io.IOException;
-
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
/**
* @author shura
- *
*/
public abstract class AjaxChildrenRenderer extends AjaxComponentRendererBase implements AjaxRenderer {
public static final String[] SPECIAL_COMPONENTS_TYPES = {"org.ajax4jsf.Bundle" /* UILoadBundle.COMPONENT_TYPE */,
@@ -64,7 +57,7 @@
* java.util.Set, java.util.Set)
*/
public void encodeAjaxChildren(FacesContext context, UIComponent component, String path, Set<String> ids,
- Set<String> renderedAreas) throws IOException {
+ Set<String> renderedAreas) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.getMessage(Messages.ENCODE_CHILD_AJAX_INFO, path, component.getId()));
@@ -82,7 +75,7 @@
}
}
- for (Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext(); ) {
+ for (Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext();) {
UIComponent element = (UIComponent) it.next();
encodeAjaxComponent(context, element, currentPath, ids, renderedAreas);
@@ -114,8 +107,8 @@
* java.util.Set, java.util.Set)
*/
public void encodeAjaxComponent(FacesContext context, UIComponent component, String currentPath, Set<String> ids,
- Set<String> renderedAreas) throws IOException {
-
+ Set<String> renderedAreas) throws IOException {
+
if (component.isRendered()) { // skip not-rendered components.
boolean found = false;
boolean limitToList = AjaxContext.getCurrentInstance(context).isLimitToList();
@@ -139,7 +132,7 @@
//
if (!found && limitToList && (component instanceof NamingContainer)
- && noIdUnderPath(absoluteId + NamingContainer.SEPARATOR_CHAR, ids)) {
+ && noIdUnderPath(absoluteId + NamingContainer.SEPARATOR_CHAR, ids)) {
return;
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxComponentRendererBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxComponentRendererBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxComponentRendererBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,15 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
/**
* Base class for all Ajax enabled components. Perform common task -
* output javasript for component.
+ *
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:49 $
- *
*/
-public abstract class AjaxComponentRendererBase extends RendererBase {}
+public abstract class AjaxComponentRendererBase extends RendererBase {
+}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,34 +19,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxContainer;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import java.io.IOException;
-
import java.util.Map;
import java.util.Set;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
/**
* Base renderer for all AJAX - subview components.
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/08 15:02:02 $
- *
*/
public class AjaxContainerRenderer extends AjaxChildrenRenderer {
public static final String AJAX_FLAG_HEADER = "Ajax-Response";
@@ -77,12 +70,9 @@
}
/**
- *
- *
* @see javax.faces.component.UIComponent#encodeChildren(javax.faces.context.FacesContext)
* Since main function of component - render subset of components, for
* update on page,don't delegate this for renderer.
- *
*/
@Override
public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxEventOptions.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxEventOptions.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxEventOptions.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.javascript.ScriptStringBase;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,30 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.PartialResponseWriter;
-import javax.faces.context.ResponseWriter;
-import javax.servlet.http.HttpServletResponse;
-
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxClientBehavior;
import org.ajax4jsf.component.AjaxComponent;
@@ -58,18 +36,33 @@
import org.richfaces.log.RichfacesLogger;
import org.slf4j.Logger;
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.ResponseWriter;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
/**
* @author shura
- *
- * Some utilites for render AJAX components.
+ * <p/>
+ * Some utilites for render AJAX components.
*/
public final class AjaxRendererUtils {
- private static final String BEFOREDOMUPDATE_ELEMENT_NAME = "beforedomupdate";
- private static final String COMPLETE_ELEMENT_NAME = "complete";
- private static final String DATA_ELEMENT_NAME = "data";
-
- public static final String AJAX_ABORT_ATTR = "ignoreDupResponses";
+ public static final String AJAX_ABORT_ATTR = "ignoreDupResponses";
public static final String AJAX_AREAS_RENDERED = "org.ajax4jsf.areas.rendered";
public static final String AJAX_DELAY_ATTR = "requestDelay";
@@ -124,19 +117,23 @@
public static final String STATUS_ATTR_NAME = "status";
public static final String VALUE_ATTR = "value";
- public final static String EXTENSION_ID = "org.richfaces.extension";
+ public static final String EXTENSION_ID = "org.richfaces.extension";
public static final String AJAX_COMPONENT_ID_PARAMETER = "org.richfaces.ajax.component";
public static final String BEHAVIOR_EVENT_PARAMETER = "javax.faces.behavior.event";
-
+
+ private static final String BEFOREDOMUPDATE_ELEMENT_NAME = "beforedomupdate";
+ private static final String COMPLETE_ELEMENT_NAME = "complete";
+ private static final String DATA_ELEMENT_NAME = "data";
+
private static final RendererUtils RENDERER_UTILS = RendererUtils.getInstance();
- private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+ private static final Class<?> OBJECT_ARRAY_CLASS = new Object[0].getClass();
private static final Logger LOG = RichfacesLogger.RENDERKIT.getLogger();
/**
* Static class - protect constructor
- *
*/
- private AjaxRendererUtils() {}
+ private AjaxRendererUtils() {
+ }
private static enum BehaviorEventOptionsData {
begin {
@@ -199,8 +196,8 @@
/**
* Build JavaScript onclick event for given component
*
- * @param uiComponent -
- * component for build event
+ * @param uiComponent -
+ * component for build event
* @param facesContext
* @return <code>StringBuffer</code> with Javascript code
*/
@@ -211,26 +208,25 @@
/**
* Build JavaScript onclick event for given component
*
- * @param uiComponent -
- * component for build event
+ * @param uiComponent -
+ * component for build event
* @param facesContext
* @param omitDefaultActionUrl - default action URL is not encoded if parameter is true
- *
* @return <code>StringBuffer</code> with Javascript code
*/
public static StringBuffer buildOnClick(UIComponent uiComponent, FacesContext facesContext,
- boolean omitDefaultActionUrl) {
+ boolean omitDefaultActionUrl) {
return buildOnEvent(uiComponent, facesContext, HTML.ONCLICK_ATTRIBUTE, omitDefaultActionUrl);
}
/**
* Build JavaScript event for component
*
- * @param uiComponent -
- * component for build event
+ * @param uiComponent -
+ * component for build event
* @param facesContext
- * @param eventName -
- * name of event
+ * @param eventName -
+ * name of event
* @return <code>StringBuffer</code> with Javascript code
*/
public static StringBuffer buildOnEvent(UIComponent uiComponent, FacesContext facesContext, String eventName) {
@@ -240,17 +236,16 @@
/**
* Build JavaScript event for component
*
- * @param uiComponent -
- * component for build event
+ * @param uiComponent -
+ * component for build event
* @param facesContext
- * @param eventName -
- * name of event
+ * @param eventName -
+ * name of event
* @param omitDefaultActionUrl - default action URL is not encoded if parameter is true
- *
* @return <code>StringBuffer</code> with Javascript code
*/
public static StringBuffer buildOnEvent(UIComponent uiComponent, FacesContext facesContext, String eventName,
- boolean omitDefaultActionUrl) {
+ boolean omitDefaultActionUrl) {
StringBuffer onEvent = new StringBuffer();
// if (null != eventName) {
@@ -294,7 +289,7 @@
}
public static AjaxEventOptions buildEventOptions(FacesContext facesContext, UIComponent component,
- AjaxClientBehavior ajaxBehavior) {
+ AjaxClientBehavior ajaxBehavior) {
AjaxEventOptions ajaxEventOptions = new AjaxEventOptions();
Map<String, Object> parametersMap = RENDERER_UTILS.createParametersMap(facesContext, component);
String ajaxStatusName = getAjaxStatus(component);
@@ -332,7 +327,7 @@
}
private static void appendComponentOptions(FacesContext facesContext, UIComponent component,
- AjaxEventOptions ajaxEventOptions) {
+ AjaxEventOptions ajaxEventOptions) {
for (EventOptionsData eventOptionsData : EventOptionsData.values()) {
String behaviorName = eventOptionsData.toString();
HandlersChain handlersChain = new HandlersChain(component);
@@ -535,14 +530,14 @@
/**
* Create call to Ajax Submit function with first two parameters
+ *
* @param facesContext
* @param uiComponent
* @param functionName
- *
* @return
*/
public static JSFunction buildAjaxFunction(FacesContext facesContext, UIComponent uiComponent,
- String functionName) {
+ String functionName) {
JSFunction ajaxFunction = new JSFunction(functionName);
ajaxFunction.addParameter(uiComponent.getClientId(facesContext));
@@ -664,7 +659,7 @@
* String ) to list of srings.
*
* @param valueToSet -
- * obect for convert to List.
+ * obect for convert to List.
* @return - list of strings.
*/
@SuppressWarnings("unchecked")
@@ -748,8 +743,7 @@
/**
* Get function name for call on completed ajax request.
*
- * @param component
- * for wich calculate function name
+ * @param component for wich calculate function name
* @return name of JavaScript function or <code>null</code>
*/
public static String getAjaxOncomplete(UIComponent component) {
@@ -763,8 +757,7 @@
/**
* Get function name for call before update DOM.
*
- * @param component
- * for wich calculate function name
+ * @param component for wich calculate function name
* @return name of JavaScript function or <code>null</code>
*/
public static String getAjaxOnBeforeDomUpdate(UIComponent component) {
@@ -782,7 +775,7 @@
return (String) component.getAttributes().get(ONBEGIN_ATTR_NAME);
}
-
+
/**
* @param component
* @return
@@ -864,8 +857,8 @@
// Search enclosed UIForm or ADF UIXForm component
while ((parent != null) && !(parent instanceof UIForm)
- && !("org.apache.myfaces.trinidad.Form".equals(parent.getFamily()))
- && !("oracle.adf.Form".equals(parent.getFamily()))) {
+ && !("org.apache.myfaces.trinidad.Form".equals(parent.getFamily()))
+ && !("oracle.adf.Form".equals(parent.getFamily()))) {
parent = parent.getParent();
}
@@ -882,7 +875,7 @@
* @return
*/
public static org.ajax4jsf.component.AjaxContainer findAjaxContainer(FacesContext facesContext,
- UIComponent uiComponent) {
+ UIComponent uiComponent) {
UIComponent parent = uiComponent.getParent();
while ((parent != null) && !(parent instanceof org.ajax4jsf.component.AjaxContainer)) {
@@ -932,7 +925,7 @@
StringBuffer senderString = new StringBuffer();
- for (Iterator<String> it = rendered.iterator(); it.hasNext(); ) {
+ for (Iterator<String> it = rendered.iterator(); it.hasNext();) {
String id = it.next();
senderString.append(id);
@@ -971,7 +964,7 @@
} else {
try {
Method setHeadergMethod = response.getClass().getMethod("setHeader",
- new Class[] {String.class, String.class});
+ new Class[]{String.class, String.class});
setHeadergMethod.invoke(response, AjaxContainerRenderer.AJAX_FLAG_HEADER, "true");
} catch (Exception e) {
@@ -1140,68 +1133,68 @@
public static void addRegionsFromComponent(UIComponent component, FacesContext facesContext) {
AjaxContext.getCurrentInstance(facesContext).addRegionsFromComponent(component);
}
-
+
private static void startExtensionElementIfNecessary(
- PartialResponseWriter partialResponseWriter,
- Map<String, String> attributes,
- boolean[] writingState) throws IOException {
-
- if (!writingState[0]) {
- writingState[0] = true;
-
- partialResponseWriter.startExtension(attributes);
- }
+ PartialResponseWriter partialResponseWriter,
+ Map<String, String> attributes,
+ boolean[] writingState) throws IOException {
+
+ if (!writingState[0]) {
+ writingState[0] = true;
+
+ partialResponseWriter.startExtension(attributes);
+ }
}
private static void endExtensionElementIfNecessary(
- PartialResponseWriter partialResponseWriter,
- boolean[] writingState) throws IOException {
-
- if (writingState[0]) {
- writingState[0] = false;
-
- partialResponseWriter.endExtension();
- }
+ PartialResponseWriter partialResponseWriter,
+ boolean[] writingState) throws IOException {
+
+ if (writingState[0]) {
+ writingState[0] = false;
+
+ partialResponseWriter.endExtension();
+ }
}
-
+
public static void renderAjaxExtensions(FacesContext facesContext, UIComponent component) throws IOException {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
-
- Map<String, String> attributes = Collections.singletonMap(HTML.ID_ATTRIBUTE,
- facesContext.getExternalContext().encodeNamespace(EXTENSION_ID));
- PartialResponseWriter writer = facesContext.getPartialViewContext().getPartialResponseWriter();
- boolean[] writingState = new boolean[] {false};
-
- Object onbeforedomupdate = ajaxContext.getOnbeforedomupdate();
- if (onbeforedomupdate != null) {
- startExtensionElementIfNecessary(writer, attributes, writingState);
- writer.startElement(BEFOREDOMUPDATE_ELEMENT_NAME, component);
- writer.writeText(onbeforedomupdate, null);
- writer.endElement(BEFOREDOMUPDATE_ELEMENT_NAME);
- }
-
- Object oncomplete = ajaxContext.getOncomplete();
- if (oncomplete != null) {
- startExtensionElementIfNecessary(writer, attributes, writingState);
- writer.startElement(COMPLETE_ELEMENT_NAME, component);
- writer.writeText(oncomplete, null);
- writer.endElement(COMPLETE_ELEMENT_NAME);
- }
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
- Object responseData = ajaxContext.getResponseData();
- if (responseData != null) {
- startExtensionElementIfNecessary(writer, attributes, writingState);
- writer.startElement(DATA_ELEMENT_NAME, component);
-
- //TODO - encode response data map
- AJAXDataSerializer serializer = ServiceTracker.getService(facesContext, AJAXDataSerializer.class);
- writer.writeText(serializer.asString(responseData), null);
-
- writer.endElement(DATA_ELEMENT_NAME);
- }
-
- endExtensionElementIfNecessary(writer, writingState);
+ Map<String, String> attributes = Collections.singletonMap(HTML.ID_ATTRIBUTE,
+ facesContext.getExternalContext().encodeNamespace(EXTENSION_ID));
+ PartialResponseWriter writer = facesContext.getPartialViewContext().getPartialResponseWriter();
+ boolean[] writingState = new boolean[]{false};
+ Object onbeforedomupdate = ajaxContext.getOnbeforedomupdate();
+ if (onbeforedomupdate != null) {
+ startExtensionElementIfNecessary(writer, attributes, writingState);
+ writer.startElement(BEFOREDOMUPDATE_ELEMENT_NAME, component);
+ writer.writeText(onbeforedomupdate, null);
+ writer.endElement(BEFOREDOMUPDATE_ELEMENT_NAME);
+ }
+
+ Object oncomplete = ajaxContext.getOncomplete();
+ if (oncomplete != null) {
+ startExtensionElementIfNecessary(writer, attributes, writingState);
+ writer.startElement(COMPLETE_ELEMENT_NAME, component);
+ writer.writeText(oncomplete, null);
+ writer.endElement(COMPLETE_ELEMENT_NAME);
+ }
+
+ Object responseData = ajaxContext.getResponseData();
+ if (responseData != null) {
+ startExtensionElementIfNecessary(writer, attributes, writingState);
+ writer.startElement(DATA_ELEMENT_NAME, component);
+
+ //TODO - encode response data map
+ AJAXDataSerializer serializer = ServiceTracker.getService(facesContext, AJAXDataSerializer.class);
+ writer.writeText(serializer.asString(responseData), null);
+
+ writer.endElement(DATA_ELEMENT_NAME);
+ }
+
+ endExtensionElementIfNecessary(writer, writingState);
+
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxViewRootRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.component.AjaxViewRoot;
@@ -31,7 +29,6 @@
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/08 15:02:03 $
- *
*/
public class AjaxViewRootRenderer extends AjaxContainerRenderer {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKit.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKit.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKit.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import javax.faces.render.RenderKit;
@@ -28,7 +26,6 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:55 $
- *
*/
public interface ChameleonRenderKit {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,28 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.util.Iterator;
-
import javax.faces.FactoryFinder;
import javax.faces.application.ApplicationFactory;
import javax.faces.context.FacesContext;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
+import java.util.Iterator;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:50 $
- *
*/
public class ChameleonRenderKitFactory extends RenderKitFactory {
@@ -52,7 +46,7 @@
RenderKitFactory defaultFactory;
/**
- * @param defaultFactory
+ * @param defaultFactory
*/
public ChameleonRenderKitFactory(RenderKitFactory defaultFactory) {
if (LOG.isDebugEnabled()) {
@@ -65,8 +59,8 @@
}
/**
- * @param renderKitId
- * @param renderKit
+ * @param renderKitId
+ * @param renderKit
*/
public void addRenderKit(String renderKitId, RenderKit renderKit) {
if (LOG.isDebugEnabled()) {
@@ -87,9 +81,9 @@
}
/**
- * @param context
- * @param renderKitId
- * @return
+ * @param context
+ * @param renderKitId
+ * @return
*/
public RenderKit getRenderKit(FacesContext context, String renderKitId) {
RenderKit renderKit = defaultFactory.getRenderKit(context, renderKitId);
@@ -132,7 +126,7 @@
}
/**
- * @return
+ * @return
*/
public Iterator<String> getRenderKitIds() {
return defaultFactory.getRenderKitIds();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitImpl.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitImpl.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,16 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import java.util.HashMap;
-import java.util.Map;
-
import javax.faces.FactoryFinder;
import javax.faces.application.ApplicationFactory;
import javax.faces.context.FacesContext;
@@ -38,14 +30,17 @@
import javax.faces.render.RenderKitFactory;
import javax.faces.render.Renderer;
import javax.faces.render.ResponseStateManager;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Map;
/**
* Wrapper for default applikation render kit. Only can append any
* custom renderers , all other methods delegate to default render kit.
*
- * @see javax.faces.render.RenderKit
* @author shura
- *
+ * @see javax.faces.render.RenderKit
*/
public class ChameleonRenderKitImpl extends RenderKit implements ChameleonRenderKit {
public static final String RENDER_KIT_ID = "AJAX_HTML_BASIC";
@@ -114,6 +109,7 @@
* and get default renderKitId as value, setted at creation time.
* in this case, we can substitute concrete renderKit even if it pointed
* as value for <f:view> tag on 1.2 specification.
+ *
* @return Returns the defaultRenderer.
*/
protected RenderKit getDefaultRenderKit() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentRendererBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentRendererBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentRendererBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
+import javax.faces.component.UIComponent;
import java.util.HashMap;
import java.util.Stack;
-import javax.faces.component.UIComponent;
-
/**
* Components Base Renderer for all chameleon Skin's and components.
* At most, make all common procedures and realise concrete work in "template" methods.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:52 $
- *
*/
public abstract class ComponentRendererBase extends RendererBase {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentVariables.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentVariables.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentVariables.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,20 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import java.io.IOException;
import java.io.Serializable;
-
import java.util.HashMap;
import java.util.Map;
/**
- * storing tempates variables
- * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/28 17:01:01 $
+ * storing tempates variables
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/28 17:01:01 $
*/
public class ComponentVariables implements Serializable {
@@ -44,6 +42,7 @@
/**
* setting variable
+ *
* @param variableName
* @param variable
*/
@@ -52,7 +51,6 @@
}
/**
- *
* @param variableName
* @return
*/
@@ -61,7 +59,6 @@
}
/**
- *
* @param variableName
* @param addValue
*/
@@ -78,7 +75,6 @@
}
/**
- *
* @param variableName
* @param variable
* @param addValue
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentsVariableResolver.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentsVariableResolver.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/ComponentsVariableResolver.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import javax.faces.component.UIComponent;
@@ -35,7 +33,8 @@
public final class ComponentsVariableResolver {
private static final String COMPONENTS_VARIABLE_RESOLVER = ComponentsVariableResolver.class.getName();
- private ComponentsVariableResolver() {}
+ private ComponentsVariableResolver() {
+ }
private static String getAttributeName(RendererBase renderer) {
return COMPONENTS_VARIABLE_RESOLVER + ":" + ((renderer != null) ? renderer.getClass().getName() : null);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/HandlersChain.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.javascript.JSFunction;
@@ -33,7 +31,6 @@
import javax.faces.component.behavior.ClientBehaviorHint;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -46,7 +43,7 @@
*/
public final class HandlersChain {
-// private static final Logger LOG = RichfacesLogger.RENDERKIT.getLogger();
+ // private static final Logger LOG = RichfacesLogger.RENDERKIT.getLogger();
private boolean hasSubmittingBehavior = false;
private boolean includeClientId = false;
@@ -137,8 +134,8 @@
}
ClientBehaviorContext behaviorContext = ClientBehaviorContext.createClientBehaviorContext(context, component,
- name, includeClientId ? component.getClientId(context) : null,
- getParameters(context));
+ name, includeClientId ? component.getClientId(context) : null,
+ getParameters(context));
for (ClientBehavior clientBehavior : behaviorsList) {
String behaviorScript = clientBehavior.getScript(behaviorContext);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,24 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
import org.ajax4jsf.resource.InternetResource;
-
import org.richfaces.log.RichfacesLogger;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
-
import org.slf4j.Logger;
-import java.io.IOException;
-
-import java.util.List;
-import java.util.Map;
-
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorHolder;
@@ -44,13 +35,16 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
/**
* Base Renderer for all chameleon Skin's and components.
* At most, make all common procedures and realise concrete work in "template" methods.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:51 $
- *
*/
public abstract class RendererBase extends Renderer {
@@ -76,12 +70,12 @@
if (!getComponentClass().isInstance(component)) {
throw new IllegalArgumentException(Messages.getMessage(Messages.COMPONENT_CLASS_ERROR, "",
- getComponentClass().getName()));
+ getComponentClass().getName()));
}
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.getMessage(Messages.START_DECODING_COMPONENT_INFO, component.getClientId(context),
- component.getClass().getName()));
+ component.getClass().getName()));
}
preDecode(context, component);
@@ -124,9 +118,11 @@
}
}
- protected void preDecode(FacesContext context, UIComponent component) {}
+ protected void preDecode(FacesContext context, UIComponent component) {
+ }
- protected void preEncodeBegin(FacesContext context, UIComponent component) throws IOException {}
+ protected void preEncodeBegin(FacesContext context, UIComponent component) throws IOException {
+ }
/*
* (non-Javadoc)
@@ -140,7 +136,7 @@
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.getMessage(Messages.START_ENCODING_COMPONENT_INFO, component.getClientId(context),
- component.getClass().getName()));
+ component.getClass().getName()));
}
preEncodeBegin(context, component);
@@ -157,7 +153,7 @@
if (!getComponentClass().isInstance(component)) {
throw new IllegalArgumentException(Messages.getMessage(Messages.COMPONENT_CLASS_ERROR,
- component.getClientId(context), getComponentClass().getName()));
+ component.getClientId(context), getComponentClass().getName()));
}
}
@@ -183,7 +179,7 @@
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.getMessage(Messages.CHILDREN_ENCODING_COMPONENT_INFO, component.getClientId(context),
- component.getClass().getName()));
+ component.getClass().getName()));
}
preEncodeBegin(context, component);
@@ -213,7 +209,7 @@
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.getMessage(Messages.FINISH_ENCODING_COMPONENT_INFO, component.getClientId(context),
- component.getClass().getName()));
+ component.getClass().getName()));
}
}
@@ -222,6 +218,7 @@
/**
* Calculate current Skin for rendering.
+ *
* @param context - current {@link FacesContext }
* @return
*/
@@ -248,30 +245,35 @@
/**
* Get base component slass , targetted for this renderer. Used for check arguments in decode/encode.
+ *
* @return
*/
protected Class<? extends UIComponent> getComponentClass() {
- //TODO - do we need this function?
- return UIComponent.class;
+ //TODO - do we need this function?
+ return UIComponent.class;
}
/**
* Template method for custom decoding of concrete renderer.
* All parameters checking if performed in original {@see decode } method.
+ *
* @param context
* @param component
*/
- protected void doDecode(FacesContext context, UIComponent component) {}
+ protected void doDecode(FacesContext context, UIComponent component) {
+ }
/**
* Template method for custom start encoding of concrete renderer.
* All parameters checking and writer is performed in original {@link encodeBegin } method.
+ *
* @param writer
* @param context
* @param component
*/
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component)
- throws IOException { }
+ throws IOException {
+ }
/**
* @param writer
@@ -287,15 +289,18 @@
/**
* Template method for custom finish encoding of concrete renderer.
* All parameters checking and writer is performed in original {@link encodeEnd } method.
+ *
* @param writer
* @param context
* @param component
* @throws IOException
*/
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {}
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ }
/**
* Render all children for given component.
+ *
* @param facesContext
* @param component
* @throws IOException
@@ -308,6 +313,7 @@
/**
* Render one component and it childrens
+ *
* @param facesContext
* @param child
* @throws IOException
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.renderkit;
import org.ajax4jsf.Messages;
@@ -30,20 +28,6 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.util.HtmlDimensions;
-import java.io.IOException;
-
-import java.lang.reflect.Array;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
import javax.faces.component.EditableValueHolder;
@@ -58,6 +42,17 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
/**
* Util class for common render operations - render passthru html attributes,
@@ -65,7 +60,6 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.6 $ $Date: 2007/02/08 19:07:16 $
- *
*/
public class RendererUtils {
public static final String DUMMY_FORM_ID = ":_form";
@@ -136,6 +130,7 @@
/**
* Use this method to get singleton instance of RendererUtils
+ *
* @return singleton instance
*/
public static RendererUtils getInstance() {
@@ -173,7 +168,7 @@
if (null != clientId) {
context.getResponseWriter().writeAttribute(attribute, clientId,
- (String) getComponentAttributeName(attribute));
+ (String) getComponentAttributeName(attribute));
}
}
@@ -188,7 +183,7 @@
public void encodeCustomId(FacesContext context, UIComponent component) throws IOException {
if ((component.getId() != null) && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
context.getResponseWriter().writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context),
- HTML.ID_ATTRIBUTE);
+ HTML.ID_ATTRIBUTE);
}
}
@@ -204,7 +199,7 @@
if (null == name) {
throw new IllegalArgumentException(Messages.getMessage(Messages.UNNAMED_PARAMETER_ERROR,
- component.getClientId(context)));
+ component.getClientId(context)));
}
boolean escape = true;
@@ -250,7 +245,7 @@
UIComponent component = (UIComponent) behaviorHolder;
ResponseWriter writer = context.getResponseWriter();
Collection<Parameter> parametersList = HandlersChain.createParametersList(createParametersMap(context,
- component));
+ component));
for (String behaviorEventName : eventNames) {
if (behaviorEventName.equals(defaultEventName)) {
@@ -305,8 +300,8 @@
* @throws IOException
*/
public void encodePassThruWithExclusions(FacesContext context, UIComponent component, String exclusions,
- String defaultHtmlEvent) throws IOException {
-
+ String defaultHtmlEvent) throws IOException {
+
if (null != exclusions) {
String[] exclusionsArray = exclusions.split(",");
@@ -315,8 +310,8 @@
}
public void encodePassThruWithExclusionsArray(FacesContext context, UIComponent component, String[] exclusions,
- String defaultHtmlEvent) throws IOException {
-
+ String defaultHtmlEvent) throws IOException {
+
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
@@ -355,7 +350,7 @@
* @throws IOException
*/
public void encodePassThruAttribute(FacesContext context, Map<String, Object> attributes, ResponseWriter writer,
- String attribute) throws IOException {
+ String attribute) throws IOException {
Object value = attributeValue(attribute, attributes.get(getComponentAttributeName(attribute)));
@@ -373,7 +368,7 @@
public void encodeAttributesFromArray(FacesContext context, UIComponent component, String[] attrs)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Map<String, Object> attributes = component.getAttributes();
@@ -387,12 +382,9 @@
/**
* Encode attributes given by comma-separated string list.
*
- * @param context
- * current JSF context
- * @param component
- * for with render attributes values
- * @param attrs
- * comma separated list of attributes
+ * @param context current JSF context
+ * @param component for with render attributes values
+ * @param attrs comma separated list of attributes
* @throws IOException
*/
public void encodeAttributes(FacesContext context, UIComponent component, String attrs) throws IOException {
@@ -408,12 +400,11 @@
* @param component
* @param property
* @param attributeName
- *
* @throws IOException
*/
public void encodeAttribute(FacesContext context, UIComponent component, Object property, String attributeName)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Object value = component.getAttributes().get(property);
@@ -427,11 +418,11 @@
}
public void writeText(ResponseWriter writer, Object value, String property) throws IOException {
- if (value != null) {
- writer.writeText(value, property);
- }
+ if (value != null) {
+ writer.writeText(value, property);
+ }
}
-
+
/**
* Write html-attribute
*
@@ -455,7 +446,7 @@
if (null == attributeVal) {
return false;
} else if ((attributeVal instanceof Boolean)
- && ((Boolean) attributeVal).booleanValue() == Boolean.FALSE.booleanValue()) {
+ && ((Boolean) attributeVal).booleanValue() == Boolean.FALSE.booleanValue()) {
return false;
} else if (attributeVal.toString().length() == 0) {
return false;
@@ -481,8 +472,8 @@
* with Java primitive types of JSF component return appropriate MIN_VALUE .
*
* @param property -
- * value of property returned from
- * {@link UIComponent#getAttributes()}
+ * value of property returned from
+ * {@link UIComponent#getAttributes()}
* @return true for setted property, false otherthise.
*/
public boolean isValidProperty(Object property) {
@@ -510,15 +501,15 @@
/**
* Checks if the argument passed in is empty or not.
* Object is empty if it is: <br />
- * - <code>null<code><br />
- * - zero-length string<br />
- * - empty collection<br />
- * - empty map<br />
- * - zero-length array<br />
+ * - <code>null<code><br />
+ * - zero-length string<br />
+ * - empty collection<br />
+ * - empty map<br />
+ * - zero-length array<br />
*
* @param o object to check for emptiness
- * @since 3.3.2
* @return <code>true</code> if the argument is empty, <code>false</code> otherwise
+ * @since 3.3.2
*/
public boolean isEmpty(Object o) {
if (null == o) {
@@ -553,7 +544,6 @@
* @param value
* @param defaultValue
* @param wrapper
- *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value, String defaultValue,
@@ -581,7 +571,6 @@
* @param name
* @param value
* @param defaultValue
- *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value, String defaultValue) {
@@ -595,7 +584,6 @@
* @param hash
* @param name
* @param value
- *
* @since 3.3.2
*/
public void addToScriptHash(Map<String, Object> hash, String name, Object value) {
@@ -623,8 +611,7 @@
* attributes return name for true value, otherthise - null. For non-boolean
* attributes return same value.
*
- * @param name
- * attribute name.
+ * @param name attribute name.
* @param value
* @return
*/
@@ -648,8 +635,7 @@
* Get boolean value of logical attribute
*
* @param component
- * @param name
- * attribute name
+ * @param name attribute name
* @return true if attribute is equals Boolean.TRUE or String "true" , false
* otherwise.
*/
@@ -747,7 +733,6 @@
* formats given value to
*
* @param value
- *
* @return
*/
public String encodePctOrPx(String value) {
@@ -811,7 +796,7 @@
*/
public void encodeBeginForm(FacesContext context, UIComponent component, ResponseWriter writer, String clientId)
throws IOException {
-
+
String actionURL = getActionUrl(context);
String encodeActionURL = context.getExternalContext().encodeActionURL(actionURL);
@@ -899,40 +884,39 @@
/**
* @param ids
* @param keyword
- * @since 4.0
- *
* @return
+ * @since 4.0
*/
private static boolean checkKeyword(Collection<String> ids, String keyword) {
- if (ids.contains(keyword)) {
- if (ids.size() != 1) {
- //TODO log
- }
-
- return true;
- }
-
- return false;
+ if (ids.contains(keyword)) {
+ if (ids.size() != 1) {
+ //TODO log
+ }
+
+ return true;
+ }
+
+ return false;
}
/**
* @param context
* @param component
* @param shortIds
- * @since 4.0
* @return
+ * @since 4.0
*/
public Collection<String> findComponentsFor(FacesContext context, UIComponent component,
- Collection<String> shortIds) {
+ Collection<String> shortIds) {
// TODO - implement
// TODO add support for @*
Set<String> result = new LinkedHashSet<String>(shortIds.size());
if (checkKeyword(shortIds, AjaxRendererUtils.ALL)) {
- result.add(AjaxRendererUtils.ALL);
+ result.add(AjaxRendererUtils.ALL);
} else if (checkKeyword(shortIds, AjaxRendererUtils.NONE)) {
- //do nothing, use empty set
+ //do nothing, use empty set
} else {
for (String id : shortIds) {
if (AjaxRendererUtils.THIS.equals(id)) {
@@ -987,9 +971,9 @@
/**
* If target component contains generated id and for doesn't, correct for id
+ *
* @param forAttr
* @param component
- *
*/
public String correctForIdReference(String forAttr, UIComponent component) {
int contains = forAttr.indexOf(UIViewRoot.UNIQUE_ID_PREFIX);
@@ -1009,7 +993,7 @@
private UIComponent findUIComponentBelow(UIComponent root, String id) {
UIComponent target = null;
- for (Iterator<UIComponent> iter = root.getFacetsAndChildren(); iter.hasNext(); ) {
+ for (Iterator<UIComponent> iter = root.getFacetsAndChildren(); iter.hasNext();) {
UIComponent child = (UIComponent) iter.next();
if (child instanceof NamingContainer) {
@@ -1036,7 +1020,7 @@
public static void writeEventHandlerFunction(FacesContext context, UIComponent component, String eventName)
throws IOException {
-
+
ResponseWriter writer = context.getResponseWriter();
Object script = component.getAttributes().get(eventName);
@@ -1052,7 +1036,7 @@
}
public JSFunctionDefinition getAsEventHandler(FacesContext context, UIComponent component, String attributeName,
- String append) {
+ String append) {
String event = (String) component.getAttributes().get(attributeName);
if (event != null) {
@@ -1116,7 +1100,6 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.6 $ $Date: 2007/02/08 19:07:16 $
- *
*/
public interface HTML {
public static final String ACCEPT_ATTRIBUTE = "accept";
@@ -1212,7 +1195,7 @@
"onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onreset", "onselect", "onsubmit",
"onunload"
};
- public static final String[] PASS_THRU_STYLES = {"style", "class", };
+ public static final String[] PASS_THRU_STYLES = {"style", "class",};
/**
* all HTML attributes with URI value.
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Classes and interface participating in component rendering process
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequest.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,16 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.request;
import org.ajax4jsf.exception.FileUploadException;
import org.ajax4jsf.webapp.BaseXMLFilter;
-
import org.richfaces.component.FileUploadConstants;
import org.richfaces.model.UploadItem;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -38,7 +39,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
@@ -51,12 +51,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-
/**
* Request wrapper for supporting multipart requests, used for file uploading.
*
@@ -73,10 +67,10 @@
private static final byte[] CR_LF = {CR, LF};
private static final Pattern PARAM_VALUE_PATTERN = Pattern.compile("^\\s*([^\\s=]+)\\s*[=:]\\s*(.+)\\s*$");
private static final Pattern FILE_NAME_PATTERN = Pattern.compile(".*filename=\"(.*)\"");
+ boolean initialized = false;
private int bytesRead = 0;
private Integer contentLength = 0;
private String encoding = null;
- boolean initialized = false;
private Map<String, Param> parameters = null;
private Map<String, Object> percentMap = null;
private int pos = 0;
@@ -99,7 +93,9 @@
private MultipartRequestRegistry requestRegistry;
private String uid;
- private enum ReadState {BOUNDARY, HEADERS, DATA}
+ private enum ReadState {
+ BOUNDARY, HEADERS, DATA
+ }
public MultipartRequest(HttpServletRequest request, boolean createTempFiles, int maxRequestSize, String uid) {
super(request);
@@ -219,7 +215,7 @@
// If we've encountered another boundary...
if (checkSequence(buffer, i - boundaryMarker.length - CR_LF.length, CR_LF)
- && checkSequence(buffer, i, boundaryMarker)) {
+ && checkSequence(buffer, i, boundaryMarker)) {
// Write any data before the boundary (that
// hasn't
@@ -271,7 +267,7 @@
baos.write(buffer, pos, i - pos - 1);
String param = (encoding == null)
- ? new String(baos.toByteArray()) : new String(baos.toByteArray(), encoding);
+ ? new String(baos.toByteArray()) : new String(baos.toByteArray(), encoding);
parseParams(param, "; ", headers);
@@ -393,7 +389,7 @@
public static MultipartRequest lookupRequest(FacesContext context, String uploadId) {
Map<String, Object> sessionMap = context.getExternalContext().getSessionMap();
Map<String, String> requestKeys = (Map<String,
- String>) sessionMap.get(FileUploadConstants.REQUEST_KEYS_BEAN_NAME);
+ String>) sessionMap.get(FileUploadConstants.REQUEST_KEYS_BEAN_NAME);
if (requestKeys != null) {
String requestKey = requestKeys.get(uploadId);
@@ -431,7 +427,7 @@
synchronized (sessionMap) {
if (percentMap == null) {
percentMap = (Map<String,
- Object>) sessionMap.get(FileUploadConstants.PERCENT_BEAN_NAME);
+ Object>) sessionMap.get(FileUploadConstants.PERCENT_BEAN_NAME);
if (percentMap == null) {
percentMap = new ConcurrentHashMap<String, Object>();
@@ -682,7 +678,7 @@
return values;
} else {
- return new String[] {(String) vp.getValue()};
+ return new String[]{(String) vp.getValue()};
}
} else {
return super.getParameterValues(name);
@@ -749,8 +745,8 @@
public boolean isDone() {
return !(this.shouldStop
- && (this.canceled
- || ((this.contentLength != null) && (this.contentLength.intValue() != this.bytesRead))));
+ && (this.canceled
+ || ((this.contentLength != null) && (this.contentLength.intValue() != this.bytesRead))));
}
@Override
@@ -954,7 +950,6 @@
}
}
-
private abstract class Param {
private String name;
@@ -969,7 +964,6 @@
public abstract void appendData(byte[] data, int start, int length) throws IOException;
}
-
private class ValueParam extends Param {
private Object value = null;
private ByteArrayOutputStream buf = new ByteArrayOutputStream();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequestRegistry.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequestRegistry.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/MultipartRequestRegistry.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,17 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.request;
+import javax.faces.context.FacesContext;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 3.3.1
@@ -40,7 +37,8 @@
private String registryId = UUID.randomUUID().toString();
private Map<String, MultipartRequest> requestsMap = new ConcurrentHashMap<String, MultipartRequest>();
- private MultipartRequestRegistry() {}
+ private MultipartRequestRegistry() {
+ }
public static MultipartRequestRegistry getInstance(FacesContext context) {
Map<String, Object> applicationMap = context.getExternalContext().getApplicationMap();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/request/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Implementation of request classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/BaseResourceRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/BaseResourceRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/BaseResourceRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,28 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.Messages;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:07 $
- *
*/
public abstract class BaseResourceRenderer implements ResourceRenderer {
public void encode(InternetResource resource, FacesContext context, Object data) throws IOException {
@@ -52,13 +47,13 @@
public void encode(InternetResource resource, FacesContext context, Object data, Map<String, Object> attributes)
throws IOException {
-
+
this.encodeBegin(resource, context, data, attributes);
this.encodeEnd(resource, context, data);
}
public void encodeBegin(InternetResource resource, FacesContext context, Object data,
- Map<String, Object> attributes) throws IOException {
+ Map<String, Object> attributes) throws IOException {
if (null != getTag()) {
ResponseWriter writer = context.getResponseWriter();
@@ -77,7 +72,7 @@
}
}
- for (Iterator<Entry<String, Object>> iter = attributes.entrySet().iterator(); iter.hasNext(); ) {
+ for (Iterator<Entry<String, Object>> iter = attributes.entrySet().iterator(); iter.hasNext();) {
Map.Entry<String, Object> attr = iter.next();
writer.writeAttribute(attr.getKey().toString(), attr.getValue(), null);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CacheContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CacheContext.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CacheContext.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
/**
* @author Nick - mailto:nbelaevski@exadel.com
- * created 01.05.2007
- *
+ * created 01.05.2007
*/
public class CacheContext {
private InternetResource resource;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CachedResourceContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CachedResourceContext.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CachedResourceContext.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.webapp.CacheContent;
@@ -29,16 +27,13 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
-
import java.net.MalformedURLException;
import java.net.URL;
-
import java.util.Set;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:59 $
- *
*/
public class CachedResourceContext extends ResourceContext {
private CacheContent content;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CompressedScriptRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CompressedScriptRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CompressedScriptRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
/**
* @author asmirnov
- *
*/
public class CompressedScriptRenderer extends OneTimeRenderer {
protected String getTag() {
@@ -43,7 +40,7 @@
protected String[][] getCommonAttrs() {
// TODO Auto-generated method stub
- return new String[][] {
+ return new String[][]{
{"type", getContentType()}
};
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CountingOutputWriter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CountingOutputWriter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/CountingOutputWriter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import java.io.IOException;
@@ -29,20 +27,29 @@
/**
* Class provides custom writer implementation with counting of bytes written
* Is using for replacement of css component writer
+ *
* @author Andrey Markavtsov
*/
public class CountingOutputWriter extends Writer {
- /** Size of char type */
+ /**
+ * Size of char type
+ */
public static final int SIZE_OF_CHAR = 1;
- /** Size of int type */
+ /**
+ * Size of int type
+ */
public static final int SIZE_OF_INT = 2;
- /** count of written bytes */
+ /**
+ * count of written bytes
+ */
private int written = 0;
- /** Buffer to store bytes written */
+ /**
+ * Buffer to store bytes written
+ */
private StringBuffer buffer;
/**
@@ -58,20 +65,23 @@
* @see java.io.Writer#close()
*/
@Override
- public void close() throws IOException {}
+ public void close() throws IOException {
+ }
/*
* (non-Javadoc)
* @see java.io.Writer#flush()
*/
@Override
- public void flush() throws IOException {}
+ public void flush() throws IOException {
+ }
/**
* Methods appends chars written to buffer
- * @param cbuf - chars to be written
- * @param off - offset
- * @param len - length of bytes
+ *
+ * @param cbuf - chars to be written
+ * @param off - offset
+ * @param len - length of bytes
*/
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
@@ -81,7 +91,8 @@
/**
* Methods appends chars written to buffer
- * @param cbuf - chars to be written
+ *
+ * @param cbuf - chars to be written
*/
@Override
public void write(char[] cbuf) throws IOException {
@@ -91,7 +102,8 @@
/**
* Methods appends int written to buffer
- * @param c - int to be written
+ *
+ * @param c - int to be written
*/
@Override
public void write(int c) throws IOException {
@@ -101,9 +113,10 @@
/**
* Methods appends string written to buffer
- * @param str - string to be written
- * @param off - offset
- * @param len - length of bytes
+ *
+ * @param str - string to be written
+ * @param off - offset
+ * @param len - length of bytes
*/
@Override
public void write(String str, int off, int len) throws IOException {
@@ -113,7 +126,8 @@
/**
* Methods appends string written to buffer
- * @param str - string to be written
+ *
+ * @param str - string to be written
*/
@Override
public void write(String str) throws IOException {
@@ -123,7 +137,8 @@
/**
* Methods gets written bytes count
- * @return written count of bytes
+ *
+ * @return written count of bytes
*/
public int getWritten() {
return written;
@@ -131,7 +146,8 @@
/**
* Methods gets content of written bytes
- * @return buffer
+ *
+ * @return buffer
*/
public StringBuffer getContent() {
return buffer;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/FacesResourceContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/FacesResourceContext.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/FacesResourceContext.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,29 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.richfaces.util.Util;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
-
import java.net.MalformedURLException;
import java.net.URL;
-
import java.util.Set;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: nick_belaevski $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:14 $
- *
*/
public class FacesResourceContext extends ResourceContext {
private ExternalContext externalContext;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/HTMLRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/HTMLRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/HTMLRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import javax.faces.context.FacesContext;
-
import java.io.IOException;
import java.io.InputStream;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:03 $
- *
*/
public class HTMLRenderer extends BaseResourceRenderer {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,26 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.Messages;
-
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-
import org.slf4j.Logger;
+import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
-
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* Base class for all Html page resources - images, scripts, styles etc. Realise
* as "brige" pattern - different subclasses for different resource source
@@ -48,7 +42,6 @@
*
* @author shura (latest modification by $Author: nick_belaevski $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:15 $
- *
*/
public abstract class InternetResourceBase implements InternetResource {
static final int BUFFER_SIZE = 1024;
@@ -74,8 +67,7 @@
}
/**
- * @param contentLength
- * The contentLength to set.
+ * @param contentLength The contentLength to set.
*/
protected void setContentLength(int contentLength) {
this.contentLength = contentLength;
@@ -101,8 +93,7 @@
}
/**
- * @param expired
- * The expired to set.
+ * @param expired The expired to set.
*/
public void setExpired(long expired) {
this.expired = expired;
@@ -122,8 +113,7 @@
}
/**
- * @param lastModified
- * The lastModified to set.
+ * @param lastModified The lastModified to set.
*/
public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
@@ -139,8 +129,7 @@
}
/**
- * @param cacheable
- * The cacheable to set.
+ * @param cacheable The cacheable to set.
*/
public void setCacheable(boolean cacheable) {
this.cacheable = cacheable;
@@ -154,8 +143,7 @@
}
/**
- * @param sessionAware
- * The sessionAware to set.
+ * @param sessionAware The sessionAware to set.
*/
public void setSessionAware(boolean sessionAware) {
this.sessionAware = sessionAware;
@@ -178,8 +166,7 @@
}
/**
- * @param renderer
- * The renderer to set.
+ * @param renderer The renderer to set.
*/
public void setRenderer(ResourceRenderer renderer) {
this.renderer = renderer;
@@ -198,8 +185,7 @@
* Set registration key ( by {@link InternetResourceBuilder} for this
* resource.
*
- * @param key
- * The key to set.
+ * @param key The key to set.
*/
public void setKey(String key) {
this.key = key;
@@ -227,10 +213,10 @@
* for restore such data muct be returned by this method.
*
* @param context -
- * current faces context.
- * @param data -
- * data for build information, usually current
- * {@link javax.faces.component.UIComponent}
+ * current faces context.
+ * @param data -
+ * data for build information, usually current
+ * {@link javax.faces.component.UIComponent}
* @return - any {@link java.io.Serializable} object, or null.
*/
protected Object getDataToStore(FacesContext context, Object data) {
@@ -278,7 +264,7 @@
*/
public InputStream getResourceAsStream(ResourceContext context) {
throw new UnsupportedOperationException(Messages.getMessage(Messages.METHOD_NOT_IMPLEMENTED,
- "getResourceAsStream"));
+ "getResourceAsStream"));
}
/*
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.Messages;
@@ -31,22 +29,13 @@
import org.ajax4jsf.resource.util.URLToStreamHelper;
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.WebXml;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.util.Map;
-import java.util.Properties;
-
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextFactory;
-
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -54,6 +43,10 @@
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Properties;
public class InternetResourceService {
static final String ENABLE_CACHING_PARAMETER = "enable-cache";
@@ -71,7 +64,8 @@
private String lifecycleClass;
private WebXml webXml;
- public InternetResourceService() {}
+ public InternetResourceService() {
+ }
public void setCacheEnabled(boolean b) {
cacheEnabled = b;
@@ -253,7 +247,7 @@
* @throws FacesException
*/
protected ResourceContext getResourceContext(InternetResource resource, HttpServletRequest request,
- HttpServletResponse response) throws FacesException {
+ HttpServletResponse response) throws FacesException {
ResourceContext resourceContext;
if (resource.requireFacesContext()) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/JarResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/JarResource.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/JarResource.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.resource.util.URLToStreamHelper;
@@ -30,9 +28,9 @@
/**
* Class stoped all resources in application classpath.
* TODO - set last midified & expired values.
+ *
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:00 $
- *
*/
public class JarResource extends InternetResourceBase {
@@ -44,7 +42,8 @@
public static final String RESOURCES_ROOT = "META-INF/resources";
private String path;
- public JarResource() {}
+ public JarResource() {
+ }
public JarResource(String path) {
this.path = path;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,34 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.util.NumericDataInputStream;
import org.ajax4jsf.util.NumericDataOutputStream;
-
import org.richfaces.resource.AbstractBaseResource;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.imageio.ImageIO;
+import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.IndexColorModel;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-
-import javax.imageio.ImageIO;
-
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/01 15:31:57 $
- *
*/
public abstract class Java2Dresource extends AbstractBaseResource implements StateHolder {
private ImageType imageType;
@@ -155,7 +147,7 @@
* Template method for create image as Applet-like paint.
*
* @param graphics2D -
- * graphics to paint.
+ * graphics to paint.
*/
protected void paint(Graphics2D graphics2D, Dimension dimension) {
@@ -208,9 +200,11 @@
return imageType.getMimeType();
}
- protected void writeState(FacesContext context, NumericDataOutputStream stream) {}
+ protected void writeState(FacesContext context, NumericDataOutputStream stream) {
+ }
- protected void readState(FacesContext context, NumericDataInputStream stream) {}
+ protected void readState(FacesContext context, NumericDataInputStream stream) {
+ }
public boolean isTransient() {
return false;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/LogfileRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/LogfileRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/LogfileRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import javax.faces.context.FacesContext;
-
import java.io.IOException;
import java.io.InputStream;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:02 $
- *
*/
public class LogfileRenderer extends BaseResourceRenderer {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/MimeRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/MimeRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/MimeRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 20.11.2006
- *
+ * created 20.11.2006
*/
public class MimeRenderer extends BaseResourceRenderer {
private String contentType = null;
- public MimeRenderer() {}
+ public MimeRenderer() {
+ }
public MimeRenderer(String contentType) {
super();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,27 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.Messages;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
+import javax.faces.context.FacesContext;
import java.io.IOException;
-
import java.util.Map;
-import javax.faces.context.FacesContext;
-
/**
* Base class for resources, rendered only one time in page ( JavaScript, CSS )
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:02 $
- *
*/
public abstract class OneTimeRenderer extends BaseResourceRenderer {
private static final Logger LOG = RichfacesLogger.RESOURCE.getLogger();
@@ -51,8 +45,8 @@
*/
@Override
public void encodeBegin(InternetResource resource, FacesContext context, Object data,
- Map<String, Object> attributes) throws IOException {
-
+ Map<String, Object> attributes) throws IOException {
+
if (!isRendered(resource, context)) {
super.encodeBegin(resource, context, data, attributes);
} else if (LOG.isDebugEnabled()) {
@@ -84,6 +78,7 @@
/**
* Detect for resource rendered status. For cacheable, show key parameter in request Map.
+ *
* @param resource
* @param context
* @return - true, if resource already rendered.
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,18 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-
-import java.util.Locale;
-
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.component.UIViewRoot;
@@ -41,13 +34,14 @@
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
import javax.faces.render.RenderKitFactory;
+import java.io.IOException;
+import java.util.Locale;
/**
* Lifecycle for simulate faces request processing for resource.
*
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:56 $
- *
*/
public class ResourceLifecycle extends Lifecycle {
private static final Logger LOG = RichfacesLogger.RESOURCE.getLogger();
@@ -176,8 +170,7 @@
*
* @param phaseListeners
* @param phaseEvent
- * @param beforePhase
- * TODO
+ * @param beforePhase TODO
*/
private void processPhaseListeners(PhaseListener[] phaseListeners, PhaseEvent phaseEvent, boolean beforePhase) {
if (beforePhase) {
@@ -206,7 +199,7 @@
*/
private void invokePhaseListener(PhaseListener phaseListener, PhaseEvent phaseEvent, boolean beforePhase) {
if (phaseEvent.getPhaseId().equals(phaseListener.getPhaseId())
- || PhaseId.ANY_PHASE.equals(phaseListener.getPhaseId())) {
+ || PhaseId.ANY_PHASE.equals(phaseListener.getPhaseId())) {
try {
if (beforePhase) {
phaseListener.beforePhase(phaseEvent);
@@ -215,7 +208,7 @@
}
} catch (Exception e) {
LOG.debug("Exception in PhaseListener, phase :" + phaseEvent.getPhaseId().toString()
- + (beforePhase ? " : beforePhase" : " : afterPhase"), e);
+ + (beforePhase ? " : beforePhase" : " : afterPhase"), e);
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,15 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import org.ajax4jsf.Messages;
import org.ajax4jsf.javascript.JSMin;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import java.io.IOException;
@@ -71,11 +67,9 @@
}
}
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:04 $
- *
*/
public class ScriptRenderer extends CompressedScriptRenderer {
private static final String COMPRESS_SCRIPTS_PARAMETER = "org.ajax4jsf.COMPRESS_SCRIPT";
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ServletResourceContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ServletResourceContext.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/ServletResourceContext.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,28 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
-
import java.net.MalformedURLException;
import java.net.URL;
-
import java.util.Set;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:01 $
- *
*/
public class ServletResourceContext extends ResourceContext {
private ServletContext context;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StaticResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StaticResource.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StaticResource.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,18 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import javax.faces.context.FacesContext;
-
import java.io.InputStream;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: nick_belaevski $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:14 $
- *
*/
public class StaticResource extends InternetResourceBase {
private String path;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StyleRenderer.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StyleRenderer.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/StyleRenderer.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,16 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
/**
* Render style element with content in page. Warning - not use for head link element,
* it must be rendered separate.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:58 $
- *
*/
public class StyleRenderer extends OneTimeRenderer {
@@ -53,7 +51,7 @@
* @see org.ajax4jsf.resource.BaseResourceRenderer#getCommonAttrs()
*/
protected String[][] getCommonAttrs() {
- return new String[][] {
+ return new String[][]{
{"type", "text/css"}, {"rel", "stylesheet"}
};
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/URIInternetResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/URIInternetResource.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/URIInternetResource.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
import javax.faces.context.FacesContext;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/UserResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/UserResource.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/UserResource.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,27 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-import java.util.Date;
-
import javax.el.ELContext;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.util.Date;
/**
* @author shura
- *
*/
public class UserResource extends InternetResourceBase {
private String contentType;
@@ -81,7 +75,7 @@
dataToStore = new UriData();
dataToStore.value = resource.getValue();
dataToStore.createContent = UIComponentBase.saveAttachedState(context,
- resource.getCreateContentExpression());
+ resource.getCreateContentExpression());
if (data instanceof UIComponent) {
UIComponent component = (UIComponent) data;
@@ -128,9 +122,9 @@
// Send content
OutputStream out = context.getOutputStream();
MethodExpression send = (MethodExpression) UIComponentBase.restoreAttachedState(facesContext,
- data.createContent);
+ data.createContent);
- send.invoke(elContext, new Object[] {out, data.value});
+ send.invoke(elContext, new Object[]{out, data.value});
}
}
@@ -146,7 +140,7 @@
if (data.modified != null) {
ValueExpression binding = (ValueExpression) UIComponentBase.restoreAttachedState(facesContext,
- data.modified);
+ data.modified);
Date modified = (Date) binding.getValue(elContext);
if (null != modified) {
@@ -170,7 +164,7 @@
if (data.expires != null) {
ValueExpression binding = (ValueExpression) UIComponentBase.restoreAttachedState(facesContext,
- data.expires);
+ data.expires);
Date expires = (Date) binding.getValue(elContext);
if (null != expires) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/DualLRUMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/DualLRUMap.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/DualLRUMap.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource.cached;
import java.util.Collection;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBean.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBean.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,15 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource.cached;
import java.io.Serializable;
/**
* @author shura
- *
*/
public class ResourceBean implements Serializable {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBytesDataBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBytesDataBean.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceBytesDataBean.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,15 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource.cached;
import java.util.Arrays;
/**
* @author shura
- *
*/
public class ResourceBytesDataBean extends ResourceBean {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceDataBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceDataBean.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/ResourceDataBean.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.resource.cached;
/**
* @author shura
- *
*/
public class ResourceDataBean extends ResourceBean {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/cached/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Implementation of cached resources
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/ImageInfo.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/ImageInfo.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/ImageInfo.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -20,7 +20,6 @@
*/
-
/*
* ImageInfo.java
*
@@ -35,7 +34,7 @@
* Contributed to the Public Domain.
*
* Last modification 2004-02-29
- */
+*/
package org.ajax4jsf.resource.image;
import org.ajax4jsf.Messages;
@@ -44,9 +43,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
-
import java.util.Vector;
/**
@@ -54,7 +51,7 @@
* number of images, comments and physical resolution from
* JPEG, GIF, BMP, PCX, PNG, IFF, RAS, PBM, PGM, PPM, PSD and SWF files
* (or input streams).
- * <p>
+ * <p/>
* Use the class like this:
* <pre>
* ImageInfo ii = new ImageInfo();
@@ -80,34 +77,34 @@
* <pre>
* java ImageInfo < image.jpg
* </pre>
- * <p>
+ * <p/>
* Known limitations:
* <ul>
* <li>When the determination of the number of images is turned off, GIF bits
- * per pixel are only read from the global header.
- * For some GIFs, local palettes change this to a typically larger
- * value. To be certain to get the correct color depth, call
- * setDetermineImageNumber(true) before calling check().
- * The complete scan over the GIF file will take additional time.</li>
+ * per pixel are only read from the global header.
+ * For some GIFs, local palettes change this to a typically larger
+ * value. To be certain to get the correct color depth, call
+ * setDetermineImageNumber(true) before calling check().
+ * The complete scan over the GIF file will take additional time.</li>
* <li>Transparency information is not included in the bits per pixel count.
- * Actually, it was my decision not to include those bits, so it's a feature! ;-)</li>
+ * Actually, it was my decision not to include those bits, so it's a feature! ;-)</li>
* </ul>
- * <p>
+ * <p/>
* Requirements:
* <ul>
* <li>Java 1.1 or higher</li>
* </ul>
- * <p>
+ * <p/>
* The latest version can be found at <a href="http://www.geocities.com/marcoschmidt.geo/image-info.html">
* http://www.geocities.com/marcoschmidt.geo/image-info.html</a>.
- * <p>
+ * <p/>
* Written by <a href="http://www.geocities.com/marcoschmidt.geo/contact.html">Marco Schmidt</a>.
- * <p>
+ * <p/>
* This class is contributed to the Public Domain.
* Use it at your own risk.
- * <p>
+ * <p/>
* Last modification 2004-02-29.
- * <p>
+ * <p/>
* History:
* <ul>
* <li><strong>2001-08-24</strong> Initial version.</li>
@@ -116,36 +113,36 @@
* <li><strong>2002-01-22</strong> Added support for file formats Amiga IFF and Sun Raster (RAS).</li>
* <li><strong>2002-01-24</strong> Added support for file formats Portable Bitmap / Graymap / Pixmap (PBM, PGM, PPM)
* and Adobe Photoshop (PSD).
- * Added new method getMimeType() to return the MIME type associated with a particular file format.</li>
+ * Added new method getMimeType() to return the MIME type associated with a particular file format.</li>
* <li><strong>2002-03-15</strong> Added support to recognize number of images in file. Only works with GIF.
- * Use {@link #setDetermineImageNumber} with <code>true</code> as argument to identify animated GIFs
- * ({@link #getNumberOfImages()} will return a value larger than <code>1</code>).</li>
+ * Use {@link #setDetermineImageNumber} with <code>true</code> as argument to identify animated GIFs
+ * ({@link #getNumberOfImages()} will return a value larger than <code>1</code>).</li>
* <li><strong>2002-04-10</strong> Fixed a bug in the feature 'determine number of images in animated GIF' introduced
* with version 1.1.
- * Thanks to Marcelo P. Lima for sending in the bug report.
- * Released as 1.1.1.</li>
+ * Thanks to Marcelo P. Lima for sending in the bug report.
+ * Released as 1.1.1.</li>
* <li><strong>2002-04-18</strong> Added {@link #setCollectComments(boolean)}.
- * That new method lets the user specify whether textual comments are to be
- * stored in an internal list when encountered in an input image file / stream.
- * Added two methods to return the physical width and height of the image in dpi:
- * {@link #getPhysicalWidthDpi()} and {@link #getPhysicalHeightDpi()}.
- * If the physical resolution could not be retrieved, these methods return <code>-1</code>.
- * </li>
+ * That new method lets the user specify whether textual comments are to be
+ * stored in an internal list when encountered in an input image file / stream.
+ * Added two methods to return the physical width and height of the image in dpi:
+ * {@link #getPhysicalWidthDpi()} and {@link #getPhysicalHeightDpi()}.
+ * If the physical resolution could not be retrieved, these methods return <code>-1</code>.
+ * </li>
* <li><strong>2002-04-23</strong> Added support for the new properties physical resolution and
- * comments for some formats. Released as 1.2.</li>
+ * comments for some formats. Released as 1.2.</li>
* <li><strong>2002-06-17</strong> Added support for SWF, sent in by Michael Aird.
- * Changed checkJpeg() so that other APP markers than APP0 will not lead to a failure anymore.
- * Released as 1.3.</li>
+ * Changed checkJpeg() so that other APP markers than APP0 will not lead to a failure anymore.
+ * Released as 1.3.</li>
* <li><strong>2003-07-28</strong> Bug fix - skip method now takes return values into consideration.
- * Less bytes than necessary may have been skipped, leading to flaws in the retrieved information in some cases.
- * Thanks to Bernard Bernstein for pointing that out.
- * Released as 1.4.</li>
+ * Less bytes than necessary may have been skipped, leading to flaws in the retrieved information in some cases.
+ * Thanks to Bernard Bernstein for pointing that out.
+ * Released as 1.4.</li>
* <li><strong>2004-02-29</strong> Added support for recognizing progressive JPEG and
- * interlaced PNG and GIF. A new method {@link #isProgressive()} returns whether ImageInfo
- * has found that the storage type is progressive (or interlaced).
- * Thanks to Joe Germuska for suggesting the feature.
- * Bug fix: BMP physical resolution is now correctly determined.
- * Released as 1.5.</li>
+ * interlaced PNG and GIF. A new method {@link #isProgressive()} returns whether ImageInfo
+ * has found that the storage type is progressive (or interlaced).
+ * Thanks to Joe Germuska for suggesting the feature.
+ * Bug fix: BMP physical resolution is now correctly determined.
+ * Released as 1.5.</li>
* </ul>
*/
public class ImageInfo {
@@ -190,15 +187,6 @@
public static final int FORMAT_JPEG = 0;
/**
- * The names of all supported file formats.
- * The FORMAT_xyz int constants can be used as index values for
- * this array.
- */
- private static final String[] FORMAT_NAMES = {
- "JPEG", "GIF", "PNG", "BMP", "PCX", "IFF", "RAS", "PBM", "PGM", "PPM", "PSD", "SWF"
- };
-
- /**
* Return value of {@link #getFormat()} for PBM streams.
*/
public static final int FORMAT_PBM = 7;
@@ -210,7 +198,9 @@
*/
public static final int FORMAT_PCX = 4;
- /** Return value of {@link #getFormat()} for PGM streams. */
+ /**
+ * Return value of {@link #getFormat()} for PGM streams.
+ */
public static final int FORMAT_PGM = 8;
/**
@@ -222,10 +212,14 @@
*/
public static final int FORMAT_PNG = 2;
- /** Return value of {@link #getFormat()} for PPM streams. */
+ /**
+ * Return value of {@link #getFormat()} for PPM streams.
+ */
public static final int FORMAT_PPM = 9;
- /** Return value of {@link #getFormat()} for PSD streams. */
+ /**
+ * Return value of {@link #getFormat()} for PSD streams.
+ */
public static final int FORMAT_PSD = 10;
/**
@@ -235,10 +229,21 @@
*/
public static final int FORMAT_RAS = 6;
- /** Return value of {@link #getFormat()} for SWF (Shockwave) streams. */
+ /**
+ * Return value of {@link #getFormat()} for SWF (Shockwave) streams.
+ */
public static final int FORMAT_SWF = 11;
/**
+ * The names of all supported file formats.
+ * The FORMAT_xyz int constants can be used as index values for
+ * this array.
+ */
+ private static final String[] FORMAT_NAMES = {
+ "JPEG", "GIF", "PNG", "BMP", "PCX", "IFF", "RAS", "PBM", "PGM", "PPM", "PSD", "SWF"
+ };
+
+ /**
* The names of the MIME types for all supported file formats.
* The FORMAT_xyz int constants can be used as index values for
* this array.
@@ -278,6 +283,7 @@
* using {@link #setInput(InputStream)} or {@link #setInput(DataInput)}.
* If true is returned, the file format was known and information
* on the file's content can be retrieved using the various getXyz methods.
+ *
* @return if information could be retrieved from input
*/
public boolean check() {
@@ -339,7 +345,7 @@
bitsPerPixel = getShortLittleEndian(a, 26);
if ((bitsPerPixel != 1) && (bitsPerPixel != 4) && (bitsPerPixel != 8) && (bitsPerPixel != 16)
- && (bitsPerPixel != 24) && (bitsPerPixel != 32)) {
+ && (bitsPerPixel != 24) && (bitsPerPixel != 32)) {
return false;
}
@@ -401,7 +407,7 @@
blockType = read();
switch (blockType) {
- case 0x2c : // image separator
+ case 0x2c: // image separator
{
if (read(a, 0, 9) != 9) {
return false;
@@ -438,7 +444,7 @@
break;
}
- case 0x21 : // extension
+ case 0x21: // extension
{
int extensionType = read();
@@ -482,10 +488,10 @@
break;
}
- case 0x3b : // end of file
+ case 0x3b: // end of file
break;
- default : {
+ default: {
return false;
}
}
@@ -512,7 +518,7 @@
int type = getIntBigEndian(a, 6);
if ((type != 0x494c424d) && // type must be ILBM...
- (type != 0x50424d20)) { // ...or PBM
+ (type != 0x50424d20)) { // ...or PBM
return false;
}
@@ -893,6 +899,7 @@
/**
* If {@link #check()} was successful, returns the image's number of bits per pixel.
* Does not include transparency information like the alpha channel.
+ *
* @return number of bits per image pixel
*/
public int getBitsPerPixel() {
@@ -901,8 +908,9 @@
/**
* Returns the index'th comment retrieved from the image.
+ *
* @throws IllegalArgumentException if index is smaller than 0 or larger than or equal
- * to the number of comments retrieved
+ * to the number of comments retrieved
* @see #getNumberOfComments
*/
public String getComment(int index) {
@@ -917,6 +925,7 @@
* If {@link #check()} was successful, returns the image format as one
* of the FORMAT_xyz constants from this class.
* Use {@link #getFormatName()} to get a textual description of the file format.
+ *
* @return file format as a FORMAT_xyz constant
*/
public int getFormat() {
@@ -926,6 +935,7 @@
/**
* If {@link #check()} was successful, returns the image format's name.
* Use {@link #getFormat()} to get a unique number.
+ *
* @return file format name
*/
public String getFormatName() {
@@ -939,6 +949,7 @@
/**
* If {@link #check()} was successful, returns one the image's vertical
* resolution in pixels.
+ *
* @return image height in pixels
*/
public int getHeight() {
@@ -956,6 +967,7 @@
/**
* If {@link #check()} was successful, returns a String with the
* MIME type of the format.
+ *
* @return MIME type, e.g. <code>image/jpeg</code>
*/
public String getMimeType() {
@@ -976,6 +988,7 @@
* from the input image stream / file.
* Any number >= 0 and smaller than this number of comments is then a
* valid argument for the {@link #getComment(int)} method.
+ *
* @return number of comments retrieved from input image
*/
public int getNumberOfComments() {
@@ -991,6 +1004,7 @@
* Assumes that <code>setDetermineImageNumber(true);</code> was called before
* a successful call to {@link #check()}.
* This value can currently be only different from <code>1</code> for GIF images.
+ *
* @return number of images in file
*/
public int getNumberOfImages() {
@@ -1001,6 +1015,7 @@
* Returns the physical height of this image in dots per inch (dpi).
* Assumes that {@link #check()} was successful.
* Returns <code>-1</code> on failure.
+ *
* @return physical height (in dpi)
* @see #getPhysicalWidthDpi()
* @see #getPhysicalHeightInch()
@@ -1012,6 +1027,7 @@
/**
* If {@link #check()} was successful, returns the physical width of this image in dpi (dots per inch)
* or -1 if no value could be found.
+ *
* @return physical height (in dpi)
* @see #getPhysicalHeightDpi()
* @see #getPhysicalWidthDpi()
@@ -1031,6 +1047,7 @@
/**
* If {@link #check()} was successful, returns the physical width of this image in dpi (dots per inch)
* or -1 if no value could be found.
+ *
* @return physical width (in dpi)
* @see #getPhysicalHeightDpi()
* @see #getPhysicalWidthInch()
@@ -1044,6 +1061,7 @@
* Returns the physical width of an image in inches, or
* <code>-1.0f</code> if width information is not available.
* Assumes that {@link #check} has been called successfully.
+ *
* @return physical width in inches or <code>-1.0f</code> on failure
* @see #getPhysicalWidthDpi
* @see #getPhysicalHeightInch
@@ -1070,6 +1088,7 @@
/**
* If {@link #check()} was successful, returns one the image's horizontal
* resolution in pixels.
+ *
* @return image width in pixels
*/
public int getWidth() {
@@ -1078,6 +1097,7 @@
/**
* Returns whether the image is stored in a progressive (also called: interlaced) way.
+ *
* @return true for progressive/interlaced, false otherwise
*/
public boolean isProgressive() {
@@ -1090,6 +1110,7 @@
* printed to standard output, one line per file) or call
* it with no parameters. It will then check data given to it
* via standard input.
+ *
* @param args the program arguments which must be file names
*/
public static void main(String[] args) {
@@ -1144,10 +1165,10 @@
private static void printCompact(String sourceName, ImageInfo imageInfo) {
System.out.println(imageInfo.getFormatName() + ";" + imageInfo.getMimeType() + ";" + imageInfo.getWidth() + ";"
- + imageInfo.getHeight() + ";" + imageInfo.getBitsPerPixel() + ";"
- + imageInfo.getNumberOfImages() + ";" + imageInfo.getPhysicalWidthDpi() + ";"
- + imageInfo.getPhysicalHeightDpi() + ";" + imageInfo.getPhysicalWidthInch() + ";"
- + imageInfo.getPhysicalHeightInch() + ";" + imageInfo.isProgressive());
+ + imageInfo.getHeight() + ";" + imageInfo.getBitsPerPixel() + ";"
+ + imageInfo.getNumberOfImages() + ";" + imageInfo.getPhysicalWidthDpi() + ";"
+ + imageInfo.getPhysicalHeightDpi() + ";" + imageInfo.getPhysicalWidthInch() + ";"
+ + imageInfo.getPhysicalHeightInch() + ";" + imageInfo.isProgressive());
}
private static void printLine(int indentLevels, String text, float value, float minValidValue) {
@@ -1346,6 +1367,7 @@
* Specify whether textual comments are supposed to be extracted from input.
* Default is <code>false</code>.
* If enabled, comments will be added to an internal list.
+ *
* @param newValue if <code>true</code>, this class will read comments
* @see #getNumberOfComments
* @see #getComment
@@ -1365,6 +1387,7 @@
* the actual number of images can be queried via
* {@link #getNumberOfImages()} after a successful call to
* {@link #check()}.
+ *
* @param newValue will the number of images be determined?
* @see #getNumberOfImages
*/
@@ -1376,6 +1399,7 @@
* Set the input stream to the argument stream (or file).
* Note that {@link java.io.RandomAccessFile} implements
* {@link java.io.DataInput}.
+ *
* @param dataInput the input stream to read from
*/
public void setInput(DataInput dataInput) {
@@ -1385,6 +1409,7 @@
/**
* Set the input stream to the argument stream (or file).
+ *
* @param inputStream the input stream to read from
*/
public void setInput(InputStream inputStream) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/image/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Image resources support classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/package.html
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/package.html 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/package.html 2009-12-04 20:46:42 UTC (rev 16071)
@@ -3,14 +3,10 @@
<head>
-
-
- <meta content="text/html; charset=Windows-1251" http-equiv="content-type">
+ <meta content="text/html; charset=Windows-1251" http-equiv="content-type">
-
-
- <title>Internet Resources</title>
+ <title>Internet Resources</title>
</head>
@@ -18,17 +14,17 @@
<h1>Package for manipulate page resources ( images, scripts, styles,
-applets etc ) at Java Server Faces render Phase and at request phase of
-concrete resource.</h1>
+ applets etc ) at Java Server Faces render Phase and at request phase of
+ concrete resource.</h1>
-Note: The resource framework implements the Lightweight design patter.
-Therefore, the resource classes should not contain data depends of
+Note: The resource framework implements the Lightweight design patter.
+Therefore, the resource classes should not contain data depends of
the particular request. The data is taken from the {@link javax.context.FacesContext}
and {@link javax.component.UIComponent}, that is passed as a parameter
when html is generated.
For passing the data with URI, the {@link InternetResourceBase} class
has getDataToSave method. It is invoked when the generation is taken place.
The returned object is serialized. Then, restoreData method de-serialize it back.
-The {@link InternetResourceBuilder} class controls this process.
+The {@link InternetResourceBuilder} class controls this process.
</body>
</html>
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.el.ELResolverWrapper;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ELUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ELUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ELUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,37 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.el.ELContextWrapper;
import org.ajax4jsf.util.GenericsIntrospectionCache.GenericsCacheEntry;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-
import java.lang.ref.SoftReference;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
-
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
-import javax.el.ELContext;
-import javax.el.ValueExpression;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-
/**
* @author asmirnov
- *
*/
public final class ELUtils {
private ELUtils() {
@@ -62,9 +55,9 @@
* Otherthise, return parsed and evaluated expression.
*
* @param context -
- * current Faces Context.
- * @param value -
- * string to parse.
+ * current Faces Context.
+ * @param value -
+ * string to parse.
* @return - interpreted el or unmodified value.
*/
public static boolean isValueReference(String value) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,23 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
-import java.beans.BeanInfo;
+import org.richfaces.util.ReferenceMap;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import java.beans.BeanInfo;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
-
import java.util.Collections;
import java.util.Map;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.util.ReferenceMap;
-
/**
* @author Nick Belaevski
* @since 3.3.0
@@ -48,8 +43,8 @@
private GenericsIntrospectionCache(int cacheSize) {
genericsCache = new ReferenceMap<Class<?>,
- GenericsCacheEntry>(Collections.synchronizedMap(new LRUMap<Class<?>,
- Reference<GenericsCacheEntry>>(cacheSize)));
+ GenericsCacheEntry>(Collections.synchronizedMap(new LRUMap<Class<?>,
+ Reference<GenericsCacheEntry>>(cacheSize)));
}
private static int getSize(ExternalContext externalContext) {
@@ -61,7 +56,7 @@
cacheSize = Integer.valueOf(cacheSizeParameter);
} catch (NumberFormatException e) {
externalContext.log("Error converting " + CACHE_SIZE_PARAMETER + " init parameter to int: "
- + e.getMessage(), e);
+ + e.getMessage(), e);
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlColor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlColor.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlColor.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.Messages;
-import java.awt.Color;
-
+import java.awt.*;
import java.util.HashMap;
import java.util.Map;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:16 $
- *
*/
public final class HtmlColor {
private static Map<String, Color> colorNames;
@@ -60,10 +56,12 @@
colorNames.put("aqua", new Color(0x00FFFF));
}
- private HtmlColor() {}
+ private HtmlColor() {
+ }
/**
* Decode HTML-attribute style of color to {@link Color}
+ *
* @param color - color name or #RRGGBB string
* @return - color for this value.
*/
@@ -79,7 +77,7 @@
c = Color.decode(color.trim());
} catch (NumberFormatException e) {
throw new IllegalArgumentException(Messages.getMessage(Messages.DECODE_COLOR_PARAMETER_ERROR, color,
- e.getMessage()));
+ e.getMessage()));
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlDimensions.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlDimensions.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/HtmlDimensions.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.Messages;
@@ -28,7 +26,6 @@
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.ParseException;
-
import java.util.regex.Pattern;
public final class HtmlDimensions {
@@ -44,7 +41,8 @@
PX_FORMAT.setNegativeSuffix("px");
}
- private HtmlDimensions() {}
+ private HtmlDimensions() {
+ }
public static Double decode(String size) {
@@ -69,8 +67,8 @@
}
} catch (ParseException e) {
throw new IllegalArgumentException(Messages.getMessage(Messages.DECODE_PARAMETER_ERROR,
- new Object[] {"size",
- size, e.getMessage()}));
+ new Object[]{"size",
+ size, e.getMessage()}));
}
return new Double(d);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/InputUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/InputUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/InputUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,32 +19,29 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.Messages;
-import java.io.Serializable;
-
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponent;
import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
+import java.io.Serializable;
/**
* @author Maksim Kaszynski
* @author Manfred Geiler
- *
*/
public final class InputUtils {
public static final String EMPTY_STRING = new String();
- public static final Object NOTHING = new Serializable() { };
+ public static final Object NOTHING = new Serializable() {
+ };
- private InputUtils() {}
+ private InputUtils() {
+ }
public static boolean isTrue(Object obj) {
if (!(obj instanceof Boolean)) {
@@ -63,7 +60,7 @@
}
public static Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue)
- throws ConverterException {
+ throws ConverterException {
String newValue = (String) submittedValue;
ValueExpression valueExpression = component.getValueExpression("value");
Converter converter = null;
@@ -82,7 +79,7 @@
if (converter == null) {
throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR,
- converterType.getName()));
+ converterType.getName()));
}
}
} else if (converter == null) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/LRUMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/LRUMap.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/LRUMap.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,20 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import java.io.Serializable;
-
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
/**
* Last Recent Used Map cache. See {@link LinkedHashMap} for details.
- * @author asmirnov
*
+ * @author asmirnov
*/
public class LRUMap<K, V> extends LinkedHashMap<K, V> implements Serializable {
@@ -65,6 +62,7 @@
/**
* Get most recent used element
+ *
* @return the most Recent value
*/
public V getMostRecent() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataInputStream.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataInputStream.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataInputStream.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,14 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
-import java.awt.Color;
-
+import java.awt.*;
import java.io.ByteArrayInputStream;
-
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataOutputStream.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataOutputStream.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/NumericDataOutputStream.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,16 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import static org.ajax4jsf.util.NumericDataInputStream.*;
-import java.awt.Color;
-
+import java.awt.*;
import java.io.ByteArrayOutputStream;
-
import java.nio.ByteBuffer;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,30 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.Messages;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.lang.reflect.Array;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
import javax.el.ELContext;
import javax.el.ValueExpression;
-
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
@@ -54,18 +38,28 @@
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.model.SelectItem;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
/**
* @author Maksim Kaszynski
- *
*/
public final class SelectUtils {
private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
- private SelectUtils() { }
+ private SelectUtils() {
+ }
/**
* Gathers all select items from specified component's children
+ *
* @param context
* @param component
* @return list of {@link SelectItems} taken from f:selectItem and f:selectItems
@@ -84,14 +78,14 @@
UISelectItem item = (UISelectItem) kid;
list.add(new SelectItem(item.getItemValue(), item.getItemLabel(), item.getItemDescription(),
- item.isItemDisabled()));
+ item.isItemDisabled()));
} else if (value instanceof SelectItem) {
list.add((SelectItem) value);
} else {
String valueClass = value != null ? "'" + value.getClass().getName() + "'" : "";
throw new IllegalArgumentException(Messages.getMessage(Messages.INVALID_ATTRIBUTE_VALUE,
- valueClass, "<selectItem>"));
+ valueClass, "<selectItem>"));
}
} else if ((kid instanceof UISelectItems) && (null != context)) {
Object value = ((UISelectItems) kid).getValue();
@@ -115,7 +109,7 @@
String valueClass = (value != null) ? "'" + value.getClass().getName() + "'" : "";
throw new IllegalArgumentException(Messages.getMessage(Messages.INVALID_ATTRIBUTE_VALUE,
- valueClass, "<selectItems>"));
+ valueClass, "<selectItems>"));
}
}
}
@@ -126,15 +120,15 @@
/**
* Converts UISelectMany submitted value to converted value
*
- * @author Manfred Geiler
* @param facesContext
* @param component
* @param submittedValue
* @return
* @throws ConverterException
+ * @author Manfred Geiler
*/
public static Object getConvertedUISelectManyValue(FacesContext facesContext, UISelectMany component,
- String[] submittedValue) throws ConverterException {
+ String[] submittedValue) throws ConverterException {
// Attention!
// This code is duplicated in jsfapi component package.
@@ -205,7 +199,7 @@
// --> so let's convert it to an Object array
int len = submittedValue.length;
Object[] convertedValues = (Object[]) Array.newInstance((arrayComponentType == null)
- ? Object.class : arrayComponentType, len);
+ ? Object.class : arrayComponentType, len);
for (int i = 0; i < len; i++) {
convertedValues[i] = converter.getAsObject(facesContext, component, submittedValue[i]);
@@ -263,11 +257,11 @@
public static Object getConvertedUIInputValue(FacesContext facesContext, UIInput component, String submittedValue)
throws ConverterException {
-
+
/*
- * if (submittedValue == null)
- * throw new NullPointerException("submittedValue");
- */
+ * if (submittedValue == null)
+ * throw new NullPointerException("submittedValue");
+ */
if (InputUtils.EMPTY_STRING.equals(submittedValue)) {
return null;
}
@@ -281,7 +275,6 @@
}
/**
- *
* @param facesContext
* @param component
* @param property
@@ -304,7 +297,7 @@
if (converter == null) {
throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR,
- valueType.getName()));
+ valueType.getName()));
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,37 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
import org.ajax4jsf.resource.util.URLToStreamHelper;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
+import javax.faces.FacesException;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
-
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import javax.faces.FacesException;
-
/**
* @author shura
- *
*/
@Deprecated
public final class ServicesUtils {
private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
private static Map<String, Map<ClassLoader, Class<?>>> services = Collections.synchronizedMap(new HashMap<String,
- Map<ClassLoader, Class<?>>>());
+ Map<ClassLoader, Class<?>>>());
private static Map<String, Map<ClassLoader, Object>> instances = Collections.synchronizedMap(new HashMap<String,
- Map<ClassLoader, Object>>());
+ Map<ClassLoader, Object>>());
private ServicesUtils() {
@@ -82,6 +75,7 @@
/**
* Get per-context instance for service.
+ *
* @param name - name ( default classname ) for service.
* @return current instance for this service.
* @throws ClassNotFoundException
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,13 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
@Deprecated
public final class Zipper {
- private Zipper() {}
+ private Zipper() {
+ }
public static void zip(byte[] buf, int value, int offset) {
buf[offset] = (byte) (value & 0x0ff);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper2.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper2.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/Zipper2.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util;
-import java.awt.Color;
-
+import java.awt.*;
import java.nio.ByteBuffer;
/**
- *
* <br /><br />
- *
+ * <p/>
* Created 21.08.2007
+ *
* @author Nick Belaevski
* @since 3.1
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryDecoder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryDecoder.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryDecoder.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
@@ -30,13 +28,11 @@
* Decodes a byte array and returns the results as a byte array.
*
* @param pArray A byte array which has been encoded with the
- * appropriate encoder
- *
+ * appropriate encoder
* @return a byte array that contains decoded content
- *
* @throws DecoderException A decoder exception is thrown
- * if a Decoder encounters a failure condition during
- * the decode process.
+ * if a Decoder encounters a failure condition during
+ * the decode process.
*/
byte[] decode(byte[] pArray) throws DecoderException;
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryEncoder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryEncoder.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/BinaryEncoder.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
@@ -31,12 +29,10 @@
* as a byte array.
*
* @param pArray Data to be encoded
- *
* @return A byte array containing the encoded data
- *
* @throws EncoderException thrown if the Encoder
- * encounters a failure condition during the
- * encoding process.
+ * encounters a failure condition during the
+ * encoding process.
*/
byte[] encode(byte[] pArray) throws EncoderException;
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Codec.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Codec.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Codec.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,23 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util.base64;
-import java.security.spec.KeySpec;
-
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
-
import javax.faces.FacesException;
+import java.security.spec.KeySpec;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:10 $
- *
*/
public class Codec {
private Cipher d = null;
@@ -44,7 +39,8 @@
/**
*
*/
- public Codec() {}
+ public Codec() {
+ }
/**
*
@@ -56,10 +52,15 @@
/**
* @param p
* @throws java.security.InvalidKeyException
+ *
* @throws java.io.UnsupportedEncodingException
+ *
* @throws java.security.spec.InvalidKeySpecException
+ *
* @throws java.security.NoSuchAlgorithmException
+ *
* @throws javax.crypto.NoSuchPaddingException
+ *
*/
public void setPassword(String p) throws FacesException {
byte[] s = {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Decoder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Decoder.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Decoder.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,18 +14,16 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
* <p>Provides the highest level of abstraction for Decoders.
* This is the sister interface of {@link Encoder}. All
* Decoders implement this common generic interface.</p>
- *
+ * <p/>
* <p>Allows a user to pass a generic Object to any Decoder
* implementation in the codec package.</p>
- *
+ * <p/>
* <p>One of the two interfaces at the center of the codec package.</p>
*
* @author Apache Software Foundation
@@ -42,14 +40,12 @@
* this decode method will throw a DecoderException.
*
* @param pObject an object to "decode"
- *
* @return a 'decoded" object
- *
* @throws DecoderException a decoder exception can
- * be thrown for any number of reasons. Some good
- * candidates are that the parameter passed to this
- * method is null, a param cannot be cast to the
- * appropriate type for a specific encoder.
+ * be thrown for any number of reasons. Some good
+ * candidates are that the parameter passed to this
+ * method is null, a param cannot be cast to the
+ * appropriate type for a specific encoder.
*/
Object decode(Object pObject) throws DecoderException;
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/DecoderException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/DecoderException.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/DecoderException.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Encoder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Encoder.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/Encoder.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
@@ -35,12 +33,10 @@
* or <code>String</code>s depending on the implementation used.
*
* @param pObject An object ot encode
- *
* @return An "encoded" Object
- *
* @throws EncoderException an encoder exception is
- * thrown if the encoder experiences a failure
- * condition during the encoding process.
+ * thrown if the encoder experiences a failure
+ * condition during the encoding process.
*/
Object encode(Object pObject) throws EncoderException;
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/EncoderException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/EncoderException.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/EncoderException.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URL64Codec.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URL64Codec.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URL64Codec.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
import org.ajax4jsf.Messages;
@@ -24,11 +22,10 @@
* Provides Base64 encoding and decoding like defined by RFC 2045, but with little difference :
* chars '=' '+' and '/' , incorrectly processed in URL by any browsers, replaced by '_' '-' '!',
*
- *
- * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @author Apache Software Foundation
- * @since 1.0-dev
* @version $Id: URL64Codec.java,v 1.1.2.1 2007/01/09 18:59:11 alexsmirnov Exp $
+ * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
+ * @since 1.0-dev
*/
public class URL64Codec implements BinaryEncoder, BinaryDecoder {
@@ -39,7 +36,7 @@
/**
* Chunk size per RFC 2045 section 6.8.
- *
+ * <p/>
* <p>The {@value} character limit does not count the trailing CRLF, but counts
* all other characters, including any equal signs.</p>
*
@@ -232,8 +229,8 @@
* chunking the output into 76 character blocks.
*
* @param binaryData Array containing binary data to encode.
- * @param isChunked if isChunked is true this encoder will chunk
- * the base64 output into 76 character blocks
+ * @param isChunked if isChunked is true this encoder will chunk
+ * the base64 output into 76 character blocks
* @return Base64-encoded data.
*/
public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
@@ -348,7 +345,7 @@
// we also add a separator to the end of the final chunk.
if (chunksSoFar < nbrChunks) {
System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedDataLength - CHUNK_SEPARATOR.length,
- CHUNK_SEPARATOR.length);
+ CHUNK_SEPARATOR.length);
}
}
@@ -433,7 +430,7 @@
* Discards any whitespace from a base-64 encoded block.
*
* @param data The base-64 encoded data to discard the whitespace
- * from.
+ * from.
* @return The data, less whitespace (see RFC 2045).
*/
static byte[] discardWhitespace(byte[] data) {
@@ -442,13 +439,13 @@
for (int i = 0; i < data.length; i++) {
switch (data[i]) {
- case (byte) ' ' :
- case (byte) '\n' :
- case (byte) '\r' :
- case (byte) '\t' :
+ case (byte) ' ':
+ case (byte) '\n':
+ case (byte) '\r':
+ case (byte) '\t':
break;
- default :
+ default:
groomedData[bytesCopied++] = data[i];
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URLCodec.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URLCodec.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/URLCodec.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -14,60 +14,49 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.util.base64;
import java.io.ByteArrayOutputStream;
-
import java.util.BitSet;
/**
- *
* <p>Implements the 'www-form-urlencoded' encoding scheme,
- *
+ * <p/>
* also misleadingly known as URL encoding.</p>
- *
- *
- *
+ * <p/>
+ * <p/>
+ * <p/>
* <p>For more detailed information please refer to
- *
+ * <p/>
* <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">
- *
+ * <p/>
* Chapter 17.13.4 'Form content types'</a> of the
- *
+ * <p/>
* <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification<a></p>
- *
- *
- *
+ * <p/>
+ * <p/>
+ * <p/>
* <p>
- *
+ * <p/>
* This codec is meant to be a replacement for standard Java classes
- *
+ * <p/>
* {@link java.net.URLEncoder} and {@link java.net.URLDecoder}
- *
+ * <p/>
* on older Java platforms, as these classes in Java versions below
- *
+ * <p/>
* 1.4 rely on the platform's default charset encoding.
- *
+ * <p/>
* </p>
*
- *
- *
* @author Apache Software Foundation
- *
- * @since 1.2
- *
* @version $Id: URLCodec.java,v 1.1.2.1 2007/01/09 18:59:14 alexsmirnov Exp $
- *
+ * @since 1.2
*/
public class URLCodec implements BinaryEncoder, BinaryDecoder {
protected static final byte ESCAPE_CHAR = '%';
/**
- *
* BitSet of www-form-url safe characters.
- *
*/
protected static final BitSet WWW_FORM_URL = new BitSet(256);
@@ -99,9 +88,7 @@
}
/**
- *
* Default constructor.
- *
*/
public URLCodec() {
super();
@@ -112,19 +99,13 @@
}
/**
- *
* Encodes an array of bytes into an array of URL safe 7-bit
- *
+ * <p/>
* characters. Unsafe characters are escaped.
*
- *
- *
* @param urlsafe bitset of characters deemed URL safe
- *
- * @param bytes array of bytes to convert to URL safe characters
- *
+ * @param bytes array of bytes to convert to URL safe characters
* @return array of bytes containing URL safe characters
- *
*/
public static final byte[] encodeUrl(BitSet urlsafe, byte[] bytes) {
if (bytes == null) {
@@ -165,21 +146,15 @@
}
/**
- *
* Decodes an array of URL safe 7-bit characters into an array of
- *
+ * <p/>
* original bytes. Escaped characters are converted back to their
- *
+ * <p/>
* original representation.
*
- *
- *
* @param bytes array of URL safe characters
- *
* @return array of original bytes
- *
* @throws DecoderException Thrown if URL decoding is unsuccessful
- *
*/
public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
if (bytes == null) {
@@ -215,61 +190,44 @@
}
/**
- *
* Encodes an array of bytes into an array of URL safe 7-bit
- *
+ * <p/>
* characters. Unsafe characters are escaped.
*
- *
- *
* @param bytes array of bytes to convert to URL safe characters
- *
* @return array of bytes containing URL safe characters
- *
*/
public byte[] encode(byte[] bytes) {
return encodeUrl(WWW_FORM_URL, bytes);
}
/**
- *
* Decodes an array of URL safe 7-bit characters into an array of
- *
+ * <p/>
* original bytes. Escaped characters are converted back to their
- *
+ * <p/>
* original representation.
*
- *
- *
* @param bytes array of URL safe characters
- *
* @return array of original bytes
- *
* @throws DecoderException Thrown if URL decoding is unsuccessful
- *
*/
public byte[] decode(byte[] bytes) throws DecoderException {
return decodeUrl(bytes);
}
/**
- *
* Encodes an object into its URL safe form. Unsafe characters are
- *
+ * <p/>
* escaped.
*
- *
- *
* @param pObject string to convert to a URL safe form
- *
* @return URL safe object
- *
* @throws EncoderException Thrown if URL encoding is not
- *
+ * <p/>
* applicable to objects of this type or
- *
+ * <p/>
* if encoding is unsuccessful
- *
*/
public Object encode(Object pObject) throws EncoderException {
if (pObject == null) {
@@ -284,23 +242,17 @@
}
/**
- *
* Decodes a URL safe object into its original form. Escaped
- *
+ * <p/>
* characters are converted back to their original representation.
*
- *
- *
* @param pObject URL safe object to convert into its original form
- *
* @return original object
- *
* @throws DecoderException Thrown if URL decoding is not
- *
+ * <p/>
* applicable to objects of this type
- *
+ * <p/>
* if decoding is unsuccessful
- *
*/
public Object decode(Object pObject) throws DecoderException {
if (pObject == null) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/base64/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Framework utility classes to handle BASE64 encoding
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Framework utility classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util.style;
import java.util.HashMap;
@@ -30,17 +28,16 @@
/**
* Simple utility class for CSS style formatting
* Current version isn't thread-safe and doesn't provide any validation
- *
+ * <p/>
* Usage is simle
* <code>
- * CSSFormat format = new CSSFormat();
- * format.add("background-position", "top left");
- * format.addURL("background-image", "/images/corner.gif");
- * responseWriter.writeAttribute("style", format, null);
+ * CSSFormat format = new CSSFormat();
+ * format.add("background-position", "top left");
+ * format.addURL("background-image", "/images/corner.gif");
+ * responseWriter.writeAttribute("style", format, null);
* </code>
*
* @author Maksim Kaszynski
- *
*/
public class CSSFormat {
private Map properties;
@@ -55,6 +52,7 @@
/**
* Constructs CSSFormat object
* and fills it with given parameters
+ *
* @param property
* @param value
*/
@@ -65,6 +63,7 @@
/**
* Surrounds given URL with <code>url()</code>
+ *
* @param url
* @return
*/
@@ -79,6 +78,7 @@
/**
* Formats property-value pair in CSS fashion
+ *
* @param property
* @param value
* @return
@@ -98,6 +98,7 @@
/**
* Adds property. If such property already exists,
* its value is replaced with new one
+ *
* @param property
* @param value
* @return itself
@@ -111,6 +112,7 @@
/**
* adds a property with URL value
* given value is wrapped in <code>url()</code> clause
+ *
* @param property
* @param url
* @return itself
@@ -130,13 +132,14 @@
/**
* Concatenates all properties with their values to produce CSS output
+ *
* @param separator - custom string to be inserted between properties
* @return
*/
public String concatenate(String separator) {
StringBuffer output = new StringBuffer();
- for (Iterator iter = properties.entrySet().iterator(); iter.hasNext(); ) {
+ for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = (Map.Entry) iter.next();
output.append(formatPropertyValue(entry.getKey(), entry.getValue()));
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util.style;
/**
* @author Maksim Kaszynski
- *
*/
public class CSSSelector {
private StringBuffer selectorBuffer;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/FontFamily.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/FontFamily.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/FontFamily.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,19 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.util.style;
-import java.awt.Font;
-import java.awt.GraphicsEnvironment;
-
+import java.awt.*;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
* @author Maksim Kaszynski
- *
*/
public final class FontFamily {
public static final String CSS_MONOSPACED = "MONOSPACE";
@@ -51,7 +46,8 @@
Arrays.sort(FONT_FAMILIES);
}
- private FontFamily() {}
+ private FontFamily() {
+ }
public static Font getFont(String fontFamily, int style, int size) {
String fontUsed = null;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/style/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* CSS utility classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.Messages;
@@ -28,27 +26,11 @@
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
import org.ajax4jsf.request.MultipartRequest;
import org.ajax4jsf.resource.InternetResourceService;
-
import org.richfaces.component.FileUploadConstants;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-
-import java.net.URLDecoder;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Pattern;
-
import javax.faces.application.ViewHandler;
-
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -60,6 +42,16 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
/**
* Base class for request processing filters, with convert Htmp content to XML
@@ -67,7 +59,6 @@
*
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:21 $
- *
*/
public abstract class BaseFilter implements Filter {
public static final String ABSOLUTE_TAGS_PARAMETER = "absolute-attributes";
@@ -84,7 +75,9 @@
// Pattern.compile(CACHEABLE_PREFIX+"/(.*)");
public static final String FILTER_PERFORMED = "com.exade.vcp.Filter.done";
- /** Multipart request start */
+ /**
+ * Multipart request start
+ */
public static final String MULTIPART = "multipart/";
// private WebXml webXml;
@@ -101,7 +94,7 @@
public static final String SEND_HTTP_ERROR = "_richfaces_send_http_error";
public static final String STYLESHEET_PARAMETER = "xsl";
public static final boolean DEBUG = true;
-
+
private static final String FUNCTION_NAME_PARAMETER = "function";
private static final String MYFACES_DOFILTER_CALLED =
"org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled";
@@ -251,7 +244,7 @@
if (session != null) {
Map<String, Integer> map = (Map<String,
- Integer>) session.getAttribute(FileUploadConstants.UPLOADED_COUNTER);
+ Integer>) session.getAttribute(FileUploadConstants.UPLOADED_COUNTER);
if (map != null) {
String id = idParameter;
@@ -311,7 +304,7 @@
if (!this.myfacesMessagePrinted) {
LOG.warn(
"MyFaces Extensions Filter should be configured to execute *AFTER* RichFaces filter. Refer to "
- + "SRV.6.2.4 section of Servlets specification on how to achieve that.");
+ + "SRV.6.2.4 section of Servlets specification on how to achieve that.");
this.myfacesMessagePrinted = true;
}
}
@@ -334,7 +327,7 @@
* @throws ServletException
*/
protected void processUploadsAndHandleRequest(HttpServletRequest request, HttpServletResponse response,
- FilterChain chain) throws IOException, ServletException {
+ FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
Map<String, String> queryParamMap = parseQueryString(httpRequest.getQueryString());
@@ -343,7 +336,7 @@
if (uid != null) {
if (isMultipartRequest(httpRequest)) {
MultipartRequest multipartRequest = new MultipartRequest(httpRequest, createTempFiles, maxRequestSize,
- uid);
+ uid);
Object oldAttributeValue =
httpRequest.getAttribute(FileUploadConstants.FILE_UPLOAD_REQUEST_ATTRIBUTE_NAME);
@@ -357,7 +350,7 @@
response.sendError(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE);
System.err.println(
"ERROR " + HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE
- + "request entity is larger than the server is willing or able to process.");
+ + "request entity is larger than the server is willing or able to process.");
return;
} else {
@@ -385,7 +378,7 @@
}
private HttpServletResponse getHttpServletResponse(final HttpServletResponse response,
- MultipartRequest multipartRequest) {
+ MultipartRequest multipartRequest) {
if (multipartRequest.isFormUpload()) {
return response;
}
@@ -473,7 +466,7 @@
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
-
+
long startTimeMills = 0;
// Detect case of request - normal, AJAX, AJAX - JavaScript
@@ -484,7 +477,7 @@
if (LOG.isDebugEnabled()) {
startTimeMills = System.currentTimeMillis();
LOG.debug(Messages.getMessage(Messages.FILTER_START_INFO, new Date(startTimeMills),
- httpServletRequest.getRequestURI()));
+ httpServletRequest.getRequestURI()));
}
if (request.getAttribute(FILTER_PERFORMED) != Boolean.TRUE) {
@@ -559,7 +552,7 @@
if (LOG.isDebugEnabled()) {
startTimeMills = System.currentTimeMillis() - startTimeMills;
LOG.debug(Messages.getMessage(Messages.FILTER_STOP_INFO, "" + startTimeMills,
- httpServletRequest.getRequestURI()));
+ httpServletRequest.getRequestURI()));
}
}
@@ -580,7 +573,8 @@
/**
* Destroy the filter.
*/
- public void destroy() { }
+ public void destroy() {
+ }
/**
* @return Returns the servletContext.
@@ -605,8 +599,7 @@
}
/**
- * @param function
- * The function to set.
+ * @param function The function to set.
*/
protected void setFunction(String function) {
this.function = function;
@@ -620,8 +613,7 @@
}
/**
- * @param rewriteid
- * The rewriteid to set.
+ * @param rewriteid The rewriteid to set.
*/
protected void setRewriteid(boolean rewriteid) {
this.rewriteid = rewriteid;
@@ -635,8 +627,7 @@
}
/**
- * @param attributesNames
- * The attributesNames to set.
+ * @param attributesNames The attributesNames to set.
*/
protected void setAttributesNames(String attributesNames) {
this.attributesNames = attributesNames;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.Messages;
import org.ajax4jsf.application.AjaxViewHandler;
import org.ajax4jsf.context.ContextInitParameters;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import javax.faces.application.ViewExpiredException;
-
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
@@ -42,12 +37,10 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
-
import java.util.Map;
public abstract class BaseXMLFilter {
@@ -95,7 +88,7 @@
if (forceNotRfParameter == null) {
forceNotRfParameter = config.getServletContext().getInitParameter(INIT_PARAMETER_PREFIX
- + FORCENOTRF_PARAMETER);
+ + FORCENOTRF_PARAMETER);
}
setupForcenotrf(forceNotRfParameter);
@@ -149,7 +142,7 @@
*/
protected void doXmlFilter(FilterChain chain, HttpServletRequest request, final HttpServletResponse response)
throws IOException, ServletException {
-
+
if (LOG.isDebugEnabled()) {
LOG.debug("XML filter service start processing request");
}
@@ -165,7 +158,7 @@
chain.doFilter(request, servletResponseWrapper);
} catch (ServletException e) {
if (handleViewExpiredOnClient && (isViewExpired(e) || isViewExpired(e.getRootCause()))
- && isAjaxRequest(request)) {
+ && isAjaxRequest(request)) {
LOG.debug("ViewExpiredException in the filter chain - will be handled on the client", e);
Writer output = resetResponse(response, servletResponseWrapper, "true");
@@ -173,9 +166,9 @@
response.setHeader(AJAX_EXPIRED, message);
output.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>" + "<meta name=\""
- + AjaxContainerRenderer.AJAX_FLAG_HEADER + "\" content=\"true\" />" + "<meta name=\""
- + AJAX_EXPIRED + "\" content=\"" + message + "\" />" + "</head></html>");
+ + "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>" + "<meta name=\""
+ + AjaxContainerRenderer.AJAX_FLAG_HEADER + "\" content=\"true\" />" + "<meta name=\""
+ + AJAX_EXPIRED + "\" content=\"" + message + "\" />" + "</head></html>");
output.flush();
response.flushBuffer();
@@ -214,10 +207,10 @@
// For buggy XmlHttpRequest realisations repeat headers in
// <meta>
output.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>" + "<meta name=\""
- + AjaxContainerRenderer.AJAX_FLAG_HEADER + "\" content=\"redirect\" />" + "<meta name=\""
- + AjaxContainerRenderer.AJAX_LOCATION_HEADER + "\" content=\"" + redirectLocation
- + "\" />" + "</head></html>");
+ + "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>" + "<meta name=\""
+ + AjaxContainerRenderer.AJAX_FLAG_HEADER + "\" content=\"redirect\" />" + "<meta name=\""
+ + AjaxContainerRenderer.AJAX_LOCATION_HEADER + "\" content=\"" + redirectLocation
+ + "\" />" + "</head></html>");
output.flush();
response.flushBuffer();
} else {
@@ -251,7 +244,7 @@
if (null == parser) {
throw new ServletException(Messages.getMessage(Messages.PARSER_NOT_INSTANTIATED_ERROR,
- contentType));
+ contentType));
}
output = createOutputWriter(response, outputEncoding);
@@ -366,9 +359,9 @@
* @throws UnsupportedEncodingException
*/
private Writer resetResponse(final HttpServletResponse response,
- FilterServletResponseWrapper servletResponseWrapper, String ajaxResponseType)
+ FilterServletResponseWrapper servletResponseWrapper, String ajaxResponseType)
throws IOException, UnsupportedEncodingException {
-
+
response.reset();
// Keep cookies.
@@ -396,6 +389,7 @@
/**
* Check for a {@link ViewExpiredException} in the exception chain.
+ *
* @param e exception from filter chain
* @return true if any exception in the chain instance of the {@link ViewExpiredException}
*/
@@ -443,7 +437,7 @@
*/
private Writer createOutputWriter(final HttpServletResponse response, String characterEncoding)
throws IOException, UnsupportedEncodingException {
-
+
Writer output;
try {
@@ -464,8 +458,7 @@
protected abstract HtmlParser getParser(String mimetype, boolean isAjax, String viewId);
/**
- * @param publicid
- * The publicid to set.
+ * @param publicid The publicid to set.
*/
protected void setPublicid(String publicid) {
this.publicid = publicid;
@@ -479,8 +472,7 @@
}
/**
- * @param systemid
- * The systemid to set.
+ * @param systemid The systemid to set.
*/
protected void setSystemid(String systemid) {
this.systemid = systemid;
@@ -494,8 +486,7 @@
}
/**
- * @param namespace
- * The namespace to set.
+ * @param namespace The namespace to set.
*/
protected void setNamespace(String namespace) {
this.namespace = namespace;
@@ -509,8 +500,7 @@
}
/**
- * @param mimetype
- * The mimetype to set.
+ * @param mimetype The mimetype to set.
*/
protected void setMimetype(String mimetype) {
this.mimetype = mimetype;
@@ -535,8 +525,7 @@
}
/**
- * @param forcexml
- * The forcexml to set.
+ * @param forcexml The forcexml to set.
*/
protected void setForcexml(boolean forcexml) {
this.forcexml = forcexml;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,47 +19,40 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.io.FastBufferOutputStream;
import org.ajax4jsf.io.FastBufferWriter;
-
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-
import org.slf4j.Logger;
+import javax.faces.context.ExternalContext;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.Writer;
-
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
-import javax.faces.context.ExternalContext;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:20 $
- *
*/
public class CacheContent implements Serializable {
private static final long serialVersionUID = 8120940486890871177L;
private static final Logger LOG = RichfacesLogger.WEBAPP.getLogger();
+ boolean filledOutputWriter = false;
+ boolean filledOutputStream = false;
+
// content to send.
private byte[] content = null;
- boolean filledOutputWriter = false;
- boolean filledOutputStream = false;
private String writerContent = null;
private Map<String, Object> headers = new HashMap<String, Object>();
private Integer contentLength;
@@ -131,7 +124,7 @@
realContentLength = contentLength.intValue();
}
- for (Iterator<Entry<String, Object>> iter = headers.entrySet().iterator(); iter.hasNext(); ) {
+ for (Iterator<Entry<String, Object>> iter = headers.entrySet().iterator(); iter.hasNext();) {
Entry<String, Object> element = iter.next();
String header = (String) element.getKey();
Object headerValue = element.getValue();
@@ -160,7 +153,7 @@
// Don't send "chunked" transfer-encoding type with real content-length
if (!((realContentLength > 0) && "Transfer-Encoding".equals(header)
- && "chunked".equals(headerValue))) {
+ && "chunked".equals(headerValue))) {
externalContext.setResponseHeader(header, (String) headerValue);
}
}
@@ -227,16 +220,21 @@
filledOutputStream = true;
content = null;
}
+
@Override
- public void flush() {}
+ public void flush() {
+ }
+
@Override
public void write(byte[] b, int off, int len) throws IOException {
outputStream.write(b, off, len);
}
+
@Override
public void write(byte[] b) throws IOException {
outputStream.write(b);
}
+
@Override
public void write(int b) throws IOException {
outputStream.write(b);
@@ -256,8 +254,11 @@
public void write(char[] cbuf, int off, int len) throws IOException {
stringOutputWriter.write(cbuf, off, len);
}
+
@Override
- public void flush() throws IOException {}
+ public void flush() throws IOException {
+ }
+
@Override
public void close() throws IOException {
filledOutputWriter = true;
@@ -305,6 +306,7 @@
/**
* Flush used output writer/stream, to fix https://jira.jboss.org/jira/browse/RF-4017
+ *
* @param response
* @throws IOException
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -33,8 +33,6 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.Messages;
@@ -42,20 +40,20 @@
import org.ajax4jsf.io.FastBufferOutputStream;
import org.ajax4jsf.io.FastBufferReader;
import org.ajax4jsf.io.FastBufferWriter;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-
import org.xml.sax.InputSource;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -63,22 +61,19 @@
import java.util.Locale;
import java.util.Map;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
/**
* Base wrapper save JSF page response, for parse to XML with different parsers
+ *
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:17 $
- *
*/
public class FilterServletResponseWrapper extends HttpServletResponseWrapper {
public static final String DEFAULT_ENCODING = "UTF-8";
private static final Logger LOG = RichfacesLogger.WEBAPP.getLogger();
- private int bufferSize = 2048;
+
protected FastBufferOutputStream byteStream = null;
+
+ private int bufferSize = 2048;
private String charterEncoding = null;
private String redirectLocation = null;
private boolean useStream = false;
@@ -99,6 +94,7 @@
/**
* Convert saved context to stream for parsing
+ *
* @return stream from saved content
*/
public InputStream getContentAsStream() {
@@ -166,6 +162,7 @@
/**
* Convert saved context to stream for parsing
+ *
* @return stream from saved content
*/
public Reader getContentAsReader() {
@@ -373,6 +370,7 @@
/**
* Send buffered content directly to output stream.
+ *
* @param outputStream
* @throws IOException
*/
@@ -400,6 +398,7 @@
/**
* Send buffered content directly to output stream.
+ *
* @param outputStream
* @throws IOException
*/
@@ -542,6 +541,7 @@
/**
* Parse saved content to output stream ( and store as Dom Document tree )
+ *
* @param out stream to send parsed content, if null - only build dom tree.
* @return parsed document as dom tree.
* @throws IOException
@@ -648,7 +648,6 @@
}
}
-
public static class NullServletOutputStream extends ServletOutputStream {
/*
@@ -675,7 +674,6 @@
}
}
-
public class ServletStringWriter extends Writer {
private boolean opened = true;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.w3c.dom.Node;
@@ -47,6 +45,7 @@
/**
* Setup, must tidy move style etc. elements to head or not.
+ *
* @param move
*/
public abstract void setMoveElements(boolean move);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ParserConfig.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ParserConfig.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ParserConfig.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import java.util.regex.Matcher;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,20 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
+import javax.servlet.ServletContext;
import java.io.Serializable;
-
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import javax.servlet.ServletContext;
-
/**
* @author asmirnov
- *
*/
//TODO: deprecate
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,14 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.event.PushEventListener;
import java.io.Serializable;
-
import java.util.EventObject;
public class PushEventsCounter implements PushEventListener, Serializable {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
+import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
-import javax.servlet.ServletOutputStream;
-
/**
* HACK - for case if servlet response already use Writer, create wrapper to stream -
* since most of serializers use outputStream. In future, must be replaced by Dual serialization
* capabilites.
- * @author shura
*
+ * @author shura
*/
final class ServletStreamWriter extends ServletOutputStream {
private byte[] buff = new byte[1024];
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,25 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.config.WebXMLParser;
-
import org.richfaces.VersionBean;
import org.richfaces.VersionBean.Version;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.Serializable;
-
import javax.faces.context.FacesContext;
-
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
+import java.io.Serializable;
/**
* Parse at startup application web.xml and store servlet and filter mappings.
@@ -45,7 +39,6 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:59 $
- *
*/
public class WebXml extends WebXMLParser implements Serializable {
public static final String CONTEXT_ATTRIBUTE = WebXml.class.getName();
@@ -55,12 +48,13 @@
public static final String RESOURCE_URI_PREFIX_PARAM = "org.ajax4jsf.RESOURCE_URI_PREFIX";
public static final String SESSION_RESOURCE_URI_PREFIX = "a4j/s";
public static final String SESSION_RESOURCE_URI_PREFIX_PARAM = "org.ajax4jsf.SESSION_RESOURCE_URI_PREFIX";
- private static final long serialVersionUID = -9042908418843695017L;
- private static final Logger LOG = RichfacesLogger.WEBAPP.getLogger();
public static final String GLOBAL_RESOURCE_URI_PREFIX_VERSIONED;
public static final String RESOURCE_URI_PREFIX_VERSIONED;
public static final String SESSION_RESOURCE_URI_PREFIX_VERSIONED;
+ private static final long serialVersionUID = -9042908418843695017L;
+ private static final Logger LOG = RichfacesLogger.WEBAPP.getLogger();
+
static {
VersionBean versionBean = new VersionBean();
Version version = versionBean.getVersion();
@@ -164,11 +158,11 @@
String globalResourcePrefix = getGlobalResourcePrefix();
if (!sessionResourcePrefix.equals(globalResourcePrefix)
- && workingResourcePath.startsWith(globalResourcePrefix, facesFilterPrefix.length())) {
+ && workingResourcePath.startsWith(globalResourcePrefix, facesFilterPrefix.length())) {
return workingResourcePath.substring(facesFilterPrefix.length()
- + globalResourcePrefix.length());
+ + globalResourcePrefix.length());
} else if (!globalResourcePrefix.equals(resourcePrefix)
- && workingResourcePath.startsWith(resourcePrefix, facesFilterPrefix.length())) {
+ && workingResourcePath.startsWith(resourcePrefix, facesFilterPrefix.length())) {
return workingResourcePath.substring(facesFilterPrefix.length() + resourcePrefix.length());
}
}
@@ -178,18 +172,18 @@
if (workingResourcePath.startsWith(sessionResourcePrefix)) {
return workingResourcePath.substring(sessionResourcePrefix.length(),
- workingResourcePath.length() - getFacesFilterSuffix().length());
+ workingResourcePath.length() - getFacesFilterSuffix().length());
} else {
String globalResourcePrefix = getGlobalResourcePrefix();
if (!sessionResourcePrefix.equals(globalResourcePrefix)
- && workingResourcePath.startsWith(globalResourcePrefix)) {
+ && workingResourcePath.startsWith(globalResourcePrefix)) {
return workingResourcePath.substring(globalResourcePrefix.length(),
- workingResourcePath.length() - getFacesFilterSuffix().length());
+ workingResourcePath.length() - getFacesFilterSuffix().length());
} else if (!globalResourcePrefix.equals(resourcePrefix)
- && workingResourcePath.startsWith(resourcePrefix)) {
+ && workingResourcePath.startsWith(resourcePrefix)) {
return workingResourcePath.substring(resourcePrefix.length(),
- workingResourcePath.length() - getFacesFilterSuffix().length());
+ workingResourcePath.length() - getFacesFilterSuffix().length());
}
}
}
@@ -200,8 +194,7 @@
/**
* Detect request to resource and extract key from request
*
- * @param request
- * current http request
+ * @param request current http request
* @return resource key, or null for ordinary faces request.
*/
public String getFacesResourceKey(HttpServletRequest request) {
@@ -243,16 +236,16 @@
}
/**
- * @since 3.2.2
* @return
+ * @since 3.2.2
*/
public String getGlobalResourcePrefix() {
return globalResourcePrefix;
}
/**
- * @since 3.2.2
* @return
+ * @since 3.2.2
*/
public String getSessionResourcePrefix() {
return sessionResourcePrefix;
@@ -266,8 +259,7 @@
}
/**
- * @param resourcePrefix
- * The resourcePrefix to set.
+ * @param resourcePrefix The resourcePrefix to set.
*/
@Deprecated
void setResourcePrefix(String resourcePrefix) {
@@ -275,19 +267,16 @@
}
/**
+ * @param resourcePrefix The resourcePrefix to set.
* @since 3.2.2
- * @param resourcePrefix
- * The resourcePrefix to set.
*/
void setGlobalResourcePrefix(String resourcePrefix) {
globalResourcePrefix = resourcePrefix;
}
/**
+ * @param resourcePrefix The resourcePrefix to set.
* @since 3.2.2
- * @param resourcePrefix
- * The resourcePrefix to set.
- *
*/
void setSessionResourcePrefix(String resourcePrefix) {
sessionResourcePrefix = resourcePrefix;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp;
import org.ajax4jsf.Messages;
+import javax.faces.component.UIComponent;
import java.io.IOException;
-import javax.faces.component.UIComponent;
-
/**
* @author shura Class to implement state pattern for
* <code>ResponceWriter</code> Real states must extend this. By
* default, block any events, ignore output.
- *
*/
class XMLResponseWriterState {
@@ -120,7 +116,6 @@
}
/**
- *
* Main hook for realise <code>Writer</code>. In document writed as
* comment, outside of document do nothing ....
*
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Web application-related stuff: filters, parsers, etc.
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import javax.faces.component.ActionSource;
@@ -36,11 +34,10 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:21 $
- *
*/
public class AjaxActionsRule extends MetaRule {
public static final Class<?>[] ACTION_SIG = new Class[0];
- public static final Class<?>[] ACTION_LISTENER_SIG = new Class[] {ActionEvent.class};
+ public static final Class<?>[] ACTION_LISTENER_SIG = new Class[]{ActionEvent.class};
public static final AjaxActionsRule INSTANCE = new AjaxActionsRule();
public AjaxActionsRule() {
@@ -84,7 +81,6 @@
}
}
-
static final class ActionListenerMapper2 extends Metadata {
private final TagAttribute attr;
@@ -99,7 +95,6 @@
}
}
-
public static final class ActionMapper extends Metadata {
private final TagAttribute attr;
@@ -109,11 +104,10 @@
public void applyMetadata(FaceletContext ctx, Object instance) {
((ActionSource2) instance).setActionExpression(this.attr.getMethodExpression(ctx, String.class,
- AjaxActionsRule.ACTION_SIG));
+ AjaxActionsRule.ACTION_SIG));
}
}
-
static final class ActionMapper2 extends Metadata {
private final TagAttribute attr;
@@ -123,7 +117,7 @@
public void applyMetadata(FaceletContext ctx, Object instance) {
((ActionSource2) instance).setActionExpression(this.attr.getMethodExpression(ctx, String.class,
- AjaxActionsRule.ACTION_SIG));
+ AjaxActionsRule.ACTION_SIG));
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxComponentHandler.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.ajax4jsf.component.AjaxContainerBase;
@@ -33,7 +31,6 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:23 $
- *
*/
public class AjaxComponentHandler extends ComponentHandler {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxContainerBaseRule.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.ajax4jsf.component.AjaxContainerBase;
@@ -35,10 +33,9 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:21 $
- *
*/
public class AjaxContainerBaseRule extends MetaRule {
- public static final Class[] AJAX_LISTENER_SIG = new Class[] {AjaxEvent.class};
+ public static final Class[] AJAX_LISTENER_SIG = new Class[]{AjaxEvent.class};
public static final AjaxContainerBaseRule INSTANCE = new AjaxContainerBaseRule();
public AjaxContainerBaseRule() {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxReRendrRule.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxReRendrRule.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxReRendrRule.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,25 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.ajax4jsf.component.AjaxComponent;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import java.util.Set;
-
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.MetaRule;
import javax.faces.view.facelets.Metadata;
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
+import java.util.Set;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
*/
public class AjaxReRendrRule extends MetaRule {
public static final AjaxReRendrRule INSTANCE = new AjaxReRendrRule();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/EmptyHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/EmptyHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/EmptyHandler.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,26 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
-import java.io.IOException;
-
import javax.el.ELException;
-
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.FaceletException;
import javax.faces.view.facelets.TagConfig;
import javax.faces.view.facelets.TagHandler;
+import java.io.IOException;
/**
* This if "empty" facelets tag handler stub. This handler used to ignore tags on a page.
* At most, it used to bypass <jsp:root> and other tags, so we can use same markup for an facelets an jsp pages.
- * @author asmirnov
*
+ * @author asmirnov
*/
public class EmptyHandler extends TagHandler {
public EmptyHandler(TagConfig config) {
@@ -51,7 +47,7 @@
*/
public void apply(FaceletContext ctx, UIComponent parent)
throws IOException, FacesException, FaceletException, ELException {
-
+
this.nextHandler.apply(ctx, parent);
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,21 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import javax.el.ValueExpression;
-
import javax.faces.component.UIComponent;
/**
* Base tag for all components with common Html attributes.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:55 $
- *
*/
public abstract class HtmlComponentTagBase extends UIComponentTagBase {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/MethodExpressionAjaxListener.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,15 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.event.AjaxListener;
import javax.el.MethodExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -59,7 +56,7 @@
public void processAjax(AjaxEvent event) {
FacesContext facesContext = FacesContext.getCurrentInstance();
- expression.invoke(facesContext.getELContext(), new Object[] {event});
+ expression.invoke(facesContext.getELContext(), new Object[]{event});
}
public void restoreState(FacesContext context, Object state) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/RowKeyConverterRule.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.richfaces.component.UIDataAdaptor;
@@ -34,6 +32,7 @@
/**
* Apply rowKeyConverter to component
+ *
* @author Maksim Kaszynski
* @since 3.3.1
*/
@@ -73,11 +72,10 @@
@Override
public void applyMetadata(FaceletContext ctx, Object instance) {
((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
- attribute.getValueExpression(ctx, Converter.class));
+ attribute.getValueExpression(ctx, Converter.class));
}
}
-
static final class StaticConverterMetadata extends Metadata {
private final String converterId;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.webapp.taglib;
import org.richfaces.webapp.taglib.UIComponentELTagBase;
@@ -28,7 +26,6 @@
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIGraphic;
@@ -40,7 +37,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public abstract class UIComponentTagBase extends UIComponentELTagBase {
protected ExpressionFactory getExpressionFactory() {
@@ -116,7 +112,7 @@
protected void setValueProperty(UIComponent component, String value) {
if (value != null) {
ValueExpression expression = getExpressionFactory().createValueExpression(getELContext(), value,
- Object.class);
+ Object.class);
setValueProperty(component, expression);
}
@@ -154,7 +150,7 @@
protected void setActionProperty(UIComponent component, String action) {
if (action != null) {
MethodExpression expression = getExpressionFactory().createMethodExpression(getELContext(), action,
- String.class, new Class[] {});
+ String.class, new Class[]{});
setActionProperty(component, expression);
}
@@ -163,7 +159,7 @@
protected void setActionListenerProperty(UIComponent component, String actionListener) {
if (actionListener != null) {
MethodExpression expression = getExpressionFactory().createMethodExpression(getELContext(), actionListener,
- String.class, new Class[] {ActionEvent.class});
+ String.class, new Class[]{ActionEvent.class});
setActionListenerProperty(component, expression);
}
@@ -172,7 +168,7 @@
protected void setValueChangedListenerProperty(UIComponent component, String valueChangedListener) {
if (valueChangedListener != null) {
MethodExpression expression = getExpressionFactory().createMethodExpression(getELContext(),
- valueChangedListener, String.class, new Class[] {ValueChangeEvent.class});
+ valueChangedListener, String.class, new Class[]{ValueChangeEvent.class});
setValueChangeListenerProperty(component, expression);
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/webapp/taglib/package-info.java 2009-12-04 20:46:42 UTC (rev 16071)
@@ -1,4 +1,3 @@
-
/**
* Basic tag classes
*/
14 years, 5 months
JBoss Rich Faces SVN: r16070 - in root/framework/trunk/impl/src/main/java/org/ajax4jsf: cache and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:41:13 -0500 (Fri, 04 Dec 2009)
New Revision: 16070
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugOutputMaker.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/FacesErrorStateHolder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package.html
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCache.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCache.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCache.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMap.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMapEntry.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheEntry.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheMap.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCache.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxInputComponent.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxLoadBundleComponent.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/InvokerCallbackWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfig.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfigHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterBean.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterMapping.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ParsingException.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletBean.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletMapping.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StateHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StringContentHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebXMLParser.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebappHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ComponentInvoker.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/InvokerCallback.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/CssCompressor.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/package-info.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxValidationActionEvent.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/EventsQueue.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/package-info.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.application;
import org.ajax4jsf.Messages;
@@ -31,15 +29,9 @@
import org.ajax4jsf.resource.InternetResource;
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.FilterServletResponseWrapper;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-
-import java.util.Map;
-
import javax.faces.FacesException;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
@@ -47,11 +39,12 @@
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Map;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.5 $ $Date: 2007/02/08 15:02:04 $
- *
*/
public class AjaxViewHandler extends ViewHandlerWrapper {
public static final String SERIALIZED_STATE_KEY = "org.ajax4jsf.view.serializedstate";
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,12 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.application;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import javax.faces.FacesException;
@@ -38,7 +35,6 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:12 $
- *
*/
public class DebugLifecycle extends Lifecycle implements PhaseListener {
public static final String DEBUG_LYFECYCLE_ID = "DEBUG";
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,23 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.application;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.util.Iterator;
-
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
+import java.util.Iterator;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:12 $
- *
*/
public class DebugLifecycleFactory extends LifecycleFactory {
private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugOutputMaker.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugOutputMaker.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/DebugOutputMaker.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,27 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.application;
-import java.io.IOException;
-import java.io.PrintWriter;
+import org.ajax4jsf.Messages;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.Map.Entry;
-
import javax.el.Expression;
import javax.el.ValueExpression;
-
import javax.faces.FacesException;
import javax.faces.application.Resource;
import javax.faces.component.UIComponent;
@@ -47,12 +32,21 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
-import org.ajax4jsf.Messages;
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:11 $
@@ -137,7 +131,7 @@
// output html prolog
out.println("<html><head><title>" + Messages.getMessage(Messages.ERROR_ON_PAGE, viewId)
- + "</title></head><body>");
+ + "</title></head><body>");
// write script
writeScriptAndStyle(out);
@@ -146,14 +140,14 @@
PhaseId facesPhase = (PhaseId) context.getExternalContext().getRequestMap().get(DebugLifecycle.PHASE_ID_PARAM);
String errorMessage = (facesPhase == null) ? Messages.getMessage(Messages.LIFECYCLE_ERROR, viewId, phase)
: Messages.getMessage(Messages.LIFECYCLE_ERROR_AT_PHASE,
- new Object[] {viewId, phase, facesPhase.toString()});
+ new Object[]{viewId, phase, facesPhase.toString()});
out.println("<h1 >");
out.println(errorMessage);
out.println("</h1>");
response.setHeader("Ajax-Error-Message",
- errorMessage + ",\n caused by " + e.getClass().getName() + ", with message: "
- + e.getMessage());
+ errorMessage + ",\n caused by " + e.getClass().getName() + ", with message: "
+ + e.getMessage());
// Output exceptions
writeExceptionStack(e, out);
@@ -193,7 +187,7 @@
writeToggleMark(out, "exception" + errorId);
out.print(caused + error.getClass().getName() + " : " + error.getMessage() + "</h3>");
out.println("<div id='exception" + errorId
- + "' style='display: none;' class='exception'><p>Exception stack :</p><pre>");
+ + "' style='display: none;' class='exception'><p>Exception stack :</p><pre>");
StackTraceElement[] stackTrace = error.getStackTrace();
@@ -258,7 +252,7 @@
String logResourceRequestPath = logResource.getRequestPath();
out.print("<iframe name='log' class='log' src='" + logResourceRequestPath + "'><a href='src='"
- + logResourceRequestPath + "'>Faces log file </a> </iframe>");
+ + logResourceRequestPath + "'>Faces log file </a> </iframe>");
out.println("</div>");
}
}
@@ -321,7 +315,7 @@
// out bindings
// out attributes map
- for (Iterator<Entry<String, Object>> it = component.getAttributes().entrySet().iterator(); it.hasNext(); ) {
+ for (Iterator<Entry<String, Object>> it = component.getAttributes().entrySet().iterator(); it.hasNext();) {
Entry<String, Object> entry = it.next();
writeAttribute(out, entry.getKey(), entry.getValue());
@@ -345,7 +339,7 @@
}
// childs components
- for (Iterator<UIComponent> childIter = component.getChildren().iterator(); childIter.hasNext(); ) {
+ for (Iterator<UIComponent> childIter = component.getChildren().iterator(); childIter.hasNext();) {
UIComponent child = childIter.next();
writeComponent(context, out, child, null);
@@ -402,7 +396,7 @@
out.print("<table><caption>");
out.print(caption);
out.println("</caption><thead><tr><th style=\"width: 10%; \">Name</th><th style=\"width: 90%; \">"
- + "Value</th></tr></thead><tbody>");
+ + "Value</th></tr></thead><tbody>");
boolean written = false;
@@ -411,7 +405,7 @@
Map.Entry<K, V> entry = null;
String key = null;
- for (Iterator<Entry<K, V>> itr = map.entrySet().iterator(); itr.hasNext(); ) {
+ for (Iterator<Entry<K, V>> itr = map.entrySet().iterator(); itr.hasNext();) {
entry = itr.next();
key = entry.getKey().toString();
@@ -463,14 +457,14 @@
*/
private void writeScript(PrintWriter out) {
out.println("<script type='text/javascript' language='javascript'>\n" + "function toggle(id) {\n"
- + "var style = document.getElementById(id).style;\n" + "if ('block' == style.display) {\n"
- + "style.display = 'none';\n"
- + "document.getElementById(id+'_collapsed').style.display = 'inline';\n"
- + "document.getElementById(id+'_expanded').style.display = 'none';\n" + "} else {\n"
- + "style.display = 'block';\n"
- + "document.getElementById(id+'_collapsed').style.display = 'none';\n"
- + "document.getElementById(id+'_expanded').style.display = 'inline';\n" + "}\n" + "}\n\n"
- + "</script>");
+ + "var style = document.getElementById(id).style;\n" + "if ('block' == style.display) {\n"
+ + "style.display = 'none';\n"
+ + "document.getElementById(id+'_collapsed').style.display = 'inline';\n"
+ + "document.getElementById(id+'_expanded').style.display = 'none';\n" + "} else {\n"
+ + "style.display = 'block';\n"
+ + "document.getElementById(id+'_collapsed').style.display = 'none';\n"
+ + "document.getElementById(id+'_expanded').style.display = 'inline';\n" + "}\n" + "}\n\n"
+ + "</script>");
}
/**
@@ -479,29 +473,29 @@
private void writeStyleSheet(PrintWriter out) {
out.println(
"<style type=\'text/css\' >\n"
- + "div.a4j_debug, .a4j_debug span, .a4j_debug td, .a4j_debug th, .a4j_debug caption { font-family: "
- + "Verdana, Arial, Sans-Serif; }\n" + ".a4j_debug li{\n list-style-position : inside;\n}\n\n"
- + ".a4j_debug li, .a4j_debug pre { padding: 0; margin: 0; font-size : 12px;}\n"
- + ".a4j_debug ul { padding: 0 0 10 0; margin: 0; font-size : 12px;}\n"
- + ".a4j_debug h1 { color: #fff; background-color :#a00; font-size :17px; padding :7px 10px 10px 10px}\n"
- + "h2.a4j_debug , h2.a4j_debug span { color: #a00; font-size : 17px; padding : 0px 0px 0px 10px;}\n"
- + "h2.a4j_debug a { text-decoration: none; color: #a00; }\n"
- + ".exception { color: #000; font-size : 14px; padding : 0px 0px 0px 10px;}\n"
- + ".grayBox { padding: 8px; margin: 10px 0; border: 1px solid #CCC; background-color:#f9f9f9; "
- + "font-size:12px;}\n" + "#error { color: #900; font-weight: bold; font-size: medium; }\n"
- + "#trace, #tree, #vars { display: none; }\n"
- + ".a4j_debug code { font-size: medium; font-size : 14px;}\n" + "#tree dl { color: #666; }\n"
- + "#tree dd { font-size : 12px;}\n"
- + "#tree dt { border: 1px solid #DDD; padding: 2px 4px 4px 4px; border-left: 2px solid #a00; "
- + "font-family: \"Courier New\", Courier, mono; font-size: small; font-size : 12px; margin-top: 2px; "
- + "margin-bottom: 2px;}\n" + ".uicText { color: #999; }\n"
- + ".a4j_debug table { border: 1px solid #CCC; border-collapse: collapse; border-spacing: 0px; width: "
- + "100%; text-align: left; }\n"
- + ".a4j_debug td { border: 1px solid #CCC; font-size : 12px; vertical-align : top}\n"
- + ".a4j_debug thead tr th { padding: 2px; color: #030; background-color: #F9F9F9; font-size : 12px;}\n"
- + ".a4j_debug tbody tr td { padding: 10px 6px; }\n"
- + ".a4j_debug table caption { text-align:left; padding: 20 0 5 0; font-size:12px; font-weight:bold;}\n"
- + ".value {font-size : 12px; font-weight : bold;}\n" + "div.log { width: 100%; height: 400px;}\n"
- + "iframe.log { width: 99%; height: 99%; border: 1px solid #CCC;}\n" + "</style>");
+ + "div.a4j_debug, .a4j_debug span, .a4j_debug td, .a4j_debug th, .a4j_debug caption { font-family: "
+ + "Verdana, Arial, Sans-Serif; }\n" + ".a4j_debug li{\n list-style-position : inside;\n}\n\n"
+ + ".a4j_debug li, .a4j_debug pre { padding: 0; margin: 0; font-size : 12px;}\n"
+ + ".a4j_debug ul { padding: 0 0 10 0; margin: 0; font-size : 12px;}\n"
+ + ".a4j_debug h1 { color: #fff; background-color :#a00; font-size :17px; padding :7px 10px 10px 10px}\n"
+ + "h2.a4j_debug , h2.a4j_debug span { color: #a00; font-size : 17px; padding : 0px 0px 0px 10px;}\n"
+ + "h2.a4j_debug a { text-decoration: none; color: #a00; }\n"
+ + ".exception { color: #000; font-size : 14px; padding : 0px 0px 0px 10px;}\n"
+ + ".grayBox { padding: 8px; margin: 10px 0; border: 1px solid #CCC; background-color:#f9f9f9; "
+ + "font-size:12px;}\n" + "#error { color: #900; font-weight: bold; font-size: medium; }\n"
+ + "#trace, #tree, #vars { display: none; }\n"
+ + ".a4j_debug code { font-size: medium; font-size : 14px;}\n" + "#tree dl { color: #666; }\n"
+ + "#tree dd { font-size : 12px;}\n"
+ + "#tree dt { border: 1px solid #DDD; padding: 2px 4px 4px 4px; border-left: 2px solid #a00; "
+ + "font-family: \"Courier New\", Courier, mono; font-size: small; font-size : 12px; margin-top: 2px; "
+ + "margin-bottom: 2px;}\n" + ".uicText { color: #999; }\n"
+ + ".a4j_debug table { border: 1px solid #CCC; border-collapse: collapse; border-spacing: 0px; width: "
+ + "100%; text-align: left; }\n"
+ + ".a4j_debug td { border: 1px solid #CCC; font-size : 12px; vertical-align : top}\n"
+ + ".a4j_debug thead tr th { padding: 2px; color: #030; background-color: #F9F9F9; font-size : 12px;}\n"
+ + ".a4j_debug tbody tr td { padding: 10px 6px; }\n"
+ + ".a4j_debug table caption { text-align:left; padding: 20 0 5 0; font-size:12px; font-weight:bold;}\n"
+ + ".value {font-size : 12px; font-weight : bold;}\n" + "div.log { width: 100%; height: 400px;}\n"
+ + "iframe.log { width: 99%; height: 99%; border: 1px solid #CCC;}\n" + "</style>");
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/FacesErrorStateHolder.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/FacesErrorStateHolder.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/FacesErrorStateHolder.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,17 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.application;
import javax.faces.component.UIViewRoot;
/**
* Hold detailed faces state for Error output.
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:11 $
- *
*/
public interface FacesErrorStateHolder {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* Classes required to implement and support application-level logic
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package.html
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package.html 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/package.html 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=Cp1251"/>
-<title>Package description for AJAX components</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=Cp1251"/>
+ <title>Package description for AJAX components</title>
</head>
<body>
</body>
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-
-
package org.ajax4jsf.cache;
import org.ajax4jsf.cache.lru.LRUMapCacheFactory;
import org.ajax4jsf.resource.util.URLToStreamHelper;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import java.io.BufferedReader;
@@ -31,7 +27,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -95,7 +90,7 @@
if (configuredFactoryName != null) {
LOG.info("Configured to use [{0}] cache factory", configuredFactoryName);
- factories = new String[] {configuredFactoryName};
+ factories = new String[]{configuredFactoryName};
} else {
factories = DEFAULT_FACTORIES_CHAIN;
}
@@ -195,7 +190,7 @@
private static String searchInJcacheProperties(String factoryId) {
try {
String configFile = System.getProperty("java.home") + File.separator + "lib" + File.separator
- + "jcache.properties";
+ + "jcache.properties";
File file = new File(configFile);
if (file.exists()) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCache.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCache.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
*
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,11 +1,9 @@
-
/**
*
*/
package org.ajax4jsf.cache;
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import java.util.Map;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCache.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCache.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
*
*/
@@ -8,16 +7,15 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author Nick Belaevski
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,11 +1,9 @@
-
/**
*
*/
package org.ajax4jsf.cache;
import org.ajax4jsf.resource.util.URLToStreamHelper;
-
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -14,15 +12,12 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
+import javax.faces.FacesException;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
-
import java.util.Map;
-import javax.faces.FacesException;
-
/**
* @author Nick Belaevski
* @since 4.0
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCache.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCache.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.cache;
import com.opensymphony.oscache.base.EntryRefreshPolicy;
@@ -31,8 +29,7 @@
/**
* @author Nick - mailto:nbelaevski@exadel.com
- * created 01.05.2007
- *
+ * created 01.05.2007
*/
public class OSCacheCache implements Cache {
private com.opensymphony.oscache.base.Cache cache;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,23 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.cache;
import com.opensymphony.oscache.general.GeneralCacheAdministrator;
-
import org.ajax4jsf.resource.util.URLToStreamHelper;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
-
import java.util.Map;
import java.util.Properties;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMap.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMap.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,10 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.cache;
+import javax.servlet.ServletContext;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Enumeration;
@@ -30,8 +29,6 @@
import java.util.Map;
import java.util.Set;
-import javax.servlet.ServletContext;
-
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 02.05.2007
@@ -90,7 +87,6 @@
}
}
-
private class MyIterator implements Iterator<Map.Entry<String, String>> {
@SuppressWarnings("unchecked")
private Enumeration<String> initNames = servletContext.getInitParameterNames();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMapEntry.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMapEntry.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/ServletContextInitMapEntry.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.cache;
import java.util.Map;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheEntry.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheEntry.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheEntry.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -17,10 +17,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ */
-
-
package org.ajax4jsf.cache.lru;
import java.util.Date;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheMap.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/CacheMap.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -17,10 +17,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ */
-
-
package org.ajax4jsf.cache.lru;
import org.ajax4jsf.util.LRUMap;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCache.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCache.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -17,10 +17,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ */
-
-
package org.ajax4jsf.cache.lru;
import org.ajax4jsf.cache.Cache;
@@ -62,7 +60,8 @@
this.map.put(key, cacheEntry);
}
- public void start() {}
+ public void start() {
+ }
public void stop() {
this.map.clear();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,15 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.cache.lru;
import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.cache.CacheFactory;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import java.util.Map;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/cache/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* Cache implementations
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxActionComponent.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.context.AjaxContext;
@@ -40,7 +38,6 @@
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/06 16:23:21 $
- *
*/
public abstract class AjaxActionComponent extends UICommand implements AjaxComponent, AjaxSource {
public static final String FOCUS_DATA_ID = "_A4J.AJAX.focus";
@@ -94,13 +91,13 @@
/**
* Template method with old signature, for backward compability.
*/
- protected void setupReRender() {}
+ protected void setupReRender() {
+ }
/**
* Template methods for fill set of resions to render in subclasses.
*
- * @param facesContext
- * TODO
+ * @param facesContext TODO
*/
protected void setupReRender(FacesContext facesContext) {
AjaxContext.getCurrentInstance(facesContext).addRegionsFromComponent(this);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxInputComponent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxInputComponent.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxInputComponent.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.context.AjaxContext;
@@ -36,9 +34,9 @@
/**
* Base class for all AJAX-enabled Input components
+ *
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/02/06 16:23:21 $
- *
*/
public abstract class AjaxInputComponent extends UIInput implements AjaxComponent, EditableValueHolder {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxLoadBundleComponent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxLoadBundleComponent.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxLoadBundleComponent.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,13 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
/**
* @author mikalaj
- *
- * Marker interface for UILoadBundle component
+ * <p/>
+ * Marker interface for UILoadBundle component
*/
-public interface AjaxLoadBundleComponent {}
+public interface AjaxLoadBundleComponent {
+}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,21 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.Messages;
import org.ajax4jsf.event.AjaxEvent;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
import javax.el.ELContext;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -43,22 +38,21 @@
/**
* @author shura
- *
- * Brige design pattern for any UIComponent append support ajax partial rendering. For AJAX request, apply
- * ActionListeniers, construct list of components for render - by direct setting
- * from Listenier or Components bean methods.
- * For use in concrete component, in constructor must be instantiated to class field as :
- * private AjaxRegionBrige brige;
- * ....
- * Constructor(){
- * brige = new AjaxRegionBrige(this);
- * }.
- * And delegate all brige public methods.
+ * <p/>
+ * Brige design pattern for any UIComponent append support ajax partial rendering. For AJAX request, apply
+ * ActionListeniers, construct list of components for render - by direct setting
+ * from Listenier or Components bean methods.
+ * For use in concrete component, in constructor must be instantiated to class field as :
+ * private AjaxRegionBrige brige;
+ * ....
+ * Constructor(){
+ * brige = new AjaxRegionBrige(this);
+ * }.
+ * And delegate all brige public methods.
* @See <code>AJAXConatiner</code> interface , or from configuration - by
- * <ajax:forupdate>jsp tag's of this or nested components, or from all
- * <code>UIForm</code> components instances with <code>isSubmitted</code>
- * set to <code>true</code>
- *
+ * <ajax:forupdate>jsp tag's of this or nested components, or from all
+ * <code>UIForm</code> components instances with <code>isSubmitted</code>
+ * set to <code>true</code>
*/
public class AjaxRegionBrige implements AjaxContainerBase, StateHolder {
@@ -181,7 +175,7 @@
}
/**
- * @param submitted The submitted to set.
+ * @param submitted The submitted to set.
*/
public void setSubmitted(boolean submitted) {
@@ -201,17 +195,12 @@
* {@link org.ajax4jsf.event.AjaxListener}registered on the {@link javax.faces.application.Application}.
* </p>
*
- * @param event
- * {@link FacesEvent}to be broadcast
- *
- * @exception AbortProcessingException
- * Signal the JavaServer Faces implementation that no further
- * processing on the current event should be performed
- * @exception IllegalArgumentException
- * if the implementation class of this {@link FacesEvent}is
- * not supported by this component
- * @exception NullPointerException
- * if <code>event</code> is <code>null</code>
+ * @param event {@link FacesEvent}to be broadcast
+ * @throws AbortProcessingException Signal the JavaServer Faces implementation that no further
+ * processing on the current event should be performed
+ * @throws IllegalArgumentException if the implementation class of this {@link FacesEvent}is
+ * not supported by this component
+ * @throws NullPointerException if <code>event</code> is <code>null</code>
*/
public void broadcast(FacesEvent event) throws AbortProcessingException {
@@ -229,7 +218,7 @@
FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context.getELContext();
- mb.invoke(elContext, new Object[] {event});
+ mb.invoke(elContext, new Object[]{event});
}
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.Messages;
@@ -30,21 +28,10 @@
import org.ajax4jsf.event.AjaxListener;
import org.ajax4jsf.event.EventsQueue;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
import javax.el.MethodExpression;
-
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.component.ContextCallback;
@@ -60,6 +47,12 @@
import javax.faces.lifecycle.LifecycleFactory;
import javax.faces.render.Renderer;
import javax.faces.webapp.FacesServlet;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Set;
/**
* Custom ViewRoot for support render parts of tree for Ajax requests. Main
@@ -70,7 +63,6 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.4 $ $Date: 2007/02/28 17:01:01 $
- *
*/
public class AjaxViewRoot extends UIViewRoot implements AjaxContainer {
public static final String ROOT_ID = "_viewRoot";
@@ -86,18 +78,23 @@
public void invokeContextCallback(FacesContext context, UIComponent component) {
component.processValidators(context);
}
- public void invokeRoot(FacesContext context) {}
+
+ public void invokeRoot(FacesContext context) {
+ }
};
private InvokerCallback updatesInvoker = new InvokerCallback() {
public void invokeContextCallback(FacesContext context, UIComponent component) {
component.processUpdates(context);
}
- public void invokeRoot(FacesContext context) {}
+
+ public void invokeRoot(FacesContext context) {
+ }
};
private InvokerCallback decodeInvoker = new InvokerCallback() {
public void invokeContextCallback(FacesContext context, UIComponent component) {
component.processDecodes(context);
}
+
public void invokeRoot(FacesContext context) {
decode(context);
}
@@ -156,6 +153,7 @@
// public String getId() {
// return ROOT_ID;
// }
+
public String getRendererType() {
return COMPONENT_FAMILY;
}
@@ -227,7 +225,7 @@
if (null != listenerExpression) {
event = createPhaseEvent(context, phase);
- listenerExpression.invoke(context.getELContext(), new Object[] {event});
+ listenerExpression.invoke(context.getELContext(), new Object[]{event});
}
if (null != this.phaseListeners) {
@@ -277,8 +275,8 @@
String submittedRegionClientId = ajaxContext.getSubmittedRegionClientId();
if (ajaxContext.isAjaxRequest() && (submittedRegionClientId != null)
- && !submittedRegionClientId.equals(ROOT_ID)
- && !submittedRegionClientId.equals(getClientId(context))) {
+ && !submittedRegionClientId.equals(ROOT_ID)
+ && !submittedRegionClientId.equals(getClientId(context))) {
invokeOnComponent(context, submittedRegionClientId, new InvokerCallbackWrapper(callback));
} else {
@@ -295,7 +293,7 @@
String ajaxSingleClientId = ajaxContext.getAjaxSingleClientId();
if (null == ajaxSingleClientId) {
- for (Iterator<UIComponent> iter = getFacetsAndChildren(); iter.hasNext(); ) {
+ for (Iterator<UIComponent> iter = getFacetsAndChildren(); iter.hasNext();) {
callback.invokeContextCallback(context, iter.next());
}
} else {
@@ -346,7 +344,7 @@
*
* @param context
* @param phaseId -
- * phase, for which events must be processed.
+ * phase, for which events must be processed.
*/
public void broadcastEvents(FacesContext context, PhaseId phaseId) {
EventsQueue[] eWebXmlvents = getEvents();
@@ -378,8 +376,7 @@
}
/**
- * @param context
- * TODO
+ * @param context TODO
* @param phaseEventsQueue
* @param havePhaseEvents
*/
@@ -420,7 +417,6 @@
* tree ( since RI hold component tree in session ).
*
* @param phase
- *
* @return
*/
protected EventsQueue getEventsQueue(PhaseId phase) {
@@ -563,7 +559,7 @@
boolean invoked = false;
if ((submittedRegionClientId != null) && !submittedRegionClientId.equals(ROOT_ID)
- && !submittedRegionClientId.equals(getClientId(context))) {
+ && !submittedRegionClientId.equals(getClientId(context))) {
invoked = invokeOnComponent(context, submittedRegionClientId, ajaxInvoker);
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import javax.faces.component.ContextCallback;
@@ -29,7 +27,6 @@
/**
* @author Anton Belevich
- *
*/
public class ContextCallbackWrapper implements ContextCallback {
ContextCallback callback;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueBinding.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.Messages;
@@ -45,20 +43,21 @@
private static final long serialVersionUID = -6583167387542332290L;
/**
- * current update component. transient since saved state as component.
+ * current update component. transient since saved state as component.
*/
private transient AjaxSupport component = null;
private String componentId;
/**
- * Default constructor for restoreState.
+ * Default constructor for restoreState.
*/
- public EventValueBinding() {}
+ public EventValueBinding() {
+ }
/**
- * Constructor for build from AjaxComponent.
+ * Constructor for build from AjaxComponent.
*
- * @param update
+ * @param update
*/
public EventValueBinding(AjaxSupport update) {
component = update;
@@ -105,8 +104,7 @@
}
/**
- * @param component
- * the component to set
+ * @param component the component to set
*/
public void setComponent(AjaxSupport component) {
this.component = component;
@@ -133,7 +131,7 @@
@Override
public void setValue(FacesContext facesContext, Object value)
throws EvaluationException, PropertyNotFoundException {
-
+
throw new EvaluationException(Messages.getMessage(Messages.EVENT_IS_READ_ONLY));
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/EventValueExpression.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.Messages;
@@ -29,14 +27,12 @@
import javax.el.ELContext;
import javax.el.ELException;
import javax.el.ValueExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
/**
* @author Maksim Kaszynski
- *
*/
public class EventValueExpression extends ValueExpression implements StateHolder {
private static final long serialVersionUID = -6583167387542332290L;
@@ -189,14 +185,14 @@
}
/**
- * @param component
- * the component to set
+ * @param component the component to set
*/
public void setComponent(AjaxSupport component) {
this.component = component;
}
- public void setTransient(boolean newTransientValue) {}
+ public void setTransient(boolean newTransientValue) {
+ }
/*
* (non-Javadoc)
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/InvokerCallbackWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/InvokerCallbackWrapper.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/InvokerCallbackWrapper.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
import org.ajax4jsf.context.InvokerCallback;
@@ -29,7 +27,6 @@
/**
* @author Anton Belevich
- *
*/
public class InvokerCallbackWrapper extends ContextCallbackWrapper implements InvokerCallback {
public InvokerCallbackWrapper(InvokerCallback invokerCallback) {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,16 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.component;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
import java.util.LinkedHashMap;
import java.util.Map;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
* @since 3.3.0
@@ -38,7 +35,8 @@
private boolean shouldCreateDefaultGlobalQueue = false;
private Map<String, Object> queuesData = new LinkedHashMap<String, Object>();
- private QueueRegistry() {}
+ private QueueRegistry() {
+ }
public static QueueRegistry getInstance(FacesContext context) {
ExternalContext externalContext = context.getExternalContext();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/component/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* Base APIs and support classes of AJAX-enabled components
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfig.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfig.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfig.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,38 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
+import javax.faces.FacesException;
+import javax.faces.webapp.FacesServlet;
+import javax.servlet.ServletContext;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
import java.net.URLConnection;
-
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.faces.FacesException;
-import javax.faces.webapp.FacesServlet;
-
-import javax.servlet.ServletContext;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
/**
* @author asmirnov
- *
*/
public class FacesConfig {
private static final String FACES_CONFIG_CLASS_PATH = "META-INF/faces-config.xml";
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfigHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfigHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FacesConfigHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.Attributes;
@@ -31,12 +29,10 @@
import org.xml.sax.helpers.DefaultHandler;
import java.io.StringReader;
-
import java.util.List;
/**
* @author asmirnov
- *
*/
public class FacesConfigHandler extends DefaultHandler {
private static final String APPLICATION_ELEMENT = "application";
@@ -69,7 +65,6 @@
/**
* @author asmirnov
- *
*/
private class ApplicationExtensionHandler extends FacesConfigElementHandler {
public ApplicationExtensionHandler(ContentHandler parent) {
@@ -86,10 +81,8 @@
}
}
-
/**
* @author asmirnov
- *
*/
private class ApplicationHandler extends FacesConfigElementHandler {
public ApplicationHandler() {
@@ -106,10 +99,8 @@
}
}
-
/**
* @author asmirnov
- *
*/
private class ExcludedAttributeHandler extends StringContentHandler {
public ExcludedAttributeHandler(ContentHandler parent) {
@@ -122,10 +113,8 @@
}
}
-
/**
* @author asmirnov
- *
*/
private class ExcludedAttributesHandler extends FacesConfigElementHandler {
public ExcludedAttributesHandler(ContentHandler parent) {
@@ -142,7 +131,6 @@
}
}
-
private abstract class FacesConfigElementHandler extends StateHandler {
public FacesConfigElementHandler(ContentHandler parentHandler) {
super(parentHandler);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterBean.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterBean.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
class FilterBean {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterMapping.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterMapping.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FilterMapping.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
/**
* @author asmirnov
- *
*/
class FilterMapping {
private final String filterName;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,25 +1,21 @@
package org.ajax4jsf.config;
import org.ajax4jsf.util.ELUtils;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.util.EnumMap;
-import java.util.Map;
-import java.util.regex.Pattern;
-
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
-
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import java.util.EnumMap;
+import java.util.Map;
+import java.util.regex.Pattern;
/**
* @author Anton Belevich
* @since 4.0
- * framework configuration class
+ * framework configuration class
*/
public final class FrameworkConfiguration {
private static final Logger LOGGER = RichfacesLogger.CONFIG.getLogger();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ParsingException.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ParsingException.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ParsingException.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
/**
* @author asmirnov
- *
*/
public class ParsingException extends Exception {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletBean.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletBean.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
class ServletBean {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletMapping.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletMapping.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/ServletMapping.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
class ServletMapping {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StateHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StateHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StateHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.Attributes;
@@ -34,7 +32,6 @@
/**
* @author asmirnov
- *
*/
public abstract class StateHandler extends DefaultHandler {
private int depth = 0;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StringContentHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StringContentHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/StringContentHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.ContentHandler;
@@ -29,7 +27,6 @@
/**
* @author asmirnov
- *
*/
class StringContentHandler extends StateHandler {
private final XMLReader reader;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebXMLParser.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebXMLParser.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebXMLParser.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,35 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.util.ArrayList;
-import java.util.List;
-
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author asmirnov
- *
*/
@Deprecated
public class WebXMLParser {
- static final String FACES_SERVLET_CLASS = "javax.faces.webapp.FacesServlet";
public static final String WEB_XML = "/WEB-INF/web.xml";
+ static final String FACES_SERVLET_CLASS = "javax.faces.webapp.FacesServlet";
+
private String facesFilterPrefix = null;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebappHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebappHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/WebappHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.config;
import org.xml.sax.Attributes;
@@ -31,13 +29,11 @@
import org.xml.sax.helpers.DefaultHandler;
import java.io.StringReader;
-
import java.util.ArrayList;
import java.util.List;
/**
* @author asmirnov
- *
*/
public class WebappHandler extends DefaultHandler {
static final String FILTER_CLASS_ELEMENT = "filter-class";
@@ -98,7 +94,6 @@
/**
* @author asmirnov
- *
*/
public class FilterHandler extends WebappElementHandler {
private StringBuilder filterName = new StringBuilder();
@@ -129,10 +124,8 @@
}
}
-
/**
* @author asmirnov
- *
*/
public class FilterMappingHandler extends WebappElementHandler {
private StringBuilder servletName = new StringBuilder();
@@ -161,11 +154,10 @@
@Override
protected void endLastElement() {
filterMappings.add(new FilterMapping(filterName.toString().trim(), servletName.toString().trim(),
- urlPattern.toString().trim()));
+ urlPattern.toString().trim()));
}
}
-
final class ServletHandler extends WebappElementHandler {
private StringBuilder servletName = new StringBuilder();
private StringBuilder servletClass = new StringBuilder();
@@ -193,7 +185,6 @@
}
}
-
final class ServletMappingHandler extends WebappElementHandler {
private StringBuilder servletName = new StringBuilder();
private StringBuilder urlPattern = new StringBuilder();
@@ -221,7 +212,6 @@
}
}
-
private abstract class WebappElementHandler extends StateHandler {
public WebappElementHandler(ContentHandler parentHandler) {
super(parentHandler);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,21 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.application.AjaxViewHandler;
+import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -49,22 +44,23 @@
import javax.faces.render.RenderKitFactory;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.application.AjaxViewHandler;
-import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.renderkit.RendererUtils;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* This class incapsulated
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.7 $ $Date: 2007/02/08 19:07:16 $
- *
*/
public class AjaxContextImpl extends AjaxContext {
public static final String SERVLET_ERROR_EXCEPTION_ATTRIBUTE = "javax.servlet.error.exception";
@@ -123,6 +119,7 @@
/**
* @param context
* @throws javax.faces.event.AbortProcessingException
+ *
*/
public void renderAjax(FacesContext context) throws FacesException {
if (LOG.isDebugEnabled()) {
@@ -182,7 +179,7 @@
// Save tree state.
} catch (IOException e) {
throw new FacesException(Messages.getMessage(Messages.RENDERING_AJAX_REGION_ERROR,
- getSubmittedRegionClientId()), e);
+ getSubmittedRegionClientId()), e);
} finally {
context.responseComplete();
@@ -244,7 +241,7 @@
if (bufWriter.getBuffer().length() > 0) {
context.getExternalContext().getRequestMap().put(AjaxViewHandler.SERIALIZED_STATE_KEY,
- bufWriter.toString());
+ bufWriter.toString());
}
context.setResponseWriter(writer);
@@ -272,8 +269,7 @@
}
/**
- * @param ajaxRequest
- * The ajaxRequest to set.
+ * @param ajaxRequest The ajaxRequest to set.
*/
public void setAjaxRequest(boolean ajaxRequest) {
this.ajaxRequest = ajaxRequest;
@@ -321,7 +317,7 @@
}
if (ajaxRegions != null) {
- for (Iterator<String> iter = ajaxRegions.iterator(); iter.hasNext(); ) {
+ for (Iterator<String> iter = ajaxRegions.iterator(); iter.hasNext();) {
String id = iter.next().toString();
ajaxAreasToRender.add(convertId(component, id));
@@ -425,8 +421,7 @@
}
/**
- * @param submittedClientId
- * The submittedClientId to set.
+ * @param submittedClientId The submittedClientId to set.
*/
@Override
public void setSubmittedRegionClientId(String submittedClientId) {
@@ -457,8 +452,7 @@
}
/**
- * @param selfRender
- * The selfRender to set.
+ * @param selfRender The selfRender to set.
*/
public void setSelfRender(boolean selfRender) {
this.selfRender = selfRender;
@@ -472,8 +466,7 @@
}
/**
- * @param viewIdHolder
- * the vievIdHolder to set
+ * @param viewIdHolder the vievIdHolder to set
*/
public void setViewIdHolder(ViewIdHolder viewIdHolder) {
this.viewIdHolder = viewIdHolder;
@@ -487,8 +480,7 @@
}
/**
- * @param responseData
- * the responseData to set
+ * @param responseData the responseData to set
*/
public void setResponseData(Object responseData) {
this.responseDataMap.put(RESPONSE_DATA_KEY, responseData);
@@ -504,11 +496,9 @@
/**
* Gives back the writer of a Response object.
*
- * @param extContext
- * The external context.
+ * @param extContext The external context.
* @return The writer of the response.
- * @throws FacesException
- * If the response object has no getWriter() method.
+ * @throws FacesException If the response object has no getWriter() method.
*/
protected PrintWriter getWriter(ExternalContext extContext) throws FacesException {
PrintWriter writer = null;
@@ -554,11 +544,11 @@
// HACK - check for a Jboss PortletBridge implementation. If present, append DirectLink attribute to url.
// TODO - how to detect portlet application ?
if (null != context.getExternalContext().getApplicationMap().get(
- "org.jboss.portletbridge.application.PortletStateHolder")) {
+ "org.jboss.portletbridge.application.PortletStateHolder")) {
// Mark Ajax action url as transparent with jsf-portlet bridge.
actionURL = actionURL + ((actionURL.lastIndexOf('?') > 0) ? "&" : "?")
- + "javax.portlet.faces.DirectLink=true";
+ + "javax.portlet.faces.DirectLink=true";
}
return context.getExternalContext().encodeActionURL(actionURL);
@@ -579,26 +569,25 @@
}
/**
- * @param oncomplete
- * the oncomplete to set
+ * @param oncomplete the oncomplete to set
*/
public void setOncomplete(Object oncomplete) {
this.oncomplete = oncomplete;
}
-
+
/* (non-Javadoc)
- * @see org.ajax4jsf.context.AjaxContext#getOnbeforedomupdate()
- */
+ * @see org.ajax4jsf.context.AjaxContext#getOnbeforedomupdate()
+ */
@Override
public Object getOnbeforedomupdate() {
- return onbeforedomupdate;
+ return onbeforedomupdate;
}
-
+
/* (non-Javadoc)
- * @see org.ajax4jsf.context.AjaxContext#setOnbeforedomupdate(java.lang.Object)
- */
+ * @see org.ajax4jsf.context.AjaxContext#setOnbeforedomupdate(java.lang.Object)
+ */
@Override
public void setOnbeforedomupdate(Object onbeforedomupdateFunction) {
- this.onbeforedomupdate = onbeforedomupdateFunction;
+ this.onbeforedomupdate = onbeforedomupdateFunction;
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ComponentInvoker.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ComponentInvoker.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ComponentInvoker.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
import org.ajax4jsf.component.AjaxViewRoot;
@@ -32,13 +30,14 @@
* Interface for call lifecycle methods on component with known clientId
* For JSF 1.2 implementation must use invokeOnComponent method, for JSF 1.1 use
* simple recursion on view tree ( not compatible with UIData components )
+ *
* @author shura
- *
*/
public interface ComponentInvoker {
/**
* Invoke method on active AjaxContainer component, or on viewRoot, if none.
+ *
* @param viewRoot
* @param context
* @param callback
@@ -47,11 +46,12 @@
/**
* Recursive call for all children for search component with same clientId as target region
+ *
* @param viewRoot
* @param context
* @param callback
* @param regionId
*/
public abstract boolean invokeOnComponent(UIComponent root, FacesContext context, InvokerCallback callback,
- String regionId);
+ String regionId);
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
import javax.faces.FacesException;
@@ -32,7 +30,6 @@
* single access point to all parameters - simplest for a documentation.
*
* @author asmirnov
- *
*/
public final class ContextInitParameters {
public static final String[] DATATABLE_USES_VIEW_LOCALE = {"org.richfaces.datatableUsesViewLocale"};
@@ -98,7 +95,7 @@
return false;
} else {
throw new FacesException("Illegal value [" + initParameter + "] for a init parameter +" + paramNames
- + ", only logical values 'true' or 'false' is allowed");
+ + ", only logical values 'true' or 'false' is allowed");
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/InvokerCallback.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/InvokerCallback.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/InvokerCallback.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
import javax.faces.component.ContextCallback;
@@ -30,13 +28,14 @@
/**
* Callback Interface
* for invoke lifecycle methods ( processDecodes, processValidators ... encodeEnd ).
+ *
* @author shura
- *
*/
public interface InvokerCallback extends ContextCallback {
/**
* Process method on given component.
+ *
* @param context
* @param component
*/
@@ -44,6 +43,7 @@
/**
* Default processing on UIVewRoot
+ *
* @param context
*/
public void invokeRoot(FacesContext context);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,24 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import javax.faces.FacesException;
-
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -63,7 +58,8 @@
node.appendChild(node.getOwnerDocument().createTextNode(new String(ch, start, length)));
}
- public void endDocument() throws SAXException {}
+ public void endDocument() throws SAXException {
+ }
public void endElement(String uri, String localName, String name) throws SAXException {
node = node.getParentNode();
@@ -73,7 +69,8 @@
throw new UnsupportedOperationException();
}
- public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
+ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+ }
public void processingInstruction(String target, String data) throws SAXException {
throw new UnsupportedOperationException();
@@ -87,7 +84,8 @@
throw new UnsupportedOperationException();
}
- public void startDocument() throws SAXException {}
+ public void startDocument() throws SAXException {
+ }
public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
Document document = node.getOwnerDocument();
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ViewResources.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ViewResources.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.context;
/**
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* Classes and interfaces that defines contextual request information
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/CssCompressor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/CssCompressor.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/CssCompressor.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -8,13 +8,10 @@
* This code is a port of Isaac Schlueter's cssmin utility.
*/
-
-
package org.ajax4jsf.css;
import java.io.IOException;
import java.io.Writer;
-
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -159,7 +156,7 @@
// Test for AABBCC pattern
if (m.group(3).equalsIgnoreCase(m.group(4)) && m.group(5).equalsIgnoreCase(m.group(6))
- && m.group(7).equalsIgnoreCase(m.group(8))) {
+ && m.group(7).equalsIgnoreCase(m.group(8))) {
m.appendReplacement(sb, m.group(1) + m.group(2) + "#" + m.group(3) + m.group(5) + m.group(7));
} else {
m.appendReplacement(sb, m.group());
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/css/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* CSS-processing classes
*/
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,20 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.el;
-import java.util.Locale;
-
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
import javax.el.VariableMapper;
+import java.util.Locale;
/**
* @author asmirnov
- *
*/
public class ELContextWrapper extends ELContext {
private final ELContext parent;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,17 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.el;
+import javax.el.ELContext;
+import javax.el.ELResolver;
import java.beans.FeatureDescriptor;
-
import java.util.Iterator;
-import javax.el.ELContext;
-import javax.el.ELResolver;
-
/**
* @author Nick Belaevski
* @since 3.3.0
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxListenerHelper.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,22 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.event;
-import java.io.Serializable;
-
import javax.el.ValueExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
+import java.io.Serializable;
/**
* Helper class to keep reference to listener binded as EL-expression.
- * @author shura
*
+ * @author shura
*/
public class AjaxListenerHelper implements AjaxListener, StateHolder {
private boolean isTransient = false;
@@ -111,12 +107,13 @@
/**
* @author shura
- * TODO Refactoring
+ * TODO Refactoring
*/
private static final class State implements Serializable {
private static final long serialVersionUID = 1978277414406556172L;
private Object binding;
- private State() {}
+ private State() {
+ }
}
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,32 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.event;
import org.ajax4jsf.Messages;
import org.ajax4jsf.context.AjaxContext;
-
import org.richfaces.log.RichfacesLogger;
import org.richfaces.skin.SkinFactory;
-
import org.slf4j.Logger;
-import java.util.Map;
-
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import java.util.Map;
/**
* Listener for act before Render phase to set RenderKit Id for current skin.
*
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/06 16:23:19 $
- *
*/
public class AjaxPhaseListener implements PhaseListener {
public static final String AJAX_BEAN_PREFIX = "org.ajax4jsf.ajaxviewbean:";
@@ -110,7 +104,7 @@
if (null != root) {
LOG.debug(Messages.getMessage(Messages.ENTER_BEFORE_RENDER_VIEW_PHASE, root.getViewId(),
- root.getRenderKitId()));
+ root.getRenderKitId()));
// TODO - create special skin-config.xml configuration.
String renderKitId = null;
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxValidationActionEvent.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxValidationActionEvent.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/AjaxValidationActionEvent.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.event;
import javax.faces.component.UIComponent;
@@ -30,9 +28,9 @@
/**
* Action event - always assigned to {@link javax.faces.event.PhaseId#PROCESS_VALIDATIONS} phase
* for bypass change phase in components , setPhaseId method do nothing.
+ *
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:37 $
- *
*/
public class AjaxValidationActionEvent extends ActionEvent {
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/EventsQueue.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/EventsQueue.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/EventsQueue.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,20 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.event;
+import javax.faces.event.FacesEvent;
import java.util.AbstractQueue;
import java.util.Iterator;
import java.util.NoSuchElementException;
-import javax.faces.event.FacesEvent;
-
/**
* Very simple implementation of FIFO buffer, to organize JSF events queue.
+ *
* @author asmirnov
- *
*/
public class EventsQueue extends AbstractQueue<FacesEvent> {
private int size = 0;
@@ -41,6 +38,7 @@
/**
* Remove and return first queued event.
+ *
* @return faces event form top of queue
* @throws NoSuchElementException , if queue is empty.
*/
@@ -74,6 +72,7 @@
/**
* Add event to queue.
+ *
* @param element
* @return TODO
*/
@@ -114,9 +113,11 @@
public Iterator<FacesEvent> iterator() {
return new Iterator<FacesEvent>() {
private QueueElement current = first;
+
public boolean hasNext() {
return null != current;
}
+
public FacesEvent next() {
if (null == current) {
throw new NoSuchElementException();
@@ -128,6 +129,7 @@
return event;
}
+
public void remove() {
throw new UnsupportedOperationException();
}
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -19,18 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf.event;
import org.ajax4jsf.application.AjaxViewHandler;
-
import org.richfaces.log.RichfacesLogger;
-
import org.slf4j.Logger;
-import java.util.Iterator;
-
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.application.ViewHandler;
@@ -40,11 +34,12 @@
import javax.faces.event.PhaseListener;
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
+import java.util.Iterator;
/**
* One time called listener, for initialize framework at first request.
- * @author shura
*
+ * @author shura
*/
public class InitPhaseListener implements PhaseListener {
private static final long serialVersionUID = 8389169240912928686L;
@@ -64,7 +59,7 @@
LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
- for (Iterator<String> iter = factory.getLifecycleIds(); iter.hasNext(); ) {
+ for (Iterator<String> iter = factory.getLifecycleIds(); iter.hasNext();) {
Lifecycle lifecycle = factory.getLifecycle(iter.next());
lifecycle.removePhaseListener(this);
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/package-info.java 2009-12-04 20:30:42 UTC (rev 16069)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/package-info.java 2009-12-04 20:41:13 UTC (rev 16070)
@@ -1,4 +1,3 @@
-
/**
* Classes implementing event-handling logic of JSF framework
*/
14 years, 5 months
JBoss Rich Faces SVN: r16069 - root/framework/trunk/test-base/src/main/java/org/richfaces/test/staging.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:30:42 -0500 (Fri, 04 Dec 2009)
New Revision: 16069
Modified:
root/framework/trunk/test-base/src/main/java/org/richfaces/test/staging/StagingServer.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/test-base/src/main/java/org/richfaces/test/staging/StagingServer.java
===================================================================
--- root/framework/trunk/test-base/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-12-04 20:28:48 UTC (rev 16068)
+++ root/framework/trunk/test-base/src/main/java/org/richfaces/test/staging/StagingServer.java 2009-12-04 20:30:42 UTC (rev 16069)
@@ -617,7 +617,7 @@
// Destroy session
// TODO - destroy all threads.
- for (Iterator<ServerHttpSession> sessionIterator = sessionInstances.iterator(); sessionIterator.hasNext(); ) {
+ for (Iterator<ServerHttpSession> sessionIterator = sessionInstances.iterator(); sessionIterator.hasNext();) {
ServerHttpSession session = sessionIterator.next();
// inform session listeners.
14 years, 5 months
JBoss Rich Faces SVN: r16068 - in root/framework/trunk/api/src/main/java/org: ajax4jsf/context and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:28:48 -0500 (Fri, 04 Dec 2009)
New Revision: 16068
Modified:
root/framework/trunk/api/src/main/java/org/ajax4jsf/Messages.java
root/framework/trunk/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java
root/framework/trunk/api/src/main/java/org/richfaces/skin/SkinFactory.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/framework/trunk/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/Messages.java 2009-12-04 20:11:46 UTC (rev 16067)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/Messages.java 2009-12-04 20:28:48 UTC (rev 16068)
@@ -19,12 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.ajax4jsf;
import java.text.MessageFormat;
-
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@@ -58,7 +55,6 @@
public static final String BUILD_RESOURCE_URI_INFO = "BUILD_RESOURCE_URI_INFO";
public static final String BUNDLE_MAP_NO_PUT_VALUE = "BUNDLE_MAP_NO_PUT_VALUE";
public static final String BUNDLE_MAP_NO_REMOVE_VALUE = "BUNDLE_MAP_NO_REMOVE_VALUE";
- private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
public static final String CALCULATE_COMPONENT_ID_INFO = "CALCULATE_COMPONENT_ID_INFO";
public static final String CALLED_SET_PARENT = "CALLED_SET_PARENT";
public static final String CANNOT_WRITE_RASTERS = "CANNOT_WRITE_RASTERS";
@@ -299,9 +295,12 @@
public static final String VAR_MUST_BE_LITERAL = "VAR_MUST_BE_LITERAL";
public static final String VIEW_HANDLER_INSTANTIATION_ERROR = "VIEW_HANDLER_INSTANTIATION_ERROR";
public static final String WRAPPED_RULES_NULL_ERROR = "WRAPPED_RULES_NULL_ERROR";
+
+ private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
private static Map<ClassLoader, ResourceBundle> bundles = new HashMap<ClassLoader, ResourceBundle>();
- private Messages() {}
+ private Messages() {
+ }
private static synchronized ResourceBundle getBundle() {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
@@ -313,7 +312,7 @@
} catch (MissingResourceException e) {
try {
bundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault(),
- Messages.class.getClassLoader());
+ Messages.class.getClassLoader());
} catch (MissingResourceException e2) {
bundle = new EmptyResourceBundle();
}
@@ -338,7 +337,7 @@
return "%" + name + "%";
}
- return MessageFormat.format(pattern, new Object[] {param});
+ return MessageFormat.format(pattern, new Object[]{param});
}
public static String getMessage(String name, Object param1, Object param2) {
@@ -348,7 +347,7 @@
return "%" + name + "%";
}
- return MessageFormat.format(pattern, new Object[] {param1, param2});
+ return MessageFormat.format(pattern, new Object[]{param1, param2});
}
public static String getMessage(String name, Object[] params) {
@@ -363,7 +362,6 @@
/**
* @author asmirnov
- *
*/
public static final class EmptyResourceBundle extends ResourceBundle {
Modified: root/framework/trunk/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2009-12-04 20:11:46 UTC (rev 16067)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2009-12-04 20:28:48 UTC (rev 16068)
@@ -44,14 +44,14 @@
* Key for keep request state information in request-scope attributes.
*/
public static final String AJAX_CONTEXT_KEY = "ajaxContext";
- private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
public static final String RESPONSE_DATA_KEY = "_ajax:data";
static final String SERVICE_RESOURCE = "META-INF/services/" + AjaxContext.class.getName();
+ private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
private static Map<ClassLoader, Class<? extends AjaxContext>> ajaxContextClasses =
new HashMap<ClassLoader, Class<? extends AjaxContext>>();
private boolean limitToList;
- protected AjaxContext() {}
+ protected AjaxContext() { }
public abstract Map<String, Object> getCommonAjaxParameters();
Modified: root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java 2009-12-04 20:11:46 UTC (rev 16067)
+++ root/framework/trunk/api/src/main/java/org/richfaces/application/ServiceTracker.java 2009-12-04 20:28:48 UTC (rev 16068)
@@ -21,101 +21,98 @@
*/
package org.richfaces.application;
+import javax.faces.context.FacesContext;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.skin.SkinFactory;
-
/**
* <p>Tracker class to provide access to various framework implementation services.
- * Examples of such services are: {@link SkinFactory}, TBD</p>
- *
- * <p><b>Note:</b> this class is not synchronized and presumes that all modification operations
+ * Examples of such services are: {@link org.richfaces.skin.SkinFactory}, TBD</p>
+ * <p/>
+ * <p><b>Note:</b> this class is not synchronized and presumes that all modification operations
* should be done in a single-thread (e.g. in initialization listener)</p>
- *
+ *
* @author Nick Belaevski
* @since 4.0
*/
public final class ServiceTracker {
- private static final String SERVICES_MAP_ATTRIBUTE = ServiceTracker.class.getName();
-
- private ServiceTracker() {
- //utility class private constructor
- }
-
- public static Collection<Class<?>> getRegisteredServiceClasses(FacesContext context) {
- Map<Class<?>, Object> servicesMap = getServicesMap(context, false);
- if (servicesMap != null) {
- return Collections.unmodifiableCollection(servicesMap.keySet());
- } else {
- return Collections.emptySet();
- }
- }
-
- @SuppressWarnings("unchecked")
- public static <T> T getService(FacesContext context, Class<T> serviceInterfaceClass) {
- if (context == null) {
- throw new NullPointerException("context");
- }
-
- if (serviceInterfaceClass == null) {
- throw new NullPointerException("serviceInterfaceClass");
- }
+ private static final String SERVICES_MAP_ATTRIBUTE = ServiceTracker.class.getName();
- T serviceImplementation = null;
-
- Map<Class<?>, Object> servicesMap = getServicesMap(context, false);
- if (servicesMap != null) {
- serviceImplementation = (T) servicesMap.get(serviceInterfaceClass);
- }
-
- //TODO - null?
- return serviceImplementation;
- }
+ private ServiceTracker() {
+ //utility class private constructor
+ }
- public static <T> void setService(FacesContext context,
- Class<T> serviceInterfaceClass,
- T serviceImplementation) {
-
- if (context == null) {
- throw new NullPointerException("context");
- }
-
- if (serviceInterfaceClass == null) {
- throw new NullPointerException("serviceInterfaceClass");
- }
-
- if (serviceImplementation == null) {
- throw new NullPointerException("serviceImplementation");
- }
-
- Map<Class<?>, Object> servicesMap = getServicesMap(context, true);
- servicesMap.put(serviceInterfaceClass, serviceImplementation);
- }
-
- public static void release(FacesContext context) {
- clearServicesMap(context);
- }
-
- private static Map<Class<?>, Object> getServicesMap(FacesContext facesContext, boolean createIfNull) {
- Map<String, Object> applicationMap = facesContext.getExternalContext().getApplicationMap();
- @SuppressWarnings("unchecked")
- Map<Class<?>, Object> servicesMap = (Map<Class<?>, Object>) applicationMap.get(SERVICES_MAP_ATTRIBUTE);
- if (servicesMap == null && createIfNull) {
- servicesMap = new HashMap<Class<?>, Object>();
- applicationMap.put(SERVICES_MAP_ATTRIBUTE, servicesMap);
- }
-
- return servicesMap;
- }
+ public static Collection<Class<?>> getRegisteredServiceClasses(FacesContext context) {
+ Map<Class<?>, Object> servicesMap = getServicesMap(context, false);
+ if (servicesMap != null) {
+ return Collections.unmodifiableCollection(servicesMap.keySet());
+ } else {
+ return Collections.emptySet();
+ }
+ }
- private static void clearServicesMap(FacesContext facesContext) {
- Map<String, Object> applicationMap = facesContext.getExternalContext().getApplicationMap();
- applicationMap.remove(SERVICES_MAP_ATTRIBUTE);
- }
+ @SuppressWarnings("unchecked")
+ public static <T> T getService(FacesContext context, Class<T> serviceInterfaceClass) {
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+
+ if (serviceInterfaceClass == null) {
+ throw new NullPointerException("serviceInterfaceClass");
+ }
+
+ T serviceImplementation = null;
+
+ Map<Class<?>, Object> servicesMap = getServicesMap(context, false);
+ if (servicesMap != null) {
+ serviceImplementation = (T) servicesMap.get(serviceInterfaceClass);
+ }
+
+ //TODO - null?
+ return serviceImplementation;
+ }
+
+ public static <T> void setService(FacesContext context,
+ Class<T> serviceInterfaceClass,
+ T serviceImplementation) {
+
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+
+ if (serviceInterfaceClass == null) {
+ throw new NullPointerException("serviceInterfaceClass");
+ }
+
+ if (serviceImplementation == null) {
+ throw new NullPointerException("serviceImplementation");
+ }
+
+ Map<Class<?>, Object> servicesMap = getServicesMap(context, true);
+ servicesMap.put(serviceInterfaceClass, serviceImplementation);
+ }
+
+ public static void release(FacesContext context) {
+ clearServicesMap(context);
+ }
+
+ private static Map<Class<?>, Object> getServicesMap(FacesContext facesContext, boolean createIfNull) {
+ Map<String, Object> applicationMap = facesContext.getExternalContext().getApplicationMap();
+ @SuppressWarnings("unchecked")
+ Map<Class<?>, Object> servicesMap = (Map<Class<?>, Object>) applicationMap.get(SERVICES_MAP_ATTRIBUTE);
+ if (servicesMap == null && createIfNull) {
+ servicesMap = new HashMap<Class<?>, Object>();
+ applicationMap.put(SERVICES_MAP_ATTRIBUTE, servicesMap);
+ }
+
+ return servicesMap;
+ }
+
+ private static void clearServicesMap(FacesContext facesContext) {
+ Map<String, Object> applicationMap = facesContext.getExternalContext().getApplicationMap();
+ applicationMap.remove(SERVICES_MAP_ATTRIBUTE);
+ }
}
Modified: root/framework/trunk/api/src/main/java/org/richfaces/skin/SkinFactory.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/skin/SkinFactory.java 2009-12-04 20:11:46 UTC (rev 16067)
+++ root/framework/trunk/api/src/main/java/org/richfaces/skin/SkinFactory.java 2009-12-04 20:28:48 UTC (rev 16068)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.skin;
-import javax.faces.context.FacesContext;
-
import org.richfaces.application.ServiceTracker;
+import javax.faces.context.FacesContext;
+
/**
* Base factory class ( implement Singleton design pattern ). Produce self
* instance to build current skin configuration. At present, realised as lazy
@@ -34,11 +32,10 @@
*
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
- *
*/
public abstract class SkinFactory {
- public static final String BASE_SKIN_PARAMETER = "org.richfaces.BASE_SKIN";
+ public static final String BASE_SKIN_PARAMETER = "org.richfaces.BASE_SKIN";
/**
* Name of web application init parameter for current skin . Can be simple
@@ -59,7 +56,7 @@
* instantiate custom factory, return default.
*/
public static final SkinFactory getInstance() {
- return ServiceTracker.getService(FacesContext.getCurrentInstance(), SkinFactory.class);
+ return ServiceTracker.getService(FacesContext.getCurrentInstance(), SkinFactory.class);
}
/**
@@ -72,6 +69,7 @@
/**
* Get current {@link Skin} implementation.
+ *
* @param context
* @return
*/
@@ -79,6 +77,7 @@
/**
* Get base {@link Skin} implementation
+ *
* @param facesContext
* @return
*/
14 years, 5 months
JBoss Rich Faces SVN: r16067 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/builder/render and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-12-04 15:11:46 -0500 (Fri, 04 Dec 2009)
New Revision: 16067
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/resources/META-INF/plexus/
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/ClassImport.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaComment.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaImport.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBody.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementsContainer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkError.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingError.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWorker.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/JavaLogger.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Logger.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LoggerFactory.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelValidator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ValidatorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaClassPathObject.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileSystemObject.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/CdkConfiguration.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Key.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Merge.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Properties.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SearchableCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Tag.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ParsingException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatementsContainer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ConversionToStringMethodBodyStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/DefineObjectStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EmptinessCheckingMethodBodyStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EncodeMethodPrefaceStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EndElementStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ForEachStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/FreeMarkerRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfElseStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassModelWrapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/MethodBodyTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/StartElementStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributeStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributesSetStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteTextStatement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/AnyElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkBodyElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkCallElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkChooseElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkConditionalJstlElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkForEachElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkIfElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkOtherwiseElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkWhenElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ElementsHandler.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/LeafModelElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelFragment.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/TemplateVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/PropertyUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/NamesListComparator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/ParsingException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBody.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodyMerge.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodySerializer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XPathComparator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Attribute.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinition.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinitionFactory.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Element.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Node.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/wutka/WutkaDefinitionFactory.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/xerces/XercesDefinitionFactory.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
RFPL-195 - Code style policy
Reformatting
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* Representation of method argument
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class Argument {
private String name;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/ClassImport.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/ClassImport.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/ClassImport.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
- *
*/
public class ClassImport implements JavaImport {
private Class<?> clazz;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.ArrayList;
@@ -29,8 +27,8 @@
/**
* Wrapper for '@annotations
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class JavaAnnotation {
private List<String> arguments = new ArrayList<String>();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.ArrayList;
@@ -32,8 +30,8 @@
/**
* Java Class model.
* Intended for building java classes.
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class JavaClass extends JavaLanguageElement {
private static final JavaClass DEFAULT_SUPERCLASS = new JavaClass(Object.class);
@@ -190,7 +188,7 @@
if (importPackageName != null && importPackageName.length() != 0) {
result = !(importPackageName.equals("java.lang")
- || (jp != null && importPackageName.equals(jp.getName())));
+ || (jp != null && importPackageName.equals(jp.getName())));
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaComment.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaComment.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaComment.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,19 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* Java comment representation
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class JavaComment {
private String value;
- public JavaComment() {}
+ public JavaComment() {
+ }
public JavaComment(String value) {
super();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* Constructor method
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class JavaConstructor extends JavaMethod {
public JavaConstructor(JavaClass javaClass, Argument... arguments) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* Class field abstraction
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class JavaField extends JavaLanguageElement {
private Class<?> type;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaImport.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaImport.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaImport.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
- *
*/
public interface JavaImport {
public String getName();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,20 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
/**
- *
* @author Maksim Kaszynski
- *
*/
public class JavaLanguageElement {
private Set<JavaModifier> modifiers = new TreeSet<JavaModifier>();
@@ -84,8 +79,8 @@
public void addAnnotation(Class<?> annotation) {
annotations.add(new JavaAnnotation(annotation));
}
-
- public void addComment(JavaComment comment) {
- comments.add(comment);
- }
+
+ public void addComment(JavaComment comment) {
+ comments.add(comment);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.ArrayList;
@@ -29,7 +27,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public class JavaMethod extends JavaLanguageElement {
private List<Argument> arguments = new ArrayList<Argument>();
@@ -39,7 +36,7 @@
public JavaMethod(String name) {
super(name);
-
+
this.returnType = Void.TYPE;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
- *
*/
public enum JavaModifier {
PRIVATE, DEFAULT {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
- *
*/
public class JavaPackage {
private String name;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.HashMap;
@@ -28,7 +26,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public final class JavaPrimitive {
private static final Map<String, Class<?>> TYPES = new HashMap<String, Class<?>>() {
@@ -56,7 +53,8 @@
}
};
- private JavaPrimitive() {}
+ private JavaPrimitive() {
+ }
public static Class<?> forName(String name) throws ClassNotFoundException {
Class<?> class1 = TYPES.get(name);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBody.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBody.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBody.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
import java.util.HashSet;
@@ -34,7 +32,8 @@
private Set<Class<?>> usedClasses = new HashSet<Class<?>>();
private JavaMethod method;
- public MethodBody() {}
+ public MethodBody() {
+ }
public MethodBody(JavaMethod method) {
super();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -25,10 +25,9 @@
/**
* @author Nick Belaevski
- *
*/
public interface MethodBodyStatement {
- public String getCode(FreeMarkerRenderer renderer);
-
+ public String getCode(FreeMarkerRenderer renderer);
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementImpl.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementImpl.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -25,20 +25,19 @@
/**
* @author Nick Belaevski
- *
*/
public class MethodBodyStatementImpl implements MethodBodyStatement {
- private String code;
-
- public MethodBodyStatementImpl(String code) {
- super();
- this.code = code;
- }
+ private String code;
- @Override
- public String getCode(FreeMarkerRenderer renderer) {
- return code;
- }
+ public MethodBodyStatementImpl(String code) {
+ super();
+ this.code = code;
+ }
+ @Override
+ public String getCode(FreeMarkerRenderer renderer) {
+ return code;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementsContainer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementsContainer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/MethodBodyStatementsContainer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,16 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
+import org.richfaces.cdk.templatecompiler.FreeMarkerRenderer;
+
import java.util.ArrayList;
import java.util.List;
-import org.richfaces.cdk.templatecompiler.FreeMarkerRenderer;
-
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -37,41 +34,41 @@
private List<MethodBodyStatement> statements = new ArrayList<MethodBodyStatement>();
- public List<MethodBodyStatement> getStatements() {
- return statements;
- }
-
- public void addStatement(MethodBodyStatement statement) {
- statements.add(statement);
- }
+ public List<MethodBodyStatement> getStatements() {
+ return statements;
+ }
- public void addStatement(int index, MethodBodyStatement statement) {
- statements.add(index, statement);
- }
+ public void addStatement(MethodBodyStatement statement) {
+ statements.add(statement);
+ }
- public void addStatement(String statementCode) {
- addStatement(new MethodBodyStatementImpl(statementCode));
- }
+ public void addStatement(int index, MethodBodyStatement statement) {
+ statements.add(index, statement);
+ }
- public void addStatement(int index, String statementCode) {
- addStatement(index, new MethodBodyStatementImpl(statementCode));
- }
-
- public boolean isEmpty() {
- return statements.isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.builder.model.MethodBodyStatement#getCode()
- */
- @Override
- public String getCode(FreeMarkerRenderer renderer) {
- StringBuilder sb = new StringBuilder();
- for (MethodBodyStatement statement: statements) {
- sb.append(statement.getCode(renderer));
- sb.append('\n');
- }
-
- return sb.toString();
- }
+ public void addStatement(String statementCode) {
+ addStatement(new MethodBodyStatementImpl(statementCode));
+ }
+
+ public void addStatement(int index, String statementCode) {
+ addStatement(index, new MethodBodyStatementImpl(statementCode));
+ }
+
+ public boolean isEmpty() {
+ return statements.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.builder.model.MethodBodyStatement#getCode()
+ */
+ @Override
+ public String getCode(FreeMarkerRenderer renderer) {
+ StringBuilder sb = new StringBuilder();
+ for (MethodBodyStatement statement : statements) {
+ sb.append(statement.getCode(renderer));
+ sb.append('\n');
+ }
+
+ return sb.toString();
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.model;
/**
* Implementation of import taht cannot be resolved in design time
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class RuntimeImport implements JavaImport {
private String name;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.render;
import org.richfaces.builder.model.JavaClass;
@@ -29,13 +27,11 @@
import org.richfaces.builder.model.JavaMethod;
import java.io.PrintWriter;
-
import java.util.List;
import java.util.Set;
/**
* @author Maksim Kaszynski
- *
*/
public class JavaClassRenderer extends JavaLanguageElementRenderer<JavaClass> {
private JavaMethodRenderer methodRenderer = new JavaMethodRenderer();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,17 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.render;
-import java.io.PrintWriter;
-
import org.richfaces.builder.model.JavaField;
+import java.io.PrintWriter;
+
/**
* @author Maksim Kaszynski
- *
*/
public class JavaFieldRenderer extends JavaLanguageElementRenderer<JavaField> {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,26 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.render;
-import java.io.PrintWriter;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
import org.richfaces.builder.model.JavaAnnotation;
import org.richfaces.builder.model.JavaComment;
import org.richfaces.builder.model.JavaLanguageElement;
import org.richfaces.builder.model.JavaModifier;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
/**
- *
* @author Maksim Kaszynski
- *
* @param <T>
*/
public abstract class JavaLanguageElementRenderer<T extends JavaLanguageElement> {
@@ -67,7 +61,7 @@
if (arguments != null && !arguments.isEmpty()) {
out.print("(");
- for (Iterator<String> iterator = arguments.iterator(); iterator.hasNext(); ) {
+ for (Iterator<String> iterator = arguments.iterator(); iterator.hasNext();) {
String string = iterator.next();
out.print(string);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,22 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.render;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-
import org.richfaces.builder.model.Argument;
import org.richfaces.builder.model.JavaMethod;
import org.richfaces.builder.model.MethodBody;
import org.richfaces.builder.model.MethodBodyStatement;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.List;
+
/**
* @author Maksim Kaszynski
- *
*/
public class JavaMethodRenderer extends JavaLanguageElementRenderer<JavaMethod> {
@Override
@@ -55,7 +52,7 @@
List<Argument> arguments = javaMethod.getArguments();
if (arguments != null) {
- for (Iterator<Argument> iterator = arguments.iterator(); iterator.hasNext(); ) {
+ for (Iterator<Argument> iterator = arguments.iterator(); iterator.hasNext();) {
Argument argument = iterator.next();
out.print(argument.getType().getSimpleName());
@@ -75,7 +72,7 @@
if (exceptions != null && !exceptions.isEmpty()) {
out.print(" throws ");
- for (Iterator<Class<? extends Throwable>> iterator = exceptions.iterator(); iterator.hasNext(); ) {
+ for (Iterator<Class<? extends Throwable>> iterator = exceptions.iterator(); iterator.hasNext();) {
Class<? extends Throwable> class1 = iterator.next();
out.print(class1.getSimpleName());
@@ -91,10 +88,10 @@
MethodBody methodBody = javaMethod.getMethodBody();
if (methodBody != null) {
- List<MethodBodyStatement> statements = methodBody.getStatements();
- for (MethodBodyStatement methodBodyStatement : statements) {
- out.println(methodBodyStatement.toString());
- }
+ List<MethodBodyStatement> statements = methodBody.getStatements();
+ for (MethodBodyStatement methodBodyStatement : statements) {
+ out.println(methodBodyStatement.toString());
+ }
}
out.println("}");
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContext.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,16 +1,15 @@
package org.richfaces.cdk;
+import org.richfaces.cdk.CdkWriter.OutputType;
+
import java.io.File;
-import org.richfaces.cdk.CdkWriter.OutputType;
-
/**
* <p class="changed_added_4_0">
* That interface defines context for all CDK operations
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public interface CdkContext {
@@ -25,6 +24,7 @@
/**
* <p class="changed_added_4_0">Get all sources for given type.</p>
+ *
* @param type
* @return
*/
@@ -33,6 +33,7 @@
/**
* <p class="changed_added_4_0">Provides default output folder for given output type.</p>
* TODO - define "output families" to group similar outputs ( classes, resources, tests ... ).
+ *
* @param type of output
* @return output folder for requested type.
*/
@@ -40,7 +41,8 @@
/**
* <p class="changed_added_4_0">This method creates output file in the appropriate output folder. If target file exists and its modification time is late than model modification time from {@code lastModified} parameter, no new file will be created.</p>
- * @param output target output folder.
+ *
+ * @param output target output folder.
* @param relativePath path to file in the output folder.
* @param lastModified model modification time. If that parameter is less then 0, no checks for existing file will be performed.
* @return new created file or null if the target file exists and its modification time is late then model.
@@ -49,6 +51,7 @@
/**
* <p class="changed_added_4_0">Record recowerable CdkError. To avoid consequence builds of the project with many errors, all non-fatal errors ( Java compilation errors, incorrect xml fales, inconsistent component descriptions ) these error are stored in the context and marks whole build failed.</p>
+ *
* @param error
*/
public void sendError(CdkError error);
@@ -57,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type
* @return
*/
@@ -64,6 +68,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param <W>
* @param workerClass
* @return
@@ -74,6 +79,7 @@
/**
* <p class="changed_added_4_0">Get value of configuration option.</p>
* TODO make it type safe.
+ *
* @param name option name.
* @return option value or null.
*/
@@ -81,8 +87,8 @@
/**
* <p class="changed_added_4_0">Id of source files e.g. Java classes, faces-configs, renderer templates</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface SourceType {
String getName();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkContextBase.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,18 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-
import org.richfaces.cdk.CdkWriter.OutputType;
import java.io.File;
import java.io.IOException;
-
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -40,8 +36,8 @@
/**
* <p class="changed_added_4_0">Base CDK context class. Particular build tool ( Ant, Maven ) should extend that class with
* tool-specific methods.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class CdkContextBase implements CdkContext {
private Map<String, String> options = Maps.newHashMap();
@@ -191,6 +187,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param options the options to set
*/
public void setOptions(Map<String, String> options) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkError.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkError.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkError.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,14 +21,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
* <p class="changed_added_4_0">That class incapsulates information about recoverable CDK errors.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class CdkError {
private Throwable cause;
@@ -37,6 +35,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public CdkError(String message) {
@@ -45,6 +44,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkException.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,24 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class CdkException extends Exception {
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkException() {}
+ public CdkException() {
+ }
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public CdkException(String message) {
@@ -47,6 +47,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cause
*/
public CdkException(Throwable cause) {
@@ -55,6 +56,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingError.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingError.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkProcessingError.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
@@ -32,22 +30,23 @@
* processing that let developer to know about all errors in the project.</p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class CdkProcessingError extends CdkException {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private static final long serialVersionUID = -3696046213271071968L;
/**
* <p class="changed_added_4_0"></p>
*/
- public CdkProcessingError() {}
+ public CdkProcessingError() {
+ }
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public CdkProcessingError(String message) {
@@ -56,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cause
*/
public CdkProcessingError(Throwable cause) {
@@ -64,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWorker.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWorker.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWorker.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,15 +21,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
* <p class="changed_added_4_0">Interface for all CDK worker objects ( parsers, validators, renderers etc. ).
* Instances of these objects are stored in the {@link CdkContext}</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public interface CdkWorker {
public void init(CdkContext context) throws CdkException;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkWriter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.ComponentLibrary;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public interface CdkWriter extends CdkWorker {
public void render(ComponentLibrary library) throws CdkException;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyBuilder.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyBuilder.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.ComponentLibrary;
/**
* <p class="changed_added_4_0">This is dummy model builder class for not yet implemented source types</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class DummyBuilder implements ModelBuilder {
private CdkContext context;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyGenerator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/DummyGenerator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.ComponentLibrary;
/**
* <p class="changed_added_4_0">This is dummy generator for not yet implemented output types</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class DummyGenerator implements CdkWriter {
private CdkContext context;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/JavaLogger.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/JavaLogger.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/JavaLogger.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import java.util.logging.Level;
/**
* <p class="changed_added_4_0">That logger delegates all calls to the JDK {@link java.util.logging.Logger}</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
class JavaLogger implements Logger {
java.util.logging.Logger jdkLogger = java.util.logging.Logger.getLogger(LoggerFactory.CDK_LOG);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LibraryBuilder.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import com.google.common.collect.ImmutableMap;
-
-import org.richfaces.cdk.templatecompiler.RendererClassGenerator;
-import org.richfaces.cdk.templatecompiler.RendererTemplateParser;
import org.richfaces.cdk.CdkContext.SourceType;
import org.richfaces.cdk.CdkWriter.OutputType;
import org.richfaces.cdk.apt.AptBuilder;
import org.richfaces.cdk.generate.java.ComponentClassGenerator;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.templatecompiler.RendererClassGenerator;
+import org.richfaces.cdk.templatecompiler.RendererTemplateParser;
import org.richfaces.cdk.xmlconfig.FacesConfigGenerator;
import org.richfaces.cdk.xmlconfig.FacesConfigParser;
@@ -44,7 +41,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public final class LibraryBuilder implements CdkWorker {
@@ -53,18 +49,18 @@
*/
private static final ImmutableMap<OutputType, Class<? extends CdkWriter>> WRITERS =
ImmutableMap.<OutputType, Class<? extends CdkWriter>>builder().put(StandardOutputs.COMPONENT_CLASSES,
- ComponentClassGenerator.class).put(StandardOutputs.RENDERER_CLASSES,
- RendererClassGenerator.class).put(StandardOutputs.FACES_CONFIG,
- FacesConfigGenerator.class).build();
+ ComponentClassGenerator.class).put(StandardOutputs.RENDERER_CLASSES,
+ RendererClassGenerator.class).put(StandardOutputs.FACES_CONFIG,
+ FacesConfigGenerator.class).build();
/**
* map contain library model builder classes for each source type.
*/
private static final ImmutableMap<SourceType, Class<? extends ModelBuilder>> BUILDERS =
ImmutableMap.<SourceType, Class<? extends ModelBuilder>>builder().put(StandardSources.FACES_CONFIGS,
- FacesConfigParser.class).put(StandardSources.JAVA_SOURCES,
- AptBuilder.class).put(StandardSources.RENDERER_TEMPLATES,
- RendererTemplateParser.class).build();
+ FacesConfigParser.class).put(StandardSources.JAVA_SOURCES,
+ AptBuilder.class).put(StandardSources.RENDERER_TEMPLATES,
+ RendererTemplateParser.class).build();
/**
* <p class="changed_added_4_0">
@@ -79,7 +75,8 @@
*
* @param context
*/
- public LibraryBuilder() {}
+ public LibraryBuilder() {
+ }
@Override
public void init(CdkContext context) throws CdkException {
@@ -106,8 +103,7 @@
* into model.
* </p>
*
- * @param sources
- * Java Source files.
+ * @param sources Java Source files.
* @return generated library model.
* @throws CdkException
*/
@@ -150,6 +146,7 @@
/**
* Generate all types of files from library model.
+ *
* @param library
* @throws CdkException
*/
@@ -165,7 +162,7 @@
* </p>
*
* @param library model
- * @param type of generated files.
+ * @param type of generated files.
* @throws CdkException
*/
public void generate(ComponentLibrary library, OutputType type) throws CdkException {
@@ -176,6 +173,7 @@
/**
* This method returns instance of {@link CdkWriter} for given output type.
+ *
* @param type
* @return
* @throws CdkException
@@ -222,6 +220,7 @@
/**
* This method returns initialized instance of the {@link ModelBuilder} for given source type.
+ *
* @param type
* @return
* @throws CdkException
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Logger.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Logger.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Logger.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,16 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
* That interface hides current logging system from generator classe.
* Concrete tools ( Maven, Ant, JUnit ) should provide appropriate logger instance that delegates
* messages to the current log system.
- * @author shura
*
+ * @author shura
*/
public interface Logger {
boolean isDebugEnabled();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LoggerFactory.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LoggerFactory.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/LoggerFactory.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,21 +21,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public final class LoggerFactory {
public static final String CDK_LOG = "org.richfaces.cdk";
/**
- * <p class="changed_added_4_0">Current logger. By default all calls will be sent to system
- * {@link java.util.logging.Logger}</p>
+ * <p class="changed_added_4_0">Current logger. By default all calls will be sent to system
+ * {@link java.util.logging.Logger}</p>
*/
private static Logger logger = new JavaLogger();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelBuilder.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelBuilder.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,21 +21,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.ComponentLibrary;
/**
* <p class="changed_added_4_0">Interface for {@link ComponentLibrary} model builder.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface ModelBuilder extends CdkWorker {
/**
* <p class="changed_added_4_0">Initialize builder.</p>
+ *
* @param context
* @throws CdkException
*/
@@ -43,6 +42,7 @@
/**
* <p class="changed_added_4_0">Build library model.</p>
+ *
* @return
* @throws CdkException
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelValidator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelValidator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ModelValidator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,21 +21,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.ComponentLibrary;
/**
* <p class="changed_added_4_0">Interface for CDK library model verifier.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public interface ModelValidator extends CdkWorker {
/**
* <p class="changed_added_4_0">Perform verify procedure on the library model.</p>
+ *
* @param library
* @throws CdkException
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.InvalidNameException;
@@ -35,7 +33,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public interface NamingConventions extends CdkWorker {
@@ -46,6 +43,7 @@
* <li><code><prefix>.component.<Name>Base</code> => <code><prefix>.<Name></code> </li>
* <li><code><prefix>.component.UI<Name></code> => <code><prefix>.<Name></code> </li>
* </ul>
+ *
* @param explicitType
* @param className
* @return
@@ -61,12 +59,13 @@
* <code><prefix>.component.UI<Name></code> for an abstract class.</li>
* <li>Use base class name if concrete class should not be generated.
* </ul>
+ *
* @param explicitClass
* @param className
* @return
*/
public String inferUIComponentClass(String componentType, String explicitClass, String baseClass,
- boolean baseClassIsAbstract) throws InvalidNameException;
+ boolean baseClassIsAbstract) throws InvalidNameException;
public String inferUIComponentBaseClass(String componentType, String baseClassName, boolean baseClassIsAbstract);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -10,7 +10,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public final class RichFacesConventions implements NamingConventions {
private static final String ABSTRACT = "Abstract";
@@ -22,7 +21,8 @@
private String baseName;
private CdkContext context;
- public RichFacesConventions() {}
+ public RichFacesConventions() {
+ }
@Override
public void init(CdkContext context) throws CdkException {
@@ -81,8 +81,8 @@
@Override
public String inferUIComponentClass(String componentType, String explicitClass, String baseClass,
- boolean baseClassIsAbstract) throws InvalidNameException {
-
+ boolean baseClassIsAbstract) throws InvalidNameException {
+
String className;
if (!Strings.isEmpty(explicitClass)) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.CdkWriter.OutputType;
/**
* <p class="changed_added_4_0">This enumeration defines standard types of output folders.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public enum StandardOutputFolders implements OutputType {
JAVA_CLASSES, RESOURCES, TEST_JAVA_CLASSES, TEST_RESOURCES, DOCUMENTATION;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.CdkWriter.OutputType;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public enum StandardOutputs implements OutputType {
COMPONENT_CLASSES(StandardOutputFolders.JAVA_CLASSES), RENDERER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
@@ -44,6 +42,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param folderType
*/
private StandardOutputs(OutputType folderType) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.CdkContext.SourceType;
/**
* <p class="changed_added_4_0">This enumeration defines standard types for project sources.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public enum StandardSources implements SourceType {
JAVA_SOURCES, FACES_CONFIGS, RENDERER_TEMPLATES;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ValidatorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ValidatorImpl.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/ValidatorImpl.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk;
import org.richfaces.cdk.model.Component;
@@ -34,8 +32,8 @@
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class ValidatorImpl implements ModelValidator {
private CdkContext context;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,31 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
-import java.io.File;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import javax.annotation.processing.Processor;
-
-import javax.tools.Diagnostic;
-import javax.tools.DiagnosticListener;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-import javax.tools.Diagnostic.Kind;
-import javax.tools.JavaCompiler.CompilationTask;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
@@ -55,7 +33,22 @@
import org.richfaces.cdk.StandardSources;
import org.richfaces.cdk.model.ComponentLibrary;
-import com.google.common.collect.Lists;
+import javax.annotation.processing.Processor;
+import javax.tools.Diagnostic;
+import javax.tools.Diagnostic.Kind;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
/**
* <p class="changed_added_4_0">
@@ -63,7 +56,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class AptBuilder implements ModelBuilder {
private static final Logger LOG = LoggerFactory.getLogger();
@@ -77,6 +69,7 @@
/**
* <p class="changed_added_4_0">Builder method that creates and initializes compiler instance.
* That instance can be reused for consecuence processing.</p>
+ *
* @param context
* @return
*/
@@ -168,6 +161,7 @@
/**
* <p class="changed_added_4_0">That method process source files and call appropriate annotation processors</p>
+ *
* @param sources
* @param processors
* @throws AptException
@@ -193,17 +187,17 @@
}
if (!sourceObjects.isEmpty()) {
- CompilationTask task = getJavaCompiler().getTask(null, getFileManager(), listener, getOptions(), null,
- sourceObjects);
+ CompilationTask task = getJavaCompiler().getTask(null, getFileManager(), listener, getOptions(), null,
+ sourceObjects);
- task.setProcessors(Arrays.asList(processors));
- task.setLocale(locale);
+ task.setProcessors(Arrays.asList(processors));
+ task.setLocale(locale);
- if (!task.call()) {
- throw new AptException("Compilation error: " + messages);
- }
+ if (!task.call()) {
+ throw new AptException("Compilation error: " + messages);
+ }
} else {
- LOG.info("No source objects detected, skipping compilation");
+ LOG.info("No source objects detected, skipping compilation");
}
}
@@ -221,8 +215,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param options
- * the options to set
+ * @param options the options to set
*/
protected void setOptions(Iterable<String> options) {
this.options = options;
@@ -230,6 +223,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the fileManager
*/
protected VirtualFileManager getFileManager() {
@@ -238,6 +232,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param fileManager the fileManager to set
*/
protected void setFileManager(VirtualFileManager fileManager) {
@@ -246,6 +241,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param javaCompiler the javaCompiler to set
*/
protected void setJavaCompiler(JavaCompiler javaCompiler) {
@@ -264,6 +260,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the locale
*/
public Locale getLocale() {
@@ -272,6 +269,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param locale the locale to set
*/
public void setLocale(Locale locale) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptException.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptException.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,31 +21,31 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class AptException extends CdkException {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private static final long serialVersionUID = 8023042422371321042L;
/**
* <p class="changed_added_4_0"></p>
*/
- public AptException() {}
+ public AptException() {
+ }
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public AptException(String message) {
@@ -54,6 +54,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cause
*/
public AptException(Throwable cause) {
@@ -62,6 +63,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,12 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import com.google.common.collect.Sets;
-
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.NamingConventions;
@@ -35,14 +32,16 @@
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
-
import javax.lang.model.SourceVersion;
-import javax.lang.model.element.*;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
-
import java.lang.annotation.Annotation;
-
import java.util.List;
import java.util.Set;
@@ -53,7 +52,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public abstract class CdkProcessor extends AbstractProcessor {
@@ -68,8 +66,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param context
- * current CDK context
+ * @param context current CDK context
*/
protected CdkProcessor(CdkContext context) {
super();
@@ -97,16 +94,14 @@
* <p class="changed_added_4_0">
* Get all classes annotated with particular annotation.
* </p>
- * @param round
- * current round environment.
- * @param annotation
- * annotation class.
*
+ * @param round current round environment.
+ * @param annotation annotation class.
* @return {@link Set} of all classes annotated with {@code annotation}
* type.
*/
protected Set<? extends TypeElement> getClassesAnnotatedWith(RoundEnvironment round,
- Class<? extends Annotation> annotation) {
+ Class<? extends Annotation> annotation) {
Set<TypeElement> classes = Sets.newHashSet();
Set<? extends Element> annotatedWith = round.getElementsAnnotatedWith(annotation);
@@ -132,7 +127,7 @@
* @return
*/
protected Set<BeanProperty> getBeanPropertiesAnnotatedWith(Class<? extends Annotation> annotation,
- TypeElement type) {
+ TypeElement type) {
Set<BeanProperty> properties = Sets.newHashSet();
List<? extends Element> members = this.processingEnv.getElementUtils().getAllMembers(type);
@@ -208,7 +203,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
protected final class BeanProperty {
private Element element;
@@ -285,6 +279,7 @@
/**
* <p class="changed_added_4_0">Get JavaDoc comment of appropriate bean property element.</p>
+ *
* @return
*/
public String getDocComment() {
@@ -297,6 +292,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the exists
*/
public boolean isExists() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,12 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import com.google.common.collect.Lists;
-
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.annotations.*;
@@ -40,14 +37,17 @@
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
-
import javax.faces.event.FacesEvent;
-
-import javax.lang.model.element.*;
+import javax.lang.model.element.AnnotationMirror;
+import javax.lang.model.element.AnnotationValue;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.Name;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
import javax.lang.model.type.MirroredTypesException;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
-
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -59,7 +59,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
@SupportedAnnotationTypes({"javax.faces.component.FacesComponent", Component.NAME})
public class ComponentProcessor extends CdkProcessor {
@@ -104,7 +103,7 @@
// Because component type is a primary key for components collection, we have to infer explicit
// value here.
String type = getNamingConventions().inferComponentType(componentAnnotation.value(),
- componentElement.getQualifiedName().toString());
+ componentElement.getQualifiedName().toString());
org.richfaces.cdk.model.Component component = library.findOrCreateComponent(type);
// Should that component be generated ?
@@ -114,7 +113,7 @@
// rise error and continue.
processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR, e.getMessage(),
- componentElement);
+ componentElement);
continue;
}
@@ -136,7 +135,7 @@
processingEnv.getElementUtils().getElementValuesWithDefaults(mirror);
for (Entry<? extends ExecutableElement, ? extends AnnotationValue> valueEntry
- : valuesWithDefaults.entrySet()) {
+ : valuesWithDefaults.entrySet()) {
Name name = valueEntry.getKey().getSimpleName();
if ("value".equals(name.toString())) {
@@ -157,7 +156,7 @@
// rise error and continue.
processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR,
- e.getMessage(), element);
+ e.getMessage(), element);
continue;
}
@@ -252,6 +251,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param component
* @param icon
*/
@@ -286,7 +286,7 @@
Set<Modifier> modifiers = field.getModifiers();
if (modifiers.contains(Modifier.FINAL) && modifiers.contains(Modifier.STATIC)
- && field.getSimpleName().equals("COMPONENT_FAMILY")) {
+ && field.getSimpleName().equals("COMPONENT_FAMILY")) {
Object value = field.getConstantValue();
if (null != value) {
@@ -338,7 +338,7 @@
protected void processAttributes(TypeElement componentElement, org.richfaces.cdk.model.Component component)
throws CdkException {
-
+
// Process XML files with standard attributes definitions.
Attributes attributes = componentElement.getAnnotation(Attributes.class);
@@ -461,6 +461,7 @@
/**
* <p class="changed_added_4_0">Reccursive method to find and process standard class or interface attributes.</p>
+ *
* @param component
* @param interfaceMirror
*/
@@ -476,7 +477,7 @@
try {
component.getAttributes().addAll(fragmentParser.parseProperties(CdkEntityResolver.URN_ATTRIBUTES + name
- + ".xml"));
+ + ".xml"));
} catch (CdkException e) {
// TODO - log errors ?
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,25 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
-
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.LoggerFactory;
-import javax.tools.*;
+import javax.tools.FileObject;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
import javax.tools.JavaFileObject.Kind;
-
+import javax.tools.StandardLocation;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.Serializable;
-
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -47,17 +46,16 @@
/**
* <p class="changed_added_4_0">
- * That class wraps {@link StandardJavaFileManager}
+ * That class wraps {@link javax.tools.StandardJavaFileManager}
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
final class VirtualFileManager extends ForwardingJavaFileManager<JavaFileManager> {
private static final Logger LOG = LoggerFactory.getLogger();
// private final BiMap<FileObjectKey, FileObject> classPathFiles;
-// private final BiMap<FileObject, FileObjectKey> inversedClassPathFiles;
+ // private final BiMap<FileObject, FileObjectKey> inversedClassPathFiles;
private final ClassLoader classPathLoader;
private final BiMap<FileObject, FileObjectKey> inversedSources;
private final BiMap<FileObjectKey, FileObject> sources;
@@ -93,16 +91,14 @@
public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.getJavaFileForInput(" + String.valueOf(location) + "," + className + ","
- + String.valueOf(kind) + ")");
+ + String.valueOf(kind) + ")");
}
FileObjectKey key = new FileObjectKey(className, kind);
if (StandardLocation.SOURCE_PATH.equals(location)) {
- JavaFileObject fileObject = null;
+ JavaFileObject fileObject = (JavaFileObject) sources.get(key);
- fileObject = (JavaFileObject) sources.get(key);
-
if (null == fileObject && null != javaSourceDirectory) {
String fileName = className.replace('.', File.separatorChar) + kind.extension;
File resource = new File(javaSourceDirectory, fileName);
@@ -126,7 +122,7 @@
}
if (StandardLocation.CLASS_OUTPUT.equals(location) || StandardLocation.SOURCE_PATH.equals(location)
- || StandardLocation.SOURCE_OUTPUT.equals(location)) {
+ || StandardLocation.SOURCE_OUTPUT.equals(location)) {
return getClassPathLoader();
} else {
return super.getClassLoader(location);
@@ -145,7 +141,7 @@
public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) {
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.getJavaFileForOutput(" + String.valueOf(location) + "," + className + ","
- + String.valueOf(kind) + "," + String.valueOf(sibling) + ")");
+ + String.valueOf(kind) + "," + String.valueOf(sibling) + ")");
}
JavaFileObject fileForOutput = null;
@@ -188,11 +184,11 @@
@Override
public Iterable<JavaFileObject> list(final Location location, final String packageName, final Set<Kind> kinds,
- final boolean recurse) throws IOException {
+ final boolean recurse) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.list(" + String.valueOf(location) + "," + packageName + ","
- + String.valueOf(kinds) + "," + String.valueOf(recurse) + ")");
+ + String.valueOf(kinds) + "," + String.valueOf(recurse) + ")");
}
Iterable<JavaFileObject> list;
@@ -214,7 +210,7 @@
// Recursive add directory content.
try {
Iterable<JavaFileObject> childList = list(location, packageName + '.' + name,
- kinds, recurse);
+ kinds, recurse);
for (JavaFileObject javaFileObject : childList) {
fileslist.add(javaFileObject);
@@ -315,7 +311,7 @@
public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.getFileForInput(" + String.valueOf(location) + "," + packageName + ","
- + relativeName + ")");
+ + relativeName + ")");
}
if (StandardLocation.SOURCE_PATH.equals(location)) {
@@ -345,10 +341,10 @@
@Override
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling)
throws IOException {
-
+
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.getFileForOutput(" + String.valueOf(location) + "," + packageName + ","
- + relativeName + "," + String.valueOf(sibling) + ")");
+ + relativeName + "," + String.valueOf(sibling) + ")");
}
return super.getFileForOutput(location, packageName, relativeName, sibling);
@@ -379,7 +375,7 @@
public String inferBinaryName(Location location, JavaFileObject file) {
if (LOG.isDebugEnabled()) {
LOG.debug("VirtualFileManager.inferBinaryName(" + String.valueOf(location) + "," + String.valueOf(file)
- + ")");
+ + ")");
}
if (StandardLocation.SOURCE_PATH.equals(location)) {
@@ -454,8 +450,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param outputDirectory
- * the outputDirectory to set
+ * @param outputDirectory the outputDirectory to set
*/
public void setOutputDirectory(File outputDirectory) {
this.outputDirectory = outputDirectory;
@@ -475,8 +470,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param javaSourceDirectory
- * the javaSourceDirectory to set
+ * @param javaSourceDirectory the javaSourceDirectory to set
*/
public void setJavaSourceDirectory(File javaSourceDirectory) {
this.javaSourceDirectory = javaSourceDirectory;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaClassPathObject.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaClassPathObject.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaClassPathObject.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,13 +21,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
@@ -37,13 +34,13 @@
* from {@link java.io.File} or {@link URL}</p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class VirtualJavaClassPathObject extends VirtualJavaFileObject {
private final URL url;
/**
* <p class="changed_added_4_0">Create file object from URL</p>
+ *
* @param url
* @param kind
* @throws URISyntaxException
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,17 +21,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import javax.tools.SimpleJavaFileObject;
-
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URI;
-
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
@@ -42,22 +37,22 @@
* from {@link java.io.File} or {@link java.net.URL}</p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class VirtualJavaFileObject extends SimpleJavaFileObject {
/**
- * <p class="changed_added_4_0">base file object. One of {@link file} or {@link url} fields should be set</p>
+ * <p class="changed_added_4_0">base file object. One of {@link file} or {@link url} fields should be set</p>
*/
private Charset charset = Charset.defaultCharset();
/**
- * <p class="changed_added_4_0">Cached content</p>
+ * <p class="changed_added_4_0">Cached content</p>
*/
private CharSequence content;
/**
* <p class="changed_added_4_0"></p>
+ *
* @param classFile
* @param kind
*/
@@ -94,6 +89,7 @@
/**
* <p class="changed_added_4_0">Set {@link Charset} for read operations</p>
+ *
* @param charset the charset to set
*/
public void setCharset(Charset charset) {
@@ -105,6 +101,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the charset
*/
public Charset getCharset() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileSystemObject.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileSystemObject.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileSystemObject.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.apt;
import java.io.File;
@@ -35,17 +33,17 @@
* {@link File} or {@link java.net.URL}</p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class VirtualJavaFileSystemObject extends VirtualJavaFileObject {
/**
- * <p class="changed_added_4_0">base file object. One of {@link file} or {@link url} fields should be set</p>
+ * <p class="changed_added_4_0">base file object. One of {@link file} or {@link url} fields should be set</p>
*/
private final File classFile;
/**
* <p class="changed_added_4_0">Create source from {@link File}</p>
+ *
* @param classFile
*/
public VirtualJavaFileSystemObject(File classFile) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/CdkConfiguration.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/CdkConfiguration.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/CdkConfiguration.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,23 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.freemarker;
-import org.richfaces.cdk.CdkContext;
-
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.Configuration;
-import freemarker.template.TemplateHashModel;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.CdkContext;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class CdkConfiguration extends Configuration {
private static final String TEMPLATES = "/META-INF/templates";
@@ -54,11 +48,12 @@
setObjectWrapper(new LibraryModelWrapper());
// Add context variables
- this.setSharedVariable("context", new BeanModel(context,new BeansWrapper()));
+ this.setSharedVariable("context", new BeanModel(context, new BeansWrapper()));
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the context
*/
protected CdkContext getContext() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,34 +21,28 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.freemarker;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.richfaces.cdk.model.Component;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Property;
-
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
-
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
-
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.model.Component;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
/**
* <p class="changed_added_4_0">
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class ComponentTemplateModel extends BeanModel implements TemplateModel {
private final Component component;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,15 +21,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.freemarker;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
@@ -38,14 +34,15 @@
import org.richfaces.cdk.model.Trackable;
import org.richfaces.cdk.model.Visitable;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
/**
* <p class="changed_added_4_0">Base class for all output file buildes that use FreeMarker as template engine.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public abstract class FreeMarkerRenderer<C extends Visitable, P> implements CdkWriter, LibraryVisitor<Boolean, P> {
private Configuration configuration;
@@ -129,6 +126,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the context
*/
protected CdkContext getContext() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,23 +21,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.freemarker;
import freemarker.ext.beans.BeansWrapper;
-
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
-
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.model.Property;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class LibraryModelWrapper extends BeansWrapper implements ObjectWrapper {
public LibraryModelWrapper() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/PropertyModel.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.freemarker;
-import org.richfaces.cdk.model.Property;
-import org.richfaces.cdk.util.Strings;
-
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
-
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.util.Strings;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class PropertyModel extends BeanModel implements TemplateModel {
private final Property property;
/**
* <p class="changed_added_4_0"></p>
+ *
* @param object
* @param wrapper
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.generate.java;
import org.richfaces.cdk.CdkContext;
@@ -38,8 +36,8 @@
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class ComponentClassGenerator extends FreeMarkerRenderer<Component, ComponentLibrary> implements CdkWriter {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,20 +21,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@SuppressWarnings("serial")
public class Attribute extends Property {
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name
*/
public Attribute(Property.Name name) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@SuppressWarnings("serial")
public class Behavior implements ModelElement<Behavior, Behavior.Type> {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class BehaviorRenderer implements ModelElement<BehaviorRenderer, BehaviorRenderer.Type> {
@@ -48,6 +46,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
public Type getType() {
@@ -56,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererClass
*/
public ClassDescription getRendererClass() {
@@ -64,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendererClass the rendererClass to set
*/
public void setRendererClass(ClassDescription rendererClass) {
@@ -82,14 +83,15 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public static final class Type extends Key {
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type
*/
public Type(String type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import com.google.common.collect.ImmutableMap;
@@ -33,41 +31,41 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class ClassDescription {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private static final long serialVersionUID = -846623207703750456L;
private static final ImmutableMap<String, String> PRIMITIVE_TYPES =
ImmutableMap.<String, String>builder().put(boolean.class.getName(),
- Boolean.class.getName()).put(byte.class.getName(),
- Byte.class.getName()).put(char.class.getName(),
- Character.class.getName()).put(short.class.getName(),
- Short.class.getName()).put(int.class.getName(),
- Integer.class.getName()).put(long.class.getName(),
- Long.class.getName()).put(float.class.getName(),
- Float.class.getName()).put(double.class.getName(),
- Double.class.getName()).build();
+ Boolean.class.getName()).put(byte.class.getName(),
+ Byte.class.getName()).put(char.class.getName(),
+ Character.class.getName()).put(short.class.getName(),
+ Short.class.getName()).put(int.class.getName(),
+ Integer.class.getName()).put(long.class.getName(),
+ Long.class.getName()).put(float.class.getName(),
+ Float.class.getName()).put(double.class.getName(),
+ Double.class.getName()).build();
private final String boxingClassName;
private final String fullName;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private final String name;
private final boolean primitive;
/**
- * <p class="changed_added_4_0">Id parameters for that class</p>
- * TODO append type parameters to key.
+ * <p class="changed_added_4_0">Id parameters for that class</p>
+ * TODO append type parameters to key.
*/
private String typeParameters;
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cl
*/
public ClassDescription(Class<?> cl) {
@@ -106,6 +104,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the typeParameters
*/
public String getTypeParameters() {
@@ -114,6 +113,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param typeParameters the typeParameters to set
*/
public void setTypeParameters(String typeParameters) {
@@ -132,6 +132,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return package name.
*/
public String getPackage() {
@@ -146,6 +147,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return package name.
*/
public String getSimpleName() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,24 +1,22 @@
package org.richfaces.cdk.model;
-import java.util.Collection;
-import java.util.Set;
+import com.google.common.collect.Sets;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.model.Facet.Name;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlType;
+import java.util.Collection;
+import java.util.Set;
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.model.Facet.Name;
-
-import com.google.common.collect.Sets;
-
/**
* That class represents JSF component in the CDK.
* That is mapped to faces-config "component" element.
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
@XmlType(name = "faces-config-componentType")
@@ -26,7 +24,7 @@
public final class Component extends ModelElementBase implements ModelElement<Component, Component.Type> {
/**
- * <p class="changed_added_4_0">Is that component c</p>
+ * <p class="changed_added_4_0">Is that component c</p>
*/
private boolean generate = false;
@@ -60,7 +58,7 @@
* </p>
*/
private final SearchableCollection<Property, Property.Name> attributes = new ModelCollection<Property,
- Property.Name>() {
+ Property.Name>() {
@Override
public Property create(Property.Name key) {
return new Property(key);
@@ -150,8 +148,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param family
- * the family to set
+ * @param family the family to set
*/
public void setFamily(String family) {
this.family = family;
@@ -172,8 +169,7 @@
* <p class="changed_added_4_0">Represents class of that component.
* </p>
*
- * @param componentClass
- * the componentClass to set
+ * @param componentClass the componentClass to set
*/
@XmlElement(name = "component-class")
public void setComponentClass(ClassDescription componentClass) {
@@ -195,8 +191,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param baseClass
- * the baseClass to set
+ * @param baseClass the baseClass to set
*/
public void setBaseClass(ClassDescription baseClass) {
this.baseClass = baseClass;
@@ -204,6 +199,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
@Merge
@@ -213,6 +209,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean exists) {
@@ -226,8 +223,8 @@
*
* @return the attributes
*/
- @XmlElements({@XmlElement(name = "property", type = Property.class) ,
- @XmlElement(name = "attribute", type = Attribute.class) })
+ @XmlElements({@XmlElement(name = "property", type = Property.class),
+ @XmlElement(name = "attribute", type = Attribute.class)})
public Collection<Property> getAttributes() {
return attributes;
}
@@ -242,6 +239,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the facets
*/
public Collection<Facet> getFacets() {
@@ -254,6 +252,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the events
*/
public Collection<Event> getEvents() {
@@ -269,6 +268,7 @@
/**
* <p class="changed_added_4_0"></p>
* TODO - synchronize renderers collection with library ?
+ *
* @return the renderers
*/
public Set<Renderer> getRenderers() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,31 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import org.richfaces.cdk.CdkException;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-
import java.io.Serializable;
-
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import java.util.Collection;
import java.util.NoSuchElementException;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.richfaces.cdk.CdkException;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-
/**
* <p class="changed_added_4_0">
* That class contains model of all JSF components asscoiated with that project
@@ -56,7 +49,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
@XmlRootElement(name = "faces-config", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlType(namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, name = "faces-configType")
@@ -72,7 +64,7 @@
*/
private static final long serialVersionUID = -6055670836731899832L;
private final SearchableCollection<Component, Component.Type> components = new ModelCollection<Component,
- Component.Type>() {
+ Component.Type>() {
@Override
public Component create(Component.Type key) {
return new Component(key);
@@ -85,7 +77,7 @@
* </p>
*/
private final SearchableCollection<RenderKit, RenderKit.Id> renderKits = new ModelCollection<RenderKit,
- RenderKit.Id>() {
+ RenderKit.Id>() {
@Override
public RenderKit create(RenderKit.Id key) {
RenderKit rendererKit = new RenderKit(key);
@@ -131,7 +123,7 @@
}
};
private final SearchableCollection<Behavior, Behavior.Type> behaviors = new ModelCollection<Behavior,
- Behavior.Type>() {
+ Behavior.Type>() {
@Override
public Behavior create(Behavior.Type key) {
Behavior behavior = new Behavior(key);
@@ -193,13 +185,10 @@
* Create a new component description.
* </p>
*
- * @param type
- * component type.
- * @param className
- * final component class name.
- * @param superClassName
- * name of the component superclass. May be empty or null for
- * already existed components.
+ * @param type component type.
+ * @param className final component class name.
+ * @param superClassName name of the component superclass. May be empty or null for
+ * already existed components.
* @return
*/
public Component findOrCreateComponent(String type) {
@@ -286,6 +275,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the events
*/
public SearchableCollection<Event, Event.Type> getEvents() {
@@ -306,6 +296,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
public ConfigExtension getExtension() {
@@ -314,6 +305,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extension the extension to set
*/
public void setExtension(ConfigExtension extension) {
@@ -328,12 +320,12 @@
static <K extends Key, T extends ModelElement<T, K>> void merge(Collection<T> target, Collection<T> source) {
for (T element : source) {
T targetElement = null;
-
+
try {
find(target, element.getKey());
} catch (NoSuchElementException e) {
- // TODO: handle exception
- }
+ // TODO: handle exception
+ }
if (null == targetElement) {
target.add(element);
@@ -377,7 +369,7 @@
}
static <R, P, T extends ModelElement<T, ?>> R accept(Iterable<T> components, LibraryVisitor<R, P> visitor, P param,
- R result) throws CdkException {
+ R result) throws CdkException {
if (null == result) {
for (T t : components) {
R accept = t.accept(visitor, param);
@@ -398,19 +390,15 @@
* Find element in the model collection.
* </p>
*
- * @param <T>
- * type of element to find.
- * @param collection
- * of elements.
- * @param key
- * for search.
+ * @param <T> type of element to find.
+ * @param collection of elements.
+ * @param key for search.
* @return existing element in the collection.
- * @throws NoSuchElementException
- * if there was no such element in collection.
+ * @throws NoSuchElementException if there was no such element in collection.
*/
static <K extends Key, T extends Searchable<K>> T find(Iterable<T> collection, final K key)
throws NoSuchElementException {
-
+
return Iterables.find(collection, new Predicate<T>() {
@Override
public boolean apply(T input) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,26 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
-import java.util.List;
+import org.dom4j.Element;
import javax.xml.bind.annotation.XmlAnyElement;
+import java.util.List;
-import org.dom4j.Element;
-
/**
* <p class="changed_added_4_0">That class represents all faces-config "extension" fields.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class ConfigExtension {
private List<Element> extensions;
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extensions
*/
@XmlAnyElement
@@ -50,6 +48,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extensions the extensions to set
*/
public void setExtensions(List<Element> extensions) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@SuppressWarnings("serial")
public class Converter implements ModelElement<Converter, Key> {
@@ -38,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public Converter(Key type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -5,8 +5,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface DescriptionGroup {
@@ -24,8 +24,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param description
- * the description to set
+ * @param description the description to set
*/
public void setDescription(String description);
@@ -43,8 +42,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param displayname
- * the displayname to set
+ * @param displayname the displayname to set
*/
public void setDisplayname(String displayname);
@@ -62,15 +60,14 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param icon
- * the icon to set
+ * @param icon the icon to set
*/
public void setIcon(Icon icon);
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "icon-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public static final class Icon {
@@ -79,6 +76,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the smallIcon
*/
@XmlElement(name = "small-icon", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -88,6 +86,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param smallIcon the smallIcon to set
*/
public void setSmallIcon(String smallIcon) {
@@ -96,6 +95,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the largeIcon
*/
@XmlElement(name = "large-icon", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -105,6 +105,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param largeIcon the largeIcon to set
*/
public void setLargeIcon(String largeIcon) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
@@ -32,7 +30,6 @@
* component.</p>
*
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class Event implements ModelElement<Event, Event.Type> {
@@ -42,12 +39,13 @@
private ClassDescription tagHandler;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private final Type type;
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public Event(Type name) {
@@ -56,6 +54,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
public Key getType() {
@@ -69,6 +68,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the description
*/
public String getDescription() {
@@ -77,6 +77,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param description the description to set
*/
public void setDescription(String description) {
@@ -85,6 +86,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the listenerInterface
*/
public ClassDescription getListenerInterface() {
@@ -93,6 +95,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param listenerInterface the listenerInterface to set
*/
public void setListenerInterface(ClassDescription listenerInterface) {
@@ -101,6 +104,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the sourceInterface
*/
public ClassDescription getSourceInterface() {
@@ -109,6 +113,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param sourceInterface the sourceInterface to set
*/
public void setSourceInterface(ClassDescription sourceInterface) {
@@ -117,6 +122,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tagHandler
*/
public ClassDescription getTagHandler() {
@@ -125,6 +131,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param tagHandler the tagHandler to set
*/
public void setTagHandler(ClassDescription tagHandler) {
@@ -143,13 +150,14 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public static final class Type extends Key {
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type
*/
public Type(String type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
-import java.io.Serializable;
-
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
+import java.io.Serializable;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class EventName implements Serializable {
@@ -42,6 +39,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
@XmlValue
@@ -51,6 +49,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
@@ -59,6 +58,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the defaultEvent
*/
@XmlAttribute(name = "default")
@@ -68,6 +68,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param defaultEvent the defaultEvent to set
*/
public void setDefaultEvent(boolean defaultEvent) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
/**
* <p class="changed_added_4_0">That interface marks all faces-config elements that have 'extension' element.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public interface Extensible<E extends ConfigExtension> {
/**
* <p class="changed_added_4_0">Return extension object that holds CDK-related tags and any other content as well.</p>
+ *
* @return
*/
public E getExtension();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class Facet extends ModelElementBase implements ModelElement<Facet, Facet.Name> {
@@ -39,6 +37,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name
*/
public Facet(Name name) {
@@ -47,6 +46,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
public Name getName() {
@@ -60,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
public boolean isGenerate() {
@@ -68,6 +69,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean generate) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0">That exception indicates what some name does not meet CDK naming conventions.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class InvalidNameException extends CdkException {
@@ -44,6 +42,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public InvalidNameException(String message) {
@@ -52,6 +51,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cause
*/
public InvalidNameException(Throwable cause) {
@@ -60,6 +60,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Key.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Key.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Key.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.io.Serializable;
/**
* <p class="changed_added_4_0">This is a Key class that should be used to find JSF elements in {@link ComponentLibrary}</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class Key implements Serializable {
@@ -38,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type
*/
public Key(String type) {
@@ -46,6 +45,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
public String getType() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/LibraryVisitor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
* @param <R> return type
* @param <P> optional parameter type.
*/
@@ -38,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param c
* @param param
* @return
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,22 +21,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@SuppressWarnings("serial")
public class Listener implements ModelElement<Listener, Key> {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private final Key type;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Merge.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Merge.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Merge.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.lang.annotation.ElementType;
@@ -33,8 +31,8 @@
/**
* <p class="changed_added_4_0">Marker for model bean property that should be merged with other.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@@ -43,6 +41,7 @@
/**
* <p class="changed_added_4_0">If true, target value should be overwritten, otherwise only null values will bw replaced.</p>
+ *
* @return
*/
boolean value() default true;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.richfaces.cdk.CdkException;
-
import com.google.common.base.Predicate;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
+import org.richfaces.cdk.CdkException;
+import java.util.Collection;
+import java.util.Iterator;
+
/**
* <p class="changed_added_4_0">
* Base class for all model collections.
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public abstract class ModelCollection<E extends ModelElement<? super E, K>, K extends Key>
- implements SearchableCollection<E, K>, Visitable, Mergeable<SearchableCollection<E, K>> {
+ implements SearchableCollection<E, K>, Visitable, Mergeable<SearchableCollection<E, K>> {
private final BiMap<K, E> elementsMap = HashBiMap.create();
private final BiMap<E, K> reverseMap = elementsMap.inverse();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -3,4 +3,5 @@
import java.io.Serializable;
public interface ModelElement<T extends ModelElement<T, K>, K extends Key>
- extends Serializable, Mergeable<T>, Searchable<K>, Visitable {}
+ extends Serializable, Mergeable<T>, Searchable<K>, Visitable {
+}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -59,6 +59,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
@XmlElement(name = "component-extensions")
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.util.regex.Pattern;
@@ -34,12 +32,11 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class Name {
private static final Pattern NAME_PATTERN = Pattern.compile("^(?:(.+)\\.)?(?:(" + Classifier.component + "|"
- + Classifier.renderkit + "|" + Classifier.event + "|"
- + Classifier.taglib + ")\\.(?:([^\\.]+)\\.)?)?([^\\.]+)$");
+ + Classifier.renderkit + "|" + Classifier.event + "|"
+ + Classifier.taglib + ")\\.(?:([^\\.]+)\\.)?)?([^\\.]+)$");
/**
* <p class="changed_added_4_0">
@@ -75,27 +72,26 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public enum Classifier {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
component,
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
renderkit,
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
event,
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
taglib;
}
@@ -144,9 +140,10 @@
/**
* <p class="changed_added_4_0">Utility method that composes library prefix from first elements of array</p>
+ *
* @param prefix buffer that collects prefix.
- * @param parts package name parts
- * @param size size of prefix part of array.
+ * @param parts package name parts
+ * @param size size of prefix part of array.
*/
private static void fillPrefix(StringBuilder prefix, String[] parts, int size) {
for (int i = 0; i < size; i++) {
@@ -186,8 +183,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param prefix
- * the prefix to set
+ * @param prefix the prefix to set
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
@@ -207,8 +203,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param classifier
- * the classifier to set
+ * @param classifier the classifier to set
*/
public void setClassifier(Classifier classifier) {
this.classifier = classifier;
@@ -228,8 +223,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param markup
- * the markup to set
+ * @param markup the markup to set
*/
public void setMarkup(String markup) {
this.markup = markup;
@@ -249,8 +243,7 @@
* <p class="changed_added_4_0">
* </p>
*
- * @param simpleName
- * the simpleName to set
+ * @param simpleName the simpleName to set
*/
public void setSimpleName(String simpleName) {
this.simpleName = simpleName;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Properties.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Properties.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Properties.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,24 +21,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+package org.richfaces.cdk.model;
+import com.google.common.collect.Lists;
-package org.richfaces.cdk.model;
-
import java.util.List;
-import com.google.common.collect.Lists;
-
/**
* <p class="changed_added_4_0">That class contains properties collection from standard include file.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class Properties {
private List<? extends Property> properties = Lists.newArrayList();
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the properties
*/
public List<? extends Property> getProperties() {
@@ -47,6 +46,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param properties the properties to set
*/
public void setProperties(List<? extends Property> properties) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-
import org.richfaces.cdk.CdkException;
import java.util.List;
@@ -33,14 +30,14 @@
/**
* That class represents JSF component property.
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class Property extends ModelElementBase implements ModelElement<Property, Property.Name> {
/**
- * <p class="changed_added_4_0">Is that bean property generate in the class or should be generated ?</p>
+ * <p class="changed_added_4_0">Is that bean property generate in the class or should be generated ?</p>
*/
private boolean generate = false;
private boolean hidden = false;
@@ -54,7 +51,7 @@
private String defaultValue;
/**
- * <p class="changed_added_4_0">Bean property name of component attribute</p>
+ * <p class="changed_added_4_0">Bean property name of component attribute</p>
*/
private final Name name;
private String suggestedValue;
@@ -62,6 +59,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name
*/
public Property(Name name) {
@@ -79,6 +77,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
public Name getName() {
@@ -87,6 +86,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@Merge
@@ -96,6 +96,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(ClassDescription type) {
@@ -104,6 +105,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the defaultValue
*/
@Merge
@@ -113,6 +115,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(String dafaultValue) {
@@ -121,6 +124,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the suggestedValue
*/
@Merge
@@ -130,6 +134,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param suggestedValue the suggestedValue to set
*/
public void setSuggestedValue(String suggestedValue) {
@@ -138,6 +143,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
@Merge
@@ -147,6 +153,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean exists) {
@@ -155,6 +162,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the eventNames
*/
@Merge
@@ -164,6 +172,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param eventNames the eventNames to set
*/
public void setEventNames(Set<EventName> eventNames) {
@@ -172,6 +181,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the hidden
*/
public boolean isHidden() {
@@ -180,6 +190,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param hidden the hidden to set
*/
public void setHidden(boolean hidden) {
@@ -188,6 +199,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the literal
*/
public boolean isLiteral() {
@@ -196,6 +208,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param literal the literal to set
*/
public void setLiteral(boolean literal) {
@@ -204,6 +217,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the required
*/
public boolean isRequired() {
@@ -212,6 +226,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param required the required to set
*/
public void setRequired(boolean required) {
@@ -220,6 +235,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param readOnly the readOnly to set
*/
public void setReadOnly(boolean readOnly) {
@@ -228,6 +244,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the readOnly
*/
public boolean isReadOnly() {
@@ -236,6 +253,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the passThrough
*/
public boolean isPassThrough() {
@@ -244,6 +262,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param passThrough the passThrough to set
*/
public void setPassThrough(boolean passThrough) {
@@ -252,6 +271,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the signature
*/
@Merge(true)
@@ -261,6 +281,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param signature the signature to set
*/
public void setSignature(List<ClassDescription> signature) {
@@ -269,6 +290,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the aliases
*/
public Set<String> getAliases() {
@@ -277,6 +299,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param aliases the aliases to set
*/
public void setAliases(Set<String> aliases) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,25 +21,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
-import java.util.Collection;
+import org.richfaces.cdk.CdkException;
import javax.faces.render.RenderKitFactory;
+import java.util.Collection;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class RenderKit extends ModelElementBase implements ModelElement<RenderKit, RenderKit.Id> {
private final SearchableCollection<Renderer, Renderer.Type> renderers = new ModelCollection<Renderer,
- Renderer.Type>() {
+ Renderer.Type>() {
@Override
public Renderer create(Renderer.Type key) {
Renderer renderer = new Renderer(key);
@@ -73,6 +70,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the id
*/
public Id getId() {
@@ -81,6 +79,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderKitClass
*/
@Merge
@@ -90,6 +89,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param renderKitClass the renderKitClass to set
*/
public void setRenderKitClass(ClassDescription renderKitClass) {
@@ -98,6 +98,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderers
*/
public Collection<Renderer> getRenderers() {
@@ -106,6 +107,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the behaviorRenderers
*/
public SearchableCollection<BehaviorRenderer, BehaviorRenderer.Type> getBehaviorRenderers() {
@@ -155,14 +157,15 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public static final class Id extends Key {
/**
* <p class="changed_added_4_0"></p>
+ *
* @param id
*/
public Id(String type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
@@ -30,8 +28,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public class Renderer extends ModelElementBase implements ModelElement<Renderer, Renderer.Type> {
@@ -39,9 +37,9 @@
private ClassDescription rendererClass;
private Template template;
private Type type;
-
+
private boolean rendersChildren;
-
+
private Tag tag;
/**
@@ -50,15 +48,16 @@
* </p>
*/
private final SearchableCollection<Attribute, Property.Name> attributes = new ModelCollection<Attribute,
- Property.Name>() {
+ Property.Name>() {
@Override
public Attribute create(Property.Name key) {
return new Attribute(key);
}
};
-
- public Renderer() {}
+ public Renderer() {
+ }
+
public Renderer(Type type) {
this.type = type;
}
@@ -73,6 +72,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(Type type) {
@@ -85,6 +85,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the template
*/
@Merge
@@ -94,6 +95,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param template the template to set
*/
public void setTemplate(Template template) {
@@ -102,6 +104,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the family
*/
@Merge
@@ -111,6 +114,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param family the family to set
*/
public void setFamily(String family) {
@@ -119,6 +123,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererClass
*/
public ClassDescription getRendererClass() {
@@ -127,6 +132,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendererClass the rendererClass to set
*/
public void setRendererClass(ClassDescription rendererClass) {
@@ -135,6 +141,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendersChildren
*/
public boolean isRendersChildren() {
@@ -143,6 +150,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendersChildren the rendersChildren to set
*/
public void setRendersChildren(boolean rendersChildren) {
@@ -151,6 +159,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the attributes
*/
public SearchableCollection<Attribute, Property.Name> getAttributes() {
@@ -159,6 +168,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tag
*/
public Tag getTag() {
@@ -167,6 +177,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param tag the tag to set
*/
public void setTag(Tag tag) {
@@ -185,8 +196,8 @@
/**
* <p class="changed_added_4_0">Key for lookup renderer in the model.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@SuppressWarnings("serial")
public static class Type extends Key {
@@ -194,6 +205,7 @@
/**
* <p class="changed_added_4_0"></p>
* TODO - use family as part of key ?
+ *
* @param type
*/
public Type(String type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SearchableCollection.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SearchableCollection.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SearchableCollection.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,22 +21,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.util.Collection;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface SearchableCollection<E extends Searchable, K extends Key>
- extends Collection<E>, Visitable, Mergeable<SearchableCollection<E, K>> {
+ extends Collection<E>, Visitable, Mergeable<SearchableCollection<E, K>> {
/**
* <p class="changed_added_4_0">Find element in collection by Key</p>
+ *
* @param key
* @return element from collection for that key, null if no such element.
*/
@@ -44,6 +43,7 @@
/**
* <p class="changed_added_4_0">Look for ilement in collection by key. If such element exists in collection, return that, otherwise create a new one.</p>
+ *
* @param key
* @return
*/
@@ -51,6 +51,7 @@
/**
* <p class="changed_added_4_0">Factory method used to create a component instance.</p>
+ *
* @param key
* @return
*/
@@ -58,6 +59,7 @@
/**
* <p class="changed_added_4_0">Return collection of all components keys.</p>
+ *
* @return
*/
public Iterable<K> keys();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Tag.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Tag.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Tag.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,46 +21,44 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
/**
* <p class="changed_added_4_0">That bean represents VDL tag</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class Tag {
/**
- * <p class="changed_added_4_0">Component that the tag creates. This in bidirectional one to one relation.</p>
- * TODO - tag should also works with {@code Validator}, {@code Converter}, {@code Behavior}, {@code FacesListener}
+ * <p class="changed_added_4_0">Component that the tag creates. This in bidirectional one to one relation.</p>
+ * TODO - tag should also works with {@code Validator}, {@code Converter}, {@code Behavior}, {@code FacesListener}
*/
private Searchable component;
/**
- * <p class="changed_added_4_0">Jsp tag class</p>
+ * <p class="changed_added_4_0">Jsp tag class</p>
*/
private String jspClass;
/**
- * <p class="changed_added_4_0">Tag library for which that tag is belong.
- * This is bidirectional many to one relation.</p>
+ * <p class="changed_added_4_0">Tag library for which that tag is belong.
+ * This is bidirectional many to one relation.</p>
*/
private TagLibrary library;
/**
- * <p class="changed_added_4_0">Tag name</p>
+ * <p class="changed_added_4_0">Tag name</p>
*/
private String name;
/**
- * <p class="changed_added_4_0">Facelets VDL tag handler class.</p>
+ * <p class="changed_added_4_0">Facelets VDL tag handler class.</p>
*/
private String tagHandlerClass;
/**
- * <p class="changed_added_4_0">Facelets VDL tag handler base class for generation.</p>
+ * <p class="changed_added_4_0">Facelets VDL tag handler base class for generation.</p>
*/
private String tagHandlerSuperClass;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagLibrary.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagLibrary.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.util.ArrayList;
@@ -30,18 +28,19 @@
/**
* <p class="changed_added_4_0">That bean represents whole tag library.</p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class TagLibrary {
/**
- * <p class="changed_added_4_0">Collection of tags associated with that library</p>
+ * <p class="changed_added_4_0">Collection of tags associated with that library</p>
*/
private final List<Tag> tags = new ArrayList<Tag>();
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tags
*/
public List<Tag> getTags() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Trackable.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -2,13 +2,14 @@
/**
* <p class="changed_added_4_0">Interface for model components that have related modification time.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface Trackable {
/**
* <p class="changed_added_4_0">Last modification time for model information.</p>
+ *
* @return
*/
public long lastModified();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,16 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import org.richfaces.cdk.CdkException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@SuppressWarnings("serial")
public class Validator implements ModelElement<Validator, Key> {
@@ -38,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public Validator(Key type) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -6,6 +6,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param <R>
* @param <P>
* @param visitor
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -20,6 +20,6 @@
)
package org.richfaces.cdk.model;
+import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/package-info.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/package-info.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,4 +1,3 @@
-
/**
* <h2>Public CDK API classes.</h2>
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el;
public final class ELNodeConstants {
-
- //operators
+
+ //operators
public static final String AND_OPERATOR = " && ";
public static final String DIV_OPERATOR = " / ";
public static final String EQUALITY_OPERATOR = " == ";
@@ -40,13 +38,13 @@
public static final String OR_OPERATOR = " || ";
public static final String PLUS_OPERATOR = " + ";
//
-
+
//constant values
public static final String FALSE_VALUE = "false";
public static final String NULL_VALUE = "null";
public static final String TRUE_VALUE = "true";
//
-
+
public static final String ARRAY_INDICATOR = "[L";
public static final String COLON = " : ";
public static final String COMMA = ",";
@@ -70,5 +68,6 @@
public static final String THIS_PREFIX = "this";
public static final String UTILS_PREFIX = "utils";
- private ELNodeConstants() {}
+ private ELNodeConstants() {
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELReflectionUtils.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,10 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el;
+import org.jboss.el.parser.*;
+import org.richfaces.cdk.parser.el.node.*;
+
import java.beans.BeanInfo;
import java.beans.IndexedPropertyDescriptor;
import java.beans.IntrospectionException;
@@ -35,77 +36,27 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.el.parser.AstAnd;
-import org.jboss.el.parser.AstBracketSuffix;
-import org.jboss.el.parser.AstChoice;
-import org.jboss.el.parser.AstDeferredExpression;
-import org.jboss.el.parser.AstDiv;
-import org.jboss.el.parser.AstDynamicExpression;
-import org.jboss.el.parser.AstEmpty;
-import org.jboss.el.parser.AstEqual;
-import org.jboss.el.parser.AstFalse;
-import org.jboss.el.parser.AstFloatingPoint;
-import org.jboss.el.parser.AstFunction;
-import org.jboss.el.parser.AstGreaterThan;
-import org.jboss.el.parser.AstGreaterThanEqual;
-import org.jboss.el.parser.AstIdentifier;
-import org.jboss.el.parser.AstInteger;
-import org.jboss.el.parser.AstLessThan;
-import org.jboss.el.parser.AstLessThanEqual;
-import org.jboss.el.parser.AstLiteralExpression;
-import org.jboss.el.parser.AstMethodSuffix;
-import org.jboss.el.parser.AstMinus;
-import org.jboss.el.parser.AstMod;
-import org.jboss.el.parser.AstMult;
-import org.jboss.el.parser.AstNegative;
-import org.jboss.el.parser.AstNot;
-import org.jboss.el.parser.AstNotEqual;
-import org.jboss.el.parser.AstNull;
-import org.jboss.el.parser.AstOr;
-import org.jboss.el.parser.AstPlus;
-import org.jboss.el.parser.AstPropertySuffix;
-import org.jboss.el.parser.AstString;
-import org.jboss.el.parser.AstTrue;
-import org.jboss.el.parser.AstValue;
-import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.node.AstBracketSuffixTreeNode;
-import org.richfaces.cdk.parser.el.node.AstChoiceTreeNode;
-import org.richfaces.cdk.parser.el.node.AstDeferredOrDynamicExpressionTreeNode;
-import org.richfaces.cdk.parser.el.node.AstEmptyTreeNode;
-import org.richfaces.cdk.parser.el.node.AstFloatingPointTreeNode;
-import org.richfaces.cdk.parser.el.node.AstFunctionTreeNode;
-import org.richfaces.cdk.parser.el.node.AstIdentifierTreeNode;
-import org.richfaces.cdk.parser.el.node.AstIntegerTreeNode;
-import org.richfaces.cdk.parser.el.node.AstLiteralTreeNode;
-import org.richfaces.cdk.parser.el.node.AstMethodSuffixTreeNode;
-import org.richfaces.cdk.parser.el.node.AstNegativeTreeNode;
-import org.richfaces.cdk.parser.el.node.AstNotTreeNode;
-import org.richfaces.cdk.parser.el.node.AstPropertySuffixTreeNode;
-import org.richfaces.cdk.parser.el.node.AstStringTreeNode;
-import org.richfaces.cdk.parser.el.node.AstValueTreeNode;
-import org.richfaces.cdk.parser.el.node.BinaryOperationTreeNode;
-import org.richfaces.cdk.parser.el.node.ConstantValueTreeNode;
-import org.richfaces.cdk.parser.el.node.ITreeNode;
-
/**
* Class, that encapsulate all functionality, related to Reflection calls, such as loading classes, get property
* descriptors etc...
- * @author amarkhel
*
+ * @author amarkhel
*/
public final class ELReflectionUtils {
private static final Class<?>[] EMPTY_CLASS_PARAMETERS = new Class<?>[0];
private static Map<String, Map<String, PropertyDescriptor>> resolvedProperties =
- new HashMap<String, Map<String, PropertyDescriptor>>();
+ new HashMap<String, Map<String, PropertyDescriptor>>();
- private ELReflectionUtils() { }
+ private ELReflectionUtils() {
+ }
/**
* This method determine type of parsed node and create wrapper for them, that extends AbstractTreeNode.
* If node type is not recognized - throws ParsingException.
+ *
* @param child - parsed node
- * @throws ParsingException - if node type is not recognized.
* @return wrapper for parsed node(if node type is recognized), that implement ITreeNode interface.
+ * @throws ParsingException - if node type is not recognized.
*/
public static ITreeNode determineNodeType(Node child) throws ParsingException {
ITreeNode treeNode = null;
@@ -179,13 +130,14 @@
}
//TODO: add support for closures
-
+
return treeNode;
}
/**
* This method return PropertyDescriptor by specified propertyName and clazz.
- * @param clazz - class to search
+ *
+ * @param clazz - class to search
* @param propertyName - propertyName to search
* @return property descriptor if found.
* @throws ParsingException if error occured.
@@ -205,6 +157,7 @@
/**
* This method resolve all properties of specified class.
+ *
* @param clazz - class to resolve
* @return Map<String, PropertyDescriptor>, populated by property descriptors.
* @throws ParsingException if error occured.
@@ -227,9 +180,10 @@
/**
* This method load specified class.
+ *
* @param className - class to load.
- * @throws ClassNotFoundException if class not found.
* @return loaded class.
+ * @throws ClassNotFoundException if class not found.
*/
private static Class<?> loadClass(Class<?> className) throws ClassNotFoundException {
Class<?> clazz = null;
@@ -253,9 +207,10 @@
/**
* This method load class by specified representation of class name..
+ *
* @param className - string representation of class.
- * @throws ClassNotFoundException if class not found.
* @return loaded class.
+ * @throws ClassNotFoundException if class not found.
*/
private static Class<?> loadClass(String className) throws ClassNotFoundException {
Class<?> clazz = null;
@@ -277,14 +232,13 @@
* <p>Retrieve the property descriptors for the specified class,
* introspecting and caching them the first time a particular bean class
* is encountered.</p>
- *
+ * <p/>
* <p><strong>FIXME</strong> - Does not work with DynaBeans.</p>
*
* @param beanClass Bean class for which property descriptors are requested
* @return the property descriptors
- * @throws ParsingException if error occured.
- *
- * @exception IllegalArgumentException if <code>beanClass</code> is null
+ * @throws ParsingException if error occured.
+ * @throws IllegalArgumentException if <code>beanClass</code> is null
*/
private static PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) throws ParsingException {
if (beanClass == null) {
@@ -313,11 +267,11 @@
if (descriptors[i] instanceof IndexedPropertyDescriptor) {
IndexedPropertyDescriptor descriptor = (IndexedPropertyDescriptor) descriptors[i];
String propName = descriptor.getName().substring(0, 1).toUpperCase()
- + descriptor.getName().substring(1);
+ + descriptor.getName().substring(1);
if (descriptor.getReadMethod() == null) {
String methodName = descriptor.getIndexedReadMethod() != null
- ? descriptor.getIndexedReadMethod().getName() : "get" + propName;
+ ? descriptor.getIndexedReadMethod().getName() : "get" + propName;
Method readMethod = getMatchingAccessibleMethod(beanClass, methodName, EMPTY_CLASS_PARAMETERS);
if (readMethod != null) {
@@ -341,20 +295,20 @@
* the given parameters.
* In other words, it finds a method with the given name
* that will take the parameters given.<p>
- *
+ * <p/>
* <p>This method is slightly undeterminstic since it loops
* through methods names and return the first matching method.</p>
- *
+ * <p/>
* <p>This method is used by
* {@link
* #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)}.
- *
+ * <p/>
* <p>This method can match primitive parameter by passing in wrapper classes.
* For example, a <code>Boolean</code> will match a primitive <code>boolean</code>
* parameter.
*
- * @param clazz find method in this class
- * @param methodName find method with this name
+ * @param clazz find method in this class
+ * @param methodName find method with this name
* @param parameterTypes find method with compatible parameters
* @return The accessible method
* @throws ParsingException if error occured.
@@ -428,7 +382,7 @@
* reflection) that implements the specified Method. If no such method
* can be found, return <code>null</code>.</p>
*
- * @param clazz The class of the object
+ * @param clazz The class of the object
* @param method The method that we wish to call
* @return The accessible method
* @throws ParsingException if error occured.
@@ -454,7 +408,7 @@
if (!method.getDeclaringClass().isAssignableFrom(clazz)) {
throw new IllegalArgumentException(clazz.getName() + " is not assignable from "
- + method.getDeclaringClass().getName());
+ + method.getDeclaringClass().getName());
}
}
@@ -486,12 +440,12 @@
* reflection) by scanning through the superclasses. If no such method
* can be found, return <code>null</code>.</p>
*
- * @param clazz Class to be checked
- * @param methodName Method name of the method we wish to call
+ * @param clazz Class to be checked
+ * @param methodName Method name of the method we wish to call
* @param parameterTypes The parameter type signatures
*/
private static Method getAccessibleMethodFromSuperclass(Class<?> clazz, String methodName,
- Class<?>[] parameterTypes) {
+ Class<?>[] parameterTypes) {
Class<?> parentClazz = clazz.getSuperclass();
while (parentClazz != null) {
@@ -514,17 +468,17 @@
* reflection) that implements the specified method, by scanning through
* all implemented interfaces and subinterfaces. If no such method
* can be found, return <code>null</code>.</p>
- *
+ * <p/>
* <p> There isn't any good reason why this method must be private.
* It is because there doesn't seem any reason why other classes should
* call this rather than the higher level methods.</p>
*
- * @param clazz Parent class for the interfaces to be checked
- * @param methodName Method name of the method we wish to call
+ * @param clazz Parent class for the interfaces to be checked
+ * @param methodName Method name of the method we wish to call
* @param parameterTypes The parameter type signatures
*/
private static Method getAccessibleMethodFromInterfaceNest(Class<?> clazz, String methodName,
- Class<?>[] parameterTypes) {
+ Class<?>[] parameterTypes) {
Method method = null;
// Search up the superclass chain
@@ -576,7 +530,8 @@
/**
* Returns the sum of the object transformation cost for each class in the source
* argument list.
- * @param srcArgs The source arguments
+ *
+ * @param srcArgs The source arguments
* @param destArgs The destination arguments
* @return The total transformation cost
*/
@@ -597,7 +552,8 @@
* Gets the number of steps required needed to turn the source class into the
* destination class. This represents the number of steps in the object hierarchy
* graph.
- * @param srcClass The source class
+ *
+ * @param srcClass The source class
* @param destClass The destination class
* @return The cost of transforming an object
*/
@@ -634,7 +590,7 @@
/**
* <p>Determine whether a type can be used as a parameter in a method invocation.
* This method handles primitive conversions correctly.</p>
- *
+ * <p/>
* <p>In order words, it will match a <code>Boolean</code> to a <code>boolean</code>,
* a <code>Long</code> to a <code>long</code>,
* a <code>Float</code> to a <code>float</code>,
@@ -643,9 +599,8 @@
* Now logic widening matches are allowed.
* For example, a <code>Long</code> will not match a <code>int</code>.
*
- * @param parameterType the type of parameter accepted by the method
+ * @param parameterType the type of parameter accepted by the method
* @param parameterization the type of parameter being tested
- *
* @return true if the assignement is compatible.
*/
private static boolean isAssignmentCompatible(Class<?> parameterType, Class<?> parameterization) {
@@ -672,9 +627,10 @@
/**
* Gets the wrapper object class for the given primitive type class.
* For example, passing <code>boolean.class</code> returns <code>Boolean.class</code>
+ *
* @param primitiveType the primitive type class for which a match is to be found
* @return the wrapper type associated with the given primitive
- * or null if no match is found
+ * or null if no match is found
*/
private static Class<?> getPrimitiveWrapper(Class<?> primitiveType) {
@@ -702,6 +658,7 @@
/**
* Try to make the method accessible
+ *
* @param method The source arguments
* @throws ParsingException if error occured during call setAccessible method.
*/
@@ -733,10 +690,11 @@
/**
* Gets the name of read method for specified property name.
+ *
* @param propertyName - property to lookup
- * @param visitor - ELVisitor instance
- * @throws ParsingException - if property not found or class not found.
+ * @param visitor - ELVisitor instance
* @return String representation of read method of specified property.
+ * @throws ParsingException - if property not found or class not found.
*/
public static String getReadMethodName(String propertyName, ELVisitor visitor) throws ParsingException {
try {
@@ -745,7 +703,7 @@
if (propertyDescriptor == null) {
throw new ParsingException("property: " + propertyName + " not found in class: "
- + visitor.getLastVariableType());
+ + visitor.getLastVariableType());
}
Class<?> propertyType = propertyDescriptor.getPropertyType();
@@ -782,7 +740,7 @@
visitor.setCollectionVariableType(readMethod.getReturnType());
String className = visitor.getCollectionVariableType().getName().substring(0,
- visitor.getCollectionVariableType().getName().length() - 1).substring(2);
+ visitor.getCollectionVariableType().getName().length() - 1).substring(2);
visitor.setCollectionVariableType(loadClass(className));
}
@@ -797,7 +755,6 @@
public void visit(Class<?> clazz) throws ParsingException;
}
-
static class ClassWalkingLogic {
private Class<?> clazz;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,21 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el;
-import java.util.Map;
-
import org.jboss.el.parser.AstCompositeExpression;
import org.jboss.el.parser.ELParser;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.node.ITreeNode;
+import java.util.Map;
+
/**
* Entry point for parsing EL expressions. @see parse() method.
+ *
* @author amarkhel
- *
*/
public final class ELVisitor {
private static ELVisitor elVisitor;
@@ -42,9 +40,10 @@
Class<?> lastVariableType = null;
boolean useConversionToString;
boolean useEmptinessCheck;
-
- private ELVisitor() {}
+ private ELVisitor() {
+ }
+
public static ELVisitor getInstance() {
if (elVisitor == null) {
elVisitor = new ELVisitor();
@@ -63,14 +62,14 @@
this.useConversionToString = needConversion;
}
- public boolean isUseEmptinessCheck() {
- return useEmptinessCheck;
- }
-
- public void setUseEmptinessCheck(boolean useCheckForEmpty) {
- this.useEmptinessCheck = useCheckForEmpty;
- }
-
+ public boolean isUseEmptinessCheck() {
+ return useEmptinessCheck;
+ }
+
+ public void setUseEmptinessCheck(boolean useCheckForEmpty) {
+ this.useEmptinessCheck = useCheckForEmpty;
+ }
+
public String getLastIndexValue() {
return lastIndexValue;
}
@@ -97,6 +96,7 @@
/**
* Parse specified EL expression and return Java code, that represent this expression
+ *
* @param expression - expression to resolve
* @param contextMap - Map<String, Class<?>> - context for search classes.
* @return generated Java code.
@@ -106,11 +106,11 @@
Node ret = ELParser.parse(expression);
if (ret instanceof AstCompositeExpression && ret.jjtGetNumChildren() >= 2) {
- //AstCompositeExpression with 2+ children is a mixed expression
- this.setUseConversionToString(true);
+ //AstCompositeExpression with 2+ children is a mixed expression
+ this.setUseConversionToString(true);
}
-
- return this.visit(ret, contextMap);
+
+ return this.visit(ret, contextMap);
}
private String visit(Node node, Map<String, Class<?>> context) throws ParsingException {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ParsingException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ParsingException.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ParsingException.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,19 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el;
/**
* Parsing Exception
- * @author amarkhel
*
+ * @author amarkhel
*/
public class ParsingException extends Exception {
private static final long serialVersionUID = 6045782920008419804L;
- public ParsingException() {}
+ public ParsingException() {
+ }
/**
* @param message
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,66 +19,65 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el;
import java.util.Locale;
public final class StringUtils {
- private StringUtils() {}
+ private StringUtils() {
+ }
- private static String toCharExpression(char c) {
- String prependingZeroesString;
- String hexString = Integer.toHexString(c);
-
- switch (hexString.length()) {
- case 1:
- prependingZeroesString = "000";
- break;
- case 2:
- prependingZeroesString = "00";
- break;
- case 3:
- prependingZeroesString = "0";
- break;
- case 4:
- prependingZeroesString = "";
- break;
- default:
- throw new IllegalArgumentException();
- }
-
- return "\\u" + prependingZeroesString + hexString.toUpperCase(Locale.US);
- }
-
- public static String getEscapedString(String s) {
+ private static String toCharExpression(char c) {
+ String prependingZeroesString;
+ String hexString = Integer.toHexString(c);
+
+ switch (hexString.length()) {
+ case 1:
+ prependingZeroesString = "000";
+ break;
+ case 2:
+ prependingZeroesString = "00";
+ break;
+ case 3:
+ prependingZeroesString = "0";
+ break;
+ case 4:
+ prependingZeroesString = "";
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+
+ return "\\u" + prependingZeroesString + hexString.toUpperCase(Locale.US);
+ }
+
+ public static String getEscapedString(String s) {
StringBuilder result = new StringBuilder();
char[] chars = s.toCharArray();
for (char c : chars) {
- if (c == '\n') {
+ if (c == '\n') {
result.append("\\n");
- } else if (c == '\r') {
+ } else if (c == '\r') {
result.append("\\r");
- } else if (c == '\t') {
+ } else if (c == '\t') {
result.append("\\t");
- } else if (c == '\f') {
- result.append("\\f");
- } else if (c == '\b') {
- result.append("\\b");
- } else if (c == '\\') {
- result.append("\\\\");
- } else if (c == '"') {
- result.append("\\\"");
- } else {
+ } else if (c == '\f') {
+ result.append("\\f");
+ } else if (c == '\b') {
+ result.append("\\b");
+ } else if (c == '\\') {
+ result.append("\\\\");
+ } else if (c == '"') {
+ result.append("\\\"");
+ } else {
if (c < 0x20 || c > 0x7F) {
result.append(toCharExpression(c));
} else {
- result.append(c);
+ result.append(c);
}
- }
+ }
}
return result.toString();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AbstractTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELReflectionUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This abstract class implement some methods of ITreeNode interface to using in subclasses.
*
* @author amarkhel
- *
*/
public abstract class AbstractTreeNode implements ITreeNode {
private Node node;
@@ -43,30 +39,30 @@
public AbstractTreeNode(Node node) {
this.node = node;
}
-
+
/**
- * Collects output from visiting child of the current node with the specified index and returns
+ * Collects output from visiting child of the current node with the specified index and returns
* collected string.
- *
+ *
* @param childIndex
* @param context
* @param visitor
* @return
* @throws ParsingException
*/
- protected String getChildOutput(int childIndex, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
-
- StringBuilder sb = new StringBuilder();
- getChild(childIndex).visit(sb, context, visitor);
-
- return sb.toString();
+ protected String getChildOutput(int childIndex, Map<String, Class<?>> context,
+ ELVisitor visitor) throws ParsingException {
+
+ StringBuilder sb = new StringBuilder();
+ getChild(childIndex).visit(sb, context, visitor);
+
+ return sb.toString();
}
/**
* Return node of current wrapper.
- * @return instance of org.jboss.el.parser.Node
*
+ * @return instance of org.jboss.el.parser.Node
*/
public Node getNode() {
return node;
@@ -74,12 +70,12 @@
/**
* Visit current node. Generate Java code, that represent current node.
+ *
* @param stringBuilder instance to collect information.
- * @param context - context to resolve beans
- * @param visitor - ELVisitor
- * @throws ParsingException - if error occurred during parsing process.
+ * @param context - context to resolve beans
+ * @param visitor - ELVisitor
* @return instance of org.jboss.el.parser.Node
- *
+ * @throws ParsingException - if error occurred during parsing process.
*/
public ITreeNode getChild(int index) throws ParsingException {
Node childNode = getNode().jjtGetChild(index);
@@ -95,12 +91,12 @@
/**
* Return child of wrapped node by specified index. Abstract operation to override in subclasses.
+ *
* @param index - index of child.
- * @throws ParsingException - if error occurred(child not found).
* @return wrapper for child
- *
+ * @throws ParsingException - if error occurred(child not found).
*/
public abstract void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor)
throws ParsingException;
-
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstBracketSuffixTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstBracketSuffix node.
*
* @author amarkhel
- *
*/
public class AstBracketSuffixTreeNode extends AbstractTreeNode {
public AstBracketSuffixTreeNode(Node node) {
@@ -47,28 +43,28 @@
String suffixValue = getChildOutput(0, context, visitor);
if (visitor.getLastVariableType() != null) {
- if (visitor.getLastVariableType().getName().startsWith(ELNodeConstants.ARRAY_INDICATOR)) {
- sb.append(ELNodeConstants.LEFT_SQUARE_BRACKET);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_SQUARE_BRACKET);
- visitor.setLastVariableType(visitor.getCollectionVariableType());
- }
+ if (visitor.getLastVariableType().getName().startsWith(ELNodeConstants.ARRAY_INDICATOR)) {
+ sb.append(ELNodeConstants.LEFT_SQUARE_BRACKET);
+ sb.append(suffixValue);
+ sb.append(ELNodeConstants.RIGHT_SQUARE_BRACKET);
+ visitor.setLastVariableType(visitor.getCollectionVariableType());
+ }
- if ((visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_LIST) == 0)
- || (visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_MAP) == 0)) {
- sb.append(ELNodeConstants.GET_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
- visitor.setLastVariableType(visitor.getCollectionVariableType());
- }
+ if ((visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_LIST) == 0)
+ || (visitor.getLastVariableType().getName().compareTo(ELNodeConstants.JAVA_UTIL_MAP) == 0)) {
+ sb.append(ELNodeConstants.GET_FUNCTION);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(suffixValue);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+ visitor.setLastVariableType(visitor.getCollectionVariableType());
+ }
} else {
- sb.append(ELNodeConstants.GET_ELEMENT_BY_INDEX_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(visitor.getLastIndexValue());
- sb.append(ELNodeConstants.COMMA);
- sb.append(suffixValue);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
+ sb.append(ELNodeConstants.GET_ELEMENT_BY_INDEX_FUNCTION);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(visitor.getLastIndexValue());
+ sb.append(ELNodeConstants.COMMA);
+ sb.append(suffixValue);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
}
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstChoiceTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstChoice node.
*
* @author amarkhel
- *
*/
public class AstChoiceTreeNode extends AbstractTreeNode {
public AstChoiceTreeNode(Node node) {
@@ -50,13 +46,13 @@
String condition = getChildOutput(0, context, visitor);
String correctConditionBranch = getChildOutput(1, context, visitor);
String incorrectConditionBranch = getChildOutput(2, context, visitor);
-
+
sb.append(condition);
sb.append(ELNodeConstants.QUESTION_SIGN);
sb.append(correctConditionBranch);
sb.append(ELNodeConstants.COLON);
sb.append(incorrectConditionBranch);
-
+
sb.append(ELNodeConstants.RIGHT_BRACKET);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,27 +19,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstDeferredExpression node.
*
* @author amarkhel
- *
*/
public class AstDeferredOrDynamicExpressionTreeNode extends AbstractTreeNode {
-
- public AstDeferredOrDynamicExpressionTreeNode(Node node) {
+
+ public AstDeferredOrDynamicExpressionTreeNode(Node node) {
super(node);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstEmpty node.
*
* @author amarkhel
- *
*/
public class AstEmptyTreeNode extends AbstractTreeNode {
public AstEmptyTreeNode(Node node) {
@@ -45,8 +41,8 @@
@Override
public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
visitor.setUseEmptinessCheck(true);
-
- StringBuilder sb1 = new StringBuilder();
+
+ StringBuilder sb1 = new StringBuilder();
ITreeNode treeNode = getChild(0);
treeNode.visit(sb1, context, visitor);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFloatingPointTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,22 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstFloatingPoint node.
*
* @author amarkhel
- *
*/
public class AstFloatingPointTreeNode extends AbstractTreeNode {
public AstFloatingPointTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstFunctionTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,24 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.AstFunction;
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstFunction node.
*
* @author amarkhel
- *
*/
public class AstFunctionTreeNode extends AbstractTreeNode {
public AstFunctionTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIdentifierTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,49 +19,45 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstIdentifier node.
*
* @author amarkhel
- *
*/
public class AstIdentifierTreeNode extends AbstractTreeNode {
- public AstIdentifierTreeNode(Node node) {
- super(node);
- }
+ public AstIdentifierTreeNode(Node node) {
+ super(node);
+ }
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
- String variableName = getNode().getImage();
+ @Override
+ public void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException {
+ String variableName = getNode().getImage();
- if (context.containsKey(variableName)) {
- visitor.setLastVariableType(context.get(variableName));
- sb.append(variableName);
- } else {
- //TODO - what's then?
- if (variableName.equals(ELNodeConstants.THIS_PREFIX)) {
- sb.append(variableName);
- } else if (variableName.equals(ELNodeConstants.UTILS_PREFIX)) {
- sb.append(ELNodeConstants.THIS_PREFIX);
- sb.append(ELNodeConstants.DOT);
- sb.append(ELNodeConstants.GET_UTILS_FUNCTION);
- sb.append(ELNodeConstants.LEFT_BRACKET);
- sb.append(ELNodeConstants.RIGHT_BRACKET);
- } else {
+ if (context.containsKey(variableName)) {
+ visitor.setLastVariableType(context.get(variableName));
+ sb.append(variableName);
+ } else {
+ //TODO - what's then?
+ if (variableName.equals(ELNodeConstants.THIS_PREFIX)) {
+ sb.append(variableName);
+ } else if (variableName.equals(ELNodeConstants.UTILS_PREFIX)) {
+ sb.append(ELNodeConstants.THIS_PREFIX);
+ sb.append(ELNodeConstants.DOT);
+ sb.append(ELNodeConstants.GET_UTILS_FUNCTION);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+ } else {
// throw new ParsingException("No instance found in context for identifier " + variableName);
- }
- }
- }
+ }
+ }
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstIntegerTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,22 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstInteger node.
*
* @author amarkhel
- *
*/
public class AstIntegerTreeNode extends AbstractTreeNode {
public AstIntegerTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,24 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstLiteral node.
*
* @author amarkhel
- *
*/
public class AstLiteralTreeNode extends AbstractTreeNode {
public AstLiteralTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstMethodSuffixTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstMethodSuffix node.
*
* @author amarkhel
- *
*/
public class AstMethodSuffixTreeNode extends AbstractTreeNode {
public AstMethodSuffixTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNegativeTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstNegative node.
*
* @author amarkhel
- *
*/
public class AstNegativeTreeNode extends AbstractTreeNode {
public AstNegativeTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstNotTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,23 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstNot node.
*
* @author amarkhel
- *
*/
public class AstNotTreeNode extends AbstractTreeNode {
public AstNotTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstPropertySuffixTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,24 +19,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELReflectionUtils;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstPropertySuffix node.
*
* @author amarkhel
- *
*/
public class AstPropertySuffixTreeNode extends AbstractTreeNode {
public AstPropertySuffixTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,12 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.AstString;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
@@ -32,11 +28,12 @@
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstString node.
*
* @author amarkhel
- *
*/
public class AstStringTreeNode extends AbstractTreeNode {
public AstStringTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstValueTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,25 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
/**
* This class extend AbstractTreeNode and wrap AstValue node.
*
* @author amarkhel
- *
*/
public class AstValueTreeNode extends AbstractTreeNode {
public AstValueTreeNode(Node node) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/BinaryOperationTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,49 +21,47 @@
*/
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* <p>Abstract class for all binary (having two operands) operation expression nodes</p>
* <p>For operands <code>A</code> and <code>B</code> and operator <code>x</code> output is <code>(A x B)</code></p>
- *
+ *
* @author Nick Belaevski
*/
public class BinaryOperationTreeNode extends AbstractTreeNode {
- private final String operatorString;
+ private final String operatorString;
- public BinaryOperationTreeNode(Node node, String operatorString) {
- super(node);
+ public BinaryOperationTreeNode(Node node, String operatorString) {
+ super(node);
- this.operatorString = operatorString;
- }
+ this.operatorString = operatorString;
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
- */
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
+ */
+ @Override
+ public void visit(StringBuilder sb, Map<String, Class<?>> context,
+ ELVisitor visitor) throws ParsingException {
- sb.append(ELNodeConstants.LEFT_BRACKET);
+ sb.append(ELNodeConstants.LEFT_BRACKET);
String firstChildOutput = getChildOutput(0, context, visitor);
- String secondChildOutput = getChildOutput(1, context, visitor);
+ String secondChildOutput = getChildOutput(1, context, visitor);
- sb.append(firstChildOutput);
- sb.append(operatorString);
- sb.append(secondChildOutput);
-
- sb.append(ELNodeConstants.RIGHT_BRACKET);
-
- }
-
-
-
+ sb.append(firstChildOutput);
+ sb.append(operatorString);
+ sb.append(secondChildOutput);
+
+ sb.append(ELNodeConstants.RIGHT_BRACKET);
+
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ConstantValueTreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,39 +21,39 @@
*/
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* @author Nick Belaevski
- *
*/
-public class ConstantValueTreeNode extends AbstractTreeNode {
+public final class ConstantValueTreeNode extends AbstractTreeNode {
- private final String value;
+ public static final ConstantValueTreeNode NULL_NODE = new ConstantValueTreeNode(ELNodeConstants.NULL_VALUE);
- public static final ConstantValueTreeNode NULL_NODE = new ConstantValueTreeNode(ELNodeConstants.NULL_VALUE);
-
- public static final ConstantValueTreeNode TRUE_NODE = new ConstantValueTreeNode(ELNodeConstants.TRUE_VALUE);
-
- public static final ConstantValueTreeNode FALSE_NODE = new ConstantValueTreeNode(ELNodeConstants.FALSE_VALUE);
+ public static final ConstantValueTreeNode TRUE_NODE = new ConstantValueTreeNode(ELNodeConstants.TRUE_VALUE);
- private ConstantValueTreeNode(String value) {
- super(null);
- this.value = value;
- }
+ public static final ConstantValueTreeNode FALSE_NODE = new ConstantValueTreeNode(ELNodeConstants.FALSE_VALUE);
- /* (non-Javadoc)
- * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map, org.richfaces.cdk.parser.el.ELVisitor)
- */
- @Override
- public void visit(StringBuilder sb, Map<String, Class<?>> context,
- ELVisitor visitor) throws ParsingException {
+ private final String value;
- sb.append(value);
- }
-
+ private ConstantValueTreeNode(String value) {
+ super(null);
+ this.value = value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.parser.el.node.AbstractTreeNode#visit(java.lang.StringBuilder, java.util.Map,
+ * org.richfaces.cdk.parser.el.ELVisitor)
+ */
+ @Override
+ public void visit(StringBuilder sb, Map<String, Class<?>> context,
+ ELVisitor visitor) throws ParsingException {
+
+ sb.append(value);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/ITreeNode.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,48 +19,45 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.parser.el.node;
-import java.util.Map;
-
import org.jboss.el.parser.Node;
-
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
+import java.util.Map;
+
/**
* Interface for all wrappers of org.jboss.el.parser.Node class.
- * @author amarkhel
*
+ * @author amarkhel
*/
public interface ITreeNode {
/**
* Return node of current wrapper.
- * @return instance of org.jboss.el.parser.Node
*
+ * @return instance of org.jboss.el.parser.Node
*/
Node getNode();
/**
* Visit current node. Generate Java code, that represent current node.
+ *
* @param stringBuilder instance to collect information.
- * @param context - context to resolve beans
- * @param visitor - ELVisitor
- * @throws ParsingException - if error occurred during parsing process.
+ * @param context - context to resolve beans
+ * @param visitor - ELVisitor
* @return instance of org.jboss.el.parser.Node
- *
+ * @throws ParsingException - if error occurred during parsing process.
*/
void visit(StringBuilder sb, Map<String, Class<?>> context, ELVisitor visitor) throws ParsingException;
/**
* Return child of wrapped node by specified index
+ *
* @param index - index of child.
- * @throws ParsingException - if error occurred(child not found).
* @return wrapper for child
- *
+ * @throws ParsingException - if error occurred(child not found).
*/
ITreeNode getChild(int index) throws ParsingException;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -25,20 +25,19 @@
/**
* @author Nick Belaevski
- *
*/
public class AbstractTemplateMethodBodyStatement implements MethodBodyStatement {
- private String templateName;
-
- protected AbstractTemplateMethodBodyStatement(String templateName) {
- super();
- this.templateName = templateName;
- }
+ private String templateName;
- @Override
- public String getCode(FreeMarkerRenderer renderer) {
- return renderer.renderSnippet(templateName, this);
- }
+ protected AbstractTemplateMethodBodyStatement(String templateName) {
+ super();
+ this.templateName = templateName;
+ }
+ @Override
+ public String getCode(FreeMarkerRenderer renderer) {
+ return renderer.renderSnippet(templateName, this);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatementsContainer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatementsContainer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/AbstractTemplateMethodBodyStatementsContainer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -25,20 +25,19 @@
/**
* @author Nick Belaevski
- *
*/
public class AbstractTemplateMethodBodyStatementsContainer extends MethodBodyStatementsContainer {
- private String templateName;
-
- protected AbstractTemplateMethodBodyStatementsContainer(String templateName) {
- super();
- this.templateName = templateName;
- }
+ private String templateName;
- @Override
- public String getCode(FreeMarkerRenderer renderer) {
- return renderer.renderSnippet(templateName, this);
- }
+ protected AbstractTemplateMethodBodyStatementsContainer(String templateName) {
+ super();
+ this.templateName = templateName;
+ }
+ @Override
+ public String getCode(FreeMarkerRenderer renderer) {
+ return renderer.renderSnippet(templateName, this);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ConversionToStringMethodBodyStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ConversionToStringMethodBodyStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ConversionToStringMethodBodyStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,11 +23,10 @@
/**
* @author Nick Belaevski
- *
*/
public class ConversionToStringMethodBodyStatement extends AbstractTemplateMethodBodyStatement {
- public ConversionToStringMethodBodyStatement() {
- super("conversion-to-string-method");
- }
+ public ConversionToStringMethodBodyStatement() {
+ super("conversion-to-string-method");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/DefineObjectStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/DefineObjectStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/DefineObjectStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,43 +23,42 @@
/**
* @author Nick Belaevski
- *
*/
public class DefineObjectStatement extends AbstractTemplateMethodBodyStatement {
- private String type;
-
- private String name;
-
- private String initializationExpression;
-
- public DefineObjectStatement(String type, String name, String initializationExpression) {
- super("define-object");
-
- this.type = type;
- this.name = name;
- this.initializationExpression = initializationExpression != null ? initializationExpression : "";
- }
+ private String type;
- /**
- * @return the type
- */
- public String getType() {
- return type;
- }
+ private String name;
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
+ private String initializationExpression;
- /**
- * @return the initializationExpression
- */
- public String getInitializationExpression() {
- return initializationExpression;
- }
+ public DefineObjectStatement(String type, String name, String initializationExpression) {
+ super("define-object");
+ this.type = type;
+ this.name = name;
+ this.initializationExpression = initializationExpression != null ? initializationExpression : "";
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the initializationExpression
+ */
+ public String getInitializationExpression() {
+ return initializationExpression;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EmptinessCheckingMethodBodyStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EmptinessCheckingMethodBodyStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EmptinessCheckingMethodBodyStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,11 +23,10 @@
/**
* @author Nick Belaevski
- *
*/
public class EmptinessCheckingMethodBodyStatement extends AbstractTemplateMethodBodyStatement {
- public EmptinessCheckingMethodBodyStatement() {
- super("emptiness-check-method");
- }
+ public EmptinessCheckingMethodBodyStatement() {
+ super("emptiness-check-method");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EncodeMethodPrefaceStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EncodeMethodPrefaceStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EncodeMethodPrefaceStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,18 +21,16 @@
*/
package org.richfaces.cdk.templatecompiler;
-
/**
* @author Nick Belaevski
- *
*/
public class EncodeMethodPrefaceStatement extends AbstractTemplateMethodBodyStatement {
- /**
- * @param templateName
- */
- public EncodeMethodPrefaceStatement() {
- super("encode-method-preface");
- }
+ /**
+ * @param templateName
+ */
+ public EncodeMethodPrefaceStatement() {
+ super("encode-method-preface");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EndElementStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EndElementStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/EndElementStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -27,8 +27,8 @@
*/
public class EndElementStatement extends StartElementStatement {
- public EndElementStatement(String elementName) {
- super("end-element", elementName);
- }
+ public EndElementStatement(String elementName) {
+ super("end-element", elementName);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ForEachStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ForEachStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/ForEachStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,43 +23,42 @@
/**
* @author Nick Belaevski
- *
*/
public class ForEachStatement extends AbstractTemplateMethodBodyStatementsContainer {
- private String itemsExpression;
-
- private String var;
-
- private String varType;
-
- public ForEachStatement(String itemsExpression,
- String var, String varType) {
- super("for-each");
- this.itemsExpression = itemsExpression;
- this.var = var;
- this.varType = varType;
- }
+ private String itemsExpression;
- /**
- * @return the itemsExpression
- */
- public String getItemsExpression() {
- return itemsExpression;
- }
-
- /**
- * @return the var
- */
- public String getVar() {
- return var;
- }
-
- /**
- * @return the varType
- */
- public String getVarType() {
- return varType;
- }
+ private String var;
+ private String varType;
+
+ public ForEachStatement(String itemsExpression,
+ String var, String varType) {
+ super("for-each");
+ this.itemsExpression = itemsExpression;
+ this.var = var;
+ this.varType = varType;
+ }
+
+ /**
+ * @return the itemsExpression
+ */
+ public String getItemsExpression() {
+ return itemsExpression;
+ }
+
+ /**
+ * @return the var
+ */
+ public String getVar() {
+ return var;
+ }
+
+ /**
+ * @return the varType
+ */
+ public String getVarType() {
+ return varType;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/FreeMarkerRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/FreeMarkerRenderer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/FreeMarkerRenderer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,14 +1,14 @@
package org.richfaces.cdk.templatecompiler;
+import freemarker.template.TemplateException;
+
import java.io.IOException;
import java.io.Writer;
-import freemarker.template.TemplateException;
-
public interface FreeMarkerRenderer {
public void writeSnippet(String templateName, Object object, Writer writer)
- throws IOException, TemplateException;
+ throws IOException, TemplateException;
public String renderSnippet(String templateName, Object object);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfElseStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfElseStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfElseStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,15 +21,14 @@
*/
package org.richfaces.cdk.templatecompiler;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
public class IfElseStatement extends AbstractTemplateMethodBodyStatementsContainer {
- public IfElseStatement() {
- super("if-else");
- }
+ public IfElseStatement() {
+ super("if-else");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/IfStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -24,15 +24,15 @@
import org.richfaces.builder.model.MethodBodyStatementsContainer;
public final class IfStatement extends MethodBodyStatementsContainer {
-
- private String test;
- public IfStatement(String test) {
- super();
- this.test = test;
- }
+ private String test;
- public String getTest() {
- return test;
- }
+ public IfStatement(String test) {
+ super();
+ this.test = test;
+ }
+
+ public String getTest() {
+ return test;
+ }
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,31 +21,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.templatecompiler;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.richfaces.cdk.CdkContext;
-
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
-import freemarker.template.TemplateHashModel;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.CdkContext;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class JavaClassConfiguration extends Configuration implements FreeMarkerRenderer {
private static final String TEMPLATES = "/META-INF/templates/java";
@@ -62,11 +56,12 @@
setObjectWrapper(new JavaClassModelWrapper(this));
// Add context variables
- this.setSharedVariable("context", new BeanModel(context,new BeansWrapper()));
+ this.setSharedVariable("context", new BeanModel(context, new BeansWrapper()));
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the context
*/
public CdkContext getContext() {
@@ -86,18 +81,18 @@
rootMap.put("responseWriterVariable", RendererClassVisitor.RESPONSE_WRITER_VARIABLE);
rootMap.put("clientIdVariable", RendererClassVisitor.CLIENT_ID_VARIABLE);
rootMap.put("rendererUtilsVariable", RendererClassVisitor.RENDERER_UTILS_VARIABLE);
-
+
t.process(rootMap, writer);
}
-
+
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.FreeMarkerRenderer#renderSnippet(java.lang.String, java.lang.Object)
- */
+ * @see org.richfaces.cdk.templatecompiler.FreeMarkerRenderer#renderSnippet(java.lang.String, java.lang.Object)
+ */
public String renderSnippet(String templateName, Object object) {
StringWriter writer = new StringWriter();
try {
writeSnippet(templateName, object, writer);
-
+
return writer.toString();
} catch (IOException e) {
// TODO: handle exception
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassModelWrapper.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassModelWrapper.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassModelWrapper.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,15 +1,10 @@
package org.richfaces.cdk.templatecompiler;
-import org.richfaces.builder.model.MethodBodyStatement;
-import org.richfaces.cdk.freemarker.ComponentTemplateModel;
-import org.richfaces.cdk.freemarker.PropertyModel;
-import org.richfaces.cdk.model.Component;
-import org.richfaces.cdk.model.Property;
-
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import org.richfaces.builder.model.MethodBodyStatement;
public class JavaClassModelWrapper extends BeansWrapper implements ObjectWrapper {
@@ -18,6 +13,7 @@
public JavaClassModelWrapper(JavaClassConfiguration configuration) {
this.configuration = configuration;
}
+
@Override
public TemplateModel wrap(Object obj) throws TemplateModelException {
@@ -32,8 +28,10 @@
return templateModel;
}
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the configuration
*/
public JavaClassConfiguration getConfiguration() {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/MethodBodyTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/MethodBodyTemplateModel.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/MethodBodyTemplateModel.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,16 +23,15 @@
package org.richfaces.cdk.templatecompiler;
-import org.richfaces.builder.model.MethodBodyStatement;
-
import freemarker.ext.beans.BeanModel;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import org.richfaces.builder.model.MethodBodyStatement;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class MethodBodyTemplateModel extends BeanModel implements TemplateModel {
@@ -41,6 +40,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param statement
* @param javaClassModelWrapper
*/
@@ -49,12 +49,12 @@
this.statement = statement;
this.modelWrapper = javaClassModelWrapper;
}
-
+
@Override
public TemplateModel get(String key) throws TemplateModelException {
- if("code".equals(key)){
+ if ("code".equals(key)) {
//TODO - ?
- return modelWrapper.wrap(statement.getCode(modelWrapper.getConfiguration()));
+ return modelWrapper.wrap(statement.getCode(modelWrapper.getConfiguration()));
}
return super.get(key);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,10 +23,7 @@
package org.richfaces.cdk.templatecompiler;
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-
+import freemarker.template.TemplateException;
import org.richfaces.builder.model.JavaClass;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
@@ -37,14 +34,15 @@
import org.richfaces.cdk.model.Renderer;
import org.richfaces.cdk.templatecompiler.model.Template;
-import freemarker.template.TemplateException;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class RendererClassGenerator implements CdkWriter {
private CdkContext context;
@@ -74,32 +72,33 @@
if (null != template) {
// TODO - put real parameters.
RendererClassVisitor visitor = new RendererClassVisitor(
- template.getInterface(), context.getLoader());
+ template.getInterface(), context.getLoader());
visitor.preProcess();
template.getImplementation().visit(visitor);
visitor.postProcess();
JavaClass javaClass = visitor.getRendererClass();
String fullName = javaClass.getFullName();
File outFile = context.createOutputFile(
- StandardOutputs.RENDERER_CLASSES, fullName.replace(
- '.', '/')
- + ".java", library.lastModified());
+ StandardOutputs.RENDERER_CLASSES, fullName.replace(
+ '.', '/')
+ + ".java", library.lastModified());
if (null != outFile) {
- PrintWriter outputWriter = null;;
+ PrintWriter outputWriter = null;
+
try {
- outputWriter = new PrintWriter(outFile);
-
- JavaClassConfiguration cdkConfiguration = new JavaClassConfiguration(context);
- cdkConfiguration.writeSnippet("class", javaClass, outputWriter);
+ outputWriter = new PrintWriter(outFile);
+
+ JavaClassConfiguration cdkConfiguration = new JavaClassConfiguration(context);
+ cdkConfiguration.writeSnippet("class", javaClass, outputWriter);
} catch (IOException e) {
throw new CdkException(e);
} catch (TemplateException e) {
throw new CdkException(e);
- } finally {
- if (outputWriter != null) {
- outputWriter.close();
- }
+ } finally {
+ if (outputWriter != null) {
+ outputWriter.close();
+ }
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,25 +23,7 @@
package org.richfaces.cdk.templatecompiler;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import javax.annotation.Generated;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.Behavior;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.convert.Converter;
-import javax.xml.namespace.QName;
-
+import com.google.common.collect.Lists;
import org.richfaces.builder.model.Argument;
import org.richfaces.builder.model.JavaClass;
import org.richfaces.builder.model.JavaMethod;
@@ -65,78 +47,97 @@
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.templatecompiler.model.TemplateVisitor;
-import com.google.common.collect.Lists;
+import javax.annotation.Generated;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.Behavior;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.convert.Converter;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class RendererClassVisitor implements TemplateVisitor {
- /**
- *
- */
- static final String RESPONSE_WRITER_VARIABLE = "responseWriter";
- /**
- *
- */
- static final String COMPONENT_VARIABLE = "cc";
- /**
- *
- */
- static final String FACES_CONTEXT_VARIABLE = "facesContext";
- /**
- *
- */
- static final String CLIENT_ID_VARIABLE = "clientId";
- /**
- *
- */
- static final String RENDERER_UTILS_VARIABLE = "utils";
-
- static final String RENDERER_UTILS_CLASS_NAME = "org.ajax4jsf.renderkit.RendererUtils";
-
- private static final Set<String> DEFAULT_NAMESPACES = new HashSet<String>();
-
- static {
- DEFAULT_NAMESPACES.add("http://richfaces.org/xhtml-el");
- DEFAULT_NAMESPACES.add("http://www.w3.org/1999/xhtml");
- }
+ /**
+ *
+ */
+ static final String RESPONSE_WRITER_VARIABLE = "responseWriter";
+ /**
+ *
+ */
+ static final String COMPONENT_VARIABLE = "cc";
+ /**
+ *
+ */
+ static final String FACES_CONTEXT_VARIABLE = "facesContext";
+ /**
+ *
+ */
+ static final String CLIENT_ID_VARIABLE = "clientId";
+ /**
+ *
+ */
+ static final String RENDERER_UTILS_VARIABLE = "utils";
- private static final String[] GUESS_PACKAGES;
-
- static {
- Class<?>[] GUESS_PACKAGES_CLASSES = {
- UIComponent.class,
- Behavior.class,
- Converter.class,
- FacesContext.class,
- Collection.class,
- Object.class,
- };
-
- GUESS_PACKAGES = new String[GUESS_PACKAGES_CLASSES.length];
- int i = 0;
- for (Class<?> guessPackageClass : GUESS_PACKAGES_CLASSES) {
- GUESS_PACKAGES[i++] = guessPackageClass.getPackage().getName();
- }
- }
-
+ static final String RENDERER_UTILS_CLASS_NAME = "org.ajax4jsf.renderkit.RendererUtils";
+
+ private static final Set<String> DEFAULT_NAMESPACES = new HashSet<String>();
+
+ static {
+ DEFAULT_NAMESPACES.add("http://richfaces.org/xhtml-el");
+ DEFAULT_NAMESPACES.add("http://www.w3.org/1999/xhtml");
+ }
+
+ private static final String[] GUESS_PACKAGES;
+
+ static {
+ Class<?>[] guessPackagesClasses = {
+ UIComponent.class,
+ Behavior.class,
+ Converter.class,
+ FacesContext.class,
+ Collection.class,
+ Object.class,
+ };
+
+ GUESS_PACKAGES = new String[guessPackagesClasses.length];
+ int i = 0;
+ for (Class<?> guessPackageClass : guessPackagesClasses) {
+ GUESS_PACKAGES[i++] = guessPackageClass.getPackage().getName();
+ }
+ }
+
private static final Map<String, Set<String>> ELEMENTS_ATTRIBUTES;
+
+ protected MethodBodyStatementsContainer currentStatement;
+
private JavaClass rendererClass;
private CompositeInterface compositeInterface;
- protected MethodBodyStatementsContainer currentStatement;
private final LinkedList<MethodBodyStatementsContainer> statements = Lists.newLinkedList();
private Map<String, Class<?>> localsTypesMap;
- private ClassLoader classLoader;
- private boolean isAddedMethodForConversionToString;
- private boolean isAddedMethodForCheckingEmptiness;
-
+ private ClassLoader classLoader;
+ private boolean isAddedMethodForConversionToString;
+ private boolean isAddedMethodForCheckingEmptiness;
+
static {
- InputStream serializedAttributesStream = RendererClassVisitor.class.getResourceAsStream("/META-INF/schema/attributes.ser");
+ InputStream serializedAttributesStream =
+ RendererClassVisitor.class.getResourceAsStream("/META-INF/schema/attributes.ser");
try {
@@ -157,79 +158,84 @@
}
}
}
-
- private void initializeJavaClass() {
- this.rendererClass = createJavaClassByName(compositeInterface.getJavaClass());
- this.rendererClass.addModifier(JavaModifier.PUBLIC);
+
+ public RendererClassVisitor(CompositeInterface compositeInterface, ClassLoader classLoader) {
+ this.compositeInterface = compositeInterface;
+ this.classLoader = classLoader;
+ }
+
+ private void initializeJavaClass() {
+ this.rendererClass = createJavaClassByName(compositeInterface.getJavaClass());
+ this.rendererClass.addModifier(JavaModifier.PUBLIC);
this.rendererClass.setSuperClass(createJavaClassByName(compositeInterface.getBaseClass()));
this.rendererClass.addImport(FacesContext.class);
- this.rendererClass.addImport(ResponseWriter.class);
+ this.rendererClass.addImport(ResponseWriter.class);
this.rendererClass.addImport(UIComponent.class);
- this.rendererClass.addImport(RENDERER_UTILS_CLASS_NAME);
+ this.rendererClass.addImport(RENDERER_UTILS_CLASS_NAME);
- this.rendererClass.addAnnotation(Generated.class, "\"RichFaces CDK\"");
- //TODO remove this after improving Java model
- this.rendererClass.addImport(Generated.class);
-
+ this.rendererClass.addAnnotation(Generated.class, "\"RichFaces CDK\"");
+ //TODO remove this after improving Java model
+ this.rendererClass.addImport(Generated.class);
+
this.createMethodContext();
- }
+ }
private void addMethodForConversionToString() {
- if (!isAddedMethodForConversionToString) {
- isAddedMethodForConversionToString = true;
-
- JavaMethod conversionMethod = new JavaMethod("convertToString", String.class,
- new Argument("object", Object.class));
-
- conversionMethod.addModifier(JavaModifier.PRIVATE);
- conversionMethod.addModifier(JavaModifier.FINAL);
+ if (!isAddedMethodForConversionToString) {
+ isAddedMethodForConversionToString = true;
- MethodBody conversionMethodBody = new MethodBody(conversionMethod);
- conversionMethod.setMethodBody(conversionMethodBody);
- conversionMethodBody.addStatement(new ConversionToStringMethodBodyStatement());
-
- rendererClass.addMethod(conversionMethod);
- }
+ JavaMethod conversionMethod = new JavaMethod("convertToString", String.class,
+ new Argument("object", Object.class));
+
+ conversionMethod.addModifier(JavaModifier.PRIVATE);
+ conversionMethod.addModifier(JavaModifier.FINAL);
+
+ MethodBody conversionMethodBody = new MethodBody(conversionMethod);
+ conversionMethod.setMethodBody(conversionMethodBody);
+ conversionMethodBody.addStatement(new ConversionToStringMethodBodyStatement());
+
+ rendererClass.addMethod(conversionMethod);
+ }
}
private void addMethodForCheckingEmptiness() {
- if (!isAddedMethodForCheckingEmptiness) {
- isAddedMethodForCheckingEmptiness = true;
+ if (!isAddedMethodForCheckingEmptiness) {
+ isAddedMethodForCheckingEmptiness = true;
- JavaMethod checkingMethod = new JavaMethod("isEmpty", boolean.class,
- new Argument("object", Object.class));
-
- checkingMethod.addModifier(JavaModifier.PRIVATE);
- checkingMethod.addModifier(JavaModifier.FINAL);
+ JavaMethod checkingMethod = new JavaMethod("isEmpty", boolean.class,
+ new Argument("object", Object.class));
- MethodBody checkingMethodBody = new MethodBody(checkingMethod);
- checkingMethod.setMethodBody(checkingMethodBody);
- checkingMethodBody.addStatement(new EmptinessCheckingMethodBodyStatement());
-
- rendererClass.addMethod(checkingMethod);
- }
+ checkingMethod.addModifier(JavaModifier.PRIVATE);
+ checkingMethod.addModifier(JavaModifier.FINAL);
+
+ MethodBody checkingMethodBody = new MethodBody(checkingMethod);
+ checkingMethod.setMethodBody(checkingMethodBody);
+ checkingMethodBody.addStatement(new EmptinessCheckingMethodBodyStatement());
+
+ rendererClass.addMethod(checkingMethod);
+ }
}
-
+
private String compileEl(String expression, Class<?> type) {
- try {
- ELVisitor elVisitor = ELVisitor.getInstance();
- String parsedExpression = elVisitor.parse(expression, localsTypesMap);
-
- if (elVisitor.isUseConversionToString()) {
- addMethodForConversionToString();
- }
-
- if (elVisitor.isUseEmptinessCheck()) {
- addMethodForCheckingEmptiness();
- }
-
- return parsedExpression + "/* " + expression.trim() + " */";
- } catch (ParsingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- throw new RuntimeException(e.getMessage());
- }
+ try {
+ ELVisitor elVisitor = ELVisitor.getInstance();
+ String parsedExpression = elVisitor.parse(expression, localsTypesMap);
+
+ if (elVisitor.isUseConversionToString()) {
+ addMethodForConversionToString();
+ }
+
+ if (elVisitor.isUseEmptinessCheck()) {
+ addMethodForCheckingEmptiness();
+ }
+
+ return parsedExpression + "/* " + expression.trim() + " */";
+ } catch (ParsingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ throw new RuntimeException(e.getMessage());
+ }
//
// if (Boolean.class.isAssignableFrom(type)) {
// //TODO just a stub!
@@ -238,59 +244,59 @@
//
// return quote(expression) + " /* " + expression.trim() + " */";
}
-
- private String getElExpressionContainerType(String value) {
- // TODO Auto-generated method stub
- return Object.class.getName();
- }
- private String getElExpressionType(String value) {
- // TODO Auto-generated method stub
- return String.class.getName();
- }
-
+ private String getElExpressionContainerType(String value) {
+ // TODO Auto-generated method stub
+ return Object.class.getName();
+ }
+
+ private String getElExpressionType(String value) {
+ // TODO Auto-generated method stub
+ return String.class.getName();
+ }
+
private boolean isDefaultNamespace(String namespaceURI) {
- //TODO - another namespaces
- if (namespaceURI == null || namespaceURI.length() == 0) {
- return true;
- }
-
- if (DEFAULT_NAMESPACES.contains(namespaceURI)) {
- return true;
- }
-
- return false;
+ //TODO - another namespaces
+ if (namespaceURI == null || namespaceURI.length() == 0) {
+ return true;
+ }
+
+ if (DEFAULT_NAMESPACES.contains(namespaceURI)) {
+ return true;
+ }
+
+ return false;
}
private void createMethodContext() {
- this.currentStatement = new MethodBody();
- this.localsTypesMap = new HashMap<String, Class<?>>();
- localsTypesMap.put(FACES_CONTEXT_VARIABLE, FacesContext.class);
- localsTypesMap.put(RESPONSE_WRITER_VARIABLE, ResponseWriter.class);
- localsTypesMap.put(COMPONENT_VARIABLE, UIComponent.class);
- localsTypesMap.put(CLIENT_ID_VARIABLE, String.class);
+ this.currentStatement = new MethodBody();
+ this.localsTypesMap = new HashMap<String, Class<?>>();
+ localsTypesMap.put(FACES_CONTEXT_VARIABLE, FacesContext.class);
+ localsTypesMap.put(RESPONSE_WRITER_VARIABLE, ResponseWriter.class);
+ localsTypesMap.put(COMPONENT_VARIABLE, UIComponent.class);
+ localsTypesMap.put(CLIENT_ID_VARIABLE, String.class);
}
-
+
private void flushToEncodeMethod(String encodeMethodName) {
- if (!this.currentStatement.isEmpty()) {
- Argument facesContextArgument = new Argument(FACES_CONTEXT_VARIABLE, FacesContext.class);
- Argument componentArgument = new Argument(COMPONENT_VARIABLE, UIComponent.class);
-
- JavaMethod javaMethod = new JavaMethod(encodeMethodName, facesContextArgument, componentArgument);
- javaMethod.addModifier(JavaModifier.PUBLIC);
- javaMethod.addAnnotation(Override.class);
- javaMethod.getExceptions().add(IOException.class);
-
- MethodBody methodBody = (MethodBody) currentStatement;
- javaMethod.setMethodBody(methodBody);
-
- methodBody.addStatement(0, new EncodeMethodPrefaceStatement());
- rendererClass.addMethod(javaMethod);
- }
+ if (!this.currentStatement.isEmpty()) {
+ Argument facesContextArgument = new Argument(FACES_CONTEXT_VARIABLE, FacesContext.class);
+ Argument componentArgument = new Argument(COMPONENT_VARIABLE, UIComponent.class);
- createMethodContext();
+ JavaMethod javaMethod = new JavaMethod(encodeMethodName, facesContextArgument, componentArgument);
+ javaMethod.addModifier(JavaModifier.PUBLIC);
+ javaMethod.addAnnotation(Override.class);
+ javaMethod.getExceptions().add(IOException.class);
+
+ MethodBody methodBody = (MethodBody) currentStatement;
+ javaMethod.setMethodBody(methodBody);
+
+ methodBody.addStatement(0, new EncodeMethodPrefaceStatement());
+ rendererClass.addMethod(javaMethod);
+ }
+
+ createMethodContext();
}
-
+
private JavaClass createJavaClassByName(String fullName) {
String simpleName = null;
String packageName = "";
@@ -305,143 +311,142 @@
return new JavaClass(simpleName, new JavaPackage(packageName));
}
-
- private Class<?> getClasByObjectTypeByName(String type) {
- Class<?> result = null;
-
- int dotIndex = type.indexOf('.');
- if (dotIndex < 0) {
- //guess type
- for (String guessPackage : GUESS_PACKAGES) {
- try {
- result = classLoader.loadClass(guessPackage + "." + type);
- break;
- } catch (ClassNotFoundException e) {
- //ignore
- }
- }
- }
-
- if (result == null) {
- try {
- classLoader.loadClass(type);
- } catch (ClassNotFoundException e) {
- //ignore
- }
- }
- if (result == null) {
- result = Object.class;
- }
+ private Class<?> getClasByObjectTypeByName(String type) {
+ Class<?> result = null;
- return result;
- }
+ int dotIndex = type.indexOf('.');
+ if (dotIndex < 0) {
+ //guess type
+ for (String guessPackage : GUESS_PACKAGES) {
+ try {
+ result = classLoader.loadClass(guessPackage + "." + type);
+ break;
+ } catch (ClassNotFoundException e) {
+ //ignore
+ }
+ }
+ }
- private void defineObject(String type, String name, String initializationExpression) {
- currentStatement.addStatement(new DefineObjectStatement(type, name, initializationExpression));
- localsTypesMap.put(name, getClasByObjectTypeByName(type));
- }
-
+ if (result == null) {
+ try {
+ classLoader.loadClass(type);
+ } catch (ClassNotFoundException e) {
+ //ignore
+ }
+ }
+ if (result == null) {
+ result = Object.class;
+ }
+
+ return result;
+ }
+
+ private void defineObject(String type, String name, String initializationExpression) {
+ currentStatement.addStatement(new DefineObjectStatement(type, name, initializationExpression));
+ localsTypesMap.put(name, getClasByObjectTypeByName(type));
+ }
+
protected void pushStatement(MethodBodyStatementsContainer container) {
- currentStatement.addStatement(container);
- statements.push(currentStatement);
- currentStatement = container;
+ currentStatement.addStatement(container);
+ statements.push(currentStatement);
+ currentStatement = container;
}
-
+
protected void popStatement() {
- currentStatement = statements.pop();
+ currentStatement = statements.pop();
}
- public RendererClassVisitor(CompositeInterface compositeInterface, ClassLoader classLoader) {
- this.compositeInterface = compositeInterface;
- this.classLoader = classLoader;
- }
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererClass
*/
public JavaClass getRendererClass() {
return this.rendererClass;
}
-
+
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
- */
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(
+ * org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
+ */
@Override
public void startElement(CdkBodyElement cdkBodyElement) throws CdkException {
- flushToEncodeMethod("encodeBegin");
+ flushToEncodeMethod("encodeBegin");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(
+ * org.richfaces.cdk.templatecompiler.model.CdkBodyElement)
*/
@Override
public void endElement(CdkBodyElement cdkBodyElement) throws CdkException {
- flushToEncodeMethod("encodeChildren");
+ flushToEncodeMethod("encodeChildren");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(
+ * org.richfaces.cdk.templatecompiler.model.AnyElement)
*/
@Override
public void startElement(AnyElement anyElement) throws CdkException {
QName elementName = anyElement.getName();
Map<QName, Object> elementAttributes = anyElement.getAttributes();
-
+
if (!isDefaultNamespace(elementName.getNamespaceURI())) {
- //TODO: add support
+ //TODO: add support
}
-
+
currentStatement.addStatement(new StartElementStatement(elementName.getLocalPart()));
-
+
if (elementAttributes != null) {
for (Map.Entry<QName, Object> attribute : elementAttributes.entrySet()) {
- QName attributeName = attribute.getKey();
- Object attributeValue = attribute.getValue();
-
- if (!isDefaultNamespace(attributeName.getNamespaceURI())) {
- //TODO: add support
-
- //TODO: optimize batch attributes encoding
- if (Template.CDK_NAMESPACE.equals(attributeName.getNamespaceURI()) &&
- "passThroughWithExclusions".equals(attributeName.getLocalPart())) {
-
- //TODO check element namespace
- Set<String> attributeSet = ELEMENTS_ATTRIBUTES.get(elementName.getLocalPart());
- if (attributeSet != null) {
- //make a copy of original set
- TreeSet<String> actualAttributesSet = new TreeSet<String>(attributeSet);
-
- if (attributeValue != null) {
- String[] exclusions = attributeValue.toString().split("\\s+");
- for (String exclusion : exclusions) {
- actualAttributesSet.remove(exclusion);
- }
- }
-
- if (!actualAttributesSet.isEmpty()) {
- currentStatement.addStatement(new WriteAttributesSetStatement(actualAttributesSet));
- }
- }
- }
-
- //TODO: cdk:passThrough
+ QName attributeName = attribute.getKey();
+ Object attributeValue = attribute.getValue();
+
+ if (!isDefaultNamespace(attributeName.getNamespaceURI())) {
+ //TODO: add support
+
+ //TODO: optimize batch attributes encoding
+ if (Template.CDK_NAMESPACE.equals(attributeName.getNamespaceURI())
+ && "passThroughWithExclusions".equals(attributeName.getLocalPart())) {
+
+ //TODO check element namespace
+ Set<String> attributeSet = ELEMENTS_ATTRIBUTES.get(elementName.getLocalPart());
+ if (attributeSet != null) {
+ //make a copy of original set
+ TreeSet<String> actualAttributesSet = new TreeSet<String>(attributeSet);
+
+ if (attributeValue != null) {
+ String[] exclusions = attributeValue.toString().split("\\s+");
+ for (String exclusion : exclusions) {
+ actualAttributesSet.remove(exclusion);
+ }
+ }
+
+ if (!actualAttributesSet.isEmpty()) {
+ currentStatement.addStatement(new WriteAttributesSetStatement(actualAttributesSet));
+ }
+ }
+ }
+
+ //TODO: cdk:passThrough
} else {
- currentStatement.addStatement(new WriteAttributeStatement(attributeName.getLocalPart(),
- compileEl(attributeValue.toString(), String.class)));
+ currentStatement.addStatement(new WriteAttributeStatement(attributeName.getLocalPart(),
+ compileEl(attributeValue.toString(), String.class)));
}
- }
+ }
}
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.AnyElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.AnyElement)
*/
@Override
public void endElement(AnyElement anyElement) throws CdkException {
- QName elementName = anyElement.getName();
+ QName elementName = anyElement.getName();
currentStatement.addStatement(new EndElementStatement(elementName.getLocalPart()));
}
@@ -450,148 +455,160 @@
*/
@Override
public void visitElement(String text) throws CdkException {
- if (text != null) {
- String trimmedText = text.trim();
- if (trimmedText.length() != 0) {
- currentStatement.addStatement(new WriteTextStatement(compileEl(trimmedText, String.class)));
- }
- }
+ if (text != null) {
+ String trimmedText = text.trim();
+ if (trimmedText.length() != 0) {
+ currentStatement.addStatement(new WriteTextStatement(compileEl(trimmedText, String.class)));
+ }
+ }
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler.model.CdkCallElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkCallElement)
*/
@Override
public void visitElement(CdkCallElement cdkCallElement) throws CdkException {
- currentStatement.addStatement(cdkCallElement.getExpression() + ";");
+ currentStatement.addStatement(cdkCallElement.getExpression() + ";");
}
/* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkIfElement)
*/
- @Override
- public void startElement(CdkIfElement cdkIfElement) {
- String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.class);
-
- pushStatement(new IfElseStatement());
- pushStatement(new IfStatement(compiledTestExpression));
- }
+ @Override
+ public void startElement(CdkIfElement cdkIfElement) {
+ String compiledTestExpression = compileEl(cdkIfElement.getTest(), Boolean.class);
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkIfElement)
- */
- @Override
- public void endElement(CdkIfElement cdkIfElement) {
- popStatement();
- popStatement();
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
- */
- @Override
- public void startElement(CdkChooseElement cdkChooseElement) {
- pushStatement(new IfElseStatement());
- }
+ pushStatement(new IfElseStatement());
+ pushStatement(new IfStatement(compiledTestExpression));
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkChooseElement)
- */
- @Override
- public void endElement(CdkChooseElement cdkChooseElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkIfElement)
+ */
+ @Override
+ public void endElement(CdkIfElement cdkIfElement) {
+ popStatement();
+ popStatement();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
- */
- @Override
- public void startElement(CdkWhenElement cdkWhenElement) {
- String compiledTestExpression = compileEl(cdkWhenElement.getTest(), Boolean.class);
-
- pushStatement(new IfStatement(compiledTestExpression));
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkChooseElement)
+ */
+ @Override
+ public void startElement(CdkChooseElement cdkChooseElement) {
+ pushStatement(new IfElseStatement());
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkWhenElement)
- */
- @Override
- public void endElement(CdkWhenElement cdkWhenElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkChooseElement)
+ */
+ @Override
+ public void endElement(CdkChooseElement cdkChooseElement) {
+ popStatement();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
- */
- @Override
- public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
- pushStatement(new IfStatement(""));
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkOtherwiseElement)
- */
- @Override
- public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkWhenElement)
+ */
+ @Override
+ public void startElement(CdkWhenElement cdkWhenElement) {
+ String compiledTestExpression = compileEl(cdkWhenElement.getTest(), Boolean.class);
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler.model.CdkObjectElement)
- */
- @Override
- public void visitElement(CdkObjectElement cdkObjectElement) {
- String name = cdkObjectElement.getName();
-
- String value = cdkObjectElement.getValue();
- if (value == null || value.length() == 0) {
- value = cdkObjectElement.getBodyValue();
- }
-
- String type = cdkObjectElement.getType();
+ pushStatement(new IfStatement(compiledTestExpression));
+ }
- if (value != null && value.length() != 0) {
- if (type == null || type.length() == 0) {
- type = getElExpressionType(value);
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkWhenElement)
+ */
+ @Override
+ public void endElement(CdkWhenElement cdkWhenElement) {
+ popStatement();
+ }
- value = compileEl(value, Object.class);
- }
-
- defineObject(type, name, value);
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkOtherwiseElement)
+ */
+ @Override
+ public void startElement(CdkOtherwiseElement cdkOtherwiseElement) {
+ pushStatement(new IfStatement(""));
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
- */
- @Override
- public void startElement(CdkForEachElement cdkForEachElement) {
- String items = cdkForEachElement.getItems();
- String itemsExpression = compileEl(items, Iterable.class);
- pushStatement(new ForEachStatement(itemsExpression, cdkForEachElement.getVar(),
- getElExpressionContainerType(items)));
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkOtherwiseElement)
+ */
+ @Override
+ public void endElement(CdkOtherwiseElement cdkOtherwiseElement) {
+ popStatement();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler.model.CdkForEachElement)
- */
- @Override
- public void endElement(CdkForEachElement cdkForEachElement) {
- popStatement();
- }
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#visitElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkObjectElement)
+ */
+ @Override
+ public void visitElement(CdkObjectElement cdkObjectElement) {
+ String name = cdkObjectElement.getName();
- /**
- *
- */
- public void preProcess() {
+ String value = cdkObjectElement.getValue();
+ if (value == null || value.length() == 0) {
+ value = cdkObjectElement.getBodyValue();
+ }
+
+ String type = cdkObjectElement.getType();
+
+ if (value != null && value.length() != 0) {
+ if (type == null || type.length() == 0) {
+ type = getElExpressionType(value);
+ }
+
+ value = compileEl(value, Object.class);
+ }
+
+ defineObject(type, name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#startElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkForEachElement)
+ */
+ @Override
+ public void startElement(CdkForEachElement cdkForEachElement) {
+ String items = cdkForEachElement.getItems();
+ String itemsExpression = compileEl(items, Iterable.class);
+ pushStatement(new ForEachStatement(itemsExpression, cdkForEachElement.getVar(),
+ getElExpressionContainerType(items)));
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.TemplateVisitor#endElement(org.richfaces.cdk.templatecompiler
+ * .model.CdkForEachElement)
+ */
+ @Override
+ public void endElement(CdkForEachElement cdkForEachElement) {
+ popStatement();
+ }
+
+ /**
+ *
+ */
+ public void preProcess() {
initializeJavaClass();
- }
+ }
- /**
- *
- */
- public void postProcess() {
- flushToEncodeMethod("encodeEnd");
- }
+ /**
+ *
+ */
+ public void postProcess() {
+ flushToEncodeMethod("encodeEnd");
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,12 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.templatecompiler;
-import java.io.File;
-
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.ModelBuilder;
@@ -40,10 +36,12 @@
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import java.io.File;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class RendererTemplateParser implements ModelBuilder {
private CdkContext context;
@@ -58,35 +56,35 @@
ComponentLibrary library = new ComponentLibrary();
for (File file : getContext().getSources(StandardSources.RENDERER_TEMPLATES)) {
- try {
- Template template = parseTemplate(file);
- CompositeInterface compositeInterface = template.getInterface();
- // TODO - infer values ?
- RenderKit renderKit = library.findOrCreateRenderKit(compositeInterface.getRenderKitId());
- Renderer renderer = renderKit.findOrCreateRenderer(compositeInterface.getRendererType());
- String componentType = compositeInterface.getComponentType();
+// try {
+ Template template = parseTemplate(file);
+ CompositeInterface compositeInterface = template.getInterface();
+ // TODO - infer values ?
+ RenderKit renderKit = library.findOrCreateRenderKit(compositeInterface.getRenderKitId());
+ Renderer renderer = renderKit.findOrCreateRenderer(compositeInterface.getRendererType());
+ String componentType = compositeInterface.getComponentType();
- if (null != componentType) {
- Component component = library.findOrCreateComponent(componentType);
+ if (null != componentType) {
+ Component component = library.findOrCreateComponent(componentType);
- component.getRenderers().add(renderer);
- }
+ component.getRenderers().add(renderer);
+ }
- String family = compositeInterface.getComponentFamily();
+ String family = compositeInterface.getComponentFamily();
- if (null != family) {
- renderer.setFamily(family);
- }
-
- renderer.setRendererClass(new ClassDescription(compositeInterface.getJavaClass()));
- renderer.setTemplate(template);
+ if (null != family) {
+ renderer.setFamily(family);
+ }
+
+ renderer.setRendererClass(new ClassDescription(compositeInterface.getJavaClass()));
+ renderer.setTemplate(template);
// } catch (FileNotFoundException e) {
// throw new CdkException(e);
// } catch (XMLStreamException e) {
// throw new CdkException(e);
- } finally {
-
- }
+// } finally {
+//
+// }
}
return library;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/StartElementStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/StartElementStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/StartElementStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,28 @@
*/
package org.richfaces.cdk.templatecompiler;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
public class StartElementStatement extends AbstractTemplateMethodBodyStatement {
- private String elementName;
-
- public StartElementStatement(String elementName) {
- this("start-element", elementName);
- }
+ private String elementName;
- protected StartElementStatement(String templateName, String elementName) {
- super(templateName);
- this.elementName = elementName;
- }
+ public StartElementStatement(String elementName) {
+ this("start-element", elementName);
+ }
- /**
- * @return the elementName
- */
- public String getElementName() {
- return elementName;
- }
+ protected StartElementStatement(String templateName, String elementName) {
+ super(templateName);
+ this.elementName = elementName;
+ }
+ /**
+ * @return the elementName
+ */
+ public String getElementName() {
+ return elementName;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributeStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributeStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributeStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,27 @@
*/
package org.richfaces.cdk.templatecompiler;
-
/**
* @author Nick Belaevski
- *
*/
public class WriteAttributeStatement extends AbstractTemplateMethodBodyStatement {
- private String attributeName;
-
- private String valueExpression;
+ private String attributeName;
- public WriteAttributeStatement(String attributeName, String valueExpression) {
- super("write-attribute");
- this.attributeName = attributeName;
- this.valueExpression = valueExpression;
- }
-
- public String getAttributeName() {
- return attributeName;
- }
-
- public String getValueExpression() {
- return valueExpression;
- }
-
+ private String valueExpression;
+
+ public WriteAttributeStatement(String attributeName, String valueExpression) {
+ super("write-attribute");
+ this.attributeName = attributeName;
+ this.valueExpression = valueExpression;
+ }
+
+ public String getAttributeName() {
+ return attributeName;
+ }
+
+ public String getValueExpression() {
+ return valueExpression;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributesSetStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributesSetStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteAttributesSetStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -25,21 +25,20 @@
/**
* @author Nick Belaevski
- *
*/
public class WriteAttributesSetStatement extends AbstractTemplateMethodBodyStatement {
- private Set<String> attributesSet;
+ private Set<String> attributesSet;
- public WriteAttributesSetStatement(Set<String> attributesSet) {
- super("write-attributes-set");
- this.attributesSet = attributesSet;
- }
-
- /**
- * @return the attributesSet
- */
- public Set<String> getAttributesSet() {
- return attributesSet;
- }
+ public WriteAttributesSetStatement(Set<String> attributesSet) {
+ super("write-attributes-set");
+ this.attributesSet = attributesSet;
+ }
+
+ /**
+ * @return the attributesSet
+ */
+ public Set<String> getAttributesSet() {
+ return attributesSet;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteTextStatement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteTextStatement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/WriteTextStatement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,22 +21,20 @@
*/
package org.richfaces.cdk.templatecompiler;
-
/**
* @author Nick Belaevski
- *
*/
public class WriteTextStatement extends AbstractTemplateMethodBodyStatement {
- private String textExpression;
+ private String textExpression;
- public WriteTextStatement(String textExpression) {
- super("write-text");
- this.textExpression = textExpression;
- }
-
- public String getTextExpression() {
- return textExpression;
- }
+ public WriteTextStatement(String textExpression) {
+ super("write-text");
+ this.textExpression = textExpression;
+ }
+ public String getTextExpression() {
+ return textExpression;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/AnyElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/AnyElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/AnyElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,48 +23,44 @@
package org.richfaces.cdk.templatecompiler.model;
-import java.util.List;
-import java.util.Map;
+import org.richfaces.cdk.CdkException;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.namespace.QName;
+import java.util.Map;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class AnyElement extends ModelFragment {
-
+
private QName name;
-
- private Map<QName,Object> attributes;
-
+ private Map<QName, Object> attributes;
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
public QName getName() {
return this.name;
}
-
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(QName name) {
this.name = name;
}
-
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the attributes
*/
@XmlAnyAttribute
@@ -72,10 +68,9 @@
return this.attributes;
}
-
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @param attributes the attributes to set
*/
public void setAttributes(Map<QName, Object> attributes) {
@@ -86,7 +81,7 @@
public void beforeVisit(TemplateVisitor visitor) throws CdkException {
visitor.startElement(this);
}
-
+
@Override
public void afterVisit(TemplateVisitor visitor) throws CdkException {
visitor.endElement(this);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -28,44 +28,45 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-@XmlType(name="uicomponent-attributeType",namespace=Template.COMPOSITE_NAMESPACE)
+@XmlType(name = "uicomponent-attributeType", namespace = Template.COMPOSITE_NAMESPACE)
public class Attribute {
-
- @XmlAttribute(required=true)
+
+ @XmlAttribute(required = true)
private String name;
-
+
@XmlAttribute
private String displayName;
-
+
@XmlAttribute
private String shortDescription;
-
- @XmlAttribute(name="default")
+
+ @XmlAttribute(name = "default")
private String defaultValue;
-
- @XmlAttribute(name="method-signature")
+
+ @XmlAttribute(name = "method-signature")
private String methodSignature;
-
+
@XmlAttribute
private String targets;
-
+
@XmlAttribute
private boolean required;
-
+
@XmlAttribute
private boolean preferred;
-
+
@XmlAttribute
private boolean expert;
@XmlAttribute
private String type = Object.class.getName();
-
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
public String getName() {
@@ -74,6 +75,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
@@ -82,6 +84,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the displayName
*/
public String getDisplayName() {
@@ -90,6 +93,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param displayName the displayName to set
*/
public void setDisplayName(String displayName) {
@@ -98,6 +102,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the shortDescription
*/
public String getShortDescription() {
@@ -106,6 +111,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param shortDescription the shortDescription to set
*/
public void setShortDescription(String shortDescription) {
@@ -114,6 +120,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the defaultValue
*/
public String getDefaultValue() {
@@ -122,6 +129,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(String defaultValue) {
@@ -130,6 +138,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the methodSignature
*/
public String getMethodSignature() {
@@ -138,6 +147,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param methodSignature the methodSignature to set
*/
public void setMethodSignature(String methodSignature) {
@@ -146,6 +156,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the targets
*/
public String getTargets() {
@@ -154,6 +165,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param targets the targets to set
*/
public void setTargets(String applyTo) {
@@ -162,6 +174,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the required
*/
public boolean isRequired() {
@@ -170,6 +183,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param required the required to set
*/
public void setRequired(boolean required) {
@@ -178,6 +192,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the preffered
*/
public boolean isPreferred() {
@@ -186,6 +201,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param preffered the preffered to set
*/
public void setPreferred(boolean preffered) {
@@ -194,6 +210,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the expert
*/
public boolean isExpert() {
@@ -202,26 +219,29 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param expert the expert to set
*/
public void setExpert(boolean expert) {
this.expert = expert;
}
-
+
/**
* <p class="changed_added_4_0"></p>
- * @return the type
- */
+ *
+ * @return the type
+ */
//TODO: add handling
- public String getType() {
- return type;
- }
-
- /**
+ public String getType() {
+ return type;
+ }
+
+ /**
* <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(String type) {
- this.type = type;
- }
+ *
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkBodyElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkBodyElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkBodyElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,23 +23,23 @@
package org.richfaces.cdk.templatecompiler.model;
+import org.richfaces.cdk.CdkException;
+
import javax.xml.bind.annotation.XmlRootElement;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlRootElement(name = "body", namespace = Template.CDK_NAMESPACE)
public class CdkBodyElement extends ModelFragment {
- @Override
+ @Override
public void beforeVisit(TemplateVisitor visitor) throws CdkException {
visitor.startElement(this);
}
-
+
@Override
public void afterVisit(TemplateVisitor visitor) throws CdkException {
visitor.endElement(this);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkCallElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkCallElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkCallElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,26 +23,27 @@
package org.richfaces.cdk.templatecompiler.model;
+import org.richfaces.cdk.CdkException;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-@XmlRootElement(name="call",namespace=Template.CDK_NAMESPACE)
+@XmlRootElement(name = "call", namespace = Template.CDK_NAMESPACE)
public class CdkCallElement implements ModelElement {
private String expression;
-
+
public CdkCallElement() {
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the expression
*/
@XmlAttribute
@@ -52,6 +53,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param expression the expression to set
*/
public void setExpression(String expression) {
@@ -60,10 +62,9 @@
@Override
public void visit(TemplateVisitor visitor) throws CdkException {
-
+
visitor.visitElement(this);
-
+
}
-
-
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkChooseElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkChooseElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkChooseElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,46 +21,44 @@
*/
package org.richfaces.cdk.templatecompiler.model;
-import java.util.Iterator;
-import java.util.List;
+import org.richfaces.cdk.CdkException;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
-import org.richfaces.cdk.CdkException;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
-@XmlRootElement(name="choose", namespace=Template.JSTL_CORE_NAMESPACE)
+@XmlRootElement(name = "choose", namespace = Template.JSTL_CORE_NAMESPACE)
public class CdkChooseElement extends ModelFragment {
- @XmlElements({
- @XmlElement(name="when", namespace=Template.JSTL_CORE_NAMESPACE, type = CdkWhenElement.class),
- @XmlElement(name="otherwise", namespace=Template.JSTL_CORE_NAMESPACE, type = CdkOtherwiseElement.class)
- })
- @Override
- public List<Object> getChildren() {
- return super.getChildren();
- }
-
- @Override
- public void setChildren(List<Object> body) {
- super.setChildren(body);
- }
+ @XmlElements({
+ @XmlElement(name = "when", namespace = Template.JSTL_CORE_NAMESPACE, type = CdkWhenElement.class),
+ @XmlElement(name = "otherwise", namespace = Template.JSTL_CORE_NAMESPACE, type = CdkOtherwiseElement.class)
+ })
+ @Override
+ public List<Object> getChildren() {
+ return super.getChildren();
+ }
- /* (non-Javadoc)
- * @see org.richfaces.cdk.templatecompiler.model.ModelFragment#visit(org.richfaces.cdk.templatecompiler.model.TemplateVisitor)
- */
- @Override
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- visitor.startElement(this);
- }
-
- @Override
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- visitor.endElement(this);
- }
+ @Override
+ public void setChildren(List<Object> body) {
+ super.setChildren(body);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.templatecompiler.model.ModelFragment#visit(org.richfaces.cdk.templatecompiler.model.TemplateVisitor)
+ */
+ @Override
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.startElement(this);
+ }
+
+ @Override
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.endElement(this);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkConditionalJstlElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkConditionalJstlElementBase.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkConditionalJstlElementBase.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -29,21 +29,21 @@
*/
public abstract class CdkConditionalJstlElementBase extends ModelFragment {
- @XmlAttribute(required = true)
- private String test;
-
- /**
- * @return the test
- */
- public String getTest() {
- return test;
- }
-
- /**
- * @param test the test to set
- */
- public void setTest(String test) {
- this.test = test;
- }
+ @XmlAttribute(required = true)
+ private String test;
+ /**
+ * @return the test
+ */
+ public String getTest() {
+ return test;
+ }
+
+ /**
+ * @param test the test to set
+ */
+ public void setTest(String test) {
+ this.test = test;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkForEachElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkForEachElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkForEachElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,11 +21,11 @@
*/
package org.richfaces.cdk.templatecompiler.model;
+import org.richfaces.cdk.CdkException;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import org.richfaces.cdk.CdkException;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -33,47 +33,47 @@
@XmlRootElement(name = "forEach", namespace = Template.JSTL_CORE_NAMESPACE)
public class CdkForEachElement extends ModelFragment {
- private String items;
-
- private String var;
-
- /**
- * @return the items
- */
- @XmlAttribute
- public String getItems() {
- return items;
- }
+ private String items;
- /**
- * @param items the items to set
- */
- public void setItems(String items) {
- this.items = items;
- }
+ private String var;
- /**
- * @return the var
- */
- @XmlAttribute
- public String getVar() {
- return var;
- }
+ /**
+ * @return the items
+ */
+ @XmlAttribute
+ public String getItems() {
+ return items;
+ }
- /**
- * @param var the var to set
- */
- public void setVar(String var) {
- this.var = var;
- }
+ /**
+ * @param items the items to set
+ */
+ public void setItems(String items) {
+ this.items = items;
+ }
- @Override
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- visitor.startElement(this);
- }
-
- @Override
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- visitor.endElement(this);
- }
+ /**
+ * @return the var
+ */
+ @XmlAttribute
+ public String getVar() {
+ return var;
+ }
+
+ /**
+ * @param var the var to set
+ */
+ public void setVar(String var) {
+ this.var = var;
+ }
+
+ @Override
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.startElement(this);
+ }
+
+ @Override
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.endElement(this);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkIfElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkIfElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkIfElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,24 +21,24 @@
*/
package org.richfaces.cdk.templatecompiler.model;
+import org.richfaces.cdk.CdkException;
+
import javax.xml.bind.annotation.XmlRootElement;
-import org.richfaces.cdk.CdkException;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
-@XmlRootElement(name="if", namespace=Template.JSTL_CORE_NAMESPACE)
+@XmlRootElement(name = "if", namespace = Template.JSTL_CORE_NAMESPACE)
public class CdkIfElement extends CdkConditionalJstlElementBase {
- @Override
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- visitor.startElement(this);
- }
-
- @Override
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- visitor.endElement(this);
- }
+ @Override
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.startElement(this);
+ }
+
+ @Override
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.endElement(this);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,90 +21,90 @@
*/
package org.richfaces.cdk.templatecompiler.model;
+import org.richfaces.cdk.CdkException;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
-import org.richfaces.cdk.CdkException;
-
/**
* @author Nick Belaevski
* @since 4.0
*/
@XmlRootElement(name = "object", namespace = Template.CDK_NAMESPACE)
public class CdkObjectElement implements ModelElement {
-
- @XmlAttribute(required = true)
- private String name;
-
- /**
- * @return the bodyValue
- */
- public String getBodyValue() {
- return bodyValue;
- }
- /**
- * @param bodyValue the bodyValue to set
- */
- public void setBodyValue(String bodyValue) {
- this.bodyValue = bodyValue;
- }
+ @XmlAttribute(required = true)
+ private String name;
- @XmlAttribute
- private String value;
+ @XmlAttribute
+ private String value;
- @XmlValue
- private String bodyValue;
-
- @XmlAttribute(required = true)
- private String type;
+ @XmlValue
+ private String bodyValue;
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
+ @XmlAttribute(required = true)
+ private String type;
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
+ /**
+ * @return the bodyValue
+ */
+ public String getBodyValue() {
+ return bodyValue;
+ }
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
+ /**
+ * @param bodyValue the bodyValue to set
+ */
+ public void setBodyValue(String bodyValue) {
+ this.bodyValue = bodyValue;
+ }
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * @return the type
- */
- public String getType() {
- return type;
- }
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
- /**
- * @param type the type to set
- */
- public void setType(String type) {
- this.type = type;
- }
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
- @Override
- public void visit(TemplateVisitor visitor) throws CdkException {
- visitor.visitElement(this);
- }
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public void visit(TemplateVisitor visitor) throws CdkException {
+ visitor.visitElement(this);
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkOtherwiseElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkOtherwiseElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkOtherwiseElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -29,13 +29,13 @@
*/
public class CdkOtherwiseElement extends ModelFragment {
- @Override
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- visitor.startElement(this);
- }
+ @Override
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.startElement(this);
+ }
- @Override
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- visitor.endElement(this);
- }
+ @Override
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.endElement(this);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkWhenElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkWhenElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkWhenElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -29,13 +29,13 @@
*/
public class CdkWhenElement extends CdkConditionalJstlElementBase {
- @Override
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- visitor.startElement(this);
- }
-
- @Override
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- visitor.endElement(this);
- }
+ @Override
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.startElement(this);
+ }
+
+ @Override
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ visitor.endElement(this);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,15 +23,14 @@
package org.richfaces.cdk.templatecompiler.model;
-
import javax.xml.bind.annotation.XmlType;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
-@XmlType(name="ImplementationType",namespace=Template.COMPOSITE_NAMESPACE)
+@XmlType(name = "ImplementationType", namespace = Template.COMPOSITE_NAMESPACE)
public class CompositeImplementation extends ModelFragment {
-
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,29 +23,28 @@
package org.richfaces.cdk.templatecompiler.model;
-import java.util.List;
-
import javax.faces.render.RenderKitFactory;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-@XmlType(name="InterfaceType",namespace=Template.COMPOSITE_NAMESPACE)
+@XmlType(name = "InterfaceType", namespace = Template.COMPOSITE_NAMESPACE)
public class CompositeInterface {
-
+
private String componentType;
-
+
private String componentFamily;
-
+
private List<Attribute> attributes;
private List<ResourceDependency> resourceDependencies;
-
+
private String renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
private String javaClass;
@@ -53,20 +52,22 @@
private String baseClass;
private String rendererType;
-
+
private boolean rendersChildren = true;
-
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the componentType
*/
- @XmlElement(name="component-type",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "component-type", namespace = Template.CDK_NAMESPACE)
public String getComponentType() {
return this.componentType;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param componentType the componentType to set
*/
public void setComponentType(String componentType) {
@@ -75,15 +76,17 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the family
*/
- @XmlElement(name="component-family",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "component-family", namespace = Template.CDK_NAMESPACE)
public String getComponentFamily() {
return this.componentFamily;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param family the family to set
*/
public void setComponentFamily(String family) {
@@ -92,15 +95,17 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the attributes
*/
- @XmlElement(name="attribute",namespace=Template.COMPOSITE_NAMESPACE)
+ @XmlElement(name = "attribute", namespace = Template.COMPOSITE_NAMESPACE)
public List<Attribute> getAttributes() {
return this.attributes;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param attributes the attributes to set
*/
public void setAttributes(List<Attribute> attributes) {
@@ -109,34 +114,38 @@
/**
* <p class="changed_added_4_0"></p>
- * @return the resourceDependencies
- */
+ *
+ * @return the resourceDependencies
+ */
@XmlElementWrapper(name = "resource-dependencies", namespace = Template.CDK_NAMESPACE)
- @XmlElement(name="resource-dependency", namespace=Template.CDK_NAMESPACE)
- public List<ResourceDependency> getResourceDependencies() {
- return resourceDependencies;
- }
-
- /**
+ @XmlElement(name = "resource-dependency", namespace = Template.CDK_NAMESPACE)
+ public List<ResourceDependency> getResourceDependencies() {
+ return resourceDependencies;
+ }
+
+ /**
* <p class="changed_added_4_0"></p>
- * @param resourceDependencies the resourceDependencies to set
- */
- public void setResourceDependencies(
- List<ResourceDependency> resourceDependencies) {
- this.resourceDependencies = resourceDependencies;
- }
-
+ *
+ * @param resourceDependencies the resourceDependencies to set
+ */
+ public void setResourceDependencies(
+ List<ResourceDependency> resourceDependencies) {
+ this.resourceDependencies = resourceDependencies;
+ }
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderKitId
*/
- @XmlElement(name="renderkit-id",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "renderkit-id", namespace = Template.CDK_NAMESPACE)
public String getRenderKitId() {
return this.renderKitId;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param renderKitId the renderKitId to set
*/
public void setRenderKitId(String renderKitId) {
@@ -145,15 +154,17 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the javaClass
*/
- @XmlElement(name="class",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "class", namespace = Template.CDK_NAMESPACE)
public String getJavaClass() {
return this.javaClass;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param javaClass the javaClass to set
*/
public void setJavaClass(String javaClass) {
@@ -162,15 +173,17 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererType
*/
- @XmlElement(name="renderer-type",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "renderer-type", namespace = Template.CDK_NAMESPACE)
public String getRendererType() {
return this.rendererType;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendererType the rendererType to set
*/
public void setRendererType(String rendererType) {
@@ -179,35 +192,38 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the baseClass
*/
- @XmlElement(name="superclass",namespace=Template.CDK_NAMESPACE)
+ @XmlElement(name = "superclass", namespace = Template.CDK_NAMESPACE)
public String getBaseClass() {
return this.baseClass;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param baseClass the baseClass to set
*/
public void setBaseClass(String baseClass) {
this.baseClass = baseClass;
}
-
+
/**
* <p class="changed_added_4_0"></p>
- * @return the rendersChildren
- */
+ *
+ * @return the rendersChildren
+ */
//TODO: add handling
- @XmlElement(name="renders-children",namespace=Template.CDK_NAMESPACE)
- public boolean isRendersChildren() {
- return rendersChildren;
- }
-
- /**
- * @param rendersChildren the rendersChildren to set
- */
- public void setRendersChildren(boolean rendersChildren) {
- this.rendersChildren = rendersChildren;
- }
+ @XmlElement(name = "renders-children", namespace = Template.CDK_NAMESPACE)
+ public boolean isRendersChildren() {
+ return rendersChildren;
+ }
+
+ /**
+ * @param rendersChildren the rendersChildren to set
+ */
+ public void setRendersChildren(boolean rendersChildren) {
+ this.rendersChildren = rendersChildren;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ElementsHandler.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ElementsHandler.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ElementsHandler.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,11 +23,15 @@
package org.richfaces.cdk.templatecompiler.model;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
import javax.xml.XMLConstants;
import javax.xml.bind.JAXB;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.annotation.DomHandler;
-import javax.xml.bind.annotation.W3CDomHandler;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -36,48 +40,43 @@
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-public class ElementsHandler implements DomHandler<ModelElement, DOMResult> {
+public class ElementsHandler implements DomHandler<ModelElement, DOMResult> {
private DocumentBuilder builder;
/**
* Default constructor.
- *
+ * <p/>
* It is up to a JAXB provider to decide which DOM implementation
* to use or how that is configured.
*/
public ElementsHandler() {
DocumentBuilderFactory docFactory = DocumentBuilderFactory
- .newInstance();
+ .newInstance();
// Create Document Builder
try {
this.builder = docFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new IllegalArgumentException("No documentBuilderFactory");
- };
+ }
}
/**
* Constructor that allows applications to specify which DOM implementation
* to be used.
*
- * @param builder
- * must not be null. JAXB uses this {@link DocumentBuilder} to create
- * a new element.
+ * @param builder must not be null. JAXB uses this {@link DocumentBuilder} to create
+ * a new element.
*/
public ElementsHandler(DocumentBuilder builder) {
- if(builder==null)
+ if (builder == null) {
throw new IllegalArgumentException();
+ }
this.builder = builder;
}
@@ -86,16 +85,18 @@
}
public void setBuilder(DocumentBuilder builder) {
- if(builder==null)
+ if (builder == null) {
throw new IllegalArgumentException();
+ }
this.builder = builder;
}
public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
- if(builder==null)
+ if (builder == null) {
return new DOMResult();
- else
+ } else {
return new DOMResult(builder.newDocument());
+ }
}
@Override
@@ -103,7 +104,8 @@
Element domElement = getDomElement(rt);
AnyElement element = JAXB.unmarshal(new DOMSource(domElement), AnyElement.class);
String prefix = domElement.getPrefix();
- QName name = new QName(domElement.getNamespaceURI(),domElement.getLocalName(),null!=prefix?prefix:XMLConstants.DEFAULT_NS_PREFIX);
+ QName name = new QName(domElement.getNamespaceURI(), domElement.getLocalName(),
+ null != prefix ? prefix : XMLConstants.DEFAULT_NS_PREFIX);
element.setName(name);
return element;
}
@@ -112,18 +114,18 @@
// JAXP spec is ambiguous about what really happens in this case,
// so work defensively
Node n = r.getNode();
- if( n instanceof Document ) {
- return ((Document)n).getDocumentElement();
+ if (n instanceof Document) {
+ return ((Document) n).getDocumentElement();
}
-
- if( n instanceof Element ) {
+
+ if (n instanceof Element) {
return (Element) n;
}
-
- if( n instanceof DocumentFragment ) {
- return (Element)n.getChildNodes().item(0);
+
+ if (n instanceof DocumentFragment) {
+ return (Element) n.getChildNodes().item(0);
}
-
+
// if the result object contains something strange,
// it is not a user problem, but it is a JAXB provider's problem.
// That's why we throw a runtime exception.
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/LeafModelElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/LeafModelElement.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/LeafModelElement.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,16 +1,15 @@
package org.richfaces.cdk.templatecompiler.model;
-import java.util.List;
-
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlMixed;
+import java.util.List;
public interface LeafModelElement extends ModelElement {
/* (non-Javadoc)
* @see org.richfaces.cdk.templatecompiler.model.ModelElement#getChildren()
*/
- @XmlAnyElement(lax=true,value=ElementsHandler.class)
+ @XmlAnyElement(lax = true, value = ElementsHandler.class)
@XmlMixed
public List<Object> getChildren();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelBase.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelBase.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,14 +23,14 @@
package org.richfaces.cdk.templatecompiler.model;
+import com.google.common.collect.Lists;
+
import java.util.List;
-import com.google.common.collect.Lists;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class ModelBase {
@@ -38,6 +38,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the children
*/
public List<ModelBase> getChildren() {
@@ -46,6 +47,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param children the children to set
*/
public void setChildren(List<ModelBase> children) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelFragment.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelFragment.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ModelFragment.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,69 +1,68 @@
package org.richfaces.cdk.templatecompiler.model;
-import java.util.List;
+import org.richfaces.cdk.CdkException;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.List;
-import org.richfaces.cdk.CdkException;
-
/**
* <p class="changed_added_4_0">All classes that are used in template bodey should be presented
* in the {@link XmlSeeAlso} annotation </p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@XmlSeeAlso({
- CdkCallElement.class,
- CdkBodyElement.class,
- CdkIfElement.class,
- CdkObjectElement.class,
- CdkChooseElement.class,
- CdkForEachElement.class
+ CdkCallElement.class,
+ CdkBodyElement.class,
+ CdkIfElement.class,
+ CdkObjectElement.class,
+ CdkChooseElement.class,
+ CdkForEachElement.class
})
public class ModelFragment implements LeafModelElement {
- private List<Object> children;
+ private List<Object> children;
+ //TODO filter unhandled elements from known namespaces
+ @XmlAnyElement(lax = true, value = ElementsHandler.class)
+ @XmlMixed
+ public List<Object> getChildren() {
+ return this.children;
+ }
- //TODO filter unhandled elements from known namespaces
- @XmlAnyElement(lax=true, value=ElementsHandler.class)
- @XmlMixed
- public List<Object> getChildren() {
- return this.children;
- }
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param body the body to set
+ */
+ public void setChildren(List<Object> body) {
+ this.children = body;
+ }
- /**
- * <p class="changed_added_4_0"></p>
- * @param body the body to set
- */
- public void setChildren(List<Object> body) {
- this.children = body;
- }
+ @Override
+ public void visit(TemplateVisitor visitor) throws CdkException {
+ beforeVisit(visitor);
+ List<Object> childrenList = getChildren();
+ if (childrenList != null) {
+ for (Object child : childrenList) {
+ if (child instanceof String) {
+ visitor.visitElement((String) child);
+ } else if (child instanceof ModelElement) {
+ ((ModelElement) child).visit(visitor);
+ } else {
+ throw new CdkException("Unknown type of element in renderer template " + child.getClass());
+ }
+ }
+ }
+ afterVisit(visitor);
+ }
- @Override
- public void visit(TemplateVisitor visitor) throws CdkException {
- beforeVisit(visitor);
- List<Object> childrenList = getChildren();
- if (childrenList != null) {
- for (Object child : childrenList) {
- if (child instanceof String) {
- visitor.visitElement((String) child);
- } else if (child instanceof ModelElement) {
- ((ModelElement) child).visit(visitor);
- } else {
- throw new CdkException("Unknown type of element in renderer template "+child.getClass());
- }
- }
- }
- afterVisit(visitor);
- }
+ public void afterVisit(TemplateVisitor visitor) throws CdkException {
+ }
- public void afterVisit(TemplateVisitor visitor) throws CdkException {
- }
+ public void beforeVisit(TemplateVisitor visitor) throws CdkException {
+ }
- public void beforeVisit(TemplateVisitor visitor) throws CdkException {
- }
-
}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,10 +21,9 @@
*/
package org.richfaces.cdk.templatecompiler.model;
-import java.text.MessageFormat;
-
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
+import java.text.MessageFormat;
/**
* @author Nick Belaevski
@@ -33,65 +32,72 @@
@XmlType(name = "resourceDependencyType", namespace = Template.CDK_NAMESPACE)
public class ResourceDependency {
- private String name;
-
- private String library;
-
- private String target = "head";
+ private String name;
- /**
+ private String library;
+
+ private String target = "head";
+
+ /**
* <p class="changed_added_4_0"></p>
- * @return the name
- */
- @XmlAttribute(name = "name", required = true)
- public String getName() {
- return name;
- }
+ *
+ * @return the name
+ */
+ @XmlAttribute(name = "name", required = true)
+ public String getName() {
+ return name;
+ }
- /**
+ /**
* <p class="changed_added_4_0"></p>
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
+ *
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
- /**
+ /**
* <p class="changed_added_4_0"></p>
- * @return the libraryName
- */
- @XmlAttribute(name = "library")
- public String getLibrary() {
- return library;
- }
+ *
+ * @return the libraryName
+ */
+ @XmlAttribute(name = "library")
+ public String getLibrary() {
+ return library;
+ }
- /**
+ /**
* <p class="changed_added_4_0"></p>
- * @param library the libraryName to set
- */
- public void setLibrary(String library) {
- this.library = library;
- }
+ *
+ * @param library the libraryName to set
+ */
+ public void setLibrary(String library) {
+ this.library = library;
+ }
- /**
+ /**
* <p class="changed_added_4_0"></p>
- * @return the target
- */
- @XmlAttribute(name = "target")
- public String getTarget() {
- return target;
- }
+ *
+ * @return the target
+ */
+ @XmlAttribute(name = "target")
+ public String getTarget() {
+ return target;
+ }
- /**
+ /**
* <p class="changed_added_4_0"></p>
- * @param target the target to set
- */
- public void setTarget(String target) {
- this.target = target;
- }
-
- @Override
- public String toString() {
- return MessageFormat.format("ResourceDependency[name={0}, library={1}, target={2}]", getName(), getLibrary(), getTarget());
- }
+ *
+ * @param target the target to set
+ */
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ @Override
+ public String toString() {
+ return MessageFormat.format("ResourceDependency[name={0}, library={1}, target={2}]",
+ getName(), getLibrary(), getTarget());
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -28,53 +28,58 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
-@XmlRootElement(name="root",namespace=Template.CDK_NAMESPACE)
+@XmlRootElement(name = "root", namespace = Template.CDK_NAMESPACE)
public class Template {
-
- public static final String JSTL_CORE_NAMESPACE = "http://java.sun.com/jsp/jstl/core";
-
- public static final String CDK_NAMESPACE="http://richfaces.org/cdk";
-
- public static final String COMPOSITE_NAMESPACE="http://java.sun.com/jsf/composite";
- private CompositeInterface _interface;
-
- private CompositeImplementation _implementation;
+ public static final String JSTL_CORE_NAMESPACE = "http://java.sun.com/jsp/jstl/core";
+
+ public static final String CDK_NAMESPACE = "http://richfaces.org/cdk";
+
+ public static final String COMPOSITE_NAMESPACE = "http://java.sun.com/jsf/composite";
+
+ private CompositeInterface compositeInterface;
+
+ private CompositeImplementation compositeImplementation;
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the interface
*/
- @XmlElement(name="interface",namespace=COMPOSITE_NAMESPACE)
+ @XmlElement(name = "interface", namespace = COMPOSITE_NAMESPACE)
public CompositeInterface getInterface() {
- return this._interface;
+ return this.compositeInterface;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param interface1 the interface to set
*/
public void setInterface(CompositeInterface interface1) {
- this._interface = interface1;
+ this.compositeInterface = interface1;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the implementation
*/
- @XmlElement(name="implementation",namespace=COMPOSITE_NAMESPACE)
+ @XmlElement(name = "implementation", namespace = COMPOSITE_NAMESPACE)
public CompositeImplementation getImplementation() {
- return this._implementation;
+ return this.compositeImplementation;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param implementation the implementation to set
*/
public void setImplementation(CompositeImplementation implementation) {
- this._implementation = implementation;
+ this.compositeImplementation = implementation;
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/TemplateVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/TemplateVisitor.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/TemplateVisitor.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -27,8 +27,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public interface TemplateVisitor {
@@ -44,26 +44,26 @@
void endElement(CdkBodyElement cdkBodyElement) throws CdkException;
- void startElement(CdkIfElement cdkIfElement);
+ void startElement(CdkIfElement cdkIfElement);
- void endElement(CdkIfElement cdkIfElement);
+ void endElement(CdkIfElement cdkIfElement);
- void startElement(CdkWhenElement cdkWhenElement);
+ void startElement(CdkWhenElement cdkWhenElement);
- void endElement(CdkWhenElement cdkWhenElement);
+ void endElement(CdkWhenElement cdkWhenElement);
- void startElement(CdkChooseElement cdkChooseElement);
+ void startElement(CdkChooseElement cdkChooseElement);
- void endElement(CdkChooseElement cdkChooseElement);
+ void endElement(CdkChooseElement cdkChooseElement);
- void startElement(CdkOtherwiseElement cdkOtherwiseElement);
+ void startElement(CdkOtherwiseElement cdkOtherwiseElement);
- void endElement(CdkOtherwiseElement cdkOtherwiseElement);
+ void endElement(CdkOtherwiseElement cdkOtherwiseElement);
- void visitElement(CdkObjectElement cdkObjectElement);
+ void visitElement(CdkObjectElement cdkObjectElement);
- void startElement(CdkForEachElement cdkForEachElement);
+ void startElement(CdkForEachElement cdkForEachElement);
- void endElement(CdkForEachElement cdkForEachElement);
+ void endElement(CdkForEachElement cdkForEachElement);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/package-info.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/package-info.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -7,16 +7,13 @@
*/
@XmlAccessorType(XmlAccessType.NONE)
@javax.xml.bind.annotation.XmlSchema(namespace = Template.CDK_NAMESPACE,
- xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
- namespaceURI = Template.CDK_NAMESPACE),
- @javax.xml.bind.annotation.XmlNs(prefix = "cc",
- namespaceURI = Template.COMPOSITE_NAMESPACE)})
-
+ xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
+ namespaceURI = Template.CDK_NAMESPACE),
+ @javax.xml.bind.annotation.XmlNs(prefix = "cc",
+ namespaceURI = Template.COMPOSITE_NAMESPACE)})
package org.richfaces.cdk.templatecompiler.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlSchemaTypes;
-import javax.xml.bind.annotation.XmlSchemaType;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/PropertyUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/PropertyUtils.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/PropertyUtils.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,27 +21,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.util;
import org.richfaces.cdk.model.InvalidNameException;
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public final class PropertyUtils {
- private PropertyUtils() {}
+ private PropertyUtils() {
+ }
public static String methodToName(String methodName) throws InvalidNameException {
if (null != methodName) {
if (methodName.length() > 3 && Character.isUpperCase(methodName.charAt(3))
- && (methodName.startsWith("set") || methodName.startsWith("get"))) {
+ && (methodName.startsWith("set") || methodName.startsWith("get"))) {
return Strings.firstToLowerCase(methodName.substring(3));
} else if (methodName.length() > 2 && Character.isUpperCase(methodName.charAt(2))
- && methodName.startsWith("is")) {
+ && methodName.startsWith("is")) {
return Strings.firstToLowerCase(methodName.substring(2));
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,14 +21,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.util;
/**
* <p class="changed_added_4_0">String manipulation utils.</p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public final class Strings {
private Strings() {
@@ -38,7 +36,8 @@
/**
* <p class="changed_added_4_0">Remove characters from string end</p>
- * @param in input string
+ *
+ * @param in input string
* @param size number of characters to remove.
* @return
*/
@@ -53,6 +52,7 @@
/**
* <p class="changed_added_4_0">Change case of the first character to lower, as it required by the Java Beans property and setter/getter method name conventions:</p>
* <p>"PropertyFoo" will be changed to "propertyFoo"</p>
+ *
* @param in
* @return {@code in} with first character changed to lower case.
*/
@@ -67,6 +67,7 @@
/**
* <p class="changed_added_4_0">Change case of the first character to upper, as it required by the Java Beans property and setter/getter method name conventions:</p>
* <p>"propertyFoo" will be changed to "PropertyFoo"</p>
+ *
* @param in
* @return {@code in} with first character changed to lower case.
*/
@@ -80,6 +81,7 @@
/**
* <p class="changed_added_4_0">Check string for null or empty value</p>
+ *
* @param type
* @return true if {@code type} is null or zero-length string.
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,28 +21,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
+import com.google.common.collect.ImmutableMap;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkContext.SourceType;
+import org.richfaces.cdk.StandardSources;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URI;
-import org.richfaces.cdk.CdkContext;
-import org.richfaces.cdk.StandardSources;
-import org.richfaces.cdk.CdkContext.SourceType;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.EntityResolver2;
-
-import com.google.common.collect.ImmutableMap;
-
/**
* <p class="changed_added_4_0">
* That class resolves entities used by CDK ( standard JSF schemas, extensions,
@@ -50,7 +45,6 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class CdkEntityResolver implements EntityResolver2 {
// configure a validating SAX2.0 parser (Xerces2)
@@ -67,32 +61,32 @@
private static final String SYSTEM_PREFIX = "/META-INF/schema";
private static final String URN_SYSTEM = "urn:system:";
private static final ImmutableMap<String, String> SYSTEM_ENTITIES = ImmutableMap
- .<String, String> builder()
- .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd",
- URN_SYSTEM + "/web-facesconfig_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd",
- URN_SYSTEM + "/web-facesuicomponent_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd",
- URN_SYSTEM + "/web-partialresponse_2_0.xsd")
- .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd",
- URN_SYSTEM + "/web-facesconfig_1_2.xsd")
- .put("http://java.sun.com/xml/ns/javaee/javaee_5.xsd",
- URN_SYSTEM + "/javaee_5.xsd")
- .put(
- "http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd",
- URN_SYSTEM + "/javaee_web_services_1_2.xsd")
- .put(
- "http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd",
- URN_SYSTEM + "/javaee_web_services_client_1_2.xsd").put(
- "http://www.w3.org/2001/03/XMLSchema.dtd",
- URN_SYSTEM + "/XMLSchema.dtd").put(
- "http://www.w3.org/2001/03/xml.xsd",
- URN_SYSTEM + "/xml.xsd").put(
- "http://richfaces.org/cdk/cdk-template.xsd",
- URN_SYSTEM + "/cdk-template.xsd").put(
- "http://richfaces.org/cdk/xhtml-el.xsd",
- URN_SYSTEM + "/xhtml-el.xsd").build();
-
+ .<String, String>builder()
+ .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd",
+ URN_SYSTEM + "/web-facesconfig_2_0.xsd")
+ .put("http://java.sun.com/xml/ns/javaee/web-facesuicomponent_2_0.xsd",
+ URN_SYSTEM + "/web-facesuicomponent_2_0.xsd")
+ .put("http://java.sun.com/xml/ns/javaee/web-partialresponse_2_0.xsd",
+ URN_SYSTEM + "/web-partialresponse_2_0.xsd")
+ .put("http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd",
+ URN_SYSTEM + "/web-facesconfig_1_2.xsd")
+ .put("http://java.sun.com/xml/ns/javaee/javaee_5.xsd",
+ URN_SYSTEM + "/javaee_5.xsd")
+ .put(
+ "http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd",
+ URN_SYSTEM + "/javaee_web_services_1_2.xsd")
+ .put(
+ "http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_2.xsd",
+ URN_SYSTEM + "/javaee_web_services_client_1_2.xsd").put(
+ "http://www.w3.org/2001/03/XMLSchema.dtd",
+ URN_SYSTEM + "/XMLSchema.dtd").put(
+ "http://www.w3.org/2001/03/xml.xsd",
+ URN_SYSTEM + "/xml.xsd").put(
+ "http://richfaces.org/cdk/cdk-template.xsd",
+ URN_SYSTEM + "/cdk-template.xsd").put(
+ "http://richfaces.org/cdk/xhtml-el.xsd",
+ URN_SYSTEM + "/xhtml-el.xsd").build();
+
private final CdkContext context;
public CdkEntityResolver(CdkContext context) {
@@ -121,7 +115,7 @@
@Override
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId)
throws SAXException, IOException {
-
+
String temSystemId = systemId;
// perform conversions with baseURI
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
import org.richfaces.cdk.CdkContext;
@@ -39,12 +37,12 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class FacesConfigGenerator implements CdkWriter {
- private static final String FACES_CONFIG_XML = "META-INF/faces-config.xml";
public static final String FACES_SCHEMA_LOCATION = ComponentLibrary.FACES_CONFIG_NAMESPACE + " "
- + ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
+ + ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
+
+ private static final String FACES_CONFIG_XML = "META-INF/faces-config.xml";
private CdkContext context;
private JAXBBinding jaxbBinding;
private FacesConfigAdapter libraryAdapter;
@@ -73,7 +71,7 @@
// TODO - check modification time.
File facesConfigXml = context.createOutputFile(StandardOutputs.FACES_CONFIG, FACES_CONFIG_XML,
- library.lastModified());
+ library.lastModified());
if (null != facesConfigXml) {
try {
@@ -83,7 +81,7 @@
jaxbBinding.marshal(facesConfigXml, FACES_SCHEMA_LOCATION, libraryAdapter.marshal(library));
} catch (Exception e) {
if (e instanceof CdkException) {
- throw(CdkException) e;
+ throw (CdkException) e;
} else {
throw new CdkException(e);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -31,8 +29,8 @@
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class FacesConfigNamespacePreffixMapper /* extends NamespacePrefixMapper */ {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
import org.richfaces.cdk.CdkContext;
@@ -36,8 +34,8 @@
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class FacesConfigParser implements ModelBuilder {
private CdkContext context;
@@ -45,6 +43,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the context
*/
public CdkContext getContext() {
@@ -64,7 +63,7 @@
library.getComponents().addAll(unmarshal.getComponents());
library.getRenderKits().addAll(unmarshal.getRenderKits());
-
+
// TODO - merge changes into library.
// library.getRenderers().addAll(unmarshal.getRenderers());
// library.getValidators().addAll(unmarshal.getValidators);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,13 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
-import java.util.Collection;
-import java.util.Collections;
-
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWorker;
@@ -35,6 +30,9 @@
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.xmlconfig.model.Properties;
+import java.util.Collection;
+import java.util.Collections;
+
/**
* <p class="changed_added_4_0">
* That class parses xml document with fragment of faces-config ( eg, standard
@@ -42,13 +40,13 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class FragmentParser implements CdkWorker {
private JAXBBinding binding;
private CdkContext context;
- public FragmentParser() {}
+ public FragmentParser() {
+ }
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,13 +21,34 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
+import com.google.common.collect.ImmutableSet;
+import org.apache.cocoon.pipeline.component.sax.XIncludeTransformer;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkWorker;
+import org.richfaces.cdk.model.ConfigExtension;
+import org.richfaces.cdk.model.Extensible;
+import org.richfaces.cdk.model.Key;
+import org.richfaces.cdk.model.ModelElement;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.bind.util.ValidationEventCollector;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -35,49 +56,17 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-
import java.net.URI;
import java.net.URISyntaxException;
-
import java.util.Collection;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.util.ValidationEventCollector;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.cocoon.pipeline.component.sax.XIncludeTransformer;
-
-import org.richfaces.cdk.CdkContext;
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.CdkWorker;
-import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.Extensible;
-import org.richfaces.cdk.model.Key;
-import org.richfaces.cdk.model.ModelElement;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import com.google.common.collect.ImmutableSet;
-
/**
* <p class="changed_added_4_0">
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class JAXBBinding implements CdkWorker {
private static final FacesConfigNamespacePreffixMapper PREFFIX_MAPPER = new FacesConfigNamespacePreffixMapper();
@@ -86,7 +75,8 @@
private CdkContext context;
private CdkEntityResolver resolver;
- public JAXBBinding() { }
+ public JAXBBinding() {
+ }
/**
* <p class="changed_added_4_0">
@@ -262,14 +252,10 @@
* object to adapter.
* </p>
*
- * @param <A>
- * type of adapter object
- * @param <T>
- * type of model object.
- * @param adapterClass
- * adapter class.
- * @param modelObject
- * model object class.
+ * @param <A> type of adapter object
+ * @param <T> type of model object.
+ * @param adapterClass adapter class.
+ * @param modelObject model object class.
* @return initialized instance of adapter object.
*/
public static <A, T> A createAdapter(Class<A> adapterClass, T modelObject) throws CdkException {
@@ -289,7 +275,7 @@
}
public static <A, T extends ModelElement<? super T, K>, K extends Key> T createModelElement(Class<T> modelClass,
- A adapter, K key) throws CdkException {
+ A adapter, K key) throws CdkException {
try {
Constructor<T> constructor = modelClass.getConstructor(key.getClass());
@@ -359,11 +345,11 @@
*/
private static <D> ConfigExtension createExtension(D destination)
throws NoSuchMethodException, InstantiationException, IllegalAccessException {
-
+
Method method = destination.getClass().getMethod("getExtension");
Class<? extends ConfigExtension> destinationExtensionType =
(Class<? extends ConfigExtension>) method.getReturnType();
-
+
return destinationExtensionType.newInstance();
}
@@ -392,7 +378,7 @@
Method readMethod = sourceProperty.getReadMethod();
if (!IGNORE_PROPERTIES.contains(name) && name.equals(sourceProperty.getName())
- && null != readMethod) {
+ && null != readMethod) {
Class<?> targetType = targetProperty.getPropertyType();
Class<?> sourceType = sourceProperty.getPropertyType();
Object propertyValue = readMethod.invoke(source);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,20 +21,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Attribute;
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class AttributeAdapter extends XmlAdapter<AttributeBean, Attribute> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,22 +21,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.Extensible;
import org.richfaces.cdk.xmlconfig.model.PropertyBean.PropertyExtension;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class AttributeBean extends DescriptionGroupBean implements Extensible<PropertyBean.PropertyExtension> {
private String defaultValue;
@@ -47,6 +45,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
@XmlElement(name = "attribute-name", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -56,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
@@ -64,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@XmlElement(name = "attribute-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -74,6 +75,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(ClassDescription type) {
@@ -82,6 +84,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the defaultValue
*/
@XmlElement(name = "default-value", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -91,6 +94,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(String defaultValue) {
@@ -99,6 +103,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the suggestedValue
*/
@XmlElement(name = "suggested-value", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -108,6 +113,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param suggestedValue the suggestedValue to set
*/
public void setSuggestedValue(String suggestedValue) {
@@ -122,6 +128,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extension the extension to set
*/
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.BehaviorRenderer;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class BehaviorRendererAdapter extends XmlAdapter<BehaviorRendererBean, BehaviorRenderer> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,22 +21,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ConfigExtension;
-package org.richfaces.cdk.xmlconfig.model;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.ConfigExtension;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "faces-config-client-behavior-rendererType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class BehaviorRendererBean {
@@ -45,6 +43,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@XmlElement(name = "client-behavior-renderer-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -54,6 +53,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(String type) {
@@ -62,6 +62,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererClass
*/
@XmlElement(name = "client-behavior-renderer-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -72,6 +73,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendererClass the rendererClass to set
*/
public void setRendererClass(ClassDescription rendererClass) {
@@ -80,10 +82,11 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
- public static class BehaviorRendererExtension extends ConfigExtension {}
+ public static class BehaviorRendererExtension extends ConfigExtension {
+ }
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,18 +21,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.ClassDescription;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class ClassAdapter extends XmlAdapter<ClassBean, ClassDescription> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ClassBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.ComponentLibrary;
-package org.richfaces.cdk.xmlconfig.model;
-
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
-import org.richfaces.cdk.model.ComponentLibrary;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "fully-qualified-classType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class ClassBean {
@@ -41,6 +39,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
@XmlValue
@@ -50,6 +49,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class ComponentAdapter extends XmlAdapter<ComponentBean, Component> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,17 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
@@ -39,12 +31,16 @@
import org.richfaces.cdk.model.Facet;
import org.richfaces.cdk.model.Property;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "faces-config-componentType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class ComponentBean extends ExtensibleBean<ComponentBean.ComponentExtension> {
@@ -55,6 +51,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@XmlElement(name = "component-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -64,6 +61,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(String type) {
@@ -72,6 +70,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the componentClass
*/
@XmlElement(name = "component-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -82,6 +81,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param componentClass the componentClass to set
*/
public void setComponentClass(ClassDescription className) {
@@ -90,25 +90,27 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the attributes
*/
@XmlElements({@XmlElement(
name = "property",
namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
type = PropertyBean.class
- ) , @XmlElement(
+ ), @XmlElement(
name = "attribute",
namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
type = AttributeBean.class
- ) })
+ )})
-// @XmlElement(name="attributes",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+// @XmlElement(name="attributes",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public List<Property> getAttributes() {
return attributes;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param attributes the attributes to set
*/
public void setAttributes(List<Property> property) {
@@ -117,6 +119,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the facets
*/
@XmlElement(name = "facet", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -127,6 +130,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param facets the facets to set
*/
public void setFacets(List<Facet> facets) {
@@ -135,6 +139,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
@XmlElement(name = "component-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -157,6 +162,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param family the family to set
*/
public void setFamily(String family) {
@@ -165,6 +171,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the family
*/
@XmlElement(name = "component-family", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -174,6 +181,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the baseClass
*/
@XmlElement(name = "base-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -184,6 +192,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param baseClass the baseClass to set
*/
public void setBaseClass(ClassDescription baseClass) {
@@ -192,6 +201,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
@XmlElement(name = "generate", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -201,6 +211,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean generate) {
@@ -209,6 +220,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param rendererTypes the rendererTypes to set
*/
@XmlElement(name = "renderer-type", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -218,6 +230,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the rendererTypes
*/
public List<String> getRendererTypes() {
@@ -226,6 +239,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the events
*/
@XmlElement(name = "fires", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -236,6 +250,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param events the events to set
*/
public void setEvents(List<Event> events) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -1,10 +1,10 @@
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.XmlElement;
-
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.DescriptionGroup;
+import javax.xml.bind.annotation.XmlElement;
+
public class DescriptionGroupBean implements DescriptionGroup {
private String description;
private String displayname;
@@ -16,6 +16,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the icon
*/
@XmlElement(name = "icon", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -25,6 +26,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param icon the icon to set
*/
public final void setIcon(Icon icon) {
@@ -33,6 +35,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the description
*/
@XmlElement(name = "description", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -42,6 +45,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param description the description to set
*/
public final void setDescription(String description) {
@@ -50,6 +54,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the displayname
*/
@XmlElement(name = "display-name", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -59,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param displayname the displayname to set
*/
public final void setDisplayname(String displayname) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Event;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class EventAdapter extends XmlAdapter<EventBean, Event> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,21 +21,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
-package org.richfaces.cdk.xmlconfig.model;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.ComponentLibrary;
-
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "faces-eventType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
public class EventBean {
@@ -47,6 +45,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@XmlElement(name = "event-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -56,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(String type) {
@@ -64,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the description
*/
@XmlElement(name = "description", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -73,6 +74,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param description the description to set
*/
public void setDescription(String description) {
@@ -81,6 +83,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the listenerInterface
*/
@XmlElement(name = "listener-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -91,6 +94,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param listenerInterface the listenerInterface to set
*/
public void setListenerInterface(ClassDescription listenerInterface) {
@@ -99,6 +103,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the sourceInterface
*/
@XmlElement(name = "source-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -109,6 +114,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param sourceInterface the sourceInterface to set
*/
public void setSourceInterface(ClassDescription sourceInterface) {
@@ -117,6 +123,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the tagHandler
*/
@XmlElement(name = "tag-handler-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -127,6 +134,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param tagHandler the tagHandler to set
*/
public void setTagHandler(ClassDescription tagHandler) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ExtensibleBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
import org.richfaces.cdk.model.ConfigExtension;
@@ -30,14 +28,15 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class ExtensibleBean<E extends ConfigExtension> extends DescriptionGroupBean implements Extensible<E> {
private E extension;
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
public E getExtension() {
@@ -46,6 +45,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extension the extension to set
*/
public void setExtension(E extension) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class FacesConfigAdapter extends XmlAdapter<FacesConfigBean, ComponentLibrary> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,17 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.Component;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
@@ -39,12 +31,16 @@
import org.richfaces.cdk.model.Extensible;
import org.richfaces.cdk.model.RenderKit;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlRootElement(name = "faces-config", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class FacesConfigBean implements Extensible<FacesConfigBean.FacesConfigExtension> {
@@ -59,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the version
*/
@XmlAttribute
@@ -68,6 +65,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param version the version to set
*/
public void setVersion(String version) {
@@ -76,6 +74,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the components
*/
public List<Component> getComponents() {
@@ -84,6 +83,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param components the components to set
*/
public void setComponents(List<Component> components) {
@@ -92,6 +92,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderKits
*/
public List<RenderKit> getRenderKits() {
@@ -100,6 +101,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param renderKits the renderKits to set
*/
public void setRenderKits(List<RenderKit> renderKits) {
@@ -108,6 +110,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
@XmlElement(name = "faces-config-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -117,6 +120,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extension the extension to set
*/
public void setExtension(FacesConfigExtension extension) {
@@ -134,6 +138,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param events the events to set
*/
public void setEvents(List<Event> events) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Facet;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class FacetAdapter extends XmlAdapter<FacetBean, Facet> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacetBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,25 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.XmlElement;
-
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
+import javax.xml.bind.annotation.XmlElement;
+
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class FacetBean extends ExtensibleBean<FacetBean.FacetExtension> {
private String name;
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
@XmlElement(name = "facet-name", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -49,6 +48,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
@@ -57,6 +57,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
@XmlElement(name = "facet-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -71,14 +72,15 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public static final class FacetExtension extends ConfigExtension {
private boolean generate;
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
@XmlElement(name = "generate", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -88,6 +90,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean generate) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/Properties.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,25 +21,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
+import com.google.common.collect.Lists;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.Property;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.Property;
-
-import com.google.common.collect.Lists;
-
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
@XmlRootElement(name = "properties", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
public class Properties {
@@ -47,21 +43,23 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the property
*/
@XmlElements({@XmlElement(
name = "property",
namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
type = PropertyBean.class
- ) , @XmlElement(name = "attribute", type = PropertyBean.class) })
+ ), @XmlElement(name = "attribute", type = PropertyBean.class)})
-// @XmlElement(name="property",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+// @XmlElement(name="property",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public List<Property> getProperty() {
return property;
}
/**
* <p class="changed_added_4_0"></p>
+ *
* @param property the property to set
*/
public void setProperty(List<Property> property) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class PropertyAdapter extends XmlAdapter<PropertyBean, Property> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,25 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.EventName;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
+import java.util.Set;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class PropertyBean extends ExtensibleBean<PropertyBean.PropertyExtension> {
private String defaultValue;
@@ -53,6 +49,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the name
*/
@XmlElement(name = "property-name", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -62,6 +59,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param name the name to set
*/
public void setName(String name) {
@@ -70,6 +68,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the type
*/
@XmlElement(name = "property-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -80,6 +79,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param type the type to set
*/
public void setType(ClassDescription type) {
@@ -88,6 +88,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the defaultValue
*/
@XmlElement(name = "default-value", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -97,6 +98,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(String defaultValue) {
@@ -105,6 +107,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the suggestedValue
*/
@XmlElement(name = "suggested-value", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -114,6 +117,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param suggestedValue the suggestedValue to set
*/
public void setSuggestedValue(String suggestedValue) {
@@ -133,8 +137,8 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public static class PropertyExtension extends ConfigExtension {
private boolean passThrough = false;
@@ -149,6 +153,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the generate
*/
@XmlElement(name = "generate", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -158,6 +163,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param generate the generate to set
*/
public void setGenerate(boolean generate) {
@@ -166,6 +172,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the hidden
*/
@XmlElement(name = "hidden", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -175,6 +182,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param hidden the hidden to set
*/
public void setHidden(boolean hidden) {
@@ -183,6 +191,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the literal
*/
@XmlElement(name = "literal", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -192,6 +201,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param literal the literal to set
*/
public void setLiteral(boolean literal) {
@@ -200,6 +210,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the required
*/
@XmlElement(name = "required", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -209,6 +220,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param required the required to set
*/
public void setRequired(boolean required) {
@@ -217,6 +229,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the readOnly
*/
@XmlElement(name = "read-only", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -226,6 +239,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param readOnly the readOnly to set
*/
public void setReadOnly(boolean readOnly) {
@@ -234,6 +248,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the passThrough
*/
@XmlElement(name = "pass-through", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -243,6 +258,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param passThrough the passThrough to set
*/
public void setPassThrough(boolean passThrough) {
@@ -251,6 +267,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the eventNames
*/
@XmlElement(name = "event-name", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -260,6 +277,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param eventNames the eventNames to set
*/
public void setEventNames(Set<EventName> eventNames) {
@@ -268,6 +286,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the signature
*/
@XmlElementWrapper(name = "signature", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -279,6 +298,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param signature the signature to set
*/
public void setSignature(List<ClassDescription> signature) {
@@ -287,6 +307,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the aliases
*/
@XmlElement(name = "alias", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -296,6 +317,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param aliases the aliases to set
*/
public void setAliases(Set<String> aliases) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.RenderKit;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class RenderKitAdapter extends XmlAdapter<RenderKitBean, RenderKit> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,29 +21,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.faces.render.RenderKitFactory;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.BehaviorRenderer;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.Renderer;
-import com.google.common.collect.Lists;
+import javax.faces.render.RenderKitFactory;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
public class RenderKitBean extends ExtensibleBean<RenderKitBean.RenderKitExtension> {
@XmlElement(name = "render-kit-id", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -60,6 +55,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderkitClass
*/
public ClassDescription getRenderkitClass() {
@@ -68,6 +64,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param renderkitClass the renderkitClass to set
*/
public void setRenderkitClass(ClassDescription renderkitClass) {
@@ -76,6 +73,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the id
*/
public String getId() {
@@ -84,6 +82,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param id the id to set
*/
public void setId(String id) {
@@ -92,6 +91,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the renderers
*/
public List<Renderer> getRenderers() {
@@ -100,6 +100,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param renderers the renderers to set
*/
public void setRenderers(List<Renderer> renderers) {
@@ -108,6 +109,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @return the extension
*/
@XmlElement(name = "render-kit-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -117,6 +119,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param extension the extension to set
*/
public void setExtension(RenderKitExtension extension) {
@@ -125,8 +128,9 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @author asmirnov(a)exadel.com
- *
*/
- public static class RenderKitExtension extends ConfigExtension {}
+ public static class RenderKitExtension extends ConfigExtension {
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererAdapter.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,19 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig.model;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
import org.richfaces.cdk.model.Renderer;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
/**
* <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
*
+ * @author asmirnov(a)exadel.com
*/
public class RendererAdapter extends XmlAdapter<RendererBean, Renderer> {
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -23,31 +23,27 @@
package org.richfaces.cdk.xmlconfig.model;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
+import com.google.common.collect.Lists;
import org.richfaces.cdk.model.Attribute;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
-import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.Tag;
-import com.google.common.collect.Lists;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.util.List;
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
@XmlType(name = "faces-config-rendererType", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class RendererBean extends
- ExtensibleBean<RendererBean.RendererExtension> {
+ ExtensibleBean<RendererBean.RendererExtension> {
private List<Attribute> attributes = Lists.newArrayList();
private String family;
@@ -57,7 +53,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the type
*/
@XmlElement(name = "renderer-type", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -68,9 +64,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param type
- * the type to set
+ *
+ * @param type the type to set
*/
public void setType(String type) {
this.type = type;
@@ -79,7 +74,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the family
*/
@XmlElement(name = "component-family", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -90,9 +85,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param family
- * the family to set
+ *
+ * @param family the family to set
*/
public void setFamily(String family) {
this.family = family;
@@ -101,7 +95,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the rendererClass
*/
@XmlElement(name = "renderer-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -113,9 +107,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param rendererClass
- * the rendererClass to set
+ *
+ * @param rendererClass the rendererClass to set
*/
public void setRendererClass(ClassDescription rendererClass) {
this.rendererClass = rendererClass;
@@ -124,7 +117,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the attributes
*/
@XmlElement(name = "attribute", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
@@ -135,9 +128,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param attributes
- * the attributes to set
+ *
+ * @param attributes the attributes to set
*/
public void setAttributes(List<Attribute> attributes) {
this.attributes = attributes;
@@ -146,7 +138,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the extension
*/
@XmlElement(name = "renderer-extension", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -162,9 +154,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
*/
public static class RendererExtension extends ConfigExtension {
private Tag tag;
@@ -174,7 +165,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the tag
*/
@XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -185,9 +176,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param tag
- * the tag to set
+ *
+ * @param tag the tag to set
*/
public void setTag(Tag tag) {
this.tag = tag;
@@ -196,7 +186,7 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @return the rendersChildren
*/
@XmlElement(name = "renders-children", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@@ -207,9 +197,8 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
- * @param rendersChildren
- * the rendersChildren to set
+ *
+ * @param rendersChildren the rendersChildren to set
*/
public void setRendersChildren(boolean rendersChildren) {
this.rendersChildren = rendersChildren;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/package-info.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -7,23 +7,23 @@
*/
@XmlAccessorType(XmlAccessType.NONE)
@javax.xml.bind.annotation.XmlSchema(namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- location = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION,
- xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
- namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)})
+ location = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION,
+ xmlns = {(a)javax.xml.bind.annotation.XmlNs(prefix = "cdk",
+ namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)})
@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type = Property.class, value = PropertyAdapter.class),
- @XmlJavaTypeAdapter(type = Attribute.class, value = AttributeAdapter.class),
- @XmlJavaTypeAdapter(type = ClassDescription.class, value = ClassAdapter.class),
- @XmlJavaTypeAdapter(type = ComponentLibrary.class, value = FacesConfigAdapter.class)
+ @XmlJavaTypeAdapter(type = Attribute.class, value = AttributeAdapter.class),
+ @XmlJavaTypeAdapter(type = ClassDescription.class, value = ClassAdapter.class),
+ @XmlJavaTypeAdapter(type = ComponentLibrary.class, value = FacesConfigAdapter.class)
})
package org.richfaces.cdk.xmlconfig.model;
+import org.richfaces.cdk.model.Attribute;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.Property;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
-import org.richfaces.cdk.model.Attribute;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.Property;
-
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/NamesListComparator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/NamesListComparator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/NamesListComparator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils;
-import java.util.Comparator;
-
import org.w3c.dom.Node;
+import java.util.Comparator;
+
/**
* @author Nick Belaevski
* @since 3.2.2
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/ParsingException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/ParsingException.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/ParsingException.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -5,7 +5,7 @@
public class ParsingException extends CdkException {
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0"></p>
*/
private static final long serialVersionUID = 1629210103196620913L;
@@ -18,6 +18,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
*/
public ParsingException(String message) {
@@ -26,6 +27,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param cause
*/
public ParsingException(Throwable cause) {
@@ -34,6 +36,7 @@
/**
* <p class="changed_added_4_0"></p>
+ *
* @param message
* @param cause
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBody.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBody.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBody.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,35 +19,30 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
class ArrayNodeList implements NodeList {
private Node[] nodes;
@@ -69,13 +64,11 @@
}
}
-
/**
* This class must read XML file from input stream and can extract body of root
* element for include into target in generation.
*
* @author shura
- *
*/
public class XMLBody {
private Element rootElement;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodyMerge.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodyMerge.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodyMerge.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,10 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -30,19 +37,8 @@
import java.util.List;
import java.util.Set;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
/**
* @author Maksim Kaszynski
- *
*/
public class XMLBodyMerge implements NodeList {
private Document document = null;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodySerializer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodySerializer.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XMLBodySerializer.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils;
-import java.io.StringWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.NodeList;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.Transformer;
@@ -31,14 +31,10 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import java.io.StringWriter;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.NodeList;
-
/**
* @author Maksim Kaszynski
- *
*/
public class XMLBodySerializer {
public String serialize(NodeList childNodes, Document xmlDocument) throws ParsingException {
@@ -54,9 +50,14 @@
Transformer transformer = transformerFactory.newTransformer();
transformer.setErrorListener(new ErrorListener() {
- public void error(TransformerException exception) throws TransformerException {}
- public void fatalError(TransformerException exception) throws TransformerException {}
- public void warning(TransformerException exception) throws TransformerException {}
+ public void error(TransformerException exception) throws TransformerException {
+ }
+
+ public void fatalError(TransformerException exception) throws TransformerException {
+ }
+
+ public void warning(TransformerException exception) throws TransformerException {
+ }
});
transformer.setOutputProperty("indent", "yes");
transformer.setOutputProperty("omit-xml-declaration", "yes");
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XPathComparator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XPathComparator.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/XPathComparator.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,21 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils;
-import java.util.Comparator;
+import org.w3c.dom.Node;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
+import java.util.Comparator;
-import org.w3c.dom.Node;
-
/**
* @author Maksim Kaszynski
- *
*/
public class XPathComparator implements Comparator<Node> {
private XPathCompatorCriterion[] criteria;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Attribute.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Attribute.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,13 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd;
/**
* @author Maksim Kaszynski
- *
*/
public class Attribute extends Node {
public Attribute(String name) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinition.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinition.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinition.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,18 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd;
import java.net.URL;
-
import java.util.HashMap;
import java.util.Map;
/**
* @author Maksim Kaszynski
- *
*/
public class DocumentDefinition {
private Map<String, Element> elements = new HashMap<String, Element>();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinitionFactory.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinitionFactory.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/DocumentDefinitionFactory.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,17 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd;
-import java.net.URL;
-
import org.richfaces.cdk.xmlutils.dtd.wutka.WutkaDefinitionFactory;
+import java.net.URL;
+
/**
* @author Maksim Kaszynski
- *
*/
public abstract class DocumentDefinitionFactory {
private static DocumentDefinitionFactory instance = new WutkaDefinitionFactory();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Element.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Element.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Element.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd;
import java.util.HashMap;
@@ -28,7 +26,6 @@
/**
* @author Maksim Kaszynski
- *
*/
public class Element extends Node {
private Map<String, Attribute> attributes = new HashMap<String, Attribute>();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Node.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Node.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/Node.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd;
/**
* Reduced DOM
- * @author Maksim Kaszynski
*
+ * @author Maksim Kaszynski
*/
public class Node {
private String name;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/wutka/WutkaDefinitionFactory.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/wutka/WutkaDefinitionFactory.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/wutka/WutkaDefinitionFactory.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -19,16 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd.wutka;
-import java.net.URL;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
+import com.wutka.dtd.DTD;
+import com.wutka.dtd.DTDAttribute;
+import com.wutka.dtd.DTDElement;
+import com.wutka.dtd.DTDParser;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.LoggerFactory;
import org.richfaces.cdk.xmlutils.dtd.Attribute;
@@ -36,14 +32,13 @@
import org.richfaces.cdk.xmlutils.dtd.DocumentDefinitionFactory;
import org.richfaces.cdk.xmlutils.dtd.Element;
-import com.wutka.dtd.DTD;
-import com.wutka.dtd.DTDAttribute;
-import com.wutka.dtd.DTDElement;
-import com.wutka.dtd.DTDParser;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author Maksim Kaszynski
- *
*/
public class WutkaDefinitionFactory extends DocumentDefinitionFactory {
private final Logger log = LoggerFactory.getLogger();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/xerces/XercesDefinitionFactory.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/xerces/XercesDefinitionFactory.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlutils/dtd/xerces/XercesDefinitionFactory.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,17 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlutils.dtd.xerces;
-import java.io.IOException;
-
-import java.net.URL;
-
-import java.util.HashMap;
-import java.util.Map;
-
import org.apache.xerces.impl.Constants;
import org.apache.xerces.parsers.XMLGrammarPreparser;
import org.apache.xerces.xni.XNIException;
@@ -40,12 +31,16 @@
import org.apache.xerces.xni.grammars.XSGrammar;
import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xs.XSModel;
-
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.LoggerFactory;
import org.richfaces.cdk.xmlutils.dtd.DocumentDefinition;
import org.richfaces.cdk.xmlutils.dtd.DocumentDefinitionFactory;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* <p class="changed_added_4_0">
* That class implements {@link DocumentDefinitionFactory} that parses XML
@@ -53,11 +48,12 @@
* </p>
*
* @author asmirnov(a)exadel.com
- *
*/
public class XercesDefinitionFactory extends DocumentDefinitionFactory {
- /** Namespaces feature id (http://xml.org/sax/features/namespaces). */
+ /**
+ * Namespaces feature id (http://xml.org/sax/features/namespaces).
+ */
public static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces";
/**
@@ -73,27 +69,39 @@
*/
public static final String SCHEMA_VALIDATION_FEATURE_ID = "http://apache.org/xml/features/validation/schema";
- /** Validation feature id (http://xml.org/sax/features/validation). */
+ /**
+ * Validation feature id (http://xml.org/sax/features/validation).
+ */
public static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation";
- /** Property identifier: symbol table. */
+ /**
+ * Property identifier: symbol table.
+ */
public static final String SYMBOL_TABLE = Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
- /** Property identifier: grammar pool . */
+ /**
+ * Property identifier: grammar pool .
+ */
public static final String GRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
- /** Property identifier: error reporter. */
+ /**
+ * Property identifier: error reporter.
+ */
public static final String ERROR_REPORTER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
- /** Property identifier: error handler. */
+ /**
+ * Property identifier: error handler.
+ */
public static final String ERROR_HANDLER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
- /** Property identifier: entity resolver. */
+ /**
+ * Property identifier: entity resolver.
+ */
public static final String ENTITY_RESOLVER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
// feature: continue-after-fatal-error
public static final String CONTINUE_AFTER_FATAL_ERROR = Constants.XERCES_FEATURE_PREFIX
- + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
+ + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
private final Logger log = LoggerFactory.getLogger();
private Map<URL, DocumentDefinition> definitions = new HashMap<URL, DocumentDefinition>();
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-12-04 19:28:29 UTC (rev 16066)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-12-04 20:11:46 UTC (rev 16067)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.builder.mojo;
import org.apache.maven.model.FileSet;
@@ -32,32 +30,44 @@
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.DirectoryScanner;
-
import org.richfaces.builder.maven.MavenLogger;
-import org.richfaces.cdk.*;
+import org.richfaces.cdk.CdkContextBase;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkWorker;
+import org.richfaces.cdk.LibraryBuilder;
+import org.richfaces.cdk.LoggerFactory;
+import org.richfaces.cdk.ModelValidator;
+import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.RichFacesConventions;
+import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.ValidatorImpl;
import org.richfaces.cdk.model.ComponentLibrary;
import java.io.File;
-
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
/**
* <p class="changed_added_4_0">
* </p>
*
* @author asmirnov(a)exadel.com
- *
* @goal generate
* @requiresDependencyResolution compile
* @phase generate-sources
*/
public class GenerateMojo extends AbstractMojo {
- private static final String[] JAVA_INCLUDES = new String[] {"**/*.java"};
+ private static final String[] JAVA_INCLUDES = new String[]{"**/*.java"};
private static final String MAIN_CONFIG = "src/main/config";
private static final String MAIN_TEMPLATES = "src/main/templates";
private static final String[] STRINGS_ARRAY = new String[0];
@@ -85,6 +95,7 @@
* The list of JSF configuration files that will be processed by CDK.
* By default, CDK looks for all files in the <code>src/main/config</code> folder
* with "xml" extension.
+ *
* @parameter
*/
protected FileSet[] facesConfigs;
@@ -113,8 +124,7 @@
/**
* Directory where the output Java Files will be located.
*
- * @parameter
- * expression="${project.build.directory}/generated-sources/main/resources"
+ * @parameter expression="${project.build.directory}/generated-sources/main/resources"
*/
protected File outputResourcesDirectory;
@@ -126,8 +136,7 @@
/**
* Directory where the output Java Files will be located.
*
- * @parameter
- * expression="${project.build.directory}/generated-sources/test/resources"
+ * @parameter expression="${project.build.directory}/generated-sources/test/resources"
*/
protected File outputTestResourcesDirectory;
@@ -142,6 +151,7 @@
/**
* List of filename patterns that will be excluded from process by annotations processor.
* By default, all *.java files will be processed.
+ *
* @parameter
*/
protected String[] sourceExcludes;
@@ -149,6 +159,7 @@
/**
* List of filename patterns that will be included to process by annotations processor.
* By default, all *.java files will be processed.
+ *
* @parameter
*/
protected String[] sourceIncludes;
@@ -157,6 +168,7 @@
* The list of Renderer template files that will be processed by CDK.
* By default, CDK looks for all files in the <code>src/main/templates</code> folder
* with "xml" extension.
+ *
* @parameter
*/
protected FileSet[] templates;
@@ -173,11 +185,11 @@
*/
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
- if ("pom".equals(project.getPackaging())) {
- getLog().info("Skipping 'pom' packaging project: " + project.getModel().getId());
- return;
- }
-
+ if ("pom".equals(project.getPackaging())) {
+ getLog().info("Skipping 'pom' packaging project: " + project.getModel().getId());
+ return;
+ }
+
// Setup logger.
LoggerFactory.setLogger(new MavenLogger(getLog()));
@@ -303,6 +315,7 @@
/**
* <p class="changed_added_4_0">This utility method sets output directory for particular type.
* I such directory does not exist, it is created.</p>
+ *
* @param context
* @param directory
* @param type
@@ -324,14 +337,14 @@
}
private File resolveRelativePath(File file) {
- File result = file;
- if (!result.isAbsolute()) {
- result = new File(project.getBasedir(), result.getPath());
- }
-
- return result;
+ File result = file;
+ if (!result.isAbsolute()) {
+ result = new File(project.getBasedir(), result.getPath());
+ }
+
+ return result;
}
-
+
private Iterable<File> findTemplateFiles() throws MojoExecutionException {
if (null == templates) {
File defaultDirectory = resolveRelativePath(new File(MAIN_TEMPLATES));
@@ -341,7 +354,7 @@
fileSet.setDirectory(MAIN_TEMPLATES);
fileSet.addInclude(XML_INCLUDES);
- templates = new FileSet[] {fileSet};
+ templates = new FileSet[]{fileSet};
}
}
@@ -373,7 +386,7 @@
fileSet.setDirectory(MAIN_CONFIG);
fileSet.addInclude(XML_INCLUDES);
- facesConfigs = new FileSet[] {fileSet};
+ facesConfigs = new FileSet[]{fileSet};
}
}
@@ -390,7 +403,7 @@
urls[i++] = new File(outputDirectory).toURI().toURL();
- for (Iterator<String> iter = classpathElements.iterator(); iter.hasNext(); ) {
+ for (Iterator<String> iter = classpathElements.iterator(); iter.hasNext();) {
String element = iter.next();
urls[i++] = new File(element).toURI().toURL();
@@ -437,10 +450,10 @@
String[] includes = (String[]) fileSet.getIncludes().toArray(STRINGS_ARRAY);
String[] excludes = (String[]) fileSet.getExcludes().toArray(STRINGS_ARRAY);
File fileSetDirectory = resolveRelativePath(new File(fileSet.getDirectory()));
- String[] scan = doScan(includes, excludes, fileSetDirectory);
+ String[] scan = doScan(includes, excludes, fileSetDirectory);
for (String filename : scan) {
- files.add(resolveRelativePath(new File(fileSetDirectory, filename)));
+ files.add(resolveRelativePath(new File(fileSetDirectory, filename)));
}
}
}
14 years, 5 months