< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -134,10 +134,11 @@
}
/**
* Return the specified parameter value. Returns <code>null</code>
* if this parameter is absent.
+ * @param name parameter name
* @return parameter value
*/
public String getParameter(String name) {
if (list == null)
return null;
@@ -198,10 +199,11 @@
* this Content-Type. Returns <code>null</code> if
* the conversion failed.
*
* @return RFC2045 style string
*/
+ @Override
public String toString() {
if (primaryType == null || subType == null) // need both
return null;
StringBuilder sb = new StringBuilder();
@@ -216,11 +218,11 @@
}
/**
* Match with the specified ContentType object. This method
* compares <strong>only the <code>primaryType</code> and
- * <code>subType</code> </strong>. The parameters of both operands
+ * <code>primaryType</code> </strong>. The parameters of both operands
* are ignored. <p>
*
* For example, this method will return <code>true</code> when
* comparing the ContentTypes for <strong>"text/plain"</strong>
* and <strong>"text/plain; charset=foobar"</strong>.
@@ -230,10 +232,12 @@
* For example, this method will return <code>true</code> when
* comparing the ContentTypes for <strong>"text/plain"</strong>
* and <strong>"text/*" </strong>
*
* @param cType to compare this against
+ * @return true if <code>primaryType</code> and <code>subType</code>
+ * match specified content type.
*/
public boolean match(ContentType cType) {
// Match primaryType
if (!primaryType.equalsIgnoreCase(cType.getPrimaryType()))
return false;
@@ -264,10 +268,14 @@
* If the <code>subType</code> of either operand is the special
* character '*', then the subtype is ignored during the match.
* For example, this method will return <code>true</code> when
* comparing the ContentType for <strong>"text/plain"</strong>
* with <strong>"text/*" </strong>
+ *
+ * @param s content type
+ * @return true if <code>primaryType</code> and <code>subType</code>
+ * match specified content type.
*/
public boolean match(String s) {
try {
return match(new ContentType(s));
} catch (ParseException pex) {
< prev index next >