本文整理匯總了Java中org.restlet.Restlet.getContext方法的典型用法代碼示例。如果您正苦於以下問題:Java Restlet.getContext方法的具體用法?Java Restlet.getContext怎麽用?Java Restlet.getContext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.restlet.Restlet
的用法示例。
在下文中一共展示了Restlet.getContext方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setNext
import org.restlet.Restlet; //導入方法依賴的package包/類
/**
* Sets the next handler such as a Restlet or a Filter.
*
* In addition, this method will set the context of the next Restlet if it
* is null by passing a reference to its own context.
*
* @param next
* The next handler.
*/
public void setNext(org.restlet.Uniform next) {
if (next instanceof Restlet) {
Restlet nextRestlet = (Restlet) next;
if (nextRestlet.getContext() == null) {
nextRestlet.setContext(getContext());
}
}
this.next = next;
// If true, it must be updated after calling this method
this.nextCreated = false;
}
示例2: attach
import org.restlet.Restlet; //導入方法依賴的package包/類
@Override
public TemplateRoute attach(Restlet target) {
if (target.getContext() == null) {
target.setContext(getContext().createChildContext());
}
return super.attach(target);
}
示例3: attachDefault
import org.restlet.Restlet; //導入方法依賴的package包/類
@Override
public TemplateRoute attachDefault(Restlet defaultTarget) {
if (defaultTarget.getContext() == null) {
defaultTarget.setContext(getContext().createChildContext());
}
return super.attachDefault(defaultTarget);
}
示例4: setNext
import org.restlet.Restlet; //導入方法依賴的package包/類
/**
* Sets the next Restlet.
*
* In addition, this method will set the context of the next Restlet if it
* is null by passing a reference to its own context.
*
* @param next
* The next Restlet.
*/
public void setNext(Restlet next) {
if ((next != null) && (next.getContext() == null)) {
next.setContext(getContext());
}
this.next = next;
}
示例5: checkContext
import org.restlet.Restlet; //導入方法依賴的package包/類
/**
* Checks the context and sets it if necessary.
*
* @param target
* The target Restlet.
*/
protected void checkContext(Restlet target) {
if ((target.getContext() == null) && (this.parentContext != null)) {
target.setContext(this.parentContext.createChildContext());
}
}
示例6: Route
import org.restlet.Restlet; //導入方法依賴的package包/類
/**
* Constructor.
*
* @param router
* The parent router.
* @param next
* The next Restlet.
*/
public Route(Router router, Restlet next) {
super((router != null) ? router.getContext() : (next != null) ? next
.getContext() : null, next);
this.router = router;
}