summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Lynggaard Hansen2012-07-10 15:53:02 (EDT)
committer Henrik Lynggaard Hansen2012-07-10 15:53:02 (EDT)
commitb7027e768e1357bbd61563c456d03a5344673f02 (patch)
tree62f641d3089a47df62aca5b004ff3ed67718d8ee
parent6b2a021db07f935226235132973fb64223c07d91 (diff)
downloadorg.eclipse.hudson.core-b7027e768e1357bbd61563c456d03a5344673f02.zip
org.eclipse.hudson.core-b7027e768e1357bbd61563c456d03a5344673f02.tar.gz
org.eclipse.hudson.core-b7027e768e1357bbd61563c456d03a5344673f02.tar.bz2
Reformat of mail and markuprefs/changes/03/6703/1
Change-Id: I04506bdd75881ef36cd480b4b38ffdd63162b853 Signed-off-by: Henrik Lynggaard Hansen <henrik@hlyh.dk>
-rw-r--r--hudson-core/src/main/java/hudson/mail/BaseMailSender.java7
-rw-r--r--hudson-core/src/main/java/hudson/markup/MarkupFormatter.java38
-rw-r--r--hudson-core/src/main/java/hudson/markup/MarkupFormatterDescriptor.java6
-rw-r--r--hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java9
4 files changed, 29 insertions, 31 deletions
diff --git a/hudson-core/src/main/java/hudson/mail/BaseMailSender.java b/hudson-core/src/main/java/hudson/mail/BaseMailSender.java
index 4e35043..9424aea 100644
--- a/hudson-core/src/main/java/hudson/mail/BaseMailSender.java
+++ b/hudson-core/src/main/java/hudson/mail/BaseMailSender.java
@@ -30,20 +30,18 @@ import javax.mail.internet.MimeMessage;
* Base logic of sending out notification e-mail.
*/
public abstract class BaseMailSender {
- private static final String DEFAULT_TEXT = "Should be overridden";
+ private static final String DEFAULT_TEXT = "Should be overridden";
protected static final String DEFAULT_CHARSET = "UTF-8";
/**
* Whitespace-separated list of e-mail addresses that represent recipients.
*/
private String recipients;
-
/**
* The charset to use for the text and subject.
*/
private String charset;
-
public BaseMailSender(String recipients) {
this(recipients, DEFAULT_CHARSET);
}
@@ -109,7 +107,7 @@ public abstract class BaseMailSender {
}
msg.setRecipients(Message.RecipientType.TO, rcp.toArray(new InternetAddress[rcp.size()]));
msg.setSubject(new StringBuilder().append(getSubjectPrefix()).append(" ").append(getSubject()).toString(),
- charset);
+ charset);
msg.setText(new StringBuilder().append(getText()).append(getTextFooter()).toString(), charset);
return msg;
}
@@ -149,5 +147,4 @@ public abstract class BaseMailSender {
protected String getSubjectPrefix() {
return hudson.mail.Messages.hudson_email_subject_prefix();
}
-
}
diff --git a/hudson-core/src/main/java/hudson/markup/MarkupFormatter.java b/hudson-core/src/main/java/hudson/markup/MarkupFormatter.java
index 7954bef..ec1b7b7 100644
--- a/hudson-core/src/main/java/hudson/markup/MarkupFormatter.java
+++ b/hudson-core/src/main/java/hudson/markup/MarkupFormatter.java
@@ -7,7 +7,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
+ * Contributors:
*
*******************************************************************************/
@@ -34,7 +34,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
package hudson.markup;
import hudson.ExtensionPoint;
@@ -46,45 +45,46 @@ import java.io.StringWriter;
import java.io.Writer;
/**
- * Generalization of a function that takes text with some markup and converts that to HTML.
- * Such markup is often associated with Wiki.
+ * Generalization of a function that takes text with some markup and converts
+ * that to HTML. Such markup is often associated with Wiki.
*
- * <p>
- * Use of markup, as opposed to using raw HTML, ensures certain degree of security.
+ * <p> Use of markup, as opposed to using raw HTML, ensures certain degree of
+ * security.
*
- * <p>
- * This is an extension point in Hudson, allowing plugins to implement different markup formatters.
+ * <p> This is an extension point in Hudson, allowing plugins to implement
+ * different markup formatters.
*
- * <h2>Views</h2>
- * <p>
- * This extension point must have a valid <tt>config.jelly</tt> that feeds the constructor.
+ * <h2>Views</h2> <p> This extension point must have a valid
+ * <tt>config.jelly</tt> that feeds the constructor.
*
- * TODO: allow {@link MarkupFormatter} to control the UI that the user uses to edit.
+ * TODO: allow {@link MarkupFormatter} to control the UI that the user uses to
+ * edit.
*
* @author Kohsuke Kawaguchi
* @since 1.391
* @see Hudson#getMarkupFormatter()
*/
public abstract class MarkupFormatter extends AbstractDescribableImpl<MarkupFormatter> implements ExtensionPoint {
+
/**
- * Given the text, converts that to HTML according to whatever markup rules implicit in the implementation class.
+ * Given the text, converts that to HTML according to whatever markup rules
+ * implicit in the implementation class.
*
- * <p>
- * Multiple threads can call this method concurrently with different inputs.
+ * <p> Multiple threads can call this method concurrently with different
+ * inputs.
*
- * @param output
- * Formatted HTML should be sent to this output.
+ * @param output Formatted HTML should be sent to this output.
*/
public abstract void translate(String markup, Writer output) throws IOException;
public final String translate(String markup) throws IOException {
StringWriter w = new StringWriter();
- translate(markup,w);
+ translate(markup, w);
return w.toString();
}
@Override
public MarkupFormatterDescriptor getDescriptor() {
- return (MarkupFormatterDescriptor)super.getDescriptor();
+ return (MarkupFormatterDescriptor) super.getDescriptor();
}
}
diff --git a/hudson-core/src/main/java/hudson/markup/MarkupFormatterDescriptor.java b/hudson-core/src/main/java/hudson/markup/MarkupFormatterDescriptor.java
index 5e9a08f..ae078db 100644
--- a/hudson-core/src/main/java/hudson/markup/MarkupFormatterDescriptor.java
+++ b/hudson-core/src/main/java/hudson/markup/MarkupFormatterDescriptor.java
@@ -7,7 +7,7 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
+ * Contributors:
*
*******************************************************************************/
@@ -34,7 +34,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
package hudson.markup;
import hudson.DescriptorExtensionList;
@@ -48,10 +47,11 @@ import hudson.model.Hudson;
* @since 1.391
*/
public abstract class MarkupFormatterDescriptor extends Descriptor<MarkupFormatter> {
+
/**
* Returns all the registered {@link MarkupFormatterDescriptor}s.
*/
- public static DescriptorExtensionList<MarkupFormatter,MarkupFormatterDescriptor> all() {
+ public static DescriptorExtensionList<MarkupFormatter, MarkupFormatterDescriptor> all() {
return Hudson.getInstance().getDescriptorList(MarkupFormatter.class);
}
}
diff --git a/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java b/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java
index b936fa0..a213fc2 100644
--- a/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java
+++ b/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java
@@ -8,7 +8,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
*
*******************************************************************************/
@@ -21,12 +21,13 @@ import java.io.IOException;
import java.io.Writer;
/**
- * {@link MarkupFormatter} that treats the input as the raw html.
- * This is the backward compatible behaviour.
+ * {@link MarkupFormatter} that treats the input as the raw html. This is the
+ * backward compatible behaviour.
*
* @author Kohsuke Kawaguchi
*/
public class RawHtmlMarkupFormatter extends MarkupFormatter {
+
@DataBoundConstructor
public RawHtmlMarkupFormatter() {
}
@@ -38,11 +39,11 @@ public class RawHtmlMarkupFormatter extends MarkupFormatter {
@Extension
public static class DescriptorImpl extends MarkupFormatterDescriptor {
+
@Override
public String getDisplayName() {
return "Raw HTML";
}
}
-
public static MarkupFormatter INSTANCE = new RawHtmlMarkupFormatter();
}