com.atlassian.plugin.webresource
Enum UrlMode

java.lang.Object
  extended by java.lang.Enum<UrlMode>
      extended by com.atlassian.plugin.webresource.UrlMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<UrlMode>

public enum UrlMode
extends java.lang.Enum<UrlMode>

A formatting mode for URLs. Used to specify to WebResourceManager methods whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide

Since:
2.3.0

Enum Constant Summary
ABSOLUTE
          Absolute URL format, with URL scheme, hostname, port (if non-standard for the scheme), and context path.
AUTO
          Unspecified URL format, indicating that either absolute or relative URLs are acceptable.
RELATIVE
          Relative URL format, containing just the context path.
 
Method Summary
static UrlMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static UrlMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ABSOLUTE

public static final UrlMode ABSOLUTE
Absolute URL format, with URL scheme, hostname, port (if non-standard for the scheme), and context path.


RELATIVE

public static final UrlMode RELATIVE
Relative URL format, containing just the context path.


AUTO

public static final UrlMode AUTO
Unspecified URL format, indicating that either absolute or relative URLs are acceptable. Implementations are free to determine which mode to use based on any criteria of their choosing. For example, an implementation may choose to return a relative URL if it detects that it is running in the context of an HTTP request, and an absolute URL if it detects that it is not. Or it may choose to always return an absolute URL, or always return a relative URL. Callers should only use WebResourceManager.UrlMode#AUTO when they are sure that either an absolute or a relative URL will be appropriate, and should not rely on any particular observed behavior regarding how this value is interpreted, which may vary across different implementations.

Method Detail

values

public static UrlMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (UrlMode c : UrlMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static UrlMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2010 Atlassian. All Rights Reserved.