You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2008/12/26 20:13:12 UTC
svn commit: r729525 - in
/james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util:
InvalidXmlException.java OperationNotAllowedException.java XmlOut.java
XmlWriter.java
Author: rdonkin
Date: Fri Dec 26 11:13:12 2008
New Revision: 729525
URL: http://svn.apache.org/viewvc?rev=729525&view=rev
Log:
Correct name, package and basic references
Added:
james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/InvalidXmlException.java
james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/OperationNotAllowedException.java
james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java (contents, props changed)
- copied, changed from r729524, james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlWriter.java
Removed:
james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlWriter.java
Added: james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/InvalidXmlException.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/InvalidXmlException.java?rev=729525&view=auto
==============================================================================
--- james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/InvalidXmlException.java (added)
+++ james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/InvalidXmlException.java Fri Dec 26 11:13:12 2008
@@ -0,0 +1,34 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.jsieve.util;
+
+import java.io.IOException;
+
+public class InvalidXmlException extends IOException {
+
+ private static final long serialVersionUID = -7530730365576151197L;
+
+ public InvalidXmlException() {
+ super();
+ }
+
+ public InvalidXmlException(String s) {
+ super(s);
+ }
+}
Added: james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/OperationNotAllowedException.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/OperationNotAllowedException.java?rev=729525&view=auto
==============================================================================
--- james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/OperationNotAllowedException.java (added)
+++ james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/OperationNotAllowedException.java Fri Dec 26 11:13:12 2008
@@ -0,0 +1,34 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.jsieve.util;
+
+import java.io.IOException;
+
+public class OperationNotAllowedException extends IOException {
+
+ private static final long serialVersionUID = -5447316582278562837L;
+
+ public OperationNotAllowedException() {
+ super();
+ }
+
+ public OperationNotAllowedException(String s) {
+ super(s);
+ }
+}
Copied: james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java (from r729524, james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlWriter.java)
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java?p2=james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java&p1=james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlWriter.java&r1=729524&r2=729525&rev=729525&view=diff
==============================================================================
--- james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlWriter.java (original)
+++ james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java Fri Dec 26 11:13:12 2008
@@ -16,19 +16,14 @@
* specific language governing permissions and limitations *
* under the License. *
*/
-package org.apache.rat.report.xml.writer.impl.base;
+package org.apache.jsieve.util;
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 org.apache.rat.report.xml.writer.IXmlWriter;
-import org.apache.rat.report.xml.writer.InvalidXmlException;
-import org.apache.rat.report.xml.writer.OperationNotAllowedException;
+import java.util.Stack;
/**
* <p>Lightweight {@link IXmlWriter} implementation.</p>
@@ -38,7 +33,7 @@
* <p>
* Not intended to be subclassed. Please copy and hack!</p>
*/
-public final class XmlWriter implements IXmlWriter {
+public final class XmlOut {
private static final byte NAME_START_MASK = 1 << 1;
private static final byte NAME_MASK = 1 << 2;
@@ -401,16 +396,16 @@
}
private final Writer writer;
- private final ArrayStack elementNames;
+ private final Stack elementNames;
private final Set currentAttributes = new HashSet();
boolean elementsWritten = false;
boolean inElement = false;
boolean prologWritten = false;
- public XmlWriter(final Writer writer) {
+ public XmlOut(final Writer writer) {
this.writer = writer;
- this.elementNames = new ArrayStack();
+ this.elementNames = new Stack();
}
/**
@@ -422,7 +417,7 @@
* if called after the first element has been written
* or once a prolog has already been written
*/
- public IXmlWriter startDocument() throws IOException {
+ public void startDocument() throws IOException {
if (elementsWritten) {
throw new OperationNotAllowedException("Document already started");
}
@@ -431,7 +426,6 @@
}
writer.write("<?xml version='1.0'?>");
prologWritten = true;
- return this;
}
/**
@@ -443,7 +437,7 @@
* @throws OperationNotAllowedException
* if called after the first element has been closed
*/
- public IXmlWriter openElement(final CharSequence elementName) throws IOException {
+ public void openElement(final CharSequence elementName) throws IOException {
if (elementsWritten && elementNames.isEmpty()) {
throw new OperationNotAllowedException("Root element already closed. Cannot open new element.");
}
@@ -459,7 +453,6 @@
inElement = true;
elementNames.push(elementName);
currentAttributes.clear();
- return this;
}
/**
@@ -475,7 +468,7 @@
* @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 {
+ public void attribute(CharSequence name, CharSequence value) throws IOException {
if (elementNames.isEmpty()) {
if (elementsWritten) {
throw new OperationNotAllowedException("Root element has already been closed.");
@@ -499,7 +492,6 @@
writeAttributeContent(value);
writer.write('\'');
currentAttributes.add(name);
- return this;
}
private void writeAttributeContent(CharSequence content) throws IOException {
@@ -517,7 +509,7 @@
* if called before any call to {@link #openElement}
* or after the first element has been closed
*/
- public IXmlWriter content(CharSequence content) throws IOException {
+ public void content(CharSequence content) throws IOException {
if (elementNames.isEmpty()) {
if (elementsWritten) {
throw new OperationNotAllowedException("Root element has already been closed.");
@@ -530,7 +522,6 @@
}
writeBodyContent(content);
inElement = false;
- return this;
}
private void writeBodyContent(final CharSequence content) throws IOException {
@@ -572,7 +563,7 @@
* if called before any call to {@link #openElement}
* or after the first element has been closed
*/
- public IXmlWriter closeElement() throws IOException {
+ public void closeElement() throws IOException {
if (elementNames.isEmpty()) {
if (elementsWritten) {
throw new OperationNotAllowedException("Root element has already been closed.");
@@ -592,7 +583,6 @@
}
writer.flush();
inElement = false;
- return this;
}
@@ -605,7 +595,7 @@
* @throws OperationNotAllowedException
* if called before any call to {@link #openElement}
*/
- public IXmlWriter closeDocument() throws IOException {
+ public void closeDocument() throws IOException {
if (elementNames.isEmpty()) {
if (!elementsWritten) {
throw new OperationNotAllowedException("Close called before an element has been opened.");
@@ -615,7 +605,6 @@
closeElement();
}
writer.flush();
- return this;
}
private void rawWrite(final CharSequence sequence) throws IOException {
Propchange: james/jsieve/trunk/util/src/main/java/org/apache/jsieve/util/XmlOut.java
------------------------------------------------------------------------------
svn:mergeinfo =
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org