private void die(String message) throws UnableToCompleteException { poison(message); throw new UnableToCompleteException(); }
private void die(String message) throws UnableToCompleteException { poison(message); throw new UnableToCompleteException(); }
builder.setType(Type.VALUE); } else { poison("The type %s is not assignable to either %s or %s", entityProxyInterface .getQualifiedSourceName(), valueProxyInterface.getQualifiedSourceName()); JsonRpcProxy jsonRpcProxy = entityProxyType.getAnnotation(JsonRpcProxy.class); if (proxyFor == null && proxyForName == null && jsonRpcProxy == null) { poison("The %s type does not have a @%s, @%s, or @%s annotation", entityProxyType .getQualifiedSourceName(), ProxyFor.class.getSimpleName(), ProxyForName.class .getSimpleName(), JsonRpcProxy.class.getSimpleName()); duplicatePropertyGetters.put(propertyName, method); } else { poison("Duplicate accessors for property %s: %s() and %s()", propertyName, previouslySeen.getName(), method.getName()); poison("The method %s is neither a getter nor a setter", method.getReadableDeclaration()); continue;
JClassType proxy = oracle.findType(clazz.getCanonicalName()); if (proxy == null) { poison("Unknown class %s in @%s", clazz.getCanonicalName(), ExtraTypes.class .getSimpleName()); } else {
builder.setType(Type.VALUE); } else { poison("The type %s is not assignable to either %s or %s", entityProxyInterface .getQualifiedSourceName(), valueProxyInterface.getQualifiedSourceName()); JsonRpcProxy jsonRpcProxy = entityProxyType.getAnnotation(JsonRpcProxy.class); if (proxyFor == null && proxyForName == null && jsonRpcProxy == null) { poison("The %s type does not have a @%s, @%s, or @%s annotation", entityProxyType .getQualifiedSourceName(), ProxyFor.class.getSimpleName(), ProxyForName.class .getSimpleName(), JsonRpcProxy.class.getSimpleName()); duplicatePropertyGetters.put(propertyName, method); } else { poison("Duplicate accessors for property %s: %s() and %s()", propertyName, previouslySeen.getName(), method.getName()); poison("The method %s is neither a getter nor a setter", method.getReadableDeclaration()); continue;
JClassType proxy = oracle.findType(clazz.getCanonicalName()); if (proxy == null) { poison("Unknown class %s in @%s", clazz.getCanonicalName(), ExtraTypes.class .getSimpleName()); } else {
/** * Examine a RequestContext subtype to populate a ContextMethod. */ private void buildContextMethod(ContextMethod.Builder contextBuilder, JClassType contextType) throws UnableToCompleteException { Service serviceAnnotation = contextType.getAnnotation(Service.class); ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class); JsonRpcService jsonRpcAnnotation = contextType.getAnnotation(JsonRpcService.class); if (serviceAnnotation == null && serviceNameAnnotation == null && jsonRpcAnnotation == null) { poison("RequestContext subtype %s is missing a @%s or @%s annotation", contextType .getQualifiedSourceName(), Service.class.getSimpleName(), JsonRpcService.class .getSimpleName()); return; } List<RequestMethod> requestMethods = new ArrayList<RequestMethod>(); for (JMethod method : contextType.getInheritableMethods()) { if (method.getEnclosingType().equals(requestContextInterface)) { // Ignore methods declared in RequestContext continue; } RequestMethod.Builder methodBuilder = new RequestMethod.Builder(); methodBuilder.setDeclarationMethod(contextType, method); if (!validateContextMethodAndSetDataType(methodBuilder, method, jsonRpcAnnotation != null)) { continue; } requestMethods.add(methodBuilder.build()); } contextBuilder.setExtraTypes(checkExtraTypes(contextType, true)).setRequestMethods( requestMethods); }
/** * Examine a RequestContext subtype to populate a ContextMethod. */ private void buildContextMethod(ContextMethod.Builder contextBuilder, JClassType contextType) throws UnableToCompleteException { Service serviceAnnotation = contextType.getAnnotation(Service.class); ServiceName serviceNameAnnotation = contextType.getAnnotation(ServiceName.class); JsonRpcService jsonRpcAnnotation = contextType.getAnnotation(JsonRpcService.class); if (serviceAnnotation == null && serviceNameAnnotation == null && jsonRpcAnnotation == null) { poison("RequestContext subtype %s is missing a @%s or @%s annotation", contextType .getQualifiedSourceName(), Service.class.getSimpleName(), JsonRpcService.class .getSimpleName()); return; } List<RequestMethod> requestMethods = new ArrayList<RequestMethod>(); for (JMethod method : contextType.getInheritableMethods()) { if (method.getEnclosingType().equals(requestContextInterface)) { // Ignore methods declared in RequestContext continue; } RequestMethod.Builder methodBuilder = new RequestMethod.Builder(); methodBuilder.setDeclarationMethod(contextType, method); if (!validateContextMethodAndSetDataType(methodBuilder, method, jsonRpcAnnotation != null)) { continue; } requestMethods.add(methodBuilder.build()); } contextBuilder.setExtraTypes(checkExtraTypes(contextType, true)).setRequestMethods( requestMethods); }
if (transportedClass == null) { if (requireObject) { poison("The type %s cannot be transported by RequestFactory as" + " a return type", type .getQualifiedSourceName()); return false; JParameterizedType parameterized = transportedClass.isParameterized(); if (parameterized == null) { poison("EntityProxyId must be parameterized"); return false; poison("Requests that return collections of List or Set must be parameterized"); return false; methodBuilder.setCollectionType(CollectionType.SET); } else { poison("Requests that return collections may be declared with" + " %s or %s only", listInterface.getQualifiedSourceName(), setInterface.getQualifiedSourceName()); return false; JParameterizedType parameterized = transportedClass.isParameterized(); if (parameterized == null) { poison("Requests that return Maps must be parameterized"); return false; methodBuilder.setCollectionType(CollectionType.MAP); } else { poison("Requests that return maps may be declared with" + " %s only", mapInterface .getQualifiedSourceName());
if (transportedClass == null) { if (requireObject) { poison("The type %s cannot be transported by RequestFactory as" + " a return type", type .getQualifiedSourceName()); return false; JParameterizedType parameterized = transportedClass.isParameterized(); if (parameterized == null) { poison("EntityProxyId must be parameterized"); return false; poison("Requests that return collections of List or Set must be parameterized"); return false; methodBuilder.setCollectionType(CollectionType.SET); } else { poison("Requests that return collections may be declared with" + " %s or %s only", listInterface.getQualifiedSourceName(), setInterface.getQualifiedSourceName()); return false; JParameterizedType parameterized = transportedClass.isParameterized(); if (parameterized == null) { poison("Requests that return Maps must be parameterized"); return false; methodBuilder.setCollectionType(CollectionType.MAP); } else { poison("Requests that return maps may be declared with" + " %s only", mapInterface .getQualifiedSourceName());
if (requestReturnType == null) { poison(badContextReturnType(method, requestInterface, instanceRequestInterface)); return false; poison(badContextReturnType(method, requestInterface, instanceRequestInterface)); return false; methodBuilder.addExtraSetter(maybeSetter); } else { poison(noSettersAllowed(maybeSetter));
if (requestReturnType == null) { poison(badContextReturnType(method, requestInterface, instanceRequestInterface)); return false; poison(badContextReturnType(method, requestInterface, instanceRequestInterface)); return false; methodBuilder.addExtraSetter(maybeSetter); } else { poison(noSettersAllowed(maybeSetter));