本文整理汇总了Java中javax.lang.model.type.UnknownTypeException类的典型用法代码示例。如果您正苦于以下问题:Java UnknownTypeException类的具体用法?Java UnknownTypeException怎么用?Java UnknownTypeException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnknownTypeException类属于javax.lang.model.type包,在下文中一共展示了UnknownTypeException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitUnknown
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
@Override
public Void visitUnknown(TypeMirror t, Types types) {
try {
return super.visitUnknown(t, types);
} catch (UnknownTypeException ex) {
System.err.println("caught " + ex);
return null;
}
}
示例2: getActions
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
public Action[] getActions(NodeActionsProvider original, Object node) throws UnknownTypeException, org.netbeans.spi.viewmodel.UnknownTypeException {
Action[] actions = original.getActions(node);
List myActions = new ArrayList();
if (node instanceof ObjectVariable) {
ObjectVariable objectVariable = (ObjectVariable) node;
if (objectVariable.getClassType().getName().equals("org.jbpm.ruleflow.instance.RuleFlowProcessInstance")) {
myActions.add(
Models.createAction(
"Open ProcessInstance Viewer",
new ProcessInstanceViewerAction(objectVariable),
Models.MULTISELECTION_TYPE_EXACTLY_ONE));
}
}
if (myActions.isEmpty()) {
return actions;
}
ArrayList actionToAdd = new ArrayList();
actionToAdd.addAll(Arrays.asList(actions));
actionToAdd.addAll(myActions);
return (Action[]) actionToAdd.toArray(new Action[actionToAdd.size()]);
}
示例3: addAdapterForField
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
private void addAdapterForField(
ImmutableMap.Builder<FieldDescriptor, AdapterDescriptor> fieldAdapterMap,
FieldDescriptor field, boolean allowSerializable) {
TypeMirror fieldType = field.type().get();
//noinspection ConstantConditions
if (!fieldType.getKind().isPrimitive()) {
AdapterDescriptor adapter = adapterFactory.create(fieldType, allowSerializable);
if (adapter != null) {
fieldAdapterMap.put(field, adapter);
} else {
throw new UnknownTypeException(fieldType, field.element());
}
}
}
示例4: performDefaultAction
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
public void performDefaultAction(NodeActionsProvider original, Object node) throws UnknownTypeException, org.netbeans.spi.viewmodel.UnknownTypeException {
original.performDefaultAction(node);
}
示例5: lunch
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
/**
* Used on every game turn. Method checks "next" by direction cell for some
* {@link CellElement} and if it have found - decides what to do with it.
*
* @throws UnknownTypeException
* If not found what to do with found {@link CellElement}
*/
private void lunch() {
if (direction == Direction.STOP) {
return;
}
CellElement headTo = head.lookForward(direction);
if (headTo != null) {
if (headTo instanceof Piece) {
Piece toPiece = (Piece) headTo;
if (toPiece.parent.equals(this)) {
kill();// ate himself
} else if (toPiece.isHead()) {
duelWith(toPiece.parent);// someone will die
} else {
int cutLength = toPiece.parent.nipOff(toPiece);
score += cutLength * ALIVE_TAIL_MULTIPLIER;
grow(cutLength / 2);
// ate someone`s tail
}
} else if (headTo instanceof Food) {
dinner((Food) headTo);
} else if (headTo instanceof Seed) {
weapon = (Seed) headTo;
} else if (headTo instanceof Plant) {
if (((Plant) headTo).getType() == PlantType.CATCHER) {
kill();
}
} else {
throw new UnknownTypeException(null, headTo);
}
}
}
示例6: visitOther
import javax.lang.model.type.UnknownTypeException; //导入依赖的package包/类
/**
* Visits an unknown kind of type. This can occur if the language evolves and new kinds of types are added to the
* {@link TypeMirror} hierarchy.
*
* <p>The default implementation of this method in {@code TypeKindVisitor7WithIntersectionType} will always throw
* {@link UnknownTypeException}. This behavior is not required of a subclass.
*
* @param typeMirror the type to visit
* @param parameter a visitor-specified parameter
* @return a visitor-specified result
* @throws UnknownTypeException a visitor implementation may optionally throw this exception
*/
@Nullable
public R visitOther(TypeMirror typeMirror, @Nullable P parameter) {
throw new UnknownTypeException(typeMirror, parameter);
}