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"&g...
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&quo...
- *
+ * <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
*/