本文整理汇总了Java中com.sk89q.intake.InvalidUsageException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidUsageException类的具体用法?Java InvalidUsageException怎么用?Java InvalidUsageException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvalidUsageException类属于com.sk89q.intake包,在下文中一共展示了InvalidUsageException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translate
import com.sk89q.intake.InvalidUsageException; //导入依赖的package包/类
@Override
public Message translate(InvalidUsageException exception, String commandLine) {
if(exception.getCause() != null) {
return rewriteToCause(exception, commandLine);
} else {
return mapToMessage(exception, commandLine);
}
}
示例2: isHelpRequestedBy
import com.sk89q.intake.InvalidUsageException; //导入依赖的package包/类
private boolean isHelpRequestedBy(Exception e) {
return e instanceof InvalidUsageException && ((InvalidUsageException) e).isFullHelpSuggested();
}
示例3: InvalidUsageTranslator
import com.sk89q.intake.InvalidUsageException; //导入依赖的package包/类
public InvalidUsageTranslator(ErrorTranslator root) {
super(InvalidUsageException.class, false);
causeRewritingTranslator = new CauseRewritingTranslator<>(InvalidUsageException.class, root);
messageTranslator = new PatternBasedMessageTranslator<>(InvalidUsageException.class, false)
.withBaseKey("InvalidUsage");
}
示例4: mapToMessage
import com.sk89q.intake.InvalidUsageException; //导入依赖的package包/类
private Message mapToMessage(InvalidUsageException exception, String commandLine) {
return messageTranslator.translate(exception, commandLine);
}
示例5: rewriteToCause
import com.sk89q.intake.InvalidUsageException; //导入依赖的package包/类
private Message rewriteToCause(InvalidUsageException exception, String commandLine) {
return causeRewritingTranslator.translate(exception, commandLine);
}