Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2004-2010 Oracle Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Kohsuke Kawaguchi /
  
 
 package org.kohsuke.stapler;
 
Information about ancestor of the "it" node.

Author(s):
Kohsuke Kawaguchi
 
 public interface Ancestor {
    
Gets the model object of the application.
 
     Object getObject();

    
Gets the URL to this ancestor.

The returned string represents the portion of the request URL that matches this object. It starts with context path, and it ends without '/'. So, for example, if your web app is deployed as "mywebapp" and this ancestor object is obtained from the app root object by getFoo().getBar(3), then this string will be /mywebapp/foo/bar/3

Any ASCII-unsafe characters are escaped.

Returns:
never null.
 
     String getUrl();

    
Gets the remaining URL after this ancestor.

The returned string represents the portion of the request URL that follows this ancestor. It starts and ends without '/'. So, for example, if the request URL is "foo/bar/3" and this ancestor object is obtained from the app root object by getFoo(), then this string will be bar/3

 
     String getRestOfUrl();

    
Of the tokens that constitute getRestOfUrl(), return the n-th token. So in the example described in getRestOfUrl(), getNextToken(0).equals("bar") and getNextToken(1).equals("3")
 
     String getNextToken(int n);

    
Gets the complete URL to this ancestor.

This method works like getUrl() except it contains the host name and the port number.

 
     String getFullUrl();

    
Gets the relative path from the current object to this ancestor.

The returned string looks like "../.." (ends without '/')

Returns:
never null.
 
     String getRelativePath();

    
Gets the previous ancestor, or null if none (meaning this is the root object.)
 
     Ancestor getPrev();

    
Gets the next ancestor, or null if none (meaning this is the 'it' object.
    Ancestor getNext();
New to GrepCode? Check out our FAQ X