Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename package org.codehaus.groovy.grails -> org.grails

in these modules:
- grails-encoder
- grails-plugin-codecs
- grails-plugin-datasource
- grails-plugin-gsp
- grails-plugin-services
- grails-plugin-testing
- grails-test
- grails-web-fileupload
- grails-web-gsp
- grails-web-gsp-taglib
- grails-web-jsp
- grails-web-sitemesh
  • Loading branch information...
commit 92a22ffcaca1fdc6f801b631e00e9da3972aeceb 1 parent 24e5e38
@lhotari lhotari authored
Showing with 16,923 additions and 17,087 deletions.
  1. +1 −1  grails-bootstrap/src/main/resources/springloaded.properties
  2. +0 −259 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/AbstractCharReplacementEncoder.java
  3. +0 −179 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicCodecLookup.java
  4. +0 −108 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicJSONEncoder.java
  5. +0 −105 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicXMLEncoder.java
  6. +0 −49 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Codec.java
  7. +0 −46 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Decoder.java
  8. +0 −107 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Encoder.java
  9. +0 −33 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLCodecFactory.groovy
  10. +0 −39 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLEncoder.java
  11. +0 −28 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLJSCodec.java
  12. +0 −40 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JSONCodecFactory.groovy
  13. +0 −50 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JavaScriptCodec.groovy
  14. +0 −111 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JavaScriptEncoder.java
  15. +0 −58 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/NoneEncoder.java
  16. +0 −109 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/RawCodec.java
  17. +0 −70 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/StandaloneCodecLookup.groovy
  18. +0 −78 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/URLCodecFactory.groovy
  19. +0 −52 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/XMLCodecFactory.java
  20. +0 −225 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/AbstractEncodedAppender.java
  21. +0 −45 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/ChainedDecoder.java
  22. +0 −156 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/ChainedEncoder.java
  23. +0 −135 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/ChainedEncoders.java
  24. +0 −59 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CharArrayAccessible.java
  25. +0 −76 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CharArrayCharSequence.java
  26. +0 −166 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CharSequences.java
  27. +0 −41 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecFactory.java
  28. +0 −52 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecIdentifier.java
  29. +0 −33 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecIdentifierProvider.java
  30. +0 −21 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecLookup.java
  31. +0 −47 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecLookupHelper.java
  32. +0 −154 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CodecMetaClassSupport.groovy
  33. +0 −65 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/CombinedCodecIdentifier.java
  34. +0 −34 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/Decoder.java
  35. +0 −123 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/DefaultCodecIdentifier.java
  36. +0 −129 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/DefaultEncodingStateRegistry.java
  37. +0 −34 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/Encodeable.java
  38. +0 −144 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodedAppender.java
  39. +0 −35 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodedAppenderFactory.java
  40. +0 −163 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodedAppenderWriter.java
  41. +0 −41 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodedAppenderWriterFactory.java
  42. +0 −56 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/Encoder.java
  43. +0 −33 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncoderAware.java
  44. +0 −33 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodesToWriter.java
  45. +0 −101 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodesToWriterAdapter.java
  46. +0 −38 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodingState.java
  47. +0 −136 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodingStateImpl.java
  48. +0 −70 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodingStateRegistry.java
  49. +0 −33 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodingStateRegistryLookup.java
  50. +0 −34 ...-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/EncodingStateRegistryLookupHolder.java
  51. +0 −71 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/SingleCharCharSequence.java
  52. +0 −43 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/StreamEncodeable.java
  53. +0 −48 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/StreamingEncoder.java
  54. +0 −70 ...ls-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/StreamingEncoderEncodedAppender.java
  55. +0 −42 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/StreamingEncoderWritable.java
  56. +0 −82 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/StreamingEncoderWriter.java
  57. +0 −76 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/SubCharSequence.java
  58. +0 −82 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/WriterEncodedAppender.java
  59. +0 −100 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/pages/FastStringPrintWriter.java
  60. +0 −72 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/pages/FastStringWriter.java
  61. +0 −63 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/CodecPrintWriter.java
  62. +0 −77 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/GrailsLazyProxyPrintWriter.java
  63. +0 −705 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/GrailsPrintWriter.java
  64. +0 −328 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/GrailsPrintWriterAdapter.java
  65. +0 −24 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/GrailsWrappedWriter.java
  66. +0 −438 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/StreamByteBuffer.java
  67. +0 −2,921 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/StreamCharBuffer.java
  68. +0 −25 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/StreamCharBufferMetaUtils.groovy
  69. +0 −213 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/web/util/StringCharArrayAccessor.java
  70. +259 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/AbstractCharReplacementEncoder.java
  71. +179 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/BasicCodecLookup.java
  72. +108 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/BasicJSONEncoder.java
  73. +105 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/BasicXMLEncoder.java
  74. +49 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTML4Codec.java
  75. +46 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTML4Decoder.java
  76. +107 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTML4Encoder.java
  77. +32 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTMLCodecFactory.groovy
  78. +39 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTMLEncoder.java
  79. +28 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/HTMLJSCodec.java
  80. +40 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/JSONCodecFactory.groovy
  81. +50 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/JavaScriptCodec.groovy
  82. +111 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/JavaScriptEncoder.java
  83. +58 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/NoneEncoder.java
  84. +109 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/RawCodec.java
  85. +70 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/StandaloneCodecLookup.groovy
  86. +76 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/URLCodecFactory.groovy
  87. +52 −0 grails-encoder/src/main/groovy/org/grails/plugins/codecs/XMLCodecFactory.java
  88. +225 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/AbstractEncodedAppender.java
  89. +45 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/ChainedDecoder.java
  90. +156 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/ChainedEncoder.java
  91. +134 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/ChainedEncoders.java
  92. +59 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CharArrayAccessible.java
  93. +76 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CharArrayCharSequence.java
  94. +166 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CharSequences.java
  95. +41 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecFactory.java
  96. +52 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecIdentifier.java
  97. +33 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecIdentifierProvider.java
  98. +21 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecLookup.java
  99. +47 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecLookupHelper.java
  100. +154 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CodecMetaClassSupport.groovy
  101. +65 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/CombinedCodecIdentifier.java
  102. +34 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/Decoder.java
  103. +123 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/DefaultCodecIdentifier.java
  104. +129 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/DefaultEncodingStateRegistry.java
  105. +34 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/Encodeable.java
  106. +144 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodedAppender.java
  107. +35 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodedAppenderFactory.java
  108. +163 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodedAppenderWriter.java
  109. +41 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodedAppenderWriterFactory.java
  110. +56 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/Encoder.java
  111. +33 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncoderAware.java
  112. +33 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodesToWriter.java
  113. +101 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodesToWriterAdapter.java
  114. +38 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodingState.java
  115. +136 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodingStateImpl.java
  116. +70 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodingStateRegistry.java
  117. +33 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodingStateRegistryLookup.java
  118. +34 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/EncodingStateRegistryLookupHolder.java
  119. +71 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/SingleCharCharSequence.java
  120. +43 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/StreamEncodeable.java
  121. +48 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/StreamingEncoder.java
  122. +70 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/StreamingEncoderEncodedAppender.java
  123. +42 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/StreamingEncoderWritable.java
  124. +82 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/StreamingEncoderWriter.java
  125. +76 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/SubCharSequence.java
  126. +82 −0 grails-encoder/src/main/groovy/org/grails/support/encoding/WriterEncodedAppender.java
  127. +100 −0 grails-encoder/src/main/groovy/org/grails/web/pages/FastStringPrintWriter.java
  128. +72 −0 grails-encoder/src/main/groovy/org/grails/web/pages/FastStringWriter.java
  129. +63 −0 grails-encoder/src/main/groovy/org/grails/web/util/CodecPrintWriter.java
  130. +77 −0 grails-encoder/src/main/groovy/org/grails/web/util/GrailsLazyProxyPrintWriter.java
  131. +704 −0 grails-encoder/src/main/groovy/org/grails/web/util/GrailsPrintWriter.java
  132. +328 −0 grails-encoder/src/main/groovy/org/grails/web/util/GrailsPrintWriterAdapter.java
  133. +24 −0 grails-encoder/src/main/groovy/org/grails/web/util/GrailsWrappedWriter.java
  134. +438 −0 grails-encoder/src/main/groovy/org/grails/web/util/StreamByteBuffer.java
  135. +2,921 −0 grails-encoder/src/main/groovy/org/grails/web/util/StreamCharBuffer.java
  136. +25 −0 grails-encoder/src/main/groovy/org/grails/web/util/StreamCharBufferMetaUtils.groovy
  137. +213 −0 grails-encoder/src/main/groovy/org/grails/web/util/StringCharArrayAccessor.java
  138. +0 −38 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicCodecLookupSpec.groovy
  139. +0 −97 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/support/encoding/ChainedEncodersSpec.groovy
  140. +0 −105 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/support/encoding/CharSequencesSpec.groovy
  141. +0 −86 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/web/codecs/HTMLEncoderSpec.groovy
  142. +0 −20 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/web/codecs/JavaScriptCodecTests.groovy
  143. +0 −504 grails-encoder/src/test/groovy/org/codehaus/groovy/grails/web/util/StreamCharBufferTests.java
  144. +39 −0 grails-encoder/src/test/groovy/org/grails/plugins/codecs/BasicCodecLookupSpec.groovy
  145. +101 −0 grails-encoder/src/test/groovy/org/grails/support/encoding/ChainedEncodersSpec.groovy
  146. +108 −0 grails-encoder/src/test/groovy/org/grails/support/encoding/CharSequencesSpec.groovy
  147. +86 −0 grails-encoder/src/test/groovy/org/grails/web/codecs/HTMLEncoderSpec.groovy
  148. +20 −0 grails-encoder/src/test/groovy/org/grails/web/codecs/JavaScriptCodecTests.groovy
  149. +504 −0 grails-encoder/src/test/groovy/org/grails/web/util/StreamCharBufferTests.java
  150. +2 −2 grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy
  151. +0 −38 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/commons/CodecArtefactHandler.java
  152. +0 −312 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsCodecClass.java
  153. +0 −30 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsCodecClass.java
  154. +0 −78 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/CodecsGrailsPlugin.groovy
  155. +0 −51 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/Base64Codec.groovy
  156. +0 −55 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/DefaultCodecLookup.java
  157. +0 −43 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/DigestUtils.groovy
  158. +0 −81 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLCodec.java
  159. +0 −64 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HexCodec.groovy
  160. +0 −14 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JSONCodec.java
  161. +0 −14 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JSONEncoder.java
  162. +0 −28 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/MD5BytesCodec.groovy
  163. +0 −28 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/MD5Codec.groovy
  164. +0 −27 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/SHA1BytesCodec.groovy
  165. +0 −27 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/SHA1Codec.groovy
  166. +0 −27 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/SHA256BytesCodec.groovy
  167. +0 −29 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/SHA256Codec.groovy
  168. +0 −30 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/URLCodec.groovy
  169. +0 −15 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/XMLCodec.java
  170. +0 −14 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/XMLEncoder.java
  171. +38 −0 grails-plugin-codecs/src/main/groovy/org/grails/commons/CodecArtefactHandler.java
  172. +312 −0 grails-plugin-codecs/src/main/groovy/org/grails/commons/DefaultGrailsCodecClass.java
  173. +30 −0 grails-plugin-codecs/src/main/groovy/org/grails/commons/GrailsCodecClass.java
  174. +77 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/CodecsGrailsPlugin.groovy
  175. +51 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/Base64Codec.groovy
  176. +55 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/DefaultCodecLookup.java
  177. +43 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/DigestUtils.groovy
  178. +84 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/HTMLCodec.java
  179. +64 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/HexCodec.groovy
  180. +16 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/JSONCodec.java
  181. +15 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/JSONEncoder.java
  182. +28 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/MD5BytesCodec.groovy
  183. +28 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/MD5Codec.groovy
  184. +27 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/SHA1BytesCodec.groovy
  185. +27 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/SHA1Codec.groovy
  186. +27 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/SHA256BytesCodec.groovy
  187. +27 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/SHA256Codec.groovy
  188. +31 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/URLCodec.groovy
  189. +15 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/XMLCodec.java
  190. +15 −0 grails-plugin-codecs/src/main/groovy/org/grails/plugins/codecs/XMLEncoder.java
  191. +1 −1  grails-plugin-codecs/src/main/resources/META-INF/grails-plugin.xml
  192. +1 −1  grails-plugin-codecs/src/main/resources/META-INF/grails.factories
  193. +0 −53 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/Base64CodecTests.groovy
  194. +0 −20 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/HTMLCodecTests.groovy
  195. +0 −39 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/HTMLJSCodecSpec.groovy
  196. +0 −37 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/HexCodecTests.groovy
  197. +0 −52 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/JSONEncoderSpec.groovy
  198. +0 −38 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/MD5BytesCodecTests.groovy
  199. +0 −29 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/MD5CodecTests.groovy
  200. +0 −29 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/SHA1BytesCodecTests.groovy
  201. +0 −29 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/SHA1CodecTests.groovy
  202. +0 −30 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/SHA256BytesCodec.groovy
  203. +0 −29 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/SHA256CodecTests.groovy
  204. +0 −36 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/URLCodecTests.groovy
  205. +53 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/Base64CodecTests.groovy
  206. +20 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/HTMLCodecTests.groovy
  207. +39 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/HTMLJSCodecSpec.groovy
  208. +37 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/HexCodecTests.groovy
  209. +52 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/JSONEncoderSpec.groovy
  210. +38 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/MD5BytesCodecTests.groovy
  211. +29 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/MD5CodecTests.groovy
  212. +29 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/SHA1BytesCodecTests.groovy
  213. +29 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/SHA1CodecTests.groovy
  214. +30 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/SHA256BytesCodec.groovy
  215. +29 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/SHA256CodecTests.groovy
  216. +36 −0 grails-plugin-codecs/src/test/groovy/org/grails/web/codecs/URLCodecTests.groovy
  217. +5 −5 grails-plugin-controllers/src/main/groovy/org/grails/plugins/web/controllers/api/ControllersApi.java
  218. +1 −1  grails-plugin-converters/src/main/groovy/grails/converters/XML.java
  219. +1 −1  grails-plugin-converters/src/main/groovy/org/grails/web/converters/AbstractConverter.java
  220. +0 −275 ...ugin-datasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceGrailsPlugin.groovy
  221. +0 −64 grails-plugin-datasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceUtils.groovy
  222. +0 −106 ...atasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/EmbeddedDatabaseShutdownHook.groovy
  223. +0 −37 ...tasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/ReadOnlyDriverManagerDataSource.java
  224. +0 −81 ...datasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/TomcatJDBCPoolMBeanExporter.groovy
  225. +275 −0 grails-plugin-datasource/src/main/groovy/org/grails/plugins/datasource/DataSourceGrailsPlugin.groovy
  226. +64 −0 grails-plugin-datasource/src/main/groovy/org/grails/plugins/datasource/DataSourceUtils.groovy
  227. +106 −0 grails-plugin-datasource/src/main/groovy/org/grails/plugins/datasource/EmbeddedDatabaseShutdownHook.groovy
  228. +37 −0 grails-plugin-datasource/src/main/groovy/org/grails/plugins/datasource/ReadOnlyDriverManagerDataSource.java
  229. +81 −0 grails-plugin-datasource/src/main/groovy/org/grails/plugins/datasource/TomcatJDBCPoolMBeanExporter.groovy
  230. +1 −1  grails-plugin-datasource/src/main/resources/META-INF/grails-plugin.xml
  231. +1 −1  grails-plugin-filters/src/main/groovy/org/grails/plugins/web/filters/FilterToHandlerAdapter.groovy
  232. +0 −67 ...ugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/ControllerTagLibraryTransformer.java
  233. +0 −136 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllerTagLibraryApi.java
  234. +67 −0 grails-plugin-gsp/src/ast/groovy/org/grails/compiler/web/taglib/ControllerTagLibraryTransformer.java
  235. +136 −0 grails-plugin-gsp/src/ast/groovy/org/grails/plugins/web/api/ControllerTagLibraryApi.java
  236. +0 −78 ...gin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GrailsLayoutViewResolverPostProcessor.groovy
  237. +0 −326 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  238. +0 −469 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ApplicationTagLib.groovy
  239. +0 −332 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/CountryTagLib.groovy
  240. +0 −1,157 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  241. +0 −380 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormatTagLib.groovy
  242. +0 −483 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/JavascriptTagLib.groovy
  243. +0 −84 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/PluginTagLib.groovy
  244. +0 −332 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/UrlMappingTagLib.groovy
  245. +0 −492 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ValidationTagLib.groovy
  246. +0 −63 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/web/filters/JavascriptLibraryHandlerInterceptor.java
  247. +78 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GrailsLayoutViewResolverPostProcessor.groovy
  248. +340 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  249. +469 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/ApplicationTagLib.groovy
  250. +332 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/CountryTagLib.groovy
  251. +1,157 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/FormTagLib.groovy
  252. +380 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/FormatTagLib.groovy
  253. +483 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/JavascriptTagLib.groovy
  254. +84 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/PluginTagLib.groovy
  255. +332 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/UrlMappingTagLib.groovy
  256. +492 −0 grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/ValidationTagLib.groovy
  257. +63 −0 grails-plugin-gsp/src/main/groovy/org/grails/web/filters/JavascriptLibraryHandlerInterceptor.java
  258. +1 −1  grails-plugin-gsp/src/main/resources/META-INF/grails-plugin.xml
  259. +1 −1  grails-plugin-rest/src/main/groovy/grails/rest/render/util/AbstractLinkingRenderer.groovy
  260. +1 −1  grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/api/ControllersRestApi.groovy
  261. +1 −1  grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/DefaultRendererRegistry.groovy
  262. +1 −1  grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/json/DefaultJsonRenderer.groovy
  263. +1 −1  grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/xml/DefaultXmlRenderer.groovy
  264. +0 −130 ...n-services/src/main/groovy/org/codehaus/groovy/grails/plugins/services/ServiceBeanAliasPostProcessor.groovy
  265. +0 −186 grails-plugin-services/src/main/groovy/org/codehaus/groovy/grails/plugins/services/ServicesGrailsPlugin.groovy
  266. +130 −0 grails-plugin-services/src/main/groovy/org/grails/plugins/services/ServiceBeanAliasPostProcessor.groovy
Sorry, we could not display the entire diff because too many files (1,055) changed.
View
2  grails-bootstrap/src/main/resources/springloaded.properties
@@ -1 +1 @@
-excluded.loaders=DEFAULT,org.codehaus.groovy.grails.compiler.web.pages.GroovyPageClassLoader
+excluded.loaders=DEFAULT,org.grails.compiler.web.pages.GroovyPageClassLoader
View
259 ...main/groovy/org/codehaus/groovy/grails/plugins/codecs/AbstractCharReplacementEncoder.java
@@ -1,259 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
-import org.codehaus.groovy.grails.support.encoding.CharSequences;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.EncodedAppender;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.codehaus.groovy.grails.support.encoding.EncodesToWriter;
-import org.codehaus.groovy.grails.support.encoding.EncodesToWriterAdapter;
-import org.codehaus.groovy.grails.support.encoding.EncodingState;
-import org.codehaus.groovy.grails.support.encoding.StreamingEncoder;
-
-/**
- * Abstract base class for implementing encoders that do character replacements
- * Implements the {@link StreamingEncoder} interface that enables efficient
- * streaming encoding
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public abstract class AbstractCharReplacementEncoder implements Encoder, StreamingEncoder, EncodesToWriter {
- protected CodecIdentifier codecIdentifier;
-
- public AbstractCharReplacementEncoder(CodecIdentifier codecIdentifier) {
- this.codecIdentifier = codecIdentifier;
- }
-
- /**
- * Escape the character, return null if no replacement has to be made
- *
- * @param ch the character to escape
- * @param previousChar the previous char
- * @return the replacement string, null if no replacement has to be made
- */
- protected abstract String escapeCharacter(char ch, char previousChar);
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#encode(java.lang.Object)
- */
- public Object encode(Object o) {
- return doCharReplacementEncoding(o);
- }
-
- protected final Object doCharReplacementEncoding(Object o) {
- if (o == null) {
- return null;
- }
-
- CharSequence str = null;
- if (o instanceof CharSequence) {
- str = (CharSequence)o;
- }
- else if (o instanceof Character) {
- String escaped = escapeCharacter((Character)o, (char)0);
- if (escaped != null) {
- return escaped;
- }
- else {
- return o;
- }
- }
- else {
- str = convertToString(o);
- }
-
- return escapeCharSequence(str);
- }
-
- protected String convertToString(Object o) {
- return String.valueOf(o);
- }
-
- protected Object escapeCharSequence(CharSequence str) {
- if (str == null || str.length() == 0) {
- return str;
- }
-
- StringBuilder sb = null;
- int n = str.length(), i;
- int startPos = -1;
- char prevChar = (char)0;
- for (i = 0; i < n; i++) {
- char ch = str.charAt(i);
- if (startPos == -1) {
- startPos = i;
- }
- String escaped = escapeCharacter(ch, prevChar);
- if (escaped != null) {
- if (sb == null) {
- sb = new StringBuilder(str.length() * 110 / 100);
- }
- if (i - startPos > 0) {
- sb.append(str, startPos, i);
- }
- if (escaped.length() > 0) {
- sb.append(escaped);
- }
- startPos = -1;
- }
- prevChar = ch;
- }
- if (sb != null) {
- if (startPos > -1 && i - startPos > 0) {
- sb.append(str, startPos, i);
- }
- return sb.toString();
- }
- else {
- return str;
- }
- }
-
- @Override
- public void encodeToWriter(CharSequence str, int off, int len, Writer writer, EncodingState encodingState) throws IOException {
- if (str == null || len <= 0) {
- return;
- }
- int n = Math.min(str.length(), off + len);
- int i;
- int startPos = -1;
- char prevChar = (char)0;
- for (i = off; i < n; i++) {
- char ch = str.charAt(i);
- if (startPos == -1) {
- startPos = i;
- }
- String escaped = escapeCharacter(ch, prevChar);
- if (escaped != null) {
- if (i - startPos > 0) {
- CharSequences.writeCharSequence(writer, str, startPos, i);
- }
- if (escaped.length() > 0) {
- writer.write(escaped);
- }
- startPos = -1;
- }
- prevChar = ch;
- }
- if (startPos > -1 && i - startPos > 0) {
- CharSequences.writeCharSequence(writer, str, startPos, i);
- }
- }
-
- @Override
- public void encodeToWriter(char[] buf, int off, int len, Writer writer, EncodingState encodingState) throws IOException {
- if (buf == null || len <= 0) {
- return;
- }
- int n = Math.min(buf.length, off + len);
- int i;
- int startPos = -1;
- char prevChar = (char)0;
- for (i = off; i < n; i++) {
- char ch = buf[i];
- if (startPos == -1) {
- startPos = i;
- }
- String escaped = escapeCharacter(ch, prevChar);
- if (escaped != null) {
- if (i - startPos > 0) {
- writer.write(buf, startPos, i - startPos);
- }
- if (escaped.length() > 0) {
- writer.write(escaped);
- }
- startPos = -1;
- }
- prevChar = ch;
- }
- if (startPos > -1 && i - startPos > 0) {
- writer.write(buf, startPos, i - startPos);
- }
- }
-
- @Override
- public EncodesToWriter createChainingEncodesToWriter(List<StreamingEncoder> encoders, boolean applyAdditionalFirst) {
- return EncodesToWriterAdapter.createChainingEncodesToWriter(this, encoders, applyAdditionalFirst);
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.StreamingEncoder#encodeToStream(org.codehaus.groovy.grails.support.encoding.Encoder, java.lang.CharSequence, int, int, org.codehaus.groovy.grails.support.encoding.EncodedAppender, org.codehaus.groovy.grails.support.encoding.EncodingState)
- */
- public void encodeToStream(Encoder thisInstance, CharSequence str, int off, int len, EncodedAppender appender, EncodingState encodingState)
- throws IOException {
- if (str == null || len <= 0) {
- return;
- }
- int n = Math.min(str.length(), off + len);
- int i;
- int startPos = -1;
- char prevChar = (char)0;
- for (i = off; i < n; i++) {
- char ch = str.charAt(i);
- if (startPos == -1) {
- startPos = i;
- }
- String escaped = escapeCharacter(ch, prevChar);
- if (escaped != null) {
- if (i - startPos > 0) {
- appender.appendEncoded(thisInstance, encodingState, str, startPos, i - startPos);
- }
- if (escaped.length() > 0) {
- appender.appendEncoded(thisInstance, encodingState, escaped, 0, escaped.length());
- }
- startPos = -1;
- }
- prevChar = ch;
- }
- if (startPos > -1 && i - startPos > 0) {
- appender.appendEncoded(thisInstance, encodingState, str, startPos, i - startPos);
- }
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#markEncoded(java.lang.CharSequence)
- */
- public void markEncoded(CharSequence string) {
- // no need to implement, wrapped automaticly
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#isSafe()
- */
- public boolean isSafe() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#isApplyToSafelyEncoded()
- */
- public boolean isApplyToSafelyEncoded() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecIdentifierProvider#getCodecIdentifier()
- */
- public CodecIdentifier getCodecIdentifier() {
- return codecIdentifier;
- }
-}
View
179 ...s-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicCodecLookup.java
@@ -1,179 +0,0 @@
-/* Copyright 2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import grails.util.GrailsNameUtils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.codehaus.groovy.grails.support.encoding.ChainedDecoder;
-import org.codehaus.groovy.grails.support.encoding.ChainedEncoder;
-import org.codehaus.groovy.grails.support.encoding.ChainedEncoders;
-import org.codehaus.groovy.grails.support.encoding.CodecFactory;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifierProvider;
-import org.codehaus.groovy.grails.support.encoding.CodecLookup;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.codehaus.groovy.grails.support.encoding.StreamingEncoder;
-import org.springframework.beans.factory.InitializingBean;
-
-public class BasicCodecLookup implements CodecLookup, InitializingBean {
- private static final String NONE_CODEC_NAME = "none";
- protected ConcurrentMap<String, Encoder> encoders;
- protected ConcurrentMap<String, Decoder> decoders;
- public static final StreamingEncoder NONE_ENCODER = new NoneEncoder();
-
- public BasicCodecLookup() {
- super();
- }
-
- public Encoder lookupEncoder(String codecName) {
- return lookupCodec(codecName, encoders, Encoder.class);
- }
-
- public Decoder lookupDecoder(String codecName) {
- return lookupCodec(codecName, decoders, Decoder.class);
- }
-
- @SuppressWarnings("unchecked")
- protected <T extends CodecIdentifierProvider> T lookupCodec(String codecName, ConcurrentMap<String, T> map, Class<T> returnType) {
- if (codecName != null && codecName.length() > 0) {
- if (NONE_CODEC_NAME.equalsIgnoreCase(codecName)) {
- if (returnType == Encoder.class) {
- return (T)NONE_ENCODER;
- }
- } else {
- T resultObject = map.get(codecName);
- if(resultObject == null) {
- resultObject = createCodec(codecName, map, returnType);
- }
- return resultObject;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected <T extends CodecIdentifierProvider> T createCodec(String codecName, ConcurrentMap<String, T> map, Class<T> returnType) {
- if(codecName.indexOf(',') > -1) {
- T createdInstance = createChainedCodecInstance(codecName, map, returnType);
- if(createdInstance != null) {
- createdInstance = putChainedCodecInstance(codecName, map, createdInstance);
- }
- return createdInstance;
- }
- return null;
- }
-
- protected <T extends CodecIdentifierProvider> T putChainedCodecInstance(String codecName,
- ConcurrentMap<String, T> map, T createdInstance) {
- T previousInstance = map.putIfAbsent(codecName, createdInstance);
- if(previousInstance != null) {
- return previousInstance;
- } else {
- return createdInstance;
- }
- }
-
- protected <T extends CodecIdentifierProvider> T createChainedCodecInstance(String codecName, ConcurrentMap<String, T> map, Class<T> returnType) {
- String[] codecs=codecName.split(",");
- List<T> codecInstances = new ArrayList<T>(codecs.length);
- for(int i=0;i < codecs.length;i++) {
- T codecInstance = map.get(codecs[i]);
- if(codecInstance != null) {
- codecInstances.add(codecInstance);
- }
- }
- if (returnType == Encoder.class) {
- List<StreamingEncoder> streamingEncoders = ChainedEncoders.toStreamingEncoders((List<Encoder>)codecInstances);
- if(streamingEncoders == null) {
- throw new RuntimeException("ChainedEncoder only supports StreamingEncoder instances. Couldn't build chained encoder for '" + codecName + "'");
- } else {
- return (T)ChainedEncoder.createFor(streamingEncoders);
- }
- } else {
- Collections.reverse(codecInstances);
- return (T)new ChainedDecoder(codecInstances.toArray(new Decoder[codecInstances.size()]));
- }
- }
-
- protected synchronized <T extends CodecIdentifierProvider> void registerWithNameVaritions(Map<String, T> destinationMap, T target) {
- String name=target.getCodecIdentifier().getCodecName();
- registerVariationsOfName(destinationMap, target, name);
- Set<String> aliases = target.getCodecIdentifier().getCodecAliases();
- if (aliases != null) {
- for (String alias : aliases) {
- registerVariationsOfName(destinationMap, target, alias);
- }
- }
- }
-
- protected <T extends CodecIdentifierProvider> void registerVariationsOfName(Map<String, T> destinationMap, T target, String name) {
- Collection<String> nameVariations = createNameVariations(name, target);
- for(String nameVariation : nameVariations) {
- destinationMap.put(nameVariation, target);
- }
- }
-
- protected Collection<String> createNameVariations(String name, CodecIdentifierProvider target) {
- Set<String> nameVariations = new LinkedHashSet<String>();
- nameVariations.add(name);
- nameVariations.add(name.toLowerCase());
- nameVariations.add(name.toUpperCase());
- nameVariations.add(GrailsNameUtils.getPropertyNameRepresentation(name));
- return nameVariations;
- }
-
- public void registerCodecFactory(CodecFactory codecFactory) {
- Encoder encoder=codecFactory.getEncoder();
- if (encoder != null) {
- registerEncoder(encoder);
- }
- Decoder decoder=codecFactory.getDecoder();
- if (decoder != null) {
- registerDecoder(decoder);
- }
- }
-
- public void registerDecoder(Decoder decoder) {
- registerWithNameVaritions(decoders, decoder);
- }
-
- public void registerEncoder(Encoder encoder) {
- registerWithNameVaritions(encoders, encoder);
- }
-
- public void reInitialize() {
- encoders = new ConcurrentHashMap<String, Encoder>();
- decoders = new ConcurrentHashMap<String, Decoder>();
- registerCodecs();
- }
-
- protected void registerCodecs() {
-
- }
-
- public void afterPropertiesSet() throws Exception {
- reInitialize();
- }
-}
View
108 ...s-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicJSONEncoder.java
@@ -1,108 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-import org.codehaus.groovy.runtime.StringGroovyMethods;
-import org.springframework.util.ClassUtils;
-
-/**
- * Escapes characters in JSON output
- *
- * @author Lari Hotari
- * @since 2.3.4
- */
-public class BasicJSONEncoder extends AbstractCharReplacementEncoder {
- public static final CodecIdentifier JSON_CODEC_IDENTIFIER = new DefaultCodecIdentifier(
- "JSON", "Json") {
- public boolean isEquivalent(CodecIdentifier other) {
- return super.isEquivalent(other) || JavaScriptEncoder.JAVASCRIPT_CODEC_IDENTIFIER.getCodecName().equals(other.getCodecName());
- };
- };
-
- public BasicJSONEncoder() {
- super(JSON_CODEC_IDENTIFIER);
- }
-
-
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder#escapeCharacter(char, char)
- */
- @Override
- protected String escapeCharacter(char ch, char previousChar) {
- switch (ch) {
- case '"':
- return "\\\"";
- case '\\':
- return "\\\\";
- case '\t':
- return "\\t";
- case '\n':
- return "\\n";
- case '\r':
- return "\\r";
- case '\f':
- return "\\f";
- case '\b':
- return "\\b";
- case '\u000B': // vertical tab: http://bclary.com/2004/11/07/#a-7.8.4
- return "\\v";
- case '\u2028':
- return "\\u2028"; // Line separator
- case '\u2029':
- return "\\u2029"; // Paragraph separator
- case '/':
- // preserve special handling that exists in JSONObject.quote to improve security if JSON is embedded in HTML document
- // prevents outputting "</" gets outputted with unicode escaping for the slash
- if (previousChar == '<') {
- return "\\u002f";
- }
- break;
- }
- if(ch < ' ') {
- // escape all other control characters
- return "\\u" + StringGroovyMethods.padLeft(Integer.toHexString(ch), 4, "0");
- }
- return null;
- }
-
- @Override
- public boolean isApplyToSafelyEncoded() {
- return true;
- }
-
- @Override
- public final Object encode(Object o) {
- return doEncode(o);
- }
-
- protected Object doEncode(Object o) {
- if(o == null) {
- return null;
- }
- if(o instanceof CharSequence || (o != null && ClassUtils.isPrimitiveOrWrapper(o.getClass())) ) {
- return super.encode(o);
- } else {
- return encodeAsJsonObject(o);
- }
- }
-
- protected Object encodeAsJsonObject(Object o) {
- return o;
- }
-}
View
105 ...ls-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/BasicXMLEncoder.java
@@ -1,105 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-import org.springframework.util.ClassUtils;
-
-/**
- * Encoder implementation that escapes some characters for inclusion in XML documents
- *
- * Currently ', ", &lt;, &gt; and &amp; characters are replaced with XML entities.
- * Additionally backslash (/), non-breaking space, backtick (`) and @ are also replaced for visibility/additional security.
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class BasicXMLEncoder extends AbstractCharReplacementEncoder {
- private static final String ESCAPED_APOS = xmlEscapeCharacter('\''); // html doesn't have apos, so use numeric entity
- private static final String ESCAPED_QUOTE = "&quot;";
- private static final String ESCAPED_GT = "&gt;";
- private static final String ESCAPED_LT = "&lt;";
- private static final String ESCAPED_AMP = "&amp;";
- // some extras
- private static final String ESCAPED_BACKSLASH = xmlEscapeCharacter('\\');
- private static final char NBSP=(char)160;
- private static final String ESCAPED_NON_BREAKING_SPACE = xmlEscapeCharacter(NBSP);
- private static final String ESCAPED_BACKTICK = xmlEscapeCharacter('`');
- private static final String ESCAPED_AT = xmlEscapeCharacter('@'); // IE Javascript conditional compilation rules
- private static final char LINE_SEPARATOR = '\u2028';
- private static final String ESCAPED_LINE_SEPARATOR = xmlEscapeCharacter(LINE_SEPARATOR);
- private static final char PARAGRAPH_SEPARATOR = '\u2029';
- private static final String ESCAPED_PARAGRAPH_SEPARATOR = xmlEscapeCharacter(PARAGRAPH_SEPARATOR);
-
- protected static final String xmlEscapeCharacter(char ch) {
- return "&#" + ((int) ch) + ";";
- }
-
- public static final CodecIdentifier XML_CODEC_IDENTIFIER=new DefaultCodecIdentifier("XML");
-
- public BasicXMLEncoder() {
- super(XML_CODEC_IDENTIFIER);
- }
-
- protected BasicXMLEncoder(CodecIdentifier codecIdentifier) {
- super(codecIdentifier);
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder#escapeCharacter(char, char)
- */
- @Override
- protected String escapeCharacter(char ch, char previousChar) {
- if(ch < ' ' && ch != '\t' && ch != '\n' && ch != '\r') {
- return "";
- }
- switch(ch) {
- case '&': return ESCAPED_AMP;
- case '<': return ESCAPED_LT;
- case '>': return ESCAPED_GT;
- case '"': return ESCAPED_QUOTE;
- case '\'': return ESCAPED_APOS;
- case '\\': return ESCAPED_BACKSLASH;
- case '@': return ESCAPED_AT;
- case '`': return ESCAPED_BACKTICK;
- case NBSP: return ESCAPED_NON_BREAKING_SPACE;
- case LINE_SEPARATOR: return ESCAPED_LINE_SEPARATOR;
- case PARAGRAPH_SEPARATOR: return ESCAPED_PARAGRAPH_SEPARATOR;
- }
- return null;
- }
-
- @Override
- public final Object encode(Object o) {
- return doEncode(o);
- }
-
- protected Object doEncode(Object o) {
- if(o == null) {
- return null;
- }
- if(o instanceof CharSequence || (o != null && ClassUtils.isPrimitiveOrWrapper(o.getClass()))) {
- return doCharReplacementEncoding(o);
- } else {
- return encodeAsXmlObject(o);
- }
- }
-
- protected Object encodeAsXmlObject(Object o) {
- return o;
- }
-}
View
49 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Codec.java
@@ -1,49 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecFactory;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-
-/**
- * Encodes and decodes strings to and from HTML. It uses escaping information
- * from Spring's HtmlUtils so that this is compatible with the previous
- * "encodeAsHTML" in older Grails versions.
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class HTML4Codec implements CodecFactory {
- static final String CODEC_NAME = "HTML4";
-
- private static Encoder encoder = new HTML4Encoder();
- private static Decoder decoder = new HTML4Decoder();
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecFactory#getEncoder()
- */
- public Encoder getEncoder() {
- return encoder;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecFactory#getDecoder()
- */
- public Decoder getDecoder() {
- return decoder;
- }
-}
View
46 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Decoder.java
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.springframework.web.util.HtmlUtils;
-
-/**
- * HTML4 decoder that uses Spring's HtmlUtils.htmlUnescape to do the unescaping.
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class HTML4Decoder implements Decoder {
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Decoder#decode(java.lang.Object)
- */
- public Object decode(Object o) {
- if (o == null) {
- return null;
- }
- return HtmlUtils.htmlUnescape(String.valueOf(o));
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecIdentifierProvider#getCodecIdentifier()
- */
- public CodecIdentifier getCodecIdentifier() {
- return HTML4Encoder.HTML4_CODEC_IDENTIFIER;
- }
-}
View
107 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTML4Encoder.java
@@ -1,107 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-import org.springframework.util.ReflectionUtils;
-import org.springframework.web.util.HtmlUtils;
-
-/**
- * This encoder is for HTML4 documents. It uses escaping information from
- * Spring's HtmlUtils so that this is compatible with the previous
- * "encodeAsHTML" in older Grails versions.
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class HTML4Encoder extends AbstractCharReplacementEncoder {
- private static final Log log = LogFactory.getLog(HTML4Encoder.class);
- static final String HTML4_CODEC_NAME = "HTML4";
- static final CodecIdentifier HTML4_CODEC_IDENTIFIER = new DefaultCodecIdentifier(HTML4_CODEC_NAME);
- Map<Character, String> replacements = new ConcurrentHashMap<Character, String>();
- private static final String NULL_MARKER = "NULL_MARKER";
-
- public HTML4Encoder() {
- super(HTML4_CODEC_IDENTIFIER);
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder
- * #escapeCharacter(char, char)
- */
- @Override
- protected String escapeCharacter(char ch, char previousChar) {
- Character key = Character.valueOf(ch);
- String replacement = replacements.get(key);
- if (replacement == null) {
- replacement = StreamingHTMLEncoderHelper.convertToReference(ch);
- replacements.put(key, replacement != null ? replacement : NULL_MARKER);
- }
- return replacement != NULL_MARKER ? replacement : null;
- }
-
- /**
- * Calls Spring's HtmlUtils's private method to convert characters to HTML entities.
- */
- private static final class StreamingHTMLEncoderHelper {
- private static Object instance;
- private static Method mapMethod;
- private static boolean disabled = false;
- static {
- try {
- Field instanceField = ReflectionUtils.findField(HtmlUtils.class, "characterEntityReferences");
- ReflectionUtils.makeAccessible(instanceField);
- instance = instanceField.get(null);
- mapMethod = ReflectionUtils.findMethod(instance.getClass(), "convertToReference", char.class);
- if (mapMethod != null)
- ReflectionUtils.makeAccessible(mapMethod);
- }
- catch (Exception e) {
- log.warn("Couldn't use reflection for resolving characterEntityReferences in HtmlUtils class", e);
- disabled = true;
- }
- }
-
- /**
- * Convert to html reference.
- *
- * @param c the character to convert
- * @return the converted entity, returns null if the character doesn't have a replacement
- */
- public static final String convertToReference(char c) {
- if (!disabled) {
- return (String)ReflectionUtils.invokeMethod(mapMethod, instance, c);
- }
-
- String charAsString = String.valueOf(c);
- String replacement = HtmlUtils.htmlEscape(charAsString);
- if (charAsString.equals(replacement)) {
- return null;
- }
- return replacement;
- }
- }
-}
View
33 ...encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLCodecFactory.groovy
@@ -1,33 +0,0 @@
-/* Copyright 2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs
-
-import groovy.transform.CompileStatic
-
-import org.codehaus.groovy.grails.support.encoding.CodecFactory
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier
-import org.codehaus.groovy.grails.support.encoding.Decoder
-import org.codehaus.groovy.grails.support.encoding.Encoder
-
-@CompileStatic
-class HTMLCodecFactory implements CodecFactory {
- Encoder encoder = new HTMLEncoder()
- Decoder decoder = decoder = new HTML4Decoder() {
- @Override
- public CodecIdentifier getCodecIdentifier() {
- return HTMLEncoder.HTML_CODEC_IDENTIFIER;
- }
- }
-}
View
39 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLEncoder.java
@@ -1,39 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-
-/**
- * HTMLEncoder implementation currently this doesn't add any extra features to
- * XMLEncoder This encoder is for XML, XHTML and HTML5 documents.
- *
- * @see HTML4Encoder
- * @author Lari Hotari
- * @since 2.3
- */
-public class HTMLEncoder extends BasicXMLEncoder {
- public static final CodecIdentifier HTML_CODEC_IDENTIFIER = new DefaultCodecIdentifier("HTML");
-
- public HTMLEncoder() {
- super(HTML_CODEC_IDENTIFIER);
- }
-
- protected Object doEncode(Object o) {
- return doCharReplacementEncoding(o);
- }
-}
View
28 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLJSCodec.java
@@ -1,28 +0,0 @@
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.ChainedDecoder;
-import org.codehaus.groovy.grails.support.encoding.ChainedEncoder;
-import org.codehaus.groovy.grails.support.encoding.CodecFactory;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.codehaus.groovy.grails.support.encoding.StreamingEncoder;
-
-public class HTMLJSCodec implements CodecFactory {
- protected final StreamingEncoder[] encoders;
- protected final Decoder[] decoders;
-
- public HTMLJSCodec() {
- encoders = new StreamingEncoder[]{(StreamingEncoder)new HTMLEncoder(), (StreamingEncoder)JavaScriptCodec.getENCODER()};
- decoders = new Decoder[]{JavaScriptCodec.getDECODER(), new HTML4Decoder()};
- }
-
- @Override
- public Encoder getEncoder() {
- return ChainedEncoder.createFor(encoders);
- }
-
- @Override
- public Decoder getDecoder() {
- return new ChainedDecoder(decoders);
- }
-}
View
40 ...encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JSONCodecFactory.groovy
@@ -1,40 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs
-
-import groovy.transform.CompileStatic
-
-import groovy.json.StringEscapeUtils
-import org.codehaus.groovy.grails.support.encoding.CodecFactory
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier
-import org.codehaus.groovy.grails.support.encoding.Decoder
-import org.codehaus.groovy.grails.support.encoding.Encoder
-
-
-@CompileStatic
-class JSONCodecFactory implements CodecFactory {
- Encoder encoder = new BasicJSONEncoder()
-
- Decoder decoder = new Decoder() {
- def decode(Object obj) {
- obj != null ? StringEscapeUtils.unescapeJavaScript(obj.toString()) : null
- }
-
- CodecIdentifier getCodecIdentifier() {
- BasicJSONEncoder.JSON_CODEC_IDENTIFIER
- }
- }
-}
View
50 ...-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JavaScriptCodec.groovy
@@ -1,50 +0,0 @@
-/*
- * Copyright 2004-2005 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs
-
-import groovy.transform.CompileStatic
-
-import groovy.json.StringEscapeUtils
-import org.codehaus.groovy.grails.support.encoding.CodecFactory
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier
-import org.codehaus.groovy.grails.support.encoding.Decoder
-import org.codehaus.groovy.grails.support.encoding.Encoder
-
-/**
- * A codec that encodes strings to Javascript
- *
- * @author Graeme Rocher
- * @since 0.5
- */
-@CompileStatic
-class JavaScriptCodec implements CodecFactory {
-
- static Encoder ENCODER = new JavaScriptEncoder()
-
- static Decoder DECODER = new Decoder() {
- def decode(Object obj) {
- obj != null ? StringEscapeUtils.unescapeJavaScript(obj.toString()) : null
- }
-
- CodecIdentifier getCodecIdentifier() {
- JavaScriptEncoder.JAVASCRIPT_CODEC_IDENTIFIER
- }
- }
-
- Encoder getEncoder() { ENCODER }
-
- Decoder getDecoder() { DECODER }
-}
View
111 ...-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/JavaScriptEncoder.java
@@ -1,111 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-
-/**
- * Used for making strings safe to be included in a SCRIPT tag besides normal
- * Javascript escaping, possibly "unsafe" characters are escaped too so that
- * it's safe to include an escaped string in a HTML SCRIPT tag.
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class JavaScriptEncoder extends AbstractCharReplacementEncoder {
- public static final CodecIdentifier JAVASCRIPT_CODEC_IDENTIFIER = new DefaultCodecIdentifier(
- "JavaScript", "Js") {
- public boolean isEquivalent(CodecIdentifier other) {
- return super.isEquivalent(other) || BasicJSONEncoder.JSON_CODEC_IDENTIFIER.getCodecName().equals(other.getCodecName());
- };
- };
-
- public JavaScriptEncoder() {
- super(JAVASCRIPT_CODEC_IDENTIFIER);
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder#escapeCharacter(char, char)
- */
- @Override
- protected String escapeCharacter(char ch, char previousChar) {
- switch (ch) {
- case '"':
- return "\\u0022";
- case '\'':
- return "\\u0027";
- case '`': // backtick
- return "\\u0060";
- case '\\':
- return "\\u005c";
- case '/':
- return "\\u002f";
- case '\t':
- return "\\t";
- case '\n':
- if (previousChar != '\r') {
- return "\\n";
- }
- case '\r':
- return "\\n";
- case '\f':
- return "\\f";
- case '\b':
- return "\\b";
- case '\u000B': // vertical tab: http://bclary.com/2004/11/07/#a-7.8.4
- return "\\v";
- case '&':
- return "\\u0026";
- case '<':
- return "\\u003c";
- case '>':
- return "\\u003e";
- case '(':
- return "\\u0028";
- case ')':
- return "\\u0029";
- case '[':
- return "\\u005b";
- case ']':
- return "\\u005d";
- case '{':
- return "\\u007b";
- case '}':
- return "\\u007d";
- case ',':
- return "\\u002c";
- case ';':
- return "\\u003b";
- case '@':
- return "\\u0040";
- case '\u2028':
- return "\\u2028"; // Line separator
- case '\u2029':
- return "\\u2029"; // Paragraph separator
- }
- if(ch < ' ') {
- // remove all other control characters
- return "";
- }
- return null;
- }
-
- @Override
- public boolean isApplyToSafelyEncoded() {
- return true;
- }
-}
View
58 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/NoneEncoder.java
@@ -1,58 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import java.io.IOException;
-
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.EncodedAppender;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.codehaus.groovy.grails.support.encoding.EncodingState;
-import org.codehaus.groovy.grails.support.encoding.StreamingEncoder;
-
-/**
- * @author Lari Hotari
- * @since 2.3
- */
-public class NoneEncoder implements StreamingEncoder {
- static final CodecIdentifier CODEC_IDENTIFIER = new DefaultCodecIdentifier("None");
-
- public Object encode(Object o) {
- return o;
- }
-
- public boolean isSafe() {
- return false;
- }
-
- public boolean isApplyToSafelyEncoded() {
- return false;
- }
-
- public void markEncoded(CharSequence string) {
-
- }
-
- public CodecIdentifier getCodecIdentifier() {
- return CODEC_IDENTIFIER;
- }
-
- public void encodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender,
- EncodingState encodingState) throws IOException {
- appender.append(null, encodingState, source, offset, len);
- }
-}
View
109 grails-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/RawCodec.java
@@ -1,109 +0,0 @@
-/* Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import java.io.IOException;
-
-import org.codehaus.groovy.grails.support.encoding.CodecFactory;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.EncodedAppender;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.codehaus.groovy.grails.support.encoding.EncodingState;
-import org.codehaus.groovy.grails.support.encoding.StreamingEncoder;
-
-/**
- * Codec that doesn't do any encoding or decoding. This is for marking some text
- * as "safe" in the buffer. "safe" part of the buffer won't be encoded later if
- * a codec is applied to the buffer
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public class RawCodec implements Encoder, Decoder, StreamingEncoder, CodecFactory {
- static final CodecIdentifier RAW_CODEC_IDENTIFIER = new DefaultCodecIdentifier("Raw") {
- // using RawCodec will prevent all other codecs from encoding a part encoded with this codec
- public boolean isEquivalent(CodecIdentifier other) { return true; };
- };
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Decoder#decode(java.lang.Object)
- */
- public Object decode(Object o) {
- return o;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#isSafe()
- */
- public boolean isSafe() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#encode(java.lang.Object)
- */
- public Object encode(Object o) {
- if(o instanceof String) {
- // create a new copy of the String instance
- return new String((String)o);
- } else if(o instanceof CharSequence) {
- // convert CharSequence to String so that we have a new instance
- return String.valueOf(o);
- } else {
- return o;
- }
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#markEncoded(java.lang.CharSequence)
- */
- public void markEncoded(CharSequence string) {
-
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.StreamingEncoder#encodeToStream(org.codehaus.groovy.grails.support.encoding.Encoder, java.lang.CharSequence, int, int, org.codehaus.groovy.grails.support.encoding.EncodedAppender, org.codehaus.groovy.grails.support.encoding.EncodingState)
- */
- public void encodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender,
- EncodingState encodingState) throws IOException {
- appender.appendEncoded(thisInstance, encodingState, source, offset, len);
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecIdentifierProvider#getCodecIdentifier()
- */
- public CodecIdentifier getCodecIdentifier() {
- return RAW_CODEC_IDENTIFIER;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.Encoder#isApplyToSafelyEncoded()
- */
- public boolean isApplyToSafelyEncoded() {
- return false;
- }
-
- @Override
- public Encoder getEncoder() {
- return this;
- }
-
- @Override
- public Decoder getDecoder() {
- return this;
- }
-}
View
70 ...er/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/StandaloneCodecLookup.groovy
@@ -1,70 +0,0 @@
-/* Copyright 2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs
-
-import groovy.transform.CompileStatic
-
-import grails.util.GrailsMetaClassUtils
-import org.codehaus.groovy.grails.support.encoding.CodecFactory
-import org.codehaus.groovy.grails.support.encoding.CodecMetaClassSupport
-import org.codehaus.groovy.runtime.GStringImpl
-
-@CompileStatic
-class StandaloneCodecLookup extends BasicCodecLookup {
- boolean registerMetaMethods = true
- boolean cacheLookupsInMetaMethods = true
- Collection<Class> targetClassesForMetaMethods = [
- String,
- GStringImpl,
- StringBuffer,
- StringBuilder,
- Object
- ]
- Collection<Class> codecFactoryClasses = [
- XMLCodecFactory,
- HTMLCodecFactory,
- JSONCodecFactory,
- JavaScriptCodec,
- HTMLJSCodec,
- URLCodecFactory,
- RawCodec
- ]
-
- @Override
- protected void registerCodecs() {
- codecFactoryClasses.each { Class clazz ->
- registerCodecFactory((CodecFactory)clazz.newInstance())
- }
- }
-
- @Override
- public void registerCodecFactory(CodecFactory codecFactory) {
- super.registerCodecFactory(codecFactory)
- registerMetaMethods(codecFactory)
- }
-
- protected registerMetaMethods(CodecFactory codecFactory) {
- if(registerMetaMethods && targetClassesForMetaMethods) {
- new CodecMetaClassSupport().configureCodecMethods(codecFactory, cacheLookupsInMetaMethods, resolveMetaClasses())
- }
- }
-
- protected List<ExpandoMetaClass> resolveMetaClasses() {
- targetClassesForMetaMethods.collect {
- Class clazz ->
- GrailsMetaClassUtils.getExpandoMetaClass(clazz)
- }
- }
-}
View
78 ...-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/URLCodecFactory.groovy
@@ -1,78 +0,0 @@
-/*
- * Copyright 2004-2005 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import groovy.transform.CompileStatic
-
-import org.codehaus.groovy.grails.support.encoding.CodecFactory
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier
-import org.codehaus.groovy.grails.support.encoding.Decoder
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier
-import org.codehaus.groovy.grails.support.encoding.Encoder
-import org.springframework.web.context.request.RequestContextHolder
-
-/**
- * Implements the 'www-form-urlencoded' encoding scheme, also misleadingly known as URL encoding.
- *
- * @see <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">Chapter 17.13.4 Form content types</a>
- * of the <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification</a>
- *
- * @since 2.4
- */
-@CompileStatic
-public class URLCodecFactory implements CodecFactory {
- static final CodecIdentifier URL_CODEC_IDENTIFIER = new DefaultCodecIdentifier("URL");
-
- Encoder encoder = new Encoder() {
- @Override
- public CodecIdentifier getCodecIdentifier() {
- URL_CODEC_IDENTIFIER;
- }
-
- public Object encode(Object o) {
- if(o==null) return o;
- URLEncoder.encode(String.valueOf(o), resolveEncoding());
- }
-
- public boolean isApplyToSafelyEncoded() {
- true;
- }
-
- public boolean isSafe() {
- true;
- }
-
- public void markEncoded(CharSequence string) {
-
- }
- };
-
- Decoder decoder = new Decoder() {
- public CodecIdentifier getCodecIdentifier() {
- URL_CODEC_IDENTIFIER;
- }
-
- @Override
- public Object decode(Object o) {
- if(o==null) return o;
- URLDecoder.decode(String.valueOf(o), resolveEncoding());
- }
- };
-
- protected String resolveEncoding() {
- 'UTF-8'
- }
-}
View
52 ...ls-encoder/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/XMLCodecFactory.java
@@ -1,52 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.plugins.codecs;
-
-import org.codehaus.groovy.grails.support.encoding.CodecFactory;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.Decoder;
-import org.codehaus.groovy.grails.support.encoding.Encoder;
-import org.springframework.web.util.HtmlUtils;
-
-public class XMLCodecFactory implements CodecFactory {
- protected Encoder encoder = new BasicXMLEncoder();
- protected Decoder decoder = new Decoder() {
- public CodecIdentifier getCodecIdentifier() {
- return BasicXMLEncoder.XML_CODEC_IDENTIFIER;
- }
-
- public Object decode(Object o) {
- if (o == null) {
- return null;
- }
- return HtmlUtils.htmlUnescape(String.valueOf(o));
- }
- };
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecFactory#getEncoder()
- */
- public Encoder getEncoder() {
- return encoder;
- }
-
- /* (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.CodecFactory#getDecoder()
- */
- public Decoder getDecoder() {
- return decoder;
- }
-}
View
225 .../src/main/groovy/org/codehaus/groovy/grails/support/encoding/AbstractEncodedAppender.java
@@ -1,225 +0,0 @@
-/*
- * Copyright 2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.support.encoding;
-
-import java.io.IOException;
-
-/**
- * Abstract base class for implementations of {@link EncodedAppender} interface
- *
- * @author Lari Hotari
- * @since 2.3
- */
-public abstract class AbstractEncodedAppender implements EncodedAppender {
- private boolean ignoreEncodingState;
-
- /**
- * Append a portion of a char array to the buffer and attach the
- * encodingState information to it
- *
- * @param encodingState
- * the new encoding state of the char array
- * @param b
- * a char array
- * @param off
- * Offset from which to start encoding characters
- * @param len
- * Number of characters to encode
- * @throws IOException
- * Signals that an I/O exception has occurred.
- */
- protected abstract void write(EncodingState encodingState, char[] b, int off, int len) throws IOException;
-
- /**
- * Append a portion of a string to the buffer and attach the encodingState
- * information to it
- *
- * @param encodingState
- * the new encoding state of the string
- * @param str
- * A String
- * @param off
- * Offset from which to start encoding characters
- * @param len
- * Number of characters to encode
- * @throws IOException
- * Signals that an I/O exception has occurred.
- */
- protected abstract void write(EncodingState encodingState, String str, int off, int len) throws IOException;
-
- /**
- * Append a portion of a CharSequence to the buffer and attach the
- * encodingState information to it
- *
- * @param encodingState
- * the new encoding state of the CharSequence portion
- * @param str
- * a CharSequence
- * @param start
- * the start index, inclusive
- * @param end
- * the end index, exclusive
- * @throws IOException
- * Signals that an I/O exception has occurred.
- */
- protected abstract void appendCharSequence(EncodingState encodingState, CharSequence str, int start, int end)
- throws IOException;
-
- /*
- * (non-Javadoc)
- * @see
- * org.codehaus.groovy.grails.support.encoding.EncodedAppender#append(org
- * .codehaus.groovy.grails.support.encoding.Encoder,
- * org.codehaus.groovy.grails.support.encoding.EncodingState, char[], int,
- * int)
- */
- public void append(Encoder encoder, EncodingState encodingState, char[] b, int off, int len) throws IOException {
- if (b == null || len <= 0) {
- return;
- }
- if (shouldEncode(encoder, encodingState)) {
- EncodingState newEncoders = createNewEncodingState(encoder, encodingState);
- if (encoder instanceof StreamingEncoder) {
- ((StreamingEncoder)encoder).encodeToStream(encoder, CharSequences.createCharSequence(b, off, len), 0, len, this,
- newEncoders);
- }
- else {
- encodeAndWrite(encoder, newEncoders, String.valueOf(b, off, len));
- }
- }
- else {
- write(encodingState, b, off, len);
- }
- }
-
- protected EncodingState createNewEncodingState(Encoder encoder, EncodingState encodingState) {
- if (encodingState == null) {
- return new EncodingStateImpl(encoder, null);
- }
- return encodingState.appendEncoder(encoder);
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.codehaus.groovy.grails.support.encoding.EncodedAppender#append(org
- * .codehaus.groovy.grails.support.encoding.Encoder,
- * org.codehaus.groovy.grails.support.encoding.EncodingState,
- * java.lang.CharSequence, int, int)
- */
- public void append(Encoder encoder, EncodingState encodingState, CharSequence str, int off, int len)
- throws IOException {
- if (str == null || len <= 0) {
- return;
- }
- if (shouldEncode(encoder, encodingState)) {
- EncodingState newEncoders = createNewEncodingState(encoder, encodingState);
- if (encoder instanceof StreamingEncoder) {
- ((StreamingEncoder)encoder).encodeToStream(encoder, str, off, len, this, newEncoders);
- }
- else {
- CharSequence source;
- if (CharSequences.canUseOriginalForSubSequence(str, off, len)) {
- source = str;
- }
- else {
- source = str.subSequence(off, off + len);
- }
- encodeAndWrite(encoder, newEncoders, source);
- }
- }
- else {
- appendCharSequence(encodingState, str, off, off + len);
- }
- }
-
- public void appendEncoded(Encoder encoder, EncodingState encodingState, char[] b, int off, int len)
- throws IOException {
- write(createNewEncodingState(encoder, encodingState), b, off, len);
- }
-
- public void appendEncoded(Encoder encoder, EncodingState encodingState, CharSequence str, int off, int len)
- throws IOException {
- appendCharSequence(createNewEncodingState(encoder, encodingState), str, off, off + len);
- }
-
- /**
- * Check if the encoder should be used to a input with certain encodingState
- *
- * @param encoderToApply
- * the encoder to apply
- * @param encodingState
- * the current encoding state
- * @return true, if should encode
- */
- public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState) {
- return ignoreEncodingState || (encoderToApply != null
- && (encodingState == null || shouldEncodeWith(encoderToApply, encodingState)));
- }
-
- protected boolean shouldEncodeWith(Encoder encoderToApply, EncodingState encodingState) {
- return DefaultEncodingStateRegistry.shouldEncodeWith(encoderToApply,
- encodingState);
- }
-
- /**
- * Encode and write input to buffer using a non-streaming encoder
- *
- * @param encoder
- * the encoder to use
- * @param newEncodingState
- * the new encoding state after encoder has been applied
- * @param input
- * the input CharSequence
- * @throws IOException
- * Signals that an I/O exception has occurred.
- */
- protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input)
- throws IOException {
- Object encoded = encoder.encode(input);
- if (encoded != null) {
- String encodedStr = String.valueOf(encoded);
- write(newEncodingState, encodedStr, 0, encodedStr.length());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.codehaus.groovy.grails.support.encoding.EncodedAppender#append(org
- * .codehaus.groovy.grails.support.encoding.Encoder,
- * org.codehaus.groovy.grails.support.encoding.StreamEncodeable)
- */
- public void append(Encoder encoder, StreamEncodeable streamEncodeable) throws IOException {
- streamEncodeable.encodeTo(this, encoder);
- }
-
- /*
- * (non-Javadoc)
- * @see org.codehaus.groovy.grails.support.encoding.EncodedAppender#flush()
- */
- public void flush() throws IOException {
-
- }
-
- public boolean isIgnoreEncodingState() {
- return ignoreEncodingState;
- }
-
- public void setIgnoreEncodingState(boolean ignoreEncodingState) {
- this.ignoreEncodingState = ignoreEncodingState;
- }
-}
View
45 ...s-encoder/src/main/groovy/org/codehaus/groovy/grails/support/encoding/ChainedDecoder.java
@@ -1,45 +0,0 @@
-/*
- * Copyright 2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.codehaus.groovy.grails.support.encoding;
-
-public class ChainedDecoder implements Decoder {
- protected Decoder[] decoders;
- protected CodecIdentifier codecIdentifier;
-
- public ChainedDecoder(Decoder[] decoders) {
- this.decoders = decoders;
- this.codecIdentifier = createCodecIdentifier(decoders);
- }
-
- protected CombinedCodecIdentifier createCodecIdentifier(Decoder[] decoders) {
- return new CombinedCodecIdentifier(decoders, true);
- }
-
- @Override
- public CodecIdentifier getCodecIdentifier() {
- return codecIdentifier;
- }
-
- @Override
- public Object decode(Object o) {
- if(o==null) return o;
- Object decoded = o;
- for (Decoder decoder : decoders) {
- decoded = decoder.decode(decoded);
- }