/** * Given type assignable to <code>Editor<Foo></code>, return * <code>Foo</code>. It is an error to call this method with a type not * assignable to {@link Editor}. */ static JClassType calculateEditedType(TreeLogger logger, JClassType editorType) throws UnableToCompleteException { JClassType editorIntf = editorType.getOracle().findType( Editor.class.getName()); JClassType parameterization[] = ModelUtils.findParameterizationOf( editorIntf, editorType); if (parameterization != null) { return parameterization[0]; } logger.log(TreeLogger.ERROR, noEditorParameterizationMessage(editorIntf, editorType)); throw new UnableToCompleteException(); }
/** * Given type assignable to <code>Editor<Foo></code>, return * <code>Foo</code>. It is an error to call this method with a type not * assignable to {@link Editor}. */ static JClassType calculateEditedType(TreeLogger logger, JClassType editorType) throws UnableToCompleteException { JClassType editorIntf = editorType.getOracle().findType( Editor.class.getName()); JClassType parameterization[] = ModelUtils.findParameterizationOf( editorIntf, editorType); if (parameterization != null) { return parameterization[0]; } logger.log(TreeLogger.ERROR, noEditorParameterizationMessage(editorIntf, editorType)); throw new UnableToCompleteException(); }
/** * Given type assignable to <code>IsEditor<Foo, FooEditor></code>, return * <code>FooEditor</code>. It is an error to call this method with a type not * assignable to {@link IsEditor}. */ static JClassType calculateIsEditedType(TreeLogger logger, JClassType editorType) throws UnableToCompleteException { JClassType editorIntf = editorType.getOracle().findType( IsEditor.class.getName()); JClassType[] parameterization = ModelUtils.findParameterizationOf( editorIntf, editorType); if (parameterization != null) { return parameterization[0]; } logger.log(TreeLogger.ERROR, noEditorParameterizationMessage(editorIntf, editorType)); throw new UnableToCompleteException(); }
/** * Given type assignable to <code>IsEditor<Foo, FooEditor></code>, return * <code>FooEditor</code>. It is an error to call this method with a type not * assignable to {@link IsEditor}. */ static JClassType calculateIsEditedType(TreeLogger logger, JClassType editorType) throws UnableToCompleteException { JClassType editorIntf = editorType.getOracle().findType( IsEditor.class.getName()); JClassType[] parameterization = ModelUtils.findParameterizationOf( editorIntf, editorType); if (parameterization != null) { return parameterization[0]; } logger.log(TreeLogger.ERROR, noEditorParameterizationMessage(editorIntf, editorType)); throw new UnableToCompleteException(); }