本文整理汇总了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;
}