本文整理匯總了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);
}