Class CodeWarnings
java.lang.Object
org.springframework.beans.factory.aot.CodeWarnings
Helper class to register warnings that the compiler may trigger on
 generated code.
- Since:
- 6.1
- Author:
- Stephane Nicoll
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondetectDeprecation(AnnotatedElement... elements) Detect the presence ofDeprecatedon the specified elements.detectDeprecation(Stream<AnnotatedElement> elements) Detect the presence ofDeprecatedon the specified elements.detectDeprecation(ResolvableType resolvableType) Detect the presence ofDeprecatedon the signature of the specifiedResolvableType.Return the currently registered warnings.voidRegister a warning to be included for this block.protected voidConsume the builder forSuppressWarningsif necessary.voidsuppress(org.springframework.javapoet.MethodSpec.Builder method) IncludeSuppressWarningson the specified method if necessary.voidsuppress(org.springframework.javapoet.TypeSpec.Builder type) IncludeSuppressWarningson the specified type if necessary.toString()
- 
Constructor Details- 
CodeWarningspublic CodeWarnings()
 
- 
- 
Method Details- 
registerRegister a warning to be included for this block. Does nothing if the warning is already registered.- Parameters:
- warning- the warning to register, if it hasn't been already
 
- 
detectDeprecationDetect the presence ofDeprecatedon the specified elements.- Parameters:
- elements- the elements to check
- Returns:
- thisinstance
 
- 
detectDeprecationDetect the presence ofDeprecatedon the specified elements.- Parameters:
- elements- the elements to check
- Returns:
- thisinstance
 
- 
detectDeprecationDetect the presence ofDeprecatedon the signature of the specifiedResolvableType.- Parameters:
- resolvableType- a type signature
- Returns:
- thisinstance
- Since:
- 6.1.8
 
- 
suppresspublic void suppress(org.springframework.javapoet.MethodSpec.Builder method) IncludeSuppressWarningson the specified method if necessary.- Parameters:
- method- the method to update
 
- 
suppresspublic void suppress(org.springframework.javapoet.TypeSpec.Builder type) IncludeSuppressWarningson the specified type if necessary.- Parameters:
- type- the type to update
 
- 
suppressprotected void suppress(Consumer<org.springframework.javapoet.AnnotationSpec.Builder> annotationSpec) Consume the builder forSuppressWarningsif necessary. If this instance has no warnings registered, the consumer is not invoked.- Parameters:
- annotationSpec- a consumer of the- AnnotationSpec.Builder
- See Also:
 
- 
getWarnings
- 
toString
 
-