You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2008/03/12 00:09:27 UTC
svn commit: r636144 [4/7] - in /incubator/rat/import: ./ rat/ rat/src/
rat/src/java/ rat/src/java/rat/ rat/src/java/rat/analysis/
rat/src/java/rat/analysis/generation/ rat/src/java/rat/analysis/license/
rat/src/java/rat/analysis/util/ rat/src/java/rat/...
Added: incubator/rat/import/rat/src/java/rat/report/xml/writer/IXmlWriter.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/java/rat/report/xml/writer/IXmlWriter.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/java/rat/report/xml/writer/IXmlWriter.java (added)
+++ incubator/rat/import/rat/src/java/rat/report/xml/writer/IXmlWriter.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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 rat.report.xml.writer;
+
+import java.io.IOException;
+
+/**
+ * Simple interface for creating basic xml documents.
+ * Performs basic validation and escaping.
+ * Not namespace aware (may reconsider this later).
+ */
+public interface IXmlWriter {
+
+ /**
+ * Starts a document by writing a prolog.
+ * Calling this method is optional.
+ * When writing a document fragment, it should <em>not</em> be called.
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called after the first element has been written
+ * or once a prolog has already been written
+ */
+ public IXmlWriter startDocument() throws IOException;
+
+ /**
+ * Writes the start of an element.
+ *
+ * @param elementName the name of the element, not null
+ * @return this object
+ * @throws InvalidXmlException if the name is not valid for an xml element
+ * @throws OperationNotAllowedException
+ * if called after the first element has been closed
+ */
+ public IXmlWriter openElement(CharSequence elementName) throws IOException;
+
+ /**
+ * Writes an attribute of an element.
+ * Note that this is only allowed directly after {@link #openElement(CharSequence)}
+ * or {@link #attribute}.
+ *
+ * @param name the attribute name, not null
+ * @param value the attribute value, not null
+ * @return this object
+ * @throws InvalidXmlException if the name is not valid for an xml attribute
+ * or if a value for the attribute has already been written
+ * @throws OperationNotAllowedException if called after {@link #content}
+ * or {@link #closeElement() or before any call to {@link #openElement}
+ */
+ public IXmlWriter attribute(CharSequence name, CharSequence value) throws IOException;
+
+ /**
+ * Writes content.
+ * Calling this method will automatically
+ * Note that this method does not use CDATA.
+ *
+ * @param content the content to write
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ * or after the first element has been closed
+ */
+ public IXmlWriter content(CharSequence content) throws IOException;
+
+ /**
+ * Closes the last element written.
+ *
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ * or after the first element has been closed
+ */
+ public IXmlWriter closeElement() throws IOException;
+
+ /**
+ * Closes all pending elements.
+ * When appropriate, resources are also flushed and closed.
+ * No exception is raised when called upon a document whose
+ * root element has already been closed.
+ *
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ */
+ public IXmlWriter closeDocument() throws IOException;
+}
\ No newline at end of file
Added: incubator/rat/import/rat/src/java/rat/report/xml/writer/InvalidXmlException.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/java/rat/report/xml/writer/InvalidXmlException.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/java/rat/report/xml/writer/InvalidXmlException.java (added)
+++ incubator/rat/import/rat/src/java/rat/report/xml/writer/InvalidXmlException.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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 rat.report.xml.writer;
+
+import java.io.IOException;
+
+/**
+ * Indicates that the requested document would not be well formed.
+ *
+ */
+public class InvalidXmlException extends IOException {
+
+ private static final long serialVersionUID = 1L;
+
+ public InvalidXmlException(String s) {
+ super(s);
+ }
+
+}
Added: incubator/rat/import/rat/src/java/rat/report/xml/writer/OperationNotAllowedException.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/java/rat/report/xml/writer/OperationNotAllowedException.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/java/rat/report/xml/writer/OperationNotAllowedException.java (added)
+++ incubator/rat/import/rat/src/java/rat/report/xml/writer/OperationNotAllowedException.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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 rat.report.xml.writer;
+
+import java.io.IOException;
+
+/**
+ * Thrown by {@link IXmlWriter} implementations when the current
+ * state does not allow the requested operation.
+ */
+public class OperationNotAllowedException extends IOException {
+
+ private static final long serialVersionUID = 1L;
+
+ public OperationNotAllowedException(String message) {
+ super(message);
+ }
+
+
+}
Added: incubator/rat/import/rat/src/java/rat/report/xml/writer/XmlWriterUtils.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/java/rat/report/xml/writer/XmlWriterUtils.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/java/rat/report/xml/writer/XmlWriterUtils.java (added)
+++ incubator/rat/import/rat/src/java/rat/report/xml/writer/XmlWriterUtils.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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 rat.report.xml.writer;
+
+import java.io.IOException;
+
+public class XmlWriterUtils {
+
+ public static final void writeAttribute(final IXmlWriter writer, final String name, final boolean booleanValue) throws IOException {
+ final String value = Boolean.toString(booleanValue);
+ writer.attribute(name, value);
+ }
+}
Added: incubator/rat/import/rat/src/java/rat/report/xml/writer/impl/base/XmlWriter.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/java/rat/report/xml/writer/impl/base/XmlWriter.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/java/rat/report/xml/writer/impl/base/XmlWriter.java (added)
+++ incubator/rat/import/rat/src/java/rat/report/xml/writer/impl/base/XmlWriter.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,656 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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 rat.report.xml.writer.impl.base;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.collections.ArrayStack;
+
+import rat.report.xml.writer.IXmlWriter;
+import rat.report.xml.writer.InvalidXmlException;
+import rat.report.xml.writer.OperationNotAllowedException;
+
+/**
+ * <p>Lightweight {@link IXmlWriter} implementation.</p>
+ * <p>
+ * Requires a wrapper to be used safely in a multithreaded
+ * environment.</p>
+ * <p>
+ * Not intended to be subclassed. Please copy and hack!</p>
+ */
+public final class XmlWriter implements IXmlWriter {
+
+ private static final byte NAME_START_MASK = 1 << 1;
+ private static final byte NAME_MASK = 1 << 2;
+ private static final byte NAME_BODY_CHAR = NAME_MASK;
+ private static final byte NAME_START_OR_BODY_CHAR = NAME_MASK | NAME_START_MASK;
+
+ private final static boolean[] ALLOWED_CHARACTERS = new boolean[1 << 16];
+
+ static {
+ Arrays.fill(ALLOWED_CHARACTERS, false);
+ ALLOWED_CHARACTERS[0x9] = true;
+ ALLOWED_CHARACTERS[0xA] = true;
+ ALLOWED_CHARACTERS[0xD] = true;
+ Arrays.fill(ALLOWED_CHARACTERS, 0x20, 0xD7FF, true);
+ Arrays.fill(ALLOWED_CHARACTERS, 0xE000, 0xFFFD, true);
+ }
+
+ private final static byte[] CHARACTER_CODES = new byte[1 << 16];
+
+ static {
+ // Name ::= (Letter | '_' | ':') (NameChar)*
+ CHARACTER_CODES['_'] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[':'] = NAME_START_OR_BODY_CHAR;
+ // Letter ::= BaseChar | Ideographic
+ // BaseChar
+ Arrays.fill(CHARACTER_CODES, 0x0041, 0x005A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0061, 0x007A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x00C0, 0x00D6, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x00D8, 0x00F6, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x00F8, 0x00FF, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0100, 0x0131, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0134, 0x013E, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0141, 0x0148, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x014A, 0x017E, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0180, 0x01C3, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x01CD, 0x01F0, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x01F4, 0x01F5, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x01FA, 0x0217, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0250, 0x02A8, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x02BB, 0x02C1, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0386] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0388, 0x038A, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x038C] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x038E, 0x03A1, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x03A3, 0x03CE, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x03D0, 0x03D6, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x03DA] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x03DC] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x03DE] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x03E0] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x03E2, 0x03F3, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0401, 0x040C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x040E, 0x044F, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0451, 0x045C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x045E, 0x0481, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0490, 0x04C4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x04C7, 0x04C8, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x04CB, 0x04CC, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x04D0, 0x04EB, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x04EE, 0x04F5, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x04F8, 0x04F9, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0531, 0x0556, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0559] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0561, 0x0586, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x05D0, 0x05EA, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x05F0, 0x05F2, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0621, 0x063A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0641, 0x064A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0671, 0x06B7, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06BA, 0x06BE, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06C0, 0x06CE, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06D0, 0x06D3, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x06D5] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x06E5, 0x06E6, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0905, 0x0939, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x093D] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0958, 0x0961, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0985, 0x098C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x098F, 0x0990, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0993, 0x09A8, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09AA, 0x09B0, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x09B2] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x09B6, 0x09B9, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09DC, 0x09DD, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09DF, 0x09E1, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09F0, 0x09F1, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A05, 0x0A0A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A0F, 0x0A10, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A13, 0x0A28, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A2A, 0x0A30, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A32, 0x0A33, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A35, 0x0A36, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A38, 0x0A39, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A59, 0x0A5C, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0A5E] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0A72, 0x0A74, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A85, 0x0A8B, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0A8D] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0A8F, 0x0A91, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A93, 0x0AA8, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0AAA, 0x0AB0, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0AB2, 0x0AB3, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0AB5, 0x0AB9, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0ABD] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x0AE0] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0B05, 0x0B0C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B0F, 0x0B10, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B13, 0x0B28, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B2A, 0x0B30, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B32, 0x0B33, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B36, 0x0B39, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0B3D] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0B5C, 0x0B5D, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B5F, 0x0B61, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B85, 0x0B8A, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B8E, 0x0B90, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B92, 0x0B95, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B99, 0x0B9A, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0B9C] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0B9E, 0x0B9F, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BA3, 0x0BA4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BA8, 0x0BAA, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BAE, 0x0BB5, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BB7, 0x0BB9, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C05, 0x0C0C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C0E, 0x0C10, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C12, 0x0C28, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C2A, 0x0C33, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C35, 0x0C39, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C60, 0x0C61, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C85, 0x0C8C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C8E, 0x0C90, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C92, 0x0CA8, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CAA, 0x0CB3, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CB5, 0x0CB9, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0CDE] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0CE0, 0x0CE1, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D05, 0x0D0C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D0E, 0x0D10, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D12, 0x0D28, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D2A, 0x0D39, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D60, 0x0D61, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E01, 0x0E2E, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0E30] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0E32, 0x0E33, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E40, 0x0E45, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E81, 0x0E82, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0E84] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0E87, 0x0E88, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0E8A] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x0E8D] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0E94, 0x0E97, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E99, 0x0E9F, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0EA1, 0x0EA3, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0EA5] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x0EA7] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0EAA, 0x0EAB, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0EAD, 0x0EAE, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0EB0] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0EB2, 0x0EB3, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x0EBD] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0EC0, 0x0EC4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F40, 0x0F47, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F49, 0x0F69, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x10A0, 0x10C5, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x10D0, 0x10F6, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1100] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x1102, 0x1103, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1105, 0x1107, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1109] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x110B, 0x110C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x110E, 0x1112, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x113C] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x113E] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1140] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x114C] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x114E] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1150] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x1154, 0x1155, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1159] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x115F, 0x1161, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1163] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1165] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1167] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1169] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x116D, 0x116E, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1172, 0x1173, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1175] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x119E] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x11A8] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x11AB] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x11AE, 0x11AF, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x11B7, 0x11B8, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x11BA] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x11BC, 0x11C2, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x11EB] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x11F0] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x11F9] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x1E00, 0x1E9B, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1EA0, 0x1EF9, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F00, 0x1F15, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F18, 0x1F1D, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F20, 0x1F45, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F48, 0x1F4D, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F50, 0x1F57, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1F59] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1F5B] = NAME_START_OR_BODY_CHAR;
+ CHARACTER_CODES[0x1F5D] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x1F5F, 0x1F7D, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1F80, 0x1FB4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FB6, 0x1FBC, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x1FBE] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x1FC2, 0x1FC4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FC6, 0x1FCC, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FD0, 0x1FD3, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FD6, 0x1FDB, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FE0, 0x1FEC, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FF2, 0x1FF4, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x1FF6, 0x1FFC, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x2126] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x212A, 0x212B, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x212E] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x2180, 0x2182, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x3041, 0x3094, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x30A1, 0x30FA, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x3105, 0x312C, NAME_START_OR_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0xAC00, 0xD7A3, NAME_START_OR_BODY_CHAR);
+ // Ideographic
+ Arrays.fill(CHARACTER_CODES, 0x4E00, 0x9FA5, NAME_START_OR_BODY_CHAR);
+ CHARACTER_CODES[0x3007] = NAME_START_OR_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x3021, 0x3029, NAME_START_OR_BODY_CHAR);
+ // NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
+ CHARACTER_CODES['.'] = NAME_BODY_CHAR;
+ CHARACTER_CODES['-'] = NAME_BODY_CHAR;
+ // CombiningChar
+ Arrays.fill(CHARACTER_CODES, 0x0300, 0x0345, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0360, 0x0361, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0483, 0x0486, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0591, 0x05A1, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x05A3, 0x05B9, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x05BB, 0x05BD, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x05BF] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x05C1, 0x05C2, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x05C4] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x064B, 0x0652, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0670] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x06D6, 0x06DC, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06DD, 0x06DF, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06E0, 0x06E4, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06E7, 0x06E8, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06EA, 0x06ED, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0901, 0x0903, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x093C] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x093E, 0x094C, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x094D] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0951, 0x0954, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0962, 0x0963, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0981, 0x0983, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x09BC] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x09BE] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x09BF] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x09C0, 0x09C4, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09C7, 0x09C8, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09CB, 0x09CD, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x09D7] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x09E2, 0x09E3, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0A02] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0A3C] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0A3E] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0A3F] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0A40, 0x0A42, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A47, 0x0A48, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A4B, 0x0A4D, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A70, 0x0A71, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A81, 0x0A83, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0ABC] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0ABE, 0x0AC5, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0AC7, 0x0AC9, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0ACB, 0x0ACD, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B01, 0x0B03, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0B3C] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0B3E, 0x0B43, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B47, 0x0B48, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B4B, 0x0B4D, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B56, 0x0B57, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B82, 0x0B83, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BBE, 0x0BC2, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BC6, 0x0BC8, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BCA, 0x0BCD, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0BD7] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0C01, 0x0C03, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C3E, 0x0C44, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C46, 0x0C48, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C4A, 0x0C4D, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C55, 0x0C56, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C82, 0x0C83, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CBE, 0x0CC4, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CC6, 0x0CC8, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CCA, 0x0CCD, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CD5, 0x0CD6, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D02, 0x0D03, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D3E, 0x0D43, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D46, 0x0D48, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D4A, 0x0D4D, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0D57] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0E31] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0E34, 0x0E3A, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E47, 0x0E4E, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0EB1] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0EB4, 0x0EB9, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0EBB, 0x0EBC, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0EC8, 0x0ECD, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F18, 0x0F19, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0F35] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0F37] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0F39] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0F3E] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0F3F] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0F71, 0x0F84, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F86, 0x0F8B, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F90, 0x0F95, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0F97] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x0F99, 0x0FAD, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0FB1, 0x0FB7, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x0FB9] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x20D0, 0x20DC, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x20E1] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x302A, 0x302F, NAME_BODY_CHAR);
+ CHARACTER_CODES[0x3099] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x309A] = NAME_BODY_CHAR;
+ // Digit
+ Arrays.fill(CHARACTER_CODES, 0x0030, 0x0039, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0660, 0x0669, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x06F0, 0x06F9, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0966, 0x096F, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x09E6, 0x09EF, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0A66, 0x0A6F, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0AE6, 0x0AEF, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0B66, 0x0B6F, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0BE7, 0x0BEF, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0C66, 0x0C6F, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0CE6, 0x0CEF, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0D66, 0x0D6F, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0E50, 0x0E59, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0ED0, 0x0ED9, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x0F20, 0x0F29, NAME_BODY_CHAR);
+ // Extender
+ CHARACTER_CODES[0x00B7] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x02D0] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x02D1] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0387] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0640] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0E46] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x0EC6] = NAME_BODY_CHAR;
+ CHARACTER_CODES[0x3005] = NAME_BODY_CHAR;
+ Arrays.fill(CHARACTER_CODES, 0x3031, 0x3035, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x309D, 0x309E, NAME_BODY_CHAR);
+ Arrays.fill(CHARACTER_CODES, 0x30FC, 0x30FE, NAME_BODY_CHAR);
+
+ }
+
+ private final Writer writer;
+ private final ArrayStack elementNames;
+ private final Set currentAttributes = new HashSet();
+
+ boolean elementsWritten = false;
+ boolean inElement = false;
+ boolean prologWritten = false;
+
+ public XmlWriter(final Writer writer) {
+ this.writer = writer;
+ this.elementNames = new ArrayStack();
+ }
+
+ /**
+ * Starts a document by writing a prolog.
+ * Calling this method is optional.
+ * When writing a document fragment, it should <em>not</em> be called.
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called after the first element has been written
+ * or once a prolog has already been written
+ */
+ public IXmlWriter startDocument() throws IOException {
+ if (elementsWritten) {
+ throw new OperationNotAllowedException("Document already started");
+ }
+ if (prologWritten) {
+ throw new OperationNotAllowedException("Only one prolog allowed");
+ }
+ writer.write("<?xml version='1.0'?>");
+ prologWritten = true;
+ return this;
+ }
+
+ /**
+ * Writes the start of an element.
+ *
+ * @param elementName the name of the element, not null
+ * @return this object
+ * @throws InvalidXmlException if the name is not valid for an xml element
+ * @throws OperationNotAllowedException
+ * if called after the first element has been closed
+ */
+ public IXmlWriter openElement(final CharSequence elementName) throws IOException {
+ if (elementsWritten && elementNames.isEmpty()) {
+ throw new OperationNotAllowedException("Root element already closed. Cannot open new element.");
+ }
+ if (!isValidName(elementName)) {
+ throw new InvalidXmlException("'" + elementName + "' is not a valid element name");
+ }
+ elementsWritten = true;
+ if (inElement) {
+ writer.write('>');
+ }
+ writer.write('<');
+ rawWrite(elementName);
+ inElement = true;
+ elementNames.push(elementName);
+ currentAttributes.clear();
+ return this;
+ }
+
+ /**
+ * Writes an attribute of an element.
+ * Note that this is only allowed directly after {@link #openElement(CharSequence)}
+ * or {@link #attribute}.
+ *
+ * @param name the attribute name, not null
+ * @param value the attribute value, not null
+ * @return this object
+ * @throws InvalidXmlException if the name is not valid for an xml attribute
+ * or if a value for the attribute has already been written
+ * @throws OperationNotAllowedException if called after {@link #content}
+ * or {@link #closeElement() or before any call to {@link #openElement}
+ */
+ public IXmlWriter attribute(CharSequence name, CharSequence value) throws IOException {
+ if (elementNames.isEmpty()) {
+ if (elementsWritten) {
+ throw new OperationNotAllowedException("Root element has already been closed.");
+ } else {
+ throw new OperationNotAllowedException("Close called before an element has been opened.");
+ }
+ }
+ if (!isValidName(name)) {
+ throw new InvalidXmlException("'" + name + "' is not a valid attribute name.");
+ }
+ if (!inElement) {
+ throw new InvalidXmlException("Attributes can only be written in elements");
+ }
+ if (currentAttributes.contains(name)) {
+ throw new InvalidXmlException("Each attribute can only be written once");
+ }
+ writer.write(' ');
+ rawWrite(name);
+ writer.write('=');
+ writer.write('\'');
+ writeAttributeContent(value);
+ writer.write('\'');
+ currentAttributes.add(name);
+ return this;
+ }
+
+ private void writeAttributeContent(CharSequence content) throws IOException {
+ writeEscaped(content, true);
+ }
+
+ /**
+ * Writes content.
+ * Calling this method will automatically
+ * Note that this method does not use CDATA.
+ *
+ * @param content the content to write
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ * or after the first element has been closed
+ */
+ public IXmlWriter content(CharSequence content) throws IOException {
+ if (elementNames.isEmpty()) {
+ if (elementsWritten) {
+ throw new OperationNotAllowedException("Root element has already been closed.");
+ } else {
+ throw new OperationNotAllowedException("An element must be opened before content can be written.");
+ }
+ }
+ if (inElement) {
+ writer.write('>');
+ }
+ writeBodyContent(content);
+ inElement = false;
+ return this;
+ }
+
+ private void writeBodyContent(final CharSequence content) throws IOException {
+ writeEscaped(content, false);
+ }
+
+ private void writeEscaped(final CharSequence content, boolean isAttributeContent) throws IOException {
+ final int length = content.length();
+ for (int i=0;i<length;i++) {
+ char character = content.charAt(i);
+ if (character == '&') {
+ writer.write("&");
+ } else if (character == '<') {
+ writer.write("<");
+ } else if (character == '>') {
+ writer.write(">");
+ } else if (isAttributeContent && character == '\'') {
+ writer.write("'");
+ } else if (isAttributeContent && character == '\"') {
+ writer.write(""");
+ } else if (isOutOfRange(character)) {
+ writer.write('?');
+ } else {
+ writer.write(character);
+ }
+ }
+ }
+
+ private boolean isOutOfRange(final char character) {
+ final boolean result = !ALLOWED_CHARACTERS[character];
+ return result;
+ }
+
+ /**
+ * Closes the last element written.
+ *
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ * or after the first element has been closed
+ */
+ public IXmlWriter closeElement() throws IOException {
+ if (elementNames.isEmpty()) {
+ if (elementsWritten) {
+ throw new OperationNotAllowedException("Root element has already been closed.");
+ } else {
+ throw new OperationNotAllowedException("Close called before an element has been opened.");
+ }
+ }
+ final CharSequence elementName = (CharSequence) elementNames.pop();
+ if (inElement) {
+ writer.write('/');
+ writer.write('>');
+ } else {
+ writer.write('<');
+ writer.write('/');
+ rawWrite(elementName);
+ writer.write('>');
+ }
+ writer.flush();
+ inElement = false;
+ return this;
+ }
+
+
+ /**
+ * Closes all pending elements.
+ * When appropriate, resources are also flushed and closed.
+ * No exception is raised when called upon a document whose
+ * root element has already been closed.
+ * @return this object
+ * @throws OperationNotAllowedException
+ * if called before any call to {@link #openElement}
+ */
+ public IXmlWriter closeDocument() throws IOException {
+ if (elementNames.isEmpty()) {
+ if (!elementsWritten) {
+ throw new OperationNotAllowedException("Close called before an element has been opened.");
+ }
+ }
+ while(!elementNames.isEmpty()) {
+ closeElement();
+ }
+ writer.flush();
+ return this;
+ }
+
+ private void rawWrite(final CharSequence sequence) throws IOException {
+ for (int i=0;i<sequence.length();i++) {
+ final char charAt = sequence.charAt(i);
+ writer.write(charAt);
+ }
+ }
+
+ private boolean isValidName(final CharSequence sequence) {
+ boolean result = true;
+ final int length = sequence.length();
+ for (int i=0;i<length;i++) {
+ char character = sequence.charAt(i);
+ if (i==0) {
+ if (!isValidNameStart(character)) {
+ result = false;
+ break;
+ }
+ } else {
+ if (!isValidNameBody(character)) {
+ result = false;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ private boolean isValidNameStart(final char character) {
+ final byte code = CHARACTER_CODES[character];
+ final boolean result = (code & NAME_START_MASK) > 0;
+ return result;
+ }
+
+ private boolean isValidNameBody(final char character) {
+ final byte code = CHARACTER_CODES[character];
+ final boolean result = (code & NAME_MASK) > 0;
+ return result;
+ }
+}
Added: incubator/rat/import/rat/src/python/recursive-rat.py
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/python/recursive-rat.py?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/python/recursive-rat.py (added)
+++ incubator/rat/import/rat/src/python/recursive-rat.py Tue Mar 11 16:08:58 2008
@@ -0,0 +1,245 @@
+#
+# Copyright 2007 Robert Burrell Donkin
+#
+# 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.
+#
+
+from sys import argv
+from os import popen
+from os import popen4
+from os import spawnl
+from os.path import isdir
+from os.path import walk
+from os.path import split
+from os.path import splitext
+from os.path import exists
+from tempfile import mkdtemp
+from os.path import join
+from os import listdir
+from os import rmdir
+from os import makedirs
+from shutil import rmtree
+import md5
+import sha
+
+class UserAbortError(Exception):
+ def __str__(self):
+ return "Aborted by user. Bye."
+
+def matchExtension(file, dir, extension):
+ matches = []
+ extension = '.' + extension.lower()
+ for element in listdir(dir):
+ root, ext = splitext(element)
+ if extension == ext.lower() and root == file:
+ matches.append(element)
+ return matches
+
+def printMatches(file, dir, extension):
+ matches = matchExtension(file, dir, extension)
+ for match in matches:
+ matchFile = open(join(dir,match), 'r')
+ text = matchFile.read();
+ matchFile.close()
+ print text
+
+
+def untgz(file, dir):
+ popen("tar -xzf " + file + " -C " + dir)
+
+def unzip(file, dir):
+ popen("unzip -d " + dir + " " + file)
+
+def checkSums(filename, dir):
+ file = open(join(dir, filename), 'r')
+ contents = file.read()
+ file.close()
+ md5sum = md5.new()
+ md5sum.update(contents)
+ print "MD5:"
+ print md5sum.hexdigest()
+ printMatches(filename, dir, "MD5")
+ shaSum = sha.new()
+ shaSum.update(contents)
+ print "SHA1:"
+ print shaSum.hexdigest()
+ printMatches(filename, dir, "SHA")
+ printMatches(filename, dir, "SHA1")
+
+def checkSignature(filename, dir, gpgCommand):
+ file = join(dir, filename)
+ signatureFile = file + '.asc'
+ if not(exists(signatureFile)):
+ signatureFile = file + '.sig'
+ if not(exists(signatureFile)):
+ print "SIGNATURE IS MISSING"
+ command = gpgCommand + ' --verify ' + signatureFile + ' ' + file
+ input, output = popen4(command)
+ print output.read()
+
+def rat(file, dir, uncompress, ratCommand, baseReportDirectory):
+ if baseReportDirectory == None:
+ reportdir = mkdtemp()
+ else:
+ reportdir = join(baseReportDirectory, file.replace('.', '_'))
+ if exists(reportdir):
+ rmtree(reportdir)
+ makedirs(reportdir)
+
+ uncompress(join(dir, file), reportdir)
+ command = ratCommand + " " + reportdir
+ input, output = popen4(command)
+ out = output.read()
+ if not baseReportDirectory == None:
+ f = open(join(baseReportDirectory, file + '.rat'), 'w')
+ f.write(out)
+ f.close()
+ print out
+
+def checkArchive(file, dir, uncompress, ratCommand, gpgCommand, baseReportDirectory):
+ print "."
+ print "."
+ print "."
+ print "###################################################"
+ print "Checking ", file
+ checkSums(file, dir)
+ checkSignature(file, dir, gpgCommand)
+ rat(file, dir, uncompress, ratCommand, baseReportDirectory)
+ print "###################################################"
+ print "."
+ print "."
+ print "."
+
+def checkFile(file, dir, ratCommand, gpgCommand, baseReportDirectory):
+ '''Checks the given file'''
+ if file.endswith('.jar'):
+ print "Checking jar ", file
+ checkArchive(file, dir, lambda a,b:unzip(a,b), ratCommand, gpgCommand, baseReportDirectory)
+ elif file.endswith('.zip'):
+ print "Checking zip ", file
+ checkArchive(file, dir, lambda a,b:unzip(a,b), ratCommand, gpgCommand, baseReportDirectory)
+ elif file.endswith('.tar.gz') or file.endswith('.tgz'):
+ print "Checking tgz ", file
+ checkArchive(file, dir, lambda a,b:untgz(a,b), ratCommand, gpgCommand, baseReportDirectory)
+
+def ignoreDirectory(dir):
+ '''Is this directory to be ignored?'''
+ if dir == "":
+ return False
+ else:
+ head, tail = split(dir)
+ if tail.startswith('.') and not(tail.startswith('..')):
+ return True
+ elif tail == "":
+ return False
+ else:
+ return ignoreDirectory(head)
+
+def checkDirectory(ratCommand, gpgCommand, dir, files, baseReportDir, check=lambda a,b,c,d: lambda x: checkFile(x,a,b,c,d)):
+ '''Checks a directory'''
+ if not(ignoreDirectory(dir)):
+ print 'Checking directory ', dir
+ map(check(dir, ratCommand, gpgCommand, baseReportDir), files)
+
+def walkDirectories(base, ratCommand, gpgCommand, baseReportDir = None, f=lambda a,b,c,d,e: checkDirectory(a,b,c,d,e)):
+ '''Traverses directories under base and executes checks'''
+ print 'Starting traversal at ', base
+ walk(base, lambda dummy, dir, files: f(ratCommand, gpgCommand, dir, files, baseReportDir), None)
+
+def enterRatCommand(rat = None):
+ '''If necessary, prompts user for an acceptable RAT command'''
+ if rat == None:
+ try:
+ rat = raw_input("Please enter RAT command (including path): ")
+ except EOFError:
+ raise UserAbortError()
+
+ if rat == "":
+ print "RAT command is required"
+ rat = enterRatCommand()
+
+ ratResult = popen(rat).close()
+ if not(ratResult == None):
+ print "Cannot execute " + rat
+ rat = enterRatCommand()
+ return rat
+
+def enterBaseDirectory(base = None):
+ '''If necessary prompts user for an acceptable base directory'''
+ if base == None:
+ try:
+ base = raw_input("Please enter base directory for recursive traversal: ")
+ except EOFError:
+ raise UserAbortError()
+ if not(isdir(base)):
+ print "'" + base + "' is not a directory."
+ base = enterBaseDirectory()
+ return base
+
+def enterGPGCommand(gpgCommand = None):
+ '''If necessary prompts user for the command used to test signatures'''
+ if gpgCommand == None:
+ try:
+ gpgCommand = raw_input("GnuPG is required. Please enter GPG command: ")
+ except EOFError:
+ raise UserAbortError()
+ result = popen(gpgCommand + " --version").close()
+ if not(result == None):
+ print "Cannot execute " + gpgCommand
+ rat = enterGPGCommand()
+ return gpgCommand
+
+def getRatCommand():
+ '''Gets an acceptable value for the RAT command'''
+ if len(argv) == 1:
+ ratCommand = enterRatCommand()
+ else:
+ ratCommand = enterRatCommand(argv[1])
+ return ratCommand
+
+def getBaseDirectory():
+ '''Gets an acceptable value for the base directory'''
+ if len(argv) < 3:
+ base = enterBaseDirectory()
+ else:
+ base = enterBaseDirectory(argv[2])
+ return base
+
+def getGPGCommand():
+ '''Gets an acceptable value for the command used to test signatures'''
+ if len(argv) < 5:
+ gpgCommand = enterGPGCommand('gpg')
+ else:
+ gpgCommand = enterGPGCommand(argv[4])
+ return gpgCommand
+
+def getBaseReportDirectory():
+ if len(argv) < 4:
+ return None
+ else:
+ return argv[3]
+
+def checkArgs(f=lambda a,b,c,d: walkDirectories(a, b, c, d)):
+ '''Prompts user for arguments missing from the command line. Check argument values.'''
+ try:
+ ratCommand = getRatCommand()
+ base = getBaseDirectory()
+ gpgCommand = getGPGCommand()
+ baseReportDirectory = getBaseReportDirectory()
+
+ f(base, ratCommand, gpgCommand, baseReportDirectory)
+ except UserAbortError, e:
+ print '\n'
+ print e
+
+checkArgs()
Added: incubator/rat/import/rat/src/test/antunit/report-bad-configurations.xml
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/antunit/report-bad-configurations.xml?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/antunit/report-bad-configurations.xml (added)
+++ incubator/rat/import/rat/src/test/antunit/report-bad-configurations.xml Tue Mar 11 16:08:58 2008
@@ -0,0 +1,46 @@
+<?xml version='1.0'?>
+<!--
+
+ Copyright 2006 Robert Burrell Donkin
+
+ 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.
+
+-->
+
+<project default="allTests"
+ xmlns:au="antlib:org.apache.ant.antunit"
+ xmlns:rat="antlib:rat.anttasks">
+
+ <target name="allTests">
+ <au:antunit xmlns:au="antlib:org.apache.ant.antunit"
+ failonerror="false" errorproperty="antunit.failed">
+ <file file="${ant.file}"/>
+ <au:plainlistener />
+ </au:antunit>
+ </target>
+
+ <target name="testNoResources">
+ <au:expectfailure expectedMessage="at least one file">
+ <rat:report/>
+ </au:expectfailure>
+ </target>
+
+ <target name="testNoLicenseMatchers">
+ <au:expectfailure expectedMessage="at least one license">
+ <rat:report addDefaultLicenseMatchers="false">
+ <file file="${ant.file}"/>
+ </rat:report>
+ </au:expectfailure>
+ </target>
+
+</project>
\ No newline at end of file
Propchange: incubator/rat/import/rat/src/test/antunit/report-bad-configurations.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/rat/import/rat/src/test/antunit/report-normal-operation.xml
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/antunit/report-normal-operation.xml?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/antunit/report-normal-operation.xml (added)
+++ incubator/rat/import/rat/src/test/antunit/report-normal-operation.xml Tue Mar 11 16:08:58 2008
@@ -0,0 +1,123 @@
+<?xml version='1.0'?>
+<!--
+
+ Copyright 2006 Robert Burrell Donkin
+
+ 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.
+
+-->
+
+<project default="allTests"
+ xmlns:au="antlib:org.apache.ant.antunit"
+ xmlns:rat="antlib:rat.anttasks">
+
+ <property name="output.dir" location="testoutput"/>
+ <pathconvert dirsep="/" property="file.name">
+ <path>
+ <pathelement location="${ant.file}"/>
+ </path>
+ </pathconvert>
+ <property name="expectedOutput" value=" AL ${file.name}"/>
+
+ <target name="allTests">
+ <au:antunit xmlns:au="antlib:org.apache.ant.antunit"
+ failonerror="false" errorproperty="antunit.failed">
+ <file file="${ant.file}"/>
+ <au:plainlistener />
+ </au:antunit>
+ </target>
+
+ <target name="tearDown">
+ <delete dir="${output.dir}"/>
+ </target>
+
+ <target name="testWithReportSentToAnt">
+ <rat:report>
+ <file file="${ant.file}"/>
+ </rat:report>
+ <au:assertLogContains text="${expectedOutput}"/>
+ </target>
+
+ <target name="testWithReportSentToFile" depends="makeOutputDir">
+ <property name="report.file" location="${output.dir}/selftest.report"/>
+ <au:assertFileDoesntExist file="${report.file}"/>
+ <rat:report reportFile="${report.file}">
+ <file file="${ant.file}"/>
+ </rat:report>
+ <au:assertLogDoesntContain text="${expectedOutput}"/>
+ <au:assertFileExists file="${report.file}"/>
+
+ <loadfile srcFile="${report.file}" property="report"/>
+ <au:assertTrue message="expected report to contain '${expectedOutput}' but was '${report}'">
+ <contains string="${report}" substring="${expectedOutput}"/>
+ </au:assertTrue>
+ </target>
+
+ <target name="testWithASLUnknown">
+ <rat:report addDefaultLicenseMatchers="false">
+ <file file="${ant.file}"/>
+ <rat:w3c/>
+ </rat:report>
+ <au:assertLogDoesntContain text="${expectedOutput}"/>
+ <au:assertLogContains text="!????? ${file.name}"/>
+ </target>
+
+ <target name="testCustomMatcher">
+ <mkdir dir="${output.dir}/dest"/>
+ <mkdir dir="${output.dir}/src/org/example"/>
+ <echo file="${output.dir}/src/org/example/Matcher.java"><![CDATA[
+package org.example;
+import rat.analysis.IHeaderMatcher;
+import rat.analysis.license.BaseLicense;
+import rat.report.claim.IClaimReporter;
+import rat.analysis.RatHeaderAnalysisException;
+public class Matcher extends BaseLicense implements IHeaderMatcher {
+ public Matcher() {
+ super("EXMPL", "Example License", "");
+ }
+ public void reset() {}
+
+ public boolean match(String subject, String line, IClaimReporter reporter) throws RatHeaderAnalysisException {
+ reportOnLicense(subject, reporter);
+ return true;
+ }
+}
+]]></echo>
+ <echo file="${output.dir}/src/org/example/LicenseFamily.java"><![CDATA[
+package org.example;
+import rat.license.ILicenseFamily;
+public class LicenseFamily implements ILicenseFamily {
+ public String getFamilyName() {
+ return "Example License";
+ }
+}
+]]></echo>
+ <javac srcdir="${output.dir}/src" destdir="${output.dir}/dest"/>
+ <typedef name="exmpl" classname="org.example.Matcher"
+ classpath="${output.dir}/dest"/>
+ <typedef name="exmpl-license" classname="org.example.LicenseFamily"
+ classpath="${output.dir}/dest"/>
+ <rat:report>
+ <file file="${ant.file}"/>
+ <exmpl/>
+ <exmpl-license/>
+ </rat:report>
+ <au:assertLogDoesntContain text="${expectedOutput}"/>
+ <au:assertLogContains text=" EXMPL ${file.name}"/>
+ </target>
+
+ <target name="makeOutputDir">
+ <mkdir dir="${output.dir}"/>
+ </target>
+
+</project>
\ No newline at end of file
Propchange: incubator/rat/import/rat/src/test/antunit/report-normal-operation.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/rat/import/rat/src/test/artifacts/dummy.tar.gz
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/artifacts/dummy.tar.gz?rev=636144&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rat/import/rat/src/test/artifacts/dummy.tar.gz
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rat/import/rat/src/test/binaries/Image-png.not
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/binaries/Image-png.not?rev=636144&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rat/import/rat/src/test/binaries/Image-png.not
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rat/import/rat/src/test/elements/Image.png
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/Image.png?rev=636144&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rat/import/rat/src/test/elements/Image.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rat/import/rat/src/test/elements/LICENSE
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/LICENSE?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/elements/LICENSE (added)
+++ incubator/rat/import/rat/src/test/elements/LICENSE Tue Mar 11 16:08:58 2008
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
\ No newline at end of file
Added: incubator/rat/import/rat/src/test/elements/NOTICE
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/NOTICE?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/elements/NOTICE (added)
+++ incubator/rat/import/rat/src/test/elements/NOTICE Tue Mar 11 16:08:58 2008
@@ -0,0 +1,7 @@
+=========================================================================
+== NOTICE file corresponding to section 4(d) of the Apache License, ==
+== Version 2.0. ==
+=========================================================================
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
Added: incubator/rat/import/rat/src/test/elements/Source.java
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/Source.java?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/elements/Source.java (added)
+++ incubator/rat/import/rat/src/test/elements/Source.java Tue Mar 11 16:08:58 2008
@@ -0,0 +1,5 @@
+package elements;
+
+public class Source {
+
+}
Added: incubator/rat/import/rat/src/test/elements/Text.txt
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/Text.txt?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/elements/Text.txt (added)
+++ incubator/rat/import/rat/src/test/elements/Text.txt Tue Mar 11 16:08:58 2008
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2006 Robert Burrell Donkin
+ *
+ * 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.
+ */
\ No newline at end of file
Added: incubator/rat/import/rat/src/test/elements/Xml.xml
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/Xml.xml?rev=636144&view=auto
==============================================================================
--- incubator/rat/import/rat/src/test/elements/Xml.xml (added)
+++ incubator/rat/import/rat/src/test/elements/Xml.xml Tue Mar 11 16:08:58 2008
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+<!--
+ Copyright 2006 Robert Burrell Donkin
+
+ 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.
+-->
+<document/>
\ No newline at end of file
Added: incubator/rat/import/rat/src/test/elements/dummy.jar
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/dummy.jar?rev=636144&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rat/import/rat/src/test/elements/dummy.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rat/import/rat/src/test/elements/sub/Empty.txt
URL: http://svn.apache.org/viewvc/incubator/rat/import/rat/src/test/elements/sub/Empty.txt?rev=636144&view=auto
==============================================================================
(empty)