output.append('L').append(nullable.getMarker());
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getParameterNullability(net.bytebuddy.description.method.ParameterDescription) */ @Override public Nullness getParameterNullability(ParameterDescription parameter) { PackageDescription pakkage = parameter.getDeclaringMethod().getDeclaringType().asErasure().getPackage(); Optional<AnnotationDescription> packageAnnotation = pakkage.getDeclaredAnnotations().stream() .filter(a -> a.getAnnotationType().getName().equals(this.nonnullParameterDefaultAnnotation)).findAny(); Nullness defaultNullness = Validate .notNull(packageAnnotation.map(a -> Nullness.NONNULL).orElse(Nullness.UNDEFINED)); Nullness nullability = getNullability(parameter.getDeclaredAnnotations()); return defaultNullness.override(nullability); }
output.append('L').append(nullable.getMarker());
/** * Append an array type signature * * @param type Array type to append * @param nullable Nullness of type * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendArrayTypeSignature(Generic type, Nullness nullable, A output) { try { output.append('[').append(nullable.getMarker()); appendJavaTypeSignature(Validate.notNull(type.getComponentType()), Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write array type %s", type)); } }
/** * Append a type variable signature * * @param typeVariable Type variable to append signature * @param nullable Nullness of type variable * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendTypeVariableSignature(Generic typeVariable, Nullness nullable, A output) { try { output.append('T').append(nullable.getMarker()).append(typeVariable.getTypeName()).append(';'); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not type variable %s", typeVariable)); } }
/** * Append an array type signature * * @param type Array type to append * @param nullable Nullness of type * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendArrayTypeSignature(Generic type, Nullness nullable, A output) { try { output.append('[').append(nullable.getMarker()); appendJavaTypeSignature(Validate.notNull(type.getComponentType()), Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write array type %s", type)); } }
/** * Append a type variable signature * * @param typeVariable Type variable to append signature * @param nullable Nullness of type variable * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendTypeVariableSignature(Generic typeVariable, Nullness nullable, A output) { try { output.append('T').append(nullable.getMarker()).append(typeVariable.getTypeName()).append(';'); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not type variable %s", typeVariable)); } }
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getParameterNullability(net.bytebuddy.description.method.ParameterDescription) */ @Override public Nullness getParameterNullability(ParameterDescription parameter) { PackageDescription pakkage = parameter.getDeclaringMethod().getDeclaringType().asErasure().getPackage(); Optional<AnnotationDescription> packageAnnotation = pakkage.getDeclaredAnnotations().stream() .filter(a -> a.getAnnotationType().getName().equals(this.nonnullParameterDefaultAnnotation)).findAny(); Nullness defaultNullness = Validate .notNull(packageAnnotation.map(a -> Nullness.NONNULL).orElse(Nullness.UNDEFINED)); Nullness nullability = getNullability(parameter.getDeclaredAnnotations()); return defaultNullness.override(nullability); }
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getParameterNullability(net.bytebuddy.description.method.ParameterDescription) */ @Override public Nullness getParameterNullability(ParameterDescription parameter) { Nullness nullability = Nullness.UNDEFINED; for (Nullability provider : this.nullabilities) { Nullness override = provider.getParameterNullability(parameter); nullability = nullability.override(override); } return nullability; }
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getReturnValueNullability(MethodDescription) */ @Override public Nullness getReturnValueNullability(MethodDescription method) { Nullness nullability = Nullness.UNDEFINED; for (Nullability provider : this.nullabilities) { Nullness override = provider.getReturnValueNullability(method); nullability = nullability.override(override); } return nullability; }
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getParameterNullability(net.bytebuddy.description.method.ParameterDescription) */ @Override public Nullness getParameterNullability(ParameterDescription parameter) { Nullness nullability = Nullness.UNDEFINED; for (Nullability provider : this.nullabilities) { Nullness override = provider.getParameterNullability(parameter); nullability = nullability.override(override); } return nullability; }
/** * @see me.seeber.gradle.ide.eclipse.annotations.Nullability#getReturnValueNullability(MethodDescription) */ @Override public Nullness getReturnValueNullability(MethodDescription method) { Nullness nullability = Nullness.UNDEFINED; for (Nullability provider : this.nullabilities) { Nullness override = provider.getReturnValueNullability(method); nullability = nullability.override(override); } return nullability; }