Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64ObjectOutputStream.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64ObjectOutputStream.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64ObjectOutputStream.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64ObjectOutputStream.java Mon Nov 12 14:22:31 2007
@@ -1,29 +1,29 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.zip.GZIPOutputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.zip.GZIPOutputStream;
/**
* Wraps a {@link Base64OutputStream} with a {@link GZIPOutputStream} as an
* {@link ObjectOutputStream}. This allows an object (or objects) to be encoded into a Base64
* string (accessed via {@link #toBase64()}).
- *
+ *
* @see Base64ObjectInputStream
*/
public class Base64ObjectOutputStream extends ObjectOutputStream
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java Mon Nov 12 14:22:31 2007
@@ -1,22 +1,22 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
-import java.io.ByteArrayOutputStream;
-
-import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.binary.Base64;
+
+import java.io.ByteArrayOutputStream;
/**
* An extension of {@link ByteArrayOutputStream} that allows the final byte array to be converted to
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ContentType.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ContentType.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ContentType.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ContentType.java Mon Nov 12 14:22:31 2007
@@ -15,14 +15,13 @@
package org.apache.tapestry.internal.util;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
+import org.apache.tapestry.ioc.internal.util.Defense;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
-import org.apache.tapestry.ioc.internal.util.Defense;
-import org.apache.tapestry.ioc.internal.util.InternalUtils;
-
/**
* Represents an HTTP content type. Allows to set various elements like the mime type, the character
* set, and other parameters. This is similar to a number of other implementations of the same
@@ -47,9 +46,8 @@
/**
* Creates a new content type from the argument. The format of the argument has to be
* basetype/subtype(;key=value)*
- *
- * @param contentType
- * the content type that needs to be represented
+ *
+ * @param contentType the content type that needs to be represented
*/
public ContentType(String contentType)
{
@@ -127,8 +125,7 @@
}
/**
- * @param key
- * the name of the content type parameter
+ * @param key the name of the content type parameter
* @return the value of the content type parameter
*/
public String getParameter(String key)
@@ -139,10 +136,8 @@
}
/**
- * @param key
- * the name of the content type parameter
- * @param value
- * the value of the content type parameter
+ * @param key the name of the content type parameter
+ * @param value the value of the content type parameter
*/
public void setParameter(String key, String value)
{
@@ -155,9 +150,8 @@
/**
* Parses the argument and configures the content type accordingly. The format of the argument
* has to be type/subtype(;key=value)*
- *
- * @param contentType
- * the content type that needs to be represented
+ *
+ * @param contentType the content type that needs to be represented
*/
public void parse(String contentType)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Holder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Holder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Holder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Holder.java Mon Nov 12 14:22:31 2007
@@ -20,7 +20,7 @@
* An object that holds some type of other object. This is useful for communicating information from
* an inner class (used as a closure) to the containing method. This is similar to
* {@link AtomicReference}, except that it is simpler but <strong>not</strong> thread safe.
- *
+ *
* @param <T>
*/
public class Holder<T>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java Mon Nov 12 14:22:31 2007
@@ -1,20 +1,20 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
-import java.util.Iterator;
+import java.util.Iterator;
/**
* Represents a sequence of integer values, either ascending or descending. The sequence is always
@@ -108,7 +108,9 @@
return result;
}
- /** Returns true if the other object is an IntegerRange with the same start and finish values. */
+ /**
+ * Returns true if the other object is an IntegerRange with the same start and finish values.
+ */
@Override
public boolean equals(Object obj)
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MethodInvocationBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MethodInvocationBuilder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MethodInvocationBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MethodInvocationBuilder.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,13 @@
package org.apache.tapestry.internal.util;
-import java.util.Map;
-
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
import org.apache.tapestry.services.ClassTransformation;
import org.apache.tapestry.services.TransformMethodSignature;
import org.apache.tapestry.services.TransformUtils;
+import java.util.Map;
+
/**
* A utility class for building part of a method body to invoke a method. Analyzes the method and
* matches parameter types to ParameterBuilders.
@@ -41,7 +41,7 @@
/**
* Maps a parameter type to a literal string to be used for the parameter expression.
- *
+ *
* @see StringParameterBuilder
*/
public void addParameter(String parameterType, String expression)
@@ -53,15 +53,14 @@
* Builds the method invocation. Analyzes the type of each parameter to the method, and uses a
* {@link ParameterBuilder} to provide the expression. Supplies a default value (usually null)
* for any parameters that do not have parameter builders.
- *
- * @param signature
- * of the method to invoke
+ *
+ * @param signature of the method to invoke
* @param transformation
* @return method invocation expression
* @see TransformUtils#getDefaultValue(String)
*/
public String buildMethodInvocation(TransformMethodSignature signature,
- ClassTransformation transformation)
+ ClassTransformation transformation)
{
StringBuilder builder = new StringBuilder(signature.getMethodName());
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MultiKey.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MultiKey.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MultiKey.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/MultiKey.java Mon Nov 12 14:22:31 2007
@@ -32,7 +32,7 @@
* Creates a new instance from the provided values. It is assumed that the values provided are
* good map keys themselves -- immutable, with proper implementations of equals() and
* hashCode().
- *
+ *
* @param values
*/
public MultiKey(Object... values)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ParameterBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ParameterBuilder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ParameterBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ParameterBuilder.java Mon Nov 12 14:22:31 2007
@@ -1,26 +1,24 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
-import org.apache.tapestry.services.ClassTransformation;
+import org.apache.tapestry.services.ClassTransformation;
/**
* Builds single parameter value to pass into a method being invoked by a
* {@link org.apache.tapestry.internal.util.MethodInvocationBuilder}.
- *
- *
*/
public interface ParameterBuilder
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/SelectModelRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/SelectModelRenderer.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/SelectModelRenderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/SelectModelRenderer.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,9 @@
package org.apache.tapestry.internal.util;
-import java.util.Map;
+import org.apache.tapestry.*;
-import org.apache.tapestry.MarkupWriter;
-import org.apache.tapestry.OptionGroupModel;
-import org.apache.tapestry.OptionModel;
-import org.apache.tapestry.SelectModelVisitor;
-import org.apache.tapestry.ValueEncoder;
+import java.util.Map;
public class SelectModelRenderer implements SelectModelVisitor
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/StringParameterBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/StringParameterBuilder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/StringParameterBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/StringParameterBuilder.java Mon Nov 12 14:22:31 2007
@@ -1,28 +1,26 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.util;
-import static java.lang.String.format;
-
-import org.apache.tapestry.services.ClassTransformation;
+import org.apache.tapestry.services.ClassTransformation;
+
+import static java.lang.String.format;
/**
* Implementation of {@link org.apache.tapestry.internal.util.ParameterBuilder} that simply provides a static
* string value for the parameter expression.
- *
- *
*/
public final class StringParameterBuilder implements ParameterBuilder
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/URLChangeTracker.java Mon Nov 12 14:22:31 2007
@@ -48,9 +48,8 @@
/**
* Creates a new URL change tracker, using either millisecond-level granularity or second-level
* granularity.
- *
- * @param granularitySeconds
- * whether or not to use second-level granularity
+ *
+ * @param granularitySeconds whether or not to use second-level granularity
*/
public URLChangeTracker(boolean granularitySeconds)
{
@@ -60,9 +59,8 @@
/**
* Stores a new URL into the tracker, or returns the previous time stamp for a previously added
* URL. Filters out all non-file URLs.
- *
- * @param url
- * of the resource to add
+ *
+ * @param url of the resource to add
* @return the current timestamp for the URL, or 0 if not a file URL
*/
public long add(URL url)
@@ -148,7 +146,9 @@
}
}
- /** Needed for testing. */
+ /**
+ * Needed for testing.
+ */
int trackedFileCount()
{
return _fileToTimestamp.size();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/UtilMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/UtilMessages.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/UtilMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/UtilMessages.java Mon Nov 12 14:22:31 2007
@@ -26,7 +26,7 @@
}
static String noReturnValueAccepted(String eventType, String componentId, Object returnValue,
- String methodDescription)
+ String methodDescription)
{
return MESSAGES.format("no-return-value-accepted", eventType, componentId, String
.valueOf(returnValue), methodDescription);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONArray.java Mon Nov 12 14:22:31 2007
@@ -38,10 +38,10 @@
SOFTWARE.
*/
-import java.util.List;
-
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+import java.util.List;
+
/**
* A JSONArray is an ordered sequence of values. Its external text form is a string wrapped in
* square brackets with commas separating the values. The internal form is an object having
@@ -49,18 +49,18 @@
* <code>put</code> methods for adding or replacing values. The values can be any of these types:
* <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>
@@ -79,7 +79,7 @@
* <small>(hex)</small> prefix.</li>
* <li>Comments written in the slashshlash, slashstar, and hash conventions will be ignored.</li>
* </ul>
- *
+ *
* @author JSON.org
* @version 2
*/
@@ -89,7 +89,8 @@
/**
* The arrayList where the JSONArray's properties are kept.
*/
- private final List<Object> _list = CollectionFactory.newList();;
+ private final List<Object> _list = CollectionFactory.newList();
+ ;
/**
* Construct an empty JSONArray.
@@ -100,20 +101,24 @@
/**
* Construct a JSONArray from a JSONTokener.
- *
- * @param tokenizer
- * A JSONTokener
- * @throws RuntimeException
- * If there is a syntax error.
+ *
+ * @param tokenizer A JSONTokener
+ * @throws RuntimeException If there is a syntax error.
*/
JSONArray(JSONTokener tokenizer)
{
assert tokenizer != null;
- if (tokenizer.nextClean() != '[') { throw tokenizer
- .syntaxError("A JSONArray text must start with '['"); }
+ if (tokenizer.nextClean() != '[')
+ {
+ throw tokenizer
+ .syntaxError("A JSONArray text must start with '['");
+ }
- if (tokenizer.nextClean() == ']') { return; }
+ if (tokenizer.nextClean() == ']')
+ {
+ return;
+ }
tokenizer.back();
@@ -134,7 +139,10 @@
{
case ';':
case ',':
- if (tokenizer.nextClean() == ']') { return; }
+ if (tokenizer.nextClean() == ']')
+ {
+ return;
+ }
tokenizer.back();
break;
@@ -149,12 +157,10 @@
/**
* 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 RuntimeException
- * If there is no value for the index.
+ * @throws RuntimeException If there is no value for the index.
*/
public Object get(int index)
{
@@ -164,12 +170,10 @@
/**
* Get the boolean value associated with an index. The string values "true" and "false" are
* converted to boolean.
- *
- * @param index
- * The index must be between 0 and length() - 1.
+ *
+ * @param index The index must be between 0 and length() - 1.
* @return The truth.
- * @throws RuntimeException
- * If there is no value for the index or if the value is not convertable to boolean.
+ * @throws RuntimeException If there is no value for the index or if the value is not convertable to boolean.
*/
public boolean getBoolean(int index)
{
@@ -196,12 +200,10 @@
/**
* Get the double 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 The value.
- * @throws JSONException
- * If the key is not found or if the value cannot be converted to a number.
+ * @throws JSONException If the key is not found or if the value cannot be converted to a number.
*/
public double getDouble(int index)
{
@@ -221,13 +223,11 @@
/**
* Get the int 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 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.
+ * @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)
{
@@ -237,46 +237,46 @@
/**
* Get the JSONArray 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 A JSONArray value.
- * @throws RuntimeException
- * If there is no value for the index. or if the value is not a JSONArray
+ * @throws RuntimeException If there is no value for the index. or if the value is not a JSONArray
*/
public JSONArray getJSONArray(int index)
{
Object o = get(index);
- if (o instanceof JSONArray) { return (JSONArray) o; }
+ if (o instanceof JSONArray)
+ {
+ return (JSONArray) o;
+ }
throw new RuntimeException("JSONArray[" + index + "] is not a JSONArray.");
}
/**
* Get the JSONObject associated with an index.
- *
- * @param index
- * subscript
+ *
+ * @param index subscript
* @return A JSONObject value.
- * @throws RuntimeException
- * If there is no value for the index or if the value is not a JSONObject
+ * @throws RuntimeException If there is no value for the index or if the value is not a JSONObject
*/
public JSONObject getJSONObject(int index)
{
Object o = get(index);
- if (o instanceof JSONObject) { return (JSONObject) o; }
+ if (o instanceof JSONObject)
+ {
+ return (JSONObject) o;
+ }
throw new RuntimeException("JSONArray[" + index + "] is not a JSONObject.");
}
/**
* Get the long 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 The value.
- * @throws JSONException
- * If the key is not found or if the value cannot be converted to a number.
+ * @throws JSONException If the key is not found or if the value cannot be converted to a number.
*/
public long getLong(int index)
{
@@ -286,12 +286,10 @@
/**
* Get the string 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 A string value.
- * @throws RuntimeException
- * If there is no value for the index.
+ * @throws RuntimeException If there is no value for the index.
*/
public String getString(int index)
{
@@ -300,9 +298,8 @@
/**
* Determine if the value is null.
- *
- * @param index
- * The index must be between 0 and length() - 1.
+ *
+ * @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.
*/
public boolean isNull(int index)
@@ -314,12 +311,10 @@
* 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.
+ *
+ * @param separator A string that will be inserted between the elements.
* @return a string.
- * @throws RuntimeException
- * If the array contains an invalid number.
+ * @throws RuntimeException If the array contains an invalid number.
*/
public String join(String separator)
{
@@ -338,7 +333,7 @@
/**
* Get the number of elements in the JSONArray, included nulls.
- *
+ *
* @return The length (or size).
*/
public int length()
@@ -348,10 +343,9 @@
/**
* 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.
+ *
+ * @param value An object value. The value should be a Boolean, Double, Integer, JSONArray,
+ * JSONObject, Long, or String, or the JSONObject.NULL object.
* @return
*/
public JSONArray put(Object value)
@@ -368,21 +362,21 @@
/**
* 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.
- *
- * @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.
+ *
+ * @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.
* @return
- * @throws RuntimeException
- * If the index is negative or if the the value is an invalid number.
+ * @throws RuntimeException If the index is negative or if the the value is an invalid number.
*/
public JSONArray put(int index, Object value)
{
assert value != null;
- if (index < 0) { throw new RuntimeException("JSONArray[" + index + "] not found."); }
+ if (index < 0)
+ {
+ throw new RuntimeException("JSONArray[" + index + "] not found.");
+ }
JSONObject.testValidity(value);
@@ -406,9 +400,9 @@
* Make a JSON text of this JSONArray. For compactness, no 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.
*/
@Override
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONObject.java Mon Nov 12 14:22:31 2007
@@ -38,11 +38,11 @@
SOFTWARE.
*/
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+
import java.util.Map;
import java.util.Set;
-import org.apache.tapestry.ioc.internal.util.CollectionFactory;
-
/**
* A JSONObject is an unordered collection of name/value pairs. Its external form is a string
* wrapped in curly braces with colons between the names and values, and commas between the values
@@ -57,19 +57,19 @@
* 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 <code>put</code> methods adds values to an object. For example,
- *
+ * <p/>
* <pre>
* myString = new JSONObject().put("JSON", "Hello, World!").toString();
* </pre>
- *
+ * <p/>
* 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>
@@ -88,12 +88,12 @@
* <li>Comments written in the slashshlash, slashstar, and hash conventions will be ignored.</li>
* </ul>
* <hr/>
- * <p>
+ * <p/>
* This class, and the other related classes, have been heavily modified from the original source,
* to fit Tapestry standards and to make use of JDK 1.5 features such as generics. Further, since
* the interest of Tapestry is primarily constructing JSON (and not parsing it), many of the
* non-essential methods have been removed (since the original code came with no tests).
- *
+ *
* @author JSON.org
* @version 2
*/
@@ -110,7 +110,7 @@
/**
* There is only intended to be a single instance of the NULL object, so the clone method
* returns itself.
- *
+ *
* @return NULL.
*/
@Override
@@ -121,9 +121,8 @@
/**
* 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.
*/
@Override
@@ -134,7 +133,7 @@
/**
* Get the "null" string value.
- *
+ *
* @return The string "null".
*/
@Override
@@ -166,13 +165,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 source
- * A JSONObject.
- * @param propertyNames
- * The strings to copy.
- * @throws RuntimeException
- * If a value is a non-finite number.
+ *
+ * @param source A JSONObject.
+ * @param propertyNames The strings to copy.
+ * @throws RuntimeException If a value is a non-finite number.
*/
public JSONObject(JSONObject source, String... propertyNames)
{
@@ -186,16 +182,18 @@
/**
* Construct a JSONObject from a JSONTokener.
- *
- * @param x
- * A JSONTokener object containing the source string. @ If there is a syntax error in the source
- * string.
+ *
+ * @param x A JSONTokener object containing the source string. @ If there is a syntax error in the source
+ * string.
*/
JSONObject(JSONTokener x)
{
String key;
- if (x.nextClean() != '{') { throw x.syntaxError("A JSONObject text must begin with '{'"); }
+ if (x.nextClean() != '{')
+ {
+ throw x.syntaxError("A JSONObject text must begin with '{'");
+ }
while (true)
{
@@ -223,7 +221,10 @@
x.back();
}
}
- else if (c != ':') { throw x.syntaxError("Expected a ':' after a key"); }
+ else if (c != ':')
+ {
+ throw x.syntaxError("Expected a ':' after a key");
+ }
put(key, x.nextValue());
/*
@@ -234,7 +235,10 @@
{
case ';':
case ',':
- if (x.nextClean() == '}') { return; }
+ if (x.nextClean() == '}')
+ {
+ return;
+ }
x.back();
break;
case '}':
@@ -247,12 +251,10 @@
/**
* 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>.
- * @throws RuntimeException
- * 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 RuntimeException If there is a syntax error in the source string.
*/
public JSONObject(String string)
{
@@ -264,14 +266,12 @@
* already an object stored under the key then a 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.
+ *
+ * @param key A key string.
+ * @param value An object to be accumulated under the key.
* @return this.
* @throws {@link RuntimeException}
- * If the value is an invalid number or if the key is null.
+ * If the value is an invalid number or if the key is null.
*/
public JSONObject accumulate(String key, Object value)
{
@@ -306,11 +306,9 @@
* 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.
+ *
+ * @param key A key string.
+ * @param value An object to be accumulated under the key.
* @return this. @ If the key is null or if the current value associated with the key is not a
* JSONArray.
*/
@@ -337,14 +335,16 @@
/**
* 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.
*/
static String doubleToString(double d)
{
- if (Double.isInfinite(d) || Double.isNaN(d)) { return "null"; }
+ if (Double.isInfinite(d) || Double.isNaN(d))
+ {
+ return "null";
+ }
// Shave off trailing zeros and decimal point, if possible.
@@ -365,28 +365,28 @@
/**
* Get the value object associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return The object associated with the key. @ if the key is not found.
* @see #opt(String)
*/
public Object get(String key)
{
Object o = opt(key);
- if (o == null) { throw new RuntimeException("JSONObject[" + quote(key) + "] not found."); }
+ if (o == null)
+ {
+ throw new RuntimeException("JSONObject[" + quote(key) + "] not found.");
+ }
return o;
}
/**
* Get the boolean value associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return The truth.
- * @throws RuntimeException
- * if the value is not a Boolean or the String "true" or "false".
+ * @throws RuntimeException if the value is not a Boolean or the String "true" or "false".
*/
public boolean getBoolean(String key)
{
@@ -408,9 +408,8 @@
/**
* Get the double value associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return The numeric value. @ if the key is not found or if the value is not a Number object
* and cannot be converted to a number.
*/
@@ -435,9 +434,8 @@
/**
* 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.
+ *
+ * @param key A key string.
* @return The integer value. @ if the key is not found or if the value cannot be converted to
* an integer.
*/
@@ -453,34 +451,36 @@
/**
* Get the JSONArray value associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return A JSONArray which is the value.
- * @throws RuntimeException
- * if the key is not found or if the value is not a JSONArray.
+ * @throws RuntimeException if the key is not found or if the value is not a JSONArray.
*/
public JSONArray getJSONArray(String key)
{
Object o = get(key);
- if (o instanceof JSONArray) { return (JSONArray) o; }
+ if (o instanceof JSONArray)
+ {
+ return (JSONArray) o;
+ }
throw new RuntimeException("JSONObject[" + quote(key) + "] is not a JSONArray.");
}
/**
* Get the JSONObject value associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return A JSONObject which is the value.
- * @throws RuntimeException
- * if the key is not found or if the value is not a JSONObject.
+ * @throws RuntimeException if the key is not found or if the value is not a JSONObject.
*/
public JSONObject getJSONObject(String key)
{
Object o = get(key);
- if (o instanceof JSONObject) { return (JSONObject) o; }
+ if (o instanceof JSONObject)
+ {
+ return (JSONObject) o;
+ }
throw new RuntimeException("JSONObject[" + quote(key) + "] is not a JSONObject.");
}
@@ -488,9 +488,8 @@
/**
* 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.
+ *
+ * @param key A key string.
* @return The long value. @ if the key is not found or if the value cannot be converted to a
* long.
*/
@@ -502,12 +501,10 @@
/**
* Get the string associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return A string which is the value.
- * @throws RuntimeException
- * if the key is not found.
+ * @throws RuntimeException if the key is not found.
*/
public String getString(String key)
{
@@ -516,9 +513,8 @@
/**
* Determine if the JSONObject contains a specific key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return true if the key exists in the JSONObject.
*/
public boolean has(String key)
@@ -528,9 +524,8 @@
/**
* Determine if the value associated with the key is null or if there is no value.
- *
- * @param key
- * A key string.
+ *
+ * @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.
*/
@@ -541,7 +536,7 @@
/**
* Get an enumeration of the keys of the JSONObject. Caution: the set should not be modified.
- *
+ *
* @return An iterator of the keys.
*/
public Set<String> keys()
@@ -551,7 +546,7 @@
/**
* Get the number of keys stored in the JSONObject.
- *
+ *
* @return The number of keys in the JSONObject.
*/
public int length()
@@ -561,7 +556,7 @@
/**
* 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.
*/
public JSONArray names()
@@ -578,9 +573,8 @@
/**
* Produce a string from a Number.
- *
- * @param n
- * A Number
+ *
+ * @param n A Number
* @return A String. @ If n is a non-finite number.
*/
static String numberToString(Number n)
@@ -608,9 +602,8 @@
/**
* Get an optional value associated with a key.
- *
- * @param key
- * A key string.
+ *
+ * @param key A key string.
* @return An object which is the value, or null if there is no value.
* @see #get(String)
*/
@@ -622,15 +615,12 @@
/**
* 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.
+ *
+ * @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.
* @return this.
- * @throws RuntimeException
- * If the value is non-finite number or if the key is null.
+ * @throws RuntimeException If the value is non-finite number or if the key is null.
*/
public JSONObject put(String key, Object value)
{
@@ -653,14 +643,16 @@
* Produce a string in double quotes with backslash sequences in all the 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
+ *
+ * @param string A String
* @return A String correctly formatted for insertion in a JSON text.
*/
public static String quote(String string)
{
- if (string == null || string.length() == 0) { return "\"\""; }
+ if (string == null || string.length() == 0)
+ {
+ return "\"\"";
+ }
char b;
char c = 0;
@@ -722,9 +714,8 @@
/**
* Remove a name and its value, if present.
- *
- * @param key
- * The name to be removed.
+ *
+ * @param key The name to be removed.
* @return The value that was associated with the name, or null if there was no value.
*/
public Object remove(String key)
@@ -733,14 +724,13 @@
}
private static final Class[] ALLOWED = new Class[]
- { String.class, Boolean.class, Number.class, JSONObject.class, JSONArray.class, Null.class };
+ {String.class, Boolean.class, Number.class, JSONObject.class, JSONArray.class, Null.class};
/**
* Throw an exception if the object is an NaN or infinite number, or not a type which may be
* stored.
- *
- * @param value
- * The object to test. @ If o is a non-finite number.
+ *
+ * @param value The object to test. @ If o is a non-finite number.
*/
@SuppressWarnings("unchecked")
static void testValidity(Object value)
@@ -763,15 +753,18 @@
throw new RuntimeException(
String
.format(
- "JSONObject properties may be String, Boolean, Number, JSONObject or JSONArray. Type %s is not allowed.",
- actual.getName()));
+ "JSONObject properties may be String, Boolean, Number, JSONObject or JSONArray. Type %s is not allowed.",
+ actual.getName()));
if (value instanceof Double)
{
Double asDouble = (Double) value;
- if (asDouble.isInfinite() || asDouble.isNaN()) { throw new RuntimeException(
- "JSON does not allow non-finite numbers."); }
+ if (asDouble.isInfinite() || asDouble.isNaN())
+ {
+ throw new RuntimeException(
+ "JSON does not allow non-finite numbers.");
+ }
return;
}
@@ -780,8 +773,11 @@
{
Float asFloat = (Float) value;
- if (asFloat.isInfinite() || asFloat.isNaN()) { throw new RuntimeException(
- "JSON does not allow non-finite numbers."); }
+ if (asFloat.isInfinite() || asFloat.isNaN())
+ {
+ throw new RuntimeException(
+ "JSON does not allow non-finite numbers.");
+ }
return;
}
@@ -791,9 +787,9 @@
/**
* 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>.
@@ -826,18 +822,20 @@
* that method will be used to produce the JSON text. The method is required to produce a
* strictly 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.
+ *
+ * @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>. @ If the value is or contains an invalid number.
+ * brace)</small>. @ If the value is or contains an invalid number.
*/
static String valueToString(Object value)
{
- if (value == null || value.equals(null)) { return "null"; }
+ if (value == null || value.equals(null))
+ {
+ return "null";
+ }
if (value instanceof JSONString)
{
@@ -854,10 +852,16 @@
}
- if (value instanceof Number) { return numberToString((Number) value); }
+ if (value instanceof Number)
+ {
+ return numberToString((Number) value);
+ }
- if (value instanceof Boolean || value instanceof JSONObject || value instanceof JSONArray) { return value
- .toString(); }
+ if (value instanceof Boolean || value instanceof JSONObject || value instanceof JSONArray)
+ {
+ return value
+ .toString();
+ }
return quote(value.toString());
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONString.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONString.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONString.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONString.java Mon Nov 12 14:22:31 2007
@@ -13,20 +13,22 @@
// limitations under the License.
package org.apache.tapestry.json;
+
/**
- * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
- * method so that a class can change the behavior of
+ * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
+ * method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
- * and <code>JSONWriter.value(</code>Object<code>)</code>. The
- * <code>toJSONString</code> method will be used instead of the default behavior
+ * and <code>JSONWriter.value(</code>Object<code>)</code>. The
+ * <code>toJSONString</code> method will be used instead of the default behavior
* of using the Object's <code>toString()</code> method and quoting the result.
*/
-public interface JSONString {
- /**
- * The <code>toJSONString</code> method allows a class to produce its own JSON
- * serialization.
- *
- * @return A strictly syntactically correct JSON text.
- */
- public String toJSONString();
+public interface JSONString
+{
+ /**
+ * The <code>toJSONString</code> method allows a class to produce its own JSON
+ * serialization.
+ *
+ * @return A strictly syntactically correct JSON text.
+ */
+ public String toJSONString();
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/json/JSONTokener.java Mon Nov 12 14:22:31 2007
@@ -41,7 +41,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
*/
@@ -60,9 +60,8 @@
/**
* Construct a JSONTokener from a string.
- *
- * @param source
- * A source string, in JSON format.
+ *
+ * @param source A source string, in JSON format.
*/
public JSONTokener(String source)
{
@@ -86,22 +85,30 @@
/**
* 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'.
+ *
+ * @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.
*/
static int dehexchar(char c)
{
- if (c >= '0' && c <= '9') { return c - '0'; }
- if (c >= 'A' && c <= 'F') { return c - ('A' - 10); }
- if (c >= 'a' && c <= 'f') { return c - ('a' - 10); }
+ if (c >= '0' && c <= '9')
+ {
+ return c - '0';
+ }
+ if (c >= 'A' && c <= 'F')
+ {
+ return c - ('A' - 10);
+ }
+ if (c >= 'a' && c <= 'f')
+ {
+ return c - ('a' - 10);
+ }
return -1;
}
/**
* 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()
@@ -111,47 +118,52 @@
/**
* Get the next character in the source string.
- *
+ *
* @return The next character, or 0 if past the end of the source string.
*/
public char next()
{
- if (more()) { return _source.charAt(_index++); }
+ if (more())
+ {
+ return _source.charAt(_index++);
+ }
return 0;
}
/**
* Consume the next character, and check that it matches a specified character.
- *
- * @param c
- * The character to match.
+ *
+ * @param c The character to match.
* @return The character.
- * @throws RuntimeException
- * if the character does not match.
+ * @throws RuntimeException if the character does not match.
*/
public char next(char c)
{
char n = next();
- if (n != c) { throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); }
+ if (n != c)
+ {
+ throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
+ }
return n;
}
/**
* Get the next n characters.
- *
- * @param n
- * The number of characters to take.
+ *
+ * @param n The number of characters to take.
* @return A string of n characters.
- * @throws RuntimeException
- * Substring bounds error if there are not n characters remaining in the source
- * string.
+ * @throws RuntimeException Substring bounds error if there are not n characters remaining in the source
+ * string.
*/
public String next(int n)
{
int i = _index;
int j = i + n;
- if (j >= _source.length()) { throw syntaxError("Substring bounds error"); }
+ if (j >= _source.length())
+ {
+ throw syntaxError("Substring bounds error");
+ }
_index += n;
return _source.substring(i, j);
}
@@ -159,13 +171,13 @@
/**
* Get the next char in the string, skipping whitespace and comments (slashslash, slashstar, and
* hash).
- *
- * @throws RuntimeException
+ *
* @return A character, or 0 if there are no more characters.
+ * @throws RuntimeException
*/
public char nextClean()
{
- for (;;)
+ for (; ;)
{
char c = next();
if (c == '/')
@@ -185,7 +197,10 @@
while (true)
{
c = next();
- if (c == 0) { throw syntaxError("Unclosed comment"); }
+ if (c == 0)
+ {
+ throw syntaxError("Unclosed comment");
+ }
if (c == '*')
{
if (next() == '/')
@@ -210,7 +225,10 @@
}
while (c != '\n' && c != '\r' && c != 0);
}
- else if (c == 0 || c > ' ') { return c; }
+ else if (c == 0 || c > ' ')
+ {
+ return c;
+ }
}
}
@@ -218,13 +236,11 @@
* Return the characters up to the next close quote character. 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>.
+ *
+ * @param quote The quoting character, either <code>"</code> <small>(double quote)</small>
+ * or <code>'</code> <small>(single quote)</small>.
* @return A String.
- * @throws RuntimeException
- * Unterminated string.
+ * @throws RuntimeException Unterminated string.
*/
public String nextString(char quote)
{
@@ -269,7 +285,10 @@
}
break;
default:
- if (c == quote) { return builder.toString(); }
+ if (c == quote)
+ {
+ return builder.toString();
+ }
builder.append(c);
}
}
@@ -278,15 +297,14 @@
/**
* Get the text up but not including the specified character or the end of line, whichever comes
* first.
- *
- * @param d
- * A delimiter character.
+ *
+ * @param d A delimiter character.
* @return A string.
*/
public String nextTo(char d)
{
StringBuffer sb = new StringBuffer();
- for (;;)
+ for (; ;)
{
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r')
@@ -304,16 +322,15 @@
/**
* 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.
+ *
+ * @param delimiters A set of delimiter characters.
* @return A string, trimmed.
*/
public String nextTo(String delimiters)
{
char c;
StringBuffer sb = new StringBuffer();
- for (;;)
+ for (; ;)
{
c = next();
if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r')
@@ -331,10 +348,9 @@
/**
* Get the next value. The value can be a Boolean, Double, Integer, JSONArray, JSONObject, Long,
* or String, or the JSONObject.NULL object.
- *
- * @throws RuntimeException
- * If syntax error.
+ *
* @return An object.
+ * @throws RuntimeException If syntax error.
*/
public Object nextValue()
{
@@ -375,10 +391,22 @@
*/
s = sb.toString().trim();
- if (s.equals("")) { throw syntaxError("Missing value"); }
- if (s.equalsIgnoreCase("true")) { return Boolean.TRUE; }
- if (s.equalsIgnoreCase("false")) { return Boolean.FALSE; }
- if (s.equalsIgnoreCase("null")) { return JSONObject.NULL; }
+ if (s.equals(""))
+ {
+ throw syntaxError("Missing value");
+ }
+ if (s.equalsIgnoreCase("true"))
+ {
+ return Boolean.TRUE;
+ }
+ if (s.equalsIgnoreCase("false"))
+ {
+ return Boolean.FALSE;
+ }
+ if (s.equalsIgnoreCase("null"))
+ {
+ return JSONObject.NULL;
+ }
/*
* If it might be a number, try converting it. We support the 0- and 0x- conventions. If a
@@ -443,9 +471,8 @@
/**
* 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.
+ *
+ * @param to A character to skip to.
* @return The requested character, or zero if the requested character is not found.
*/
public char skipTo(char to)
@@ -469,9 +496,8 @@
/**
* 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.
+ *
+ * @param to A string to skip past.
*/
public boolean skipPast(String to)
{
@@ -488,9 +514,8 @@
/**
* Make a JSONException to signal a syntax error.
- *
- * @param message
- * The error message.
+ *
+ * @param message The error message.
* @return A JSONException object, suitable for throwing
*/
RuntimeException syntaxError(String message)
@@ -500,7 +525,7 @@
/**
* Make a printable string of this JSONTokener.
- *
+ *
* @return " at character [myIndex] of [mySource]"
*/
@Override
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ComponentModel.java Mon Nov 12 14:22:31 2007
@@ -14,19 +14,19 @@
package org.apache.tapestry.model;
-import java.util.List;
-
import org.apache.tapestry.annotations.MixinAfter;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.annotations.SupportsInformalParameters;
import org.apache.tapestry.ioc.Resource;
import org.slf4j.Logger;
+import java.util.List;
+
/**
* Defines a component in terms of its capabilities, parameters, sub-components, etc. During
* <em>runtime</em>, the component model is immutable. During <em>construction</em> time, when
* the class is being transformed and loaded, the model is mutable.
- *
+ *
* @see MutableComponentModel
*/
public interface ComponentModel
@@ -37,7 +37,9 @@
*/
Resource getBaseResource();
- /** The FQCN of the component. */
+ /**
+ * The FQCN of the component.
+ */
String getComponentClassName();
/**
@@ -48,33 +50,35 @@
/**
* Returns an embedded component.
- *
- * @param componentId
- * the id of the embedded component
+ *
+ * @param componentId the id of the embedded component
* @return the embedded component model, or null if no component exists with that id
*/
EmbeddedComponentModel getEmbeddedComponentModel(String componentId);
/**
* Returns the persistent strategy associated with the field.
- *
+ *
* @param fieldName
* @return the corresponding strategy, or the empty string
* @throw IllegalArgumentException if the named field is not marked as persistent
*/
String getFieldPersistenceStrategy(String fieldName);
- /** Returns object that will be used to log warnings and errors related to this component. */
+ /**
+ * Returns object that will be used to log warnings and errors related to this component.
+ */
Logger getLogger();
- /** Returns a list of the class names of mixins that are part of the component's implementation. */
+ /**
+ * Returns a list of the class names of mixins that are part of the component's implementation.
+ */
List<String> getMixinClassNames();
/**
* Return a single parameter model by parameter name, or null if the parameter is not defined.
- *
- * @param parameterName
- * the name of the parameter (case is ignored)
+ *
+ * @param parameterName the name of the parameter (case is ignored)
*/
ParameterModel getParameterModel(String parameterName);
@@ -94,7 +98,7 @@
/**
* Returns a list of the names of all persistent fields (within this class, or any super-class).
* The names are sorted alphabetically.
- *
+ *
* @see Persist
*/
List<String> getPersistentFieldNames();
@@ -103,7 +107,7 @@
* Returns true if the modeled component is a root class, a component class whose parent does
* not have the {@link ComponentClass} annotation. This is often used to determine whether to
* invoke the super-class implementation of certain methods.
- *
+ *
* @return true if a root class, false if a subclass
*/
boolean isRootClass();
@@ -113,7 +117,7 @@
* the formal parameter defined for the component, are supported. This is false in most cases,
* but may be set to true for specific classes (when the {@link SupportsInformalParameters}
* annotation is present, or inherited from a super-class).
- *
+ *
* @return true if this component model supports informal parameters
*/
boolean getSupportsInformalParameters();
@@ -122,7 +126,7 @@
* Returns the component model for this component's super-class, if it exists. Remember that
* only classes with the {@link ComponentClass} annotation, and in the correct packages, are
* considered component classes.
- *
+ *
* @return the parent class model, or null if this component's super class is not itself a
* component class
*/
@@ -132,7 +136,7 @@
* Relevant for component mixins only. Indicates that the mixin behavior should occur
* <em>after</em> (not before) the component. Normally, this flag is set by the presence of
* the {@link MixinAfter} annotation.
- *
+ *
* @return true if the mixin should operate after, not before, the component
*/
boolean isMixinAfter();
@@ -140,9 +144,8 @@
/**
* Gets a meta value identified by the given key. If the current model does not provide a value
* for the key, then the parent component model (if any) is searched.
- *
- * @param key
- * identifies the value to be accessed
+ *
+ * @param key identifies the value to be accessed
* @return the value for the key (possibly inherited from a parent model), or null
*/
String getMeta(String key);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/EmbeddedComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/EmbeddedComponentModel.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/EmbeddedComponentModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/EmbeddedComponentModel.java Mon Nov 12 14:22:31 2007
@@ -1,23 +1,23 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.model;
-import java.util.List;
-
-import org.apache.tapestry.annotations.Component;
-import org.apache.tapestry.ioc.Locatable;
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.ioc.Locatable;
+
+import java.util.List;
/**
* The model for a component embedded within another component, as defined by the
@@ -25,10 +25,14 @@
*/
public interface EmbeddedComponentModel extends Locatable
{
- /** A unique id for the embedded component. */
+ /**
+ * A unique id for the embedded component.
+ */
String getId();
- /** The type of the component, which may be blank. */
+ /**
+ * The type of the component, which may be blank.
+ */
String getComponentType();
/**
@@ -37,10 +41,14 @@
*/
String getComponentClassName();
- /** A sorted list of the names of all bound parameters. */
+ /**
+ * A sorted list of the names of all bound parameters.
+ */
List<String> getParameterNames();
- /** The value for each parameter, which will be interpreted as a binding expression. */
+ /**
+ * The value for each parameter, which will be interpreted as a binding expression.
+ */
String getParameterValue(String parameterName);
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableComponentModel.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableComponentModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableComponentModel.java Mon Nov 12 14:22:31 2007
@@ -28,54 +28,46 @@
/**
* Adds a new formal parameter to the model. Each parameter has a unique name (though access to
* parameters is case insensitive).
- *
- * @param name
- * new, unique name for the parameter
- * @param required
- * if true, the parameter must be bound
- * @param defaultBindingPrefix
- * the default binding prefix for this parameter
- * @throws IllegalArgumentException
- * if a parameter with the given name has already been defined for this model
+ *
+ * @param name new, unique name for the parameter
+ * @param required if true, the parameter must be bound
+ * @param defaultBindingPrefix the default binding prefix for this parameter
+ * @throws IllegalArgumentException if a parameter with the given name has already been defined for this model
* @see Parameter
*/
void addParameter(String name, boolean required, String defaultBindingPrefix);
/**
* Defines a new embedded component.
- *
- * @param id
- * the unique id for the embedded component, which must not already exist.
- * @param type
- * the type of the component (posslibly blank)
- * @param componentClassName
- * the fully qualified class name (derived from the field), used if the type is blank
- * @param location
- * where the component is defined
+ *
+ * @param id the unique id for the embedded component, which must not already exist.
+ * @param type the type of the component (posslibly blank)
+ * @param componentClassName the fully qualified class name (derived from the field), used if the type is blank
+ * @param location where the component is defined
* @return a mutable model allowing parameters to be set
*/
MutableEmbeddedComponentModel addEmbeddedComponent(String id, String type,
- String componentClassName, Location location);
+ String componentClassName, Location location);
/**
* Used to define the field persistence strategy for a particular field name. Returns a logical
* name for the field, which is guaranteed to be unique (this is necessary for handling the case
* where a subclass has a persistent field with the same name as a persistent field from a
* super-class).
- *
- * @param fieldName
- * the name of the field which is to be made persistent
- * @param strategy
- * the strategy for persisting the field, from {@link Persist#value()}. This value
- * may be blank, in which case the stategy is inherited from the component, or the
- * component's container.
+ *
+ * @param fieldName the name of the field which is to be made persistent
+ * @param strategy the strategy for persisting the field, from {@link Persist#value()}. This value
+ * may be blank, in which case the stategy is inherited from the component, or the
+ * component's container.
* @return a logical name for the field, to be used with
* {@link ComponentModel#getFieldPersistenceStrategy(String)}, and with
* {@link InternalComponentResources#persistFieldChange(String, Object)}, etc.
*/
String setFieldPersistenceStrategy(String fieldName, String strategy);
- /** Adds a mixin to the component's implementation. */
+ /**
+ * Adds a mixin to the component's implementation.
+ */
void addMixinClassName(String mixinClassName);
/**
@@ -84,9 +76,13 @@
*/
void enableSupportsInformalParameters();
- /** Changes the value of the mixinAfter flag. The default value is false. */
+ /**
+ * Changes the value of the mixinAfter flag. The default value is false.
+ */
void setMixinAfter(boolean mixinAfter);
- /** Stores a meta data value under the indicated key. */
+ /**
+ * Stores a meta data value under the indicated key.
+ */
void setMeta(String key, String value);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableEmbeddedComponentModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableEmbeddedComponentModel.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableEmbeddedComponentModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableEmbeddedComponentModel.java Mon Nov 12 14:22:31 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.model;
/**
@@ -22,6 +22,8 @@
{
void addParameter(String name, String value);
- /** Adds a mixin to the component in terms of its fully qualified class name. */
+ /**
+ * Adds a mixin to the component in terms of its fully qualified class name.
+ */
void addMixin(String mixinClassName);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ParameterModel.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ParameterModel.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ParameterModel.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/ParameterModel.java Mon Nov 12 14:22:31 2007
@@ -18,17 +18,23 @@
/**
* Model for a <em>formal</em> parameter of a component.
- *
+ *
* @see Parameter
*/
public interface ParameterModel
{
- /** The name of the parameter. */
+ /**
+ * The name of the parameter.
+ */
String getName();
- /** If true, the parameter is required. */
+ /**
+ * If true, the parameter is required.
+ */
boolean isRequired();
- /** The default binding prefix for the parameter, usually "prop". */
+ /**
+ * The default binding prefix for the parameter, usually "prop".
+ */
String getDefaultBindingPrefix();
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/Component.java Mon Nov 12 14:22:31 2007
@@ -22,10 +22,10 @@
* the component for many different events. This interface is part of the public API for Tapestry,
* but is <em>not</em> expected to be directly implemented by component classes; it should only be
* implemented as part of the component class transformation process.
- * <p>
+ * <p/>
* Most of the methods are related to render phases; see the corresponding annotations and component
* rendering documentation to see how they relate to each other.
- * <p>
+ * <p/>
* This interface is likely to change without notice.
*/
public interface Component extends ComponentResourcesAware, PageLifecycleListener
@@ -54,7 +54,9 @@
*/
void beforeRenderTemplate(MarkupWriter writer, Event event);
- /** Invoked after rendering the template for a component (only for components with a template). */
+ /**
+ * Invoked after rendering the template for a component (only for components with a template).
+ */
void afterRenderTemplate(MarkupWriter writer, Event event);
/**
@@ -62,7 +64,9 @@
*/
void beforeRenderBody(MarkupWriter writer, Event event);
- /** Invoked just after rendering the body of the component. */
+ /**
+ * Invoked just after rendering the body of the component.
+ */
void afterRenderBody(MarkupWriter writer, Event event);
/**
@@ -79,7 +83,7 @@
/**
* Invoked to handle a component event. Methods with the {@link OnEvent} annotation will be
* invoked until one returns a non-null value.
- *
+ *
* @param event
* @return true if any handler was found (and invoked), false otherwise
*/
|