com.atlassian.sal.api
Enum UrlMode

java.lang.Object
  extended by java.lang.Enum<UrlMode>
      extended by com.atlassian.sal.api.UrlMode
All Implemented Interfaces:
Serializable, Comparable<UrlMode>

public enum UrlMode
extends Enum<UrlMode>

The kind of URL to return from methods that accept this as a parameter.


Enum Constant Summary
ABSOLUTE
          Generate a URL that is absolute.
AUTO
          Generate a URL that is either CANONICAL or RELATIVE, based on whether there is a request in the current scope.
CANONICAL
          Generate a URL that is absolute, using the canonical URL.
RELATIVE
          Generate a URL that is relative, containing just the context path.
RELATIVE_CANONICAL
          Generate a URL that is relative, containing just the context path.
 
Method Summary
static UrlMode valueOf(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

CANONICAL

public static final UrlMode CANONICAL
Generate a URL that is absolute, using the canonical URL. e.g. http://www.example.com:8080/myapp. Useful for generating links for emails.


ABSOLUTE

public static final UrlMode ABSOLUTE
Generate a URL that is absolute. Will be derived from the URL of a request in the current scope, or CANONICAL if there is no such request. e.g. http://www:8080/myapp.


RELATIVE

public static final UrlMode RELATIVE
Generate a URL that is relative, containing just the context path. Will be derived from the URL of a request in the current scope, or from CANONICAL if there is no such request. e.g. /myapp.


RELATIVE_CANONICAL

public static final UrlMode RELATIVE_CANONICAL
Generate a URL that is relative, containing just the context path. Will be derived from the CANONICAL URL. e.g. /myapp.


AUTO

public static final UrlMode AUTO
Generate a URL that is either CANONICAL or RELATIVE, based on whether there is a request in the current scope. Useful for macros, web panels and other content that may be rendered in a page or in email.

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2015 Atlassian. All rights reserved.