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 2013/12/08 22:26:43 UTC
svn commit: r1549290 -
/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java
Author: rdonkin
Date: Sun Dec 8 21:26:42 2013
New Revision: 1549290
URL: http://svn.apache.org/r1549290
Log:
Add java doc.
Modified:
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java
Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java?rev=1549290&r1=1549289&r2=1549290&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/MockXmlWriter.java Sun Dec 8 21:26:42 2013
@@ -24,45 +24,94 @@ import java.util.List;
import org.apache.rat.report.xml.writer.IXmlWriter;
+/**
+ * The Class MockXmlWriter.
+ */
public class MockXmlWriter implements IXmlWriter {
+ /** The calls. */
public final List<Object> calls;
+ /**
+ * Instantiates a new mock xml writer.
+ */
public MockXmlWriter() {
calls = new ArrayList<Object>();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.rat.report.xml.writer.IXmlWriter#attribute(java.lang.CharSequence
+ * , java.lang.CharSequence)
+ */
public IXmlWriter attribute(CharSequence name, CharSequence value)
throws IOException {
calls.add(new Attribute(name, value));
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.rat.report.xml.writer.IXmlWriter#closeDocument()
+ */
public IXmlWriter closeDocument() throws IOException {
calls.add(new CloseDocument());
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.rat.report.xml.writer.IXmlWriter#closeElement()
+ */
public IXmlWriter closeElement() throws IOException {
calls.add(new CloseElement());
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.rat.report.xml.writer.IXmlWriter#content(java.lang.CharSequence
+ * )
+ */
public IXmlWriter content(CharSequence content) throws IOException {
calls.add(new Content(content));
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.rat.report.xml.writer.IXmlWriter#openElement(java.lang.
+ * CharSequence)
+ */
public IXmlWriter openElement(CharSequence elementName) throws IOException {
calls.add(new OpenElement(elementName));
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.rat.report.xml.writer.IXmlWriter#startDocument()
+ */
public IXmlWriter startDocument() throws IOException {
calls.add(new StartDocument());
return this;
}
+ /**
+ * Checks if is close element.
+ *
+ * @param index
+ * the index
+ * @return true, if is close element
+ */
public boolean isCloseElement(int index) {
boolean result = false;
final Object call = calls.get(index);
@@ -70,6 +119,15 @@ public class MockXmlWriter implements IX
return result;
}
+ /**
+ * Checks if is content.
+ *
+ * @param content
+ * the content
+ * @param index
+ * the index
+ * @return true, if is content
+ */
public boolean isContent(String content, int index) {
boolean result = false;
final Object call = calls.get(index);
@@ -80,6 +138,15 @@ public class MockXmlWriter implements IX
return result;
}
+ /**
+ * Checks if is open element.
+ *
+ * @param name
+ * the name
+ * @param index
+ * the index
+ * @return true, if is open element
+ */
public boolean isOpenElement(String name, int index) {
boolean result = false;
final Object call = calls.get(index);
@@ -90,6 +157,17 @@ public class MockXmlWriter implements IX
return result;
}
+ /**
+ * Checks if is attribute.
+ *
+ * @param name
+ * the name
+ * @param value
+ * the value
+ * @param index
+ * the index
+ * @return true, if is attribute
+ */
public boolean isAttribute(String name, String value, int index) {
boolean result = false;
final Object call = calls.get(index);
@@ -101,35 +179,81 @@ public class MockXmlWriter implements IX
return result;
}
+ /**
+ * The Class StartDocument.
+ */
public class StartDocument {
}
+ /**
+ * The Class CloseDocument.
+ */
public class CloseDocument {
}
+ /**
+ * The Class CloseElement.
+ */
public class CloseElement {
}
+ /**
+ * The Class OpenElement.
+ */
public class OpenElement {
+
+ /** The element name. */
public final CharSequence elementName;
+ /**
+ * Instantiates a new open element.
+ *
+ * @param elementName
+ * the element name
+ */
private OpenElement(CharSequence elementName) {
this.elementName = elementName;
}
}
+ /**
+ * The Class Content.
+ */
public class Content {
+
+ /** The content. */
public final CharSequence content;
+ /**
+ * Instantiates a new content.
+ *
+ * @param content
+ * the content
+ */
private Content(CharSequence content) {
this.content = content;
}
}
+ /**
+ * The Class Attribute.
+ */
public class Attribute {
+
+ /** The name. */
public final CharSequence name;
+
+ /** The value. */
public final CharSequence value;
+ /**
+ * Instantiates a new attribute.
+ *
+ * @param name
+ * the name
+ * @param value
+ * the value
+ */
private Attribute(CharSequence name, CharSequence value) {
this.name = name;
this.value = value;