You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2026/05/12 14:56:36 UTC
(juneau) branch master updated (fe62d501f8 -> bd1889c113)
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
from fe62d501f8 chore: remove completed TODO-21 from TODO.md
new b66b76b180 refactor: extract @BeanType from @Marshalled and create commons.bean package (Phase 1 of bean-layer split)
new 0cdbdd819c refactor: extract @BeanProp from @MarshalledProp; merge @MarshalledCtor into @BeanCtor (Phase 2 of bean-layer split)
new fc54e2a5e5 refactor: extract @BeanConfig from @MarshalledConfig (Phase 3 of bean-layer split)
new 6dc9a18ab5 refactor: extract @BeanIgnore from @MarshalledIgnore for bean-detection (Phase 4 of bean-layer split)
new 595f2273e6 refactor: move MarshallingInterceptor to commons.bean.BeanInterceptor (Phase 5a of bean-layer split)
new bd1889c113 docs: simplify annotation links in marshall and rest Javadocs
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/juneau/bean/LinkString.java | 3 +-
.../org/apache/juneau/bean/html5/HtmlElement.java | 5 +-
.../juneau/bean/html5/HtmlElementContainer.java | 5 +-
.../apache/juneau/bean/html5/HtmlElementMixed.java | 5 +-
.../juneau/bean/html5/HtmlElementRawText.java | 5 +-
.../apache/juneau/bean/html5/HtmlElementText.java | 5 +-
.../java/org/apache/juneau/bean/html5/Pre.java | 3 +-
.../apache/juneau/bean/jsonschema/JsonSchema.java | 53 +-
.../org/apache/juneau/bean/mcp/JsonSchema.java | 3 +-
.../apache/juneau/bean/openapi3/HeaderInfo.java | 9 +-
.../org/apache/juneau/bean/openapi3/Items.java | 5 +-
.../org/apache/juneau/bean/openapi3/MediaType.java | 5 +-
.../juneau/bean/openapi3/OpenApiElement.java | 7 +-
.../apache/juneau/bean/openapi3/SchemaInfo.java | 5 +-
.../org/apache/juneau/bean/swagger/HeaderInfo.java | 5 +-
.../java/org/apache/juneau/bean/swagger/Items.java | 5 +-
.../org/apache/juneau/bean/swagger/SchemaInfo.java | 5 +-
.../apache/juneau/bean/swagger/SwaggerElement.java | 7 +-
.../commons/annotation/MarshalledIgnore.java | 58 --
.../juneau/commons/bean}/BasicPropertyNamer.java | 2 +-
.../apache/juneau/commons/bean/BeanConfig.java} | 360 +----------
.../BeanConfigAnnotation.java} | 22 +-
.../org/apache/juneau/commons/bean/BeanCtor.java} | 54 +-
.../juneau/commons/bean/BeanCtorAnnotation.java} | 44 +-
.../org/apache/juneau/commons/bean/BeanIgnore.java | 87 +++
.../juneau/commons/bean/BeanIgnoreAnnotation.java} | 48 +-
.../juneau/commons/bean/BeanInterceptor.java} | 20 +-
.../org/apache/juneau/commons/bean/BeanProp.java | 299 +++++++++
.../juneau/commons/bean/BeanPropAnnotation.java} | 140 ++--
.../org/apache/juneau/commons/bean/BeanType.java} | 254 +-------
.../juneau/commons/bean/BeanTypeAnnotation.java} | 260 ++------
.../apache/juneau/commons/bean}/PropertyNamer.java | 6 +-
.../juneau/commons/bean}/PropertyNamerDLC.java | 2 +-
.../juneau/commons/bean}/PropertyNamerDUCS.java | 2 +-
.../juneau/commons/bean}/PropertyNamerULC.java | 2 +-
.../apache/juneau/commons/bean}/package-info.java | 11 +-
.../juneau/commons/function/BeanFactory.java | 5 +-
.../juneau/commons/function/ListBeanChannel.java | 2 +-
.../juneau/commons/function/package-info.java | 12 +-
.../apache/juneau/commons/http/MediaRanges.java | 4 +-
.../org/apache/juneau/commons/http/MediaType.java | 4 +-
.../apache/juneau/commons/http/StringRange.java | 4 +-
.../apache/juneau/commons/http/StringRanges.java | 4 +-
.../juneau/commons/inject/BeanInstantiator.java | 2 +-
.../java/org/apache/juneau/jena/RdfParser.java | 6 +-
.../java/org/apache/juneau/jena/RdfSerializer.java | 6 +-
.../java/org/apache/juneau/AnnotationWorkList.java | 7 +
.../src/main/java/org/apache/juneau/BeanMap.java | 5 +-
.../src/main/java/org/apache/juneau/BeanMeta.java | 157 ++---
.../java/org/apache/juneau/BeanPropertyMeta.java | 69 +-
.../src/main/java/org/apache/juneau/ClassMeta.java | 11 +-
.../src/main/java/org/apache/juneau/Context.java | 16 +-
.../java/org/apache/juneau/MarshalledFilter.java | 83 ++-
.../java/org/apache/juneau/MarshallingContext.java | 91 +--
.../org/apache/juneau/MarshallingContextable.java | 39 +-
.../java/org/apache/juneau/MarshallingSession.java | 1 +
.../apache/juneau/MarshallingTraverseContext.java | 6 +-
.../main/java/org/apache/juneau/UriContext.java | 3 +-
...igAnnotation.java => BeanConfigAnnotation.java} | 46 +-
.../{UriApply.java => BeanCtorApply.java} | 27 +-
...nnotation.java => BeanCtorApplyAnnotation.java} | 55 +-
.../{SchemaApply.java => BeanIgnoreApply.java} | 24 +-
...otation.java => BeanIgnoreApplyAnnotation.java} | 55 +-
.../{UriApply.java => BeanPropApply.java} | 25 +-
...nnotation.java => BeanPropApplyAnnotation.java} | 55 +-
.../{MarshalledApply.java => BeanTypeApply.java} | 22 +-
...nnotation.java => BeanTypeApplyAnnotation.java} | 55 +-
.../org/apache/juneau/annotation/Marshalled.java | 322 +--------
.../juneau/annotation/MarshalledAnnotation.java | 282 +-------
.../apache/juneau/annotation/MarshalledConfig.java | 719 +--------------------
.../annotation/MarshalledConfigAnnotation.java | 28 -
.../juneau/annotation/MarshalledCtorApply.java | 96 ---
.../annotation/MarshalledCtorApplyAnnotation.java | 225 -------
.../apache/juneau/annotation/MarshalledIgnore.java | 59 +-
.../annotation/MarshalledIgnoreAnnotation.java | 21 +-
.../apache/juneau/annotation/MarshalledProp.java | 386 +----------
.../annotation/MarshalledPropAnnotation.java | 161 +----
.../java/org/apache/juneau/annotation/Name.java | 3 +-
.../main/java/org/apache/juneau/csv/CsvParser.java | 6 +-
.../java/org/apache/juneau/csv/CsvSerializer.java | 6 +-
.../org/apache/juneau/html/HtmlDocSerializer.java | 6 +-
.../java/org/apache/juneau/html/HtmlParser.java | 6 +-
.../juneau/html/HtmlSchemaDocSerializer.java | 6 +-
.../apache/juneau/html/HtmlSchemaSerializer.java | 6 +-
.../org/apache/juneau/html/HtmlSerializer.java | 6 +-
.../juneau/html/HtmlStrippedDocSerializer.java | 6 +-
.../java/org/apache/juneau/json/JsonParser.java | 6 +-
.../apache/juneau/json/JsonSchemaSerializer.java | 6 +-
.../org/apache/juneau/json/JsonSerializer.java | 6 +-
.../java/org/apache/juneau/json5/Json5Parser.java | 6 +-
.../org/apache/juneau/json5/Json5Serializer.java | 6 +-
.../juneau/jsonschema/JsonSchemaGenerator.java | 6 +-
.../org/apache/juneau/markdown/MarkdownParser.java | 6 +-
.../apache/juneau/markdown/MarkdownSerializer.java | 6 +-
.../org/apache/juneau/msgpack/MsgPackParser.java | 6 +-
.../apache/juneau/msgpack/MsgPackSerializer.java | 6 +-
.../java/org/apache/juneau/oapi/OpenApiParser.java | 6 +-
.../org/apache/juneau/oapi/OpenApiSerializer.java | 6 +-
.../apache/juneau/parser/InputStreamParser.java | 6 +-
.../main/java/org/apache/juneau/parser/Parser.java | 6 +-
.../org/apache/juneau/parser/ReaderParser.java | 6 +-
.../apache/juneau/plaintext/PlainTextParser.java | 6 +-
.../juneau/plaintext/PlainTextSerializer.java | 6 +-
.../juneau/serializer/OutputStreamSerializer.java | 6 +-
.../org/apache/juneau/serializer/Serializer.java | 6 +-
.../apache/juneau/serializer/WriterSerializer.java | 6 +-
.../org/apache/juneau/soap/SoapXmlSerializer.java | 6 +-
.../java/org/apache/juneau/swap/AutoListSwap.java | 13 +-
.../java/org/apache/juneau/swap/AutoMapSwap.java | 13 +-
.../org/apache/juneau/swap/AutoNumberSwap.java | 13 +-
.../org/apache/juneau/swap/AutoObjectSwap.java | 13 +-
.../java/org/apache/juneau/swap/SurrogateSwap.java | 3 +-
.../main/java/org/apache/juneau/uon/UonParser.java | 6 +-
.../java/org/apache/juneau/uon/UonSerializer.java | 6 +-
.../juneau/urlencoding/UrlEncodingParser.java | 6 +-
.../juneau/urlencoding/UrlEncodingSerializer.java | 6 +-
.../main/java/org/apache/juneau/xml/XmlParser.java | 6 +-
.../java/org/apache/juneau/xml/XmlSerializer.java | 6 +-
.../java/org/apache/juneau/xml/annotation/Xml.java | 3 +-
.../java/org/apache/juneau/yaml/YamlParser.java | 6 +-
.../org/apache/juneau/yaml/YamlSerializer.java | 6 +-
.../examples/core/html/HtmlComplexExample.java | 2 +-
.../examples/core/html/HtmlSimpleExample.java | 2 +-
.../examples/core/json/JsonComplexExample.java | 2 +-
.../examples/core/json/JsonSimpleExample.java | 2 +-
.../juneau/examples/core/oapi/OapiExample.java | 2 +-
.../org/apache/juneau/examples/core/pojo/Pojo.java | 3 +-
.../juneau/examples/core/pojo/PojoComplex.java | 3 +-
.../juneau/examples/core/uon/UonExample.java | 2 +-
.../examples/core/xml/XmlComplexExample.java | 2 +-
.../juneau/examples/core/xml/XmlSimpleExample.java | 2 +-
.../juneau/examples/rest/RequestEchoResource.java | 7 +-
.../juneau/examples/rest/UtilityBeansResource.java | 3 +-
.../microservice/resources/DirectoryResource.java | 3 +-
.../microservice/resources/LogsResource.java | 3 +-
.../org/apache/juneau/rest/client/RestClient.java | 6 +-
.../org/apache/juneau/rest/client/RestRequest.java | 1 +
.../org/apache/juneau/http/annotation/Header.java | 2 +-
.../apache/juneau/http/entity/BasicHttpEntity.java | 4 +-
.../apache/juneau/http/resource/BasicResource.java | 4 +-
.../apache/juneau/rest/mock/MockRestClient.java | 6 +-
.../java/org/apache/juneau/rest/RestContext.java | 10 +-
.../org/apache/juneau/rest/annotation/RestGet.java | 5 +-
.../apache/juneau/rest/annotation/RestInit.java | 6 +-
.../org/apache/juneau/rest/annotation/RestOp.java | 7 +-
.../apache/juneau/rest/annotation/RestPatch.java | 7 +-
.../apache/juneau/rest/beans/BeanDescription.java | 3 +-
.../juneau/rest/beans/ResourceDescription.java | 3 +-
.../apache/juneau/rest/config/DefaultConfig.java | 3 +-
.../apache/juneau/rest/stats/RestContextStats.java | 3 +-
.../apache/juneau/AnnotationInheritance_Test.java | 23 +-
.../java/org/apache/juneau/Annotations_Test.java | 9 +-
.../java/org/apache/juneau/BasicBeans_Test.java | 5 +-
.../java/org/apache/juneau/BeanMapErrors_Test.java | 27 +-
.../test/java/org/apache/juneau/BeanMap_Test.java | 81 +--
.../java/org/apache/juneau/BeanStreaming_Test.java | 3 +-
.../apache/juneau/DynaBean_ComboRoundTripTest.java | 19 +-
.../org/apache/juneau/MarshalledConfig_Test.java | 17 +-
.../java/org/apache/juneau/PropertyNamerTest.java | 1 +
.../juneau/ReadWriteOnlyProperties_Test.java | 29 +-
.../src/test/java/org/apache/juneau/TestUtils.java | 8 +-
.../src/test/java/org/apache/juneau/a/A1.java | 12 +-
.../juneau/a/rttests/Generics_RoundTripTest.java | 3 +-
.../a/rttests/ReadOnlyBeans_RoundTripTest.java | 5 +-
.../juneau/a/rttests/Records_RoundTripTest.java | 9 +-
.../juneau/a/rttests/RoundTripBeanMaps_Test.java | 21 +-
.../a/rttests/RoundTripBeansWithBuilders_Test.java | 13 +-
...on_Test.java => BeanConfigAnnotation_Test.java} | 97 +--
...tion_Test.java => BeanCtorAnnotation_Test.java} | 19 +-
...on_Test.java => BeanIgnoreAnnotation_Test.java} | 27 +-
...halledIgnore_Test.java => BeanIgnore_Test.java} | 103 ++-
.../BeanPropAnnotation_Test.java} | 59 +-
...Test.java => BeanProp_StarPlainField_Test.java} | 15 +-
.../annotation/MarshalledAnnotation_Test.java | 105 ++-
.../MarshalledConfigAnnotation_Test.java | 99 +--
.../MarshalledIgnoreAnnotation_Test.java | 2 +-
.../juneau/annotation/MarshalledIgnore_Test.java | 94 +--
.../annotation/MarshalledPropAnnotation_Test.java | 42 +-
.../apache/juneau/annotation/Marshalled_Test.java | 53 +-
.../java/org/apache/juneau/csv/CsvParser_Test.java | 5 +-
.../org/apache/juneau/html/BasicHtml_Test.java | 15 +-
.../juneau/html/HtmlSchemaSerializer_Test.java | 5 +-
.../java/org/apache/juneau/html/Html_Test.java | 3 +-
.../org/apache/juneau/ini/IniRoundTrip_Test.java | 7 +-
.../org/apache/juneau/jena/RdfParser_Test.java | 3 +-
.../org/apache/juneau/jena/RdfSerializer_Test.java | 3 +-
.../org/apache/juneau/jsonl/JsonlParser_Test.java | 3 +-
.../apache/juneau/jsonl/JsonlRoundTrip_Test.java | 7 +-
.../java/org/apache/juneau/jsonl/Jsonl_Test.java | 3 +-
.../juneau/markdown/MarkdownParser_Test.java | 5 +-
.../apache/juneau/objecttools/ObjectRest_Test.java | 6 +-
.../annotation/RestOp_MarshalledConfig_Test.java | 39 +-
.../RestClient_Config_MarshallingContext_Test.java | 3 +-
.../apache/juneau/transform/AutoListSwapTest.java | 17 +-
.../apache/juneau/transform/AutoMapSwapTest.java | 17 +-
.../juneau/transform/AutoNumberSwapTest.java | 17 +-
.../juneau/transform/AutoObjectSwapTest.java | 17 +-
.../transforms/Builder_ComboRoundTripTest.java | 3 +-
.../juneau/transforms/MarshalledFilter_Test.java | 13 +-
.../urlencoding/UrlEncodingSerializer_Test.java | 9 +-
.../java/org/apache/juneau/xml/BasicXml_Test.java | 18 +-
.../java/org/apache/juneau/xml/CommonXml_Test.java | 3 +-
.../org/apache/juneau/xml/XmlCollapsed_Test.java | 5 +-
.../apache/juneau/xml/XmlIgnoreComments_Test.java | 9 +-
.../test/java/org/apache/juneau/xml/Xml_Test.java | 20 +-
.../test/java/org/apache/juneau/xml/xml1b/T7.java | 13 +-
scripts/check-fluent-setter-overrides.py | 6 +-
todo/TODO-5-bean-runtime-types-to-commons.md | 178 +++++
todo/TODO.md | 2 +
209 files changed, 2184 insertions(+), 4672 deletions(-)
delete mode 100644 juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/annotation/MarshalledIgnore.java
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau => juneau-commons/src/main/java/org/apache/juneau/commons/bean}/BasicPropertyNamer.java (97%)
copy juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfig.java} (59%)
copy juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/{logging/LogRecordListener.java => bean/BeanConfigAnnotation.java} (57%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtor.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtor.java} (61%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorAnnotation.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtorAnnotation.java} (70%)
create mode 100644 juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnore.java
copy juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnoreAnnotation.java} (68%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/swap/MarshallingInterceptor.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanInterceptor.java} (85%)
create mode 100644 juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanProp.java
copy juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanPropAnnotation.java} (60%)
copy juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanType.java} (51%)
copy juneau-core/{juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java => juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanTypeAnnotation.java} (54%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau => juneau-commons/src/main/java/org/apache/juneau/commons/bean}/PropertyNamer.java (88%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau => juneau-commons/src/main/java/org/apache/juneau/commons/bean}/PropertyNamerDLC.java (98%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau => juneau-commons/src/main/java/org/apache/juneau/commons/bean}/PropertyNamerDUCS.java (98%)
rename juneau-core/{juneau-marshall/src/main/java/org/apache/juneau => juneau-commons/src/main/java/org/apache/juneau/commons/bean}/PropertyNamerULC.java (98%)
copy {juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5 => juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean}/package-info.java (69%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{MarshalledConfigAnnotation.java => BeanConfigAnnotation.java} (68%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{UriApply.java => BeanCtorApply.java} (77%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{UriApplyAnnotation.java => BeanCtorApplyAnnotation.java} (74%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{SchemaApply.java => BeanIgnoreApply.java} (78%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{MarshalledApplyAnnotation.java => BeanIgnoreApplyAnnotation.java} (75%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{UriApply.java => BeanPropApply.java} (79%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{UriApplyAnnotation.java => BeanPropApplyAnnotation.java} (74%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{MarshalledApply.java => BeanTypeApply.java} (80%)
copy juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/{UriApplyAnnotation.java => BeanTypeApplyAnnotation.java} (74%)
delete mode 100644 juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java
delete mode 100644 juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java
copy juneau-utest/src/test/java/org/apache/juneau/annotation/{MarshalledConfigAnnotation_Test.java => BeanConfigAnnotation_Test.java} (67%)
rename juneau-utest/src/test/java/org/apache/juneau/annotation/{MarshalledCtorAnnotation_Test.java => BeanCtorAnnotation_Test.java} (88%)
copy juneau-utest/src/test/java/org/apache/juneau/annotation/{MarshalledIgnoreAnnotation_Test.java => BeanIgnoreAnnotation_Test.java} (82%)
copy juneau-utest/src/test/java/org/apache/juneau/annotation/{MarshalledIgnore_Test.java => BeanIgnore_Test.java} (72%)
copy juneau-utest/src/test/java/org/apache/juneau/{rest/annotation/RestDestroyAnnotation_Test.java => annotation/BeanPropAnnotation_Test.java} (65%)
rename juneau-utest/src/test/java/org/apache/juneau/annotation/{MarshalledProp_StarPlainField_Test.java => BeanProp_StarPlainField_Test.java} (87%)
create mode 100644 todo/TODO-5-bean-runtime-types-to-commons.md
(juneau) 02/06: refactor: extract @BeanProp from @MarshalledProp; merge @MarshalledCtor into @BeanCtor (Phase 2 of bean-layer split)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit 0cdbdd819cebac79b5828787184f35961fcf639d
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 09:07:09 2026 -0400
refactor: extract @BeanProp from @MarshalledProp; merge @MarshalledCtor into @BeanCtor (Phase 2 of bean-layer split)
Split per-property and per-constructor annotations into bean-modeling vs
marshalling-only concerns:
@MarshalledProp:
- Kept marshalling attrs (description, dictionary, format, properties) on
@MarshalledProp.
- Moved bean-modeling attrs (name, value, ro, wo, type, params, elementType,
factory) to new @BeanProp in juneau-commons/org.apache.juneau.commons.bean.
@MarshalledCtor:
- All attrs were bean-modeling, so the annotation was removed entirely and
replaced by the new @BeanCtor in commons.bean (description, properties).
- MarshalledCtorAnnotation/Apply/ApplyAnnotation were deleted.
New files:
- commons.bean.BeanProp + BeanPropAnnotation (metadata-only processor).
- commons.bean.BeanCtor + BeanCtorAnnotation.
- annotation.BeanPropApply + BeanPropApplyAnnotation.
- annotation.BeanCtorApply + BeanCtorApplyAnnotation.
Updated runtime sites (BeanMeta, BeanPropertyMeta, MarshallingContext,
MarshalledFilter, Context, MarshallingContextable, UriContext, BeanMap)
to read bean-modeling attrs from @BeanProp/@BeanCtor.
Migrated all callsites across juneau-bean, juneau-utest, and
juneau-examples; split @MarshalledProp usages that mixed both groups into
separate @BeanProp + @MarshalledProp annotations.
Renamed/split test files:
- MarshalledCtorAnnotation_Test -> BeanCtorAnnotation_Test.
- MarshalledPropAnnotation_Test split into BeanPropAnnotation_Test (bean-
modeling) + slimmer MarshalledPropAnnotation_Test (marshalling-only).
- MarshalledProp_StarPlainField_Test -> BeanProp_StarPlainField_Test.
Co-authored-by: Cursor <cu...@cursor.com>
---
.../org/apache/juneau/bean/html5/HtmlElement.java | 5 +-
.../juneau/bean/html5/HtmlElementContainer.java | 5 +-
.../apache/juneau/bean/html5/HtmlElementMixed.java | 5 +-
.../juneau/bean/html5/HtmlElementRawText.java | 5 +-
.../apache/juneau/bean/html5/HtmlElementText.java | 5 +-
.../java/org/apache/juneau/bean/html5/Pre.java | 3 +-
.../apache/juneau/bean/jsonschema/JsonSchema.java | 31 +-
.../org/apache/juneau/bean/mcp/JsonSchema.java | 3 +-
.../apache/juneau/bean/openapi3/HeaderInfo.java | 9 +-
.../org/apache/juneau/bean/openapi3/Items.java | 5 +-
.../org/apache/juneau/bean/openapi3/MediaType.java | 5 +-
.../juneau/bean/openapi3/OpenApiElement.java | 7 +-
.../apache/juneau/bean/openapi3/SchemaInfo.java | 5 +-
.../org/apache/juneau/bean/swagger/HeaderInfo.java | 5 +-
.../java/org/apache/juneau/bean/swagger/Items.java | 5 +-
.../org/apache/juneau/bean/swagger/SchemaInfo.java | 5 +-
.../apache/juneau/bean/swagger/SwaggerElement.java | 7 +-
.../org/apache/juneau/commons/bean/BeanCtor.java} | 54 ++-
.../juneau/commons/bean/BeanCtorAnnotation.java} | 44 +--
.../org/apache/juneau/commons/bean/BeanProp.java | 299 ++++++++++++++++
.../juneau/commons/bean/BeanPropAnnotation.java} | 140 +++-----
.../juneau/commons/function/BeanFactory.java | 3 +-
.../juneau/commons/function/ListBeanChannel.java | 2 +-
.../juneau/commons/function/package-info.java | 8 +-
.../src/main/java/org/apache/juneau/BeanMap.java | 5 +-
.../src/main/java/org/apache/juneau/BeanMeta.java | 90 ++---
.../java/org/apache/juneau/BeanPropertyMeta.java | 69 ++--
.../src/main/java/org/apache/juneau/Context.java | 3 +-
.../java/org/apache/juneau/MarshalledFilter.java | 5 +-
.../java/org/apache/juneau/MarshallingContext.java | 20 +-
.../org/apache/juneau/MarshallingContextable.java | 12 +-
.../main/java/org/apache/juneau/UriContext.java | 3 +-
...MarshalledCtorApply.java => BeanCtorApply.java} | 24 +-
...nnotation.java => BeanCtorApplyAnnotation.java} | 55 +--
...MarshalledCtorApply.java => BeanPropApply.java} | 22 +-
...nnotation.java => BeanPropApplyAnnotation.java} | 55 +--
.../apache/juneau/annotation/MarshalledProp.java | 385 +--------------------
.../annotation/MarshalledPropAnnotation.java | 161 +--------
.../java/org/apache/juneau/xml/annotation/Xml.java | 3 +-
.../examples/core/html/HtmlComplexExample.java | 2 +-
.../examples/core/html/HtmlSimpleExample.java | 2 +-
.../examples/core/json/JsonComplexExample.java | 2 +-
.../examples/core/json/JsonSimpleExample.java | 2 +-
.../juneau/examples/core/oapi/OapiExample.java | 2 +-
.../org/apache/juneau/examples/core/pojo/Pojo.java | 3 +-
.../juneau/examples/core/pojo/PojoComplex.java | 3 +-
.../juneau/examples/core/uon/UonExample.java | 2 +-
.../examples/core/xml/XmlComplexExample.java | 2 +-
.../juneau/examples/core/xml/XmlSimpleExample.java | 2 +-
.../org/apache/juneau/http/annotation/Header.java | 2 +-
.../apache/juneau/AnnotationInheritance_Test.java | 23 +-
.../java/org/apache/juneau/BasicBeans_Test.java | 3 +-
.../java/org/apache/juneau/BeanMapErrors_Test.java | 14 +-
.../test/java/org/apache/juneau/BeanMap_Test.java | 36 +-
.../apache/juneau/DynaBean_ComboRoundTripTest.java | 19 +-
.../org/apache/juneau/MarshalledConfig_Test.java | 8 +-
.../juneau/ReadWriteOnlyProperties_Test.java | 12 +-
.../a/rttests/ReadOnlyBeans_RoundTripTest.java | 5 +-
.../juneau/a/rttests/Records_RoundTripTest.java | 4 +-
.../juneau/a/rttests/RoundTripBeanMaps_Test.java | 2 +-
...tion_Test.java => BeanCtorAnnotation_Test.java} | 19 +-
...tion_Test.java => BeanPropAnnotation_Test.java} | 64 ++--
...Test.java => BeanProp_StarPlainField_Test.java} | 15 +-
.../annotation/MarshalledPropAnnotation_Test.java | 42 +--
.../apache/juneau/annotation/Marshalled_Test.java | 18 +-
.../java/org/apache/juneau/csv/CsvParser_Test.java | 5 +-
.../org/apache/juneau/html/BasicHtml_Test.java | 8 +-
.../juneau/markdown/MarkdownParser_Test.java | 5 +-
.../annotation/RestOp_MarshalledConfig_Test.java | 4 +-
.../transforms/Builder_ComboRoundTripTest.java | 3 +-
.../urlencoding/UrlEncodingSerializer_Test.java | 9 +-
.../java/org/apache/juneau/xml/BasicXml_Test.java | 8 +-
.../apache/juneau/xml/XmlIgnoreComments_Test.java | 9 +-
.../test/java/org/apache/juneau/xml/Xml_Test.java | 10 +-
.../test/java/org/apache/juneau/xml/xml1b/T7.java | 13 +-
scripts/check-fluent-setter-overrides.py | 6 +-
76 files changed, 863 insertions(+), 1102 deletions(-)
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElement.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElement.java
index c1d18ca1a4..9cd9609112 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElement.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElement.java
@@ -26,6 +26,7 @@ import java.net.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.html.*;
import org.apache.juneau.xml.annotation.*;
@@ -202,7 +203,7 @@ public abstract class HtmlElement {
* @return The attributes of this element.
*/
@Xml(format = ATTRS)
- @MarshalledProp("a")
+ @BeanProp("a")
public java.util.Map<String,Object> getAttrs() { return attrs; }
/**
@@ -1046,7 +1047,7 @@ public abstract class HtmlElement {
* @param value The new attributes for this element.
* @return This object.
*/
- @MarshalledProp("a")
+ @BeanProp("a")
public HtmlElement setAttrs(java.util.Map<String,Object> value) {
if (nn(value)) {
value.entrySet().forEach(x -> {
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementContainer.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementContainer.java
index 6e7d18ab77..bd7544f415 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementContainer.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementContainer.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.xml.annotation.XmlFormat.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.xml.annotation.*;
@@ -158,7 +159,7 @@ public class HtmlElementContainer extends HtmlElement {
* @return The children of this element.
*/
@Xml(format = ELEMENTS)
- @MarshalledProp(dictionary = HtmlBeanDictionary.class, name = "c")
+ @BeanProp(name="c") @MarshalledProp(dictionary=HtmlBeanDictionary.class)
public List<Object> getChildren() { return children; }
@Override /* Overridden from HtmlElement */
@@ -485,7 +486,7 @@ public class HtmlElementContainer extends HtmlElement {
* @param children The new children for this container.
* @return This object.
*/
- @MarshalledProp("c")
+ @BeanProp("c")
public HtmlElementContainer setChildren(List<Object> children) {
this.children = children;
return this;
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementMixed.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementMixed.java
index 628f3f3c4d..44fe7ef09a 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementMixed.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementMixed.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.xml.annotation.XmlFormat.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.xml.annotation.*;
@@ -164,7 +165,7 @@ public class HtmlElementMixed extends HtmlElement {
* @return The children of this element.
*/
@Xml(format = MIXED)
- @MarshalledProp(dictionary = HtmlBeanDictionary.class, name = "c")
+ @BeanProp(name="c") @MarshalledProp(dictionary=HtmlBeanDictionary.class)
public List<Object> getChildren() { return children; }
@Override /* Overridden from HtmlElement */
@@ -491,7 +492,7 @@ public class HtmlElementMixed extends HtmlElement {
* @param children The new children of this element.
* @return This object.
*/
- @MarshalledProp("c")
+ @BeanProp("c")
public HtmlElement setChildren(List<Object> children) {
this.children = children;
return this;
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementRawText.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementRawText.java
index 4a077e9d91..10bfc67ef7 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementRawText.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementRawText.java
@@ -17,6 +17,7 @@
package org.apache.juneau.bean.html5;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -73,7 +74,7 @@ public class HtmlElementRawText extends HtmlElement {
* @return The inner text of this element, or <jk>null</jk> if no text is set.
*/
@Xml(format = XmlFormat.TEXT_PWS)
- @MarshalledProp("c")
+ @BeanProp("c")
public Object getText() { return text; }
@Override /* Overridden from HtmlElement */
@@ -400,7 +401,7 @@ public class HtmlElementRawText extends HtmlElement {
* @param text The inner text of this element, or <jk>null</jk> if no text is set.
* @return This object.
*/
- @MarshalledProp("c")
+ @BeanProp("c")
public HtmlElement setText(Object text) {
this.text = text;
return this;
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementText.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementText.java
index 451a8338f3..58d05455a7 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementText.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/HtmlElementText.java
@@ -17,6 +17,7 @@
package org.apache.juneau.bean.html5;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -72,7 +73,7 @@ public class HtmlElementText extends HtmlElement {
* @return The inner text of this element, or <jk>null</jk> if no text is set.
*/
@Xml(format = XmlFormat.TEXT)
- @MarshalledProp("c")
+ @BeanProp("c")
public Object getText() { return text; }
@Override /* Overridden from HtmlElement */
@@ -399,7 +400,7 @@ public class HtmlElementText extends HtmlElement {
* @param text The inner text of this element, or <jk>null</jk> if no text is set.
* @return This object.
*/
- @MarshalledProp("c")
+ @BeanProp("c")
public HtmlElement setText(Object text) {
this.text = text;
return this;
diff --git a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/Pre.java b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/Pre.java
index 3182401132..ca843668e9 100644
--- a/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/Pre.java
+++ b/juneau-bean/juneau-bean-html5/src/main/java/org/apache/juneau/bean/html5/Pre.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.xml.annotation.XmlFormat.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.xml.annotation.*;
/**
@@ -166,7 +167,7 @@ public class Pre extends HtmlElementMixed {
}
@Xml(format = MIXED_PWS)
- @MarshalledProp(dictionary = HtmlBeanDictionary.class, name = "c")
+ @BeanProp(name="c") @MarshalledProp(dictionary=HtmlBeanDictionary.class)
@Override
public List<Object> getChildren() { return super.getChildren(); }
diff --git a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
index b6e6f598eb..773cfb53bb 100644
--- a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
+++ b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
@@ -27,6 +27,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.json.*;
import org.apache.juneau.parser.*;
@@ -807,7 +808,7 @@ public class JsonSchema {
*
* @return The value of the <property>$defs</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$defs")
+ @BeanProp("$defs")
public Map<String,JsonSchema> getDefs() {
return defs; // Return only defs, not definitions (to avoid double serialization)
}
@@ -855,7 +856,7 @@ public class JsonSchema {
*
* @return The value of the <property>else</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("else")
+ @BeanProp("else")
public JsonSchema getElse() { return else_; }
/**
@@ -927,7 +928,7 @@ public class JsonSchema {
*
* @return The value of the <property>$id</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$id")
+ @BeanProp("$id")
public URI getIdUri() {
return idUri; // Return only idUri, not id (to avoid double serialization)
}
@@ -940,7 +941,7 @@ public class JsonSchema {
*
* @return The value of the <property>if</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("if")
+ @BeanProp("if")
public JsonSchema getIf() { return if_; }
/**
@@ -1155,7 +1156,7 @@ public class JsonSchema {
*
* @return The value of the <property>$ref</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public URI getRef() { return ref; }
/**
@@ -1170,7 +1171,7 @@ public class JsonSchema {
*
* @return The value of the <property>$schema</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$schema")
+ @BeanProp("$schema")
public URI getSchemaVersionUri() { return schemaVersion; }
/**
@@ -1181,7 +1182,7 @@ public class JsonSchema {
*
* @return The value of the <property>then</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("then")
+ @BeanProp("then")
public JsonSchema getThen() { return then_; }
/**
@@ -1319,7 +1320,7 @@ public class JsonSchema {
* @return This object.
* @throws BeanRuntimeException If invalid object type passed in.
*/
- @MarshalledProp(dictionary = { JsonSchema.class })
+ @MarshalledProp(dictionary={ JsonSchema.class })
public JsonSchema setAdditionalProperties(Object value) {
this.additionalPropertiesBoolean = null;
this.additionalPropertiesSchema = null;
@@ -1424,7 +1425,7 @@ public class JsonSchema {
* @param value The new value for the <property>$defs</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("$defs")
+ @BeanProp("$defs")
public JsonSchema setDefs(Map<String,JsonSchema> value) {
this.defs = value;
if (nn(value))
@@ -1495,7 +1496,7 @@ public class JsonSchema {
* @param value The new value for the <property>else</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("else")
+ @BeanProp("else")
public JsonSchema setElse(JsonSchema value) {
this.else_ = value;
setMasterOn(value);
@@ -1600,7 +1601,7 @@ public class JsonSchema {
* @param value The new value for the <property>$id</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("$id")
+ @BeanProp("$id")
public JsonSchema setIdUri(Object value) {
this.idUri = toUri(value);
return this;
@@ -1615,7 +1616,7 @@ public class JsonSchema {
* @param value The new value for the <property>if</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("if")
+ @BeanProp("if")
public JsonSchema setIf(JsonSchema value) {
this.if_ = value;
setMasterOn(value);
@@ -1875,7 +1876,7 @@ public class JsonSchema {
* @param value The new value for the <property>$ref</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public JsonSchema setRef(Object value) {
this.ref = toUri(value);
return this;
@@ -1918,7 +1919,7 @@ public class JsonSchema {
* @param value The new value for the <property>schemaVersion</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("$schema")
+ @BeanProp("$schema")
public JsonSchema setSchemaVersionUri(Object value) {
this.schemaVersion = toUri(value);
return this;
@@ -1933,7 +1934,7 @@ public class JsonSchema {
* @param value The new value for the <property>then</property> property on this bean.
* @return This object.
*/
- @MarshalledProp("then")
+ @BeanProp("then")
public JsonSchema setThen(JsonSchema value) {
this.then_ = value;
setMasterOn(value);
diff --git a/juneau-bean/juneau-bean-mcp/src/main/java/org/apache/juneau/bean/mcp/JsonSchema.java b/juneau-bean/juneau-bean-mcp/src/main/java/org/apache/juneau/bean/mcp/JsonSchema.java
index 64f1896423..5d1e0c7f61 100644
--- a/juneau-bean/juneau-bean-mcp/src/main/java/org/apache/juneau/bean/mcp/JsonSchema.java
+++ b/juneau-bean/juneau-bean-mcp/src/main/java/org/apache/juneau/bean/mcp/JsonSchema.java
@@ -19,6 +19,7 @@ package org.apache.juneau.bean.mcp;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* JSON Schema subset used by MCP tool {@code inputSchema} objects.
@@ -32,7 +33,7 @@ public class JsonSchema {
private Object additionalProperties;
private JsonSchema items;
- @MarshalledProp(name = "$defs")
+ @BeanProp(name="$defs")
private Map<String, JsonSchema> defs;
/**
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/HeaderInfo.java b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/HeaderInfo.java
index b11f15daac..0b3137ff7f 100644
--- a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/HeaderInfo.java
+++ b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/HeaderInfo.java
@@ -24,6 +24,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
/**
@@ -219,7 +220,7 @@ public class HeaderInfo extends OpenApiElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("x-example")
+ @BeanProp("x-example")
public Object getExample() { return example; }
/**
@@ -247,7 +248,7 @@ public class HeaderInfo extends OpenApiElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -406,7 +407,7 @@ public class HeaderInfo extends OpenApiElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object
*/
- @MarshalledProp("x-example")
+ @BeanProp("x-example")
public HeaderInfo setExample(Object value) {
example = value;
return this;
@@ -454,7 +455,7 @@ public class HeaderInfo extends OpenApiElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public HeaderInfo setRef(String value) {
ref = value;
return this;
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
index 32c1709d59..4e39245911 100644
--- a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
+++ b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/Items.java
@@ -27,6 +27,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.json5.*;
@@ -347,7 +348,7 @@ public class Items extends OpenApiElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -724,7 +725,7 @@ public class Items extends OpenApiElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public Items setRef(Object value) {
ref = s(value);
return this;
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/MediaType.java b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/MediaType.java
index 434563dfc0..63f1f7ae2b 100644
--- a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/MediaType.java
+++ b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/MediaType.java
@@ -24,6 +24,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
/**
@@ -173,7 +174,7 @@ public class MediaType extends OpenApiElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("x-example")
+ @BeanProp("x-example")
public Object getExample() { return example; }
/**
@@ -244,7 +245,7 @@ public class MediaType extends OpenApiElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object
*/
- @MarshalledProp("x-example")
+ @BeanProp("x-example")
public MediaType setExample(Object value) {
example = value;
return this;
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/OpenApiElement.java b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/OpenApiElement.java
index b8cb759bf7..4aab8f3b56 100644
--- a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/OpenApiElement.java
+++ b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/OpenApiElement.java
@@ -26,6 +26,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.json.*;
/**
@@ -72,7 +73,7 @@ public abstract class OpenApiElement {
* All the non-standard keys on this element.
* <br>Never <jk>null</jk>.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public Set<String> extraKeys() {
return extra == null ? Collections.emptySet() : extra.keySet();
}
@@ -86,7 +87,7 @@ public abstract class OpenApiElement {
* @param property The property name to retrieve. Must not be <jk>null</jk>.
* @return The property value, or <jk>null</jk> if the property does not exist or is not set.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public Object get(String property) {
assertArgNotNull(ARG_property, property);
return opt(extra).map(x -> x.get(property)).orElse(null);
@@ -130,7 +131,7 @@ public abstract class OpenApiElement {
* @return This object
* @throws RuntimeException if strict mode is enabled.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public OpenApiElement set(String property, Object value) {
assertArgNotNull(ARG_property, property);
if (strict)
diff --git a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SchemaInfo.java b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SchemaInfo.java
index 7a26938037..b4f9e14f5d 100644
--- a/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SchemaInfo.java
+++ b/juneau-bean/juneau-bean-openapi-v3/src/main/java/org/apache/juneau/bean/openapi3/SchemaInfo.java
@@ -24,6 +24,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
/**
@@ -651,7 +652,7 @@ public class SchemaInfo extends OpenApiElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -1245,7 +1246,7 @@ public class SchemaInfo extends OpenApiElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public SchemaInfo setRef(Object value) {
ref = s(value);
return this;
diff --git a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
index 5f2f9afe4b..887714a091 100644
--- a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
+++ b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/HeaderInfo.java
@@ -25,6 +25,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.marshaller.*;
@@ -367,7 +368,7 @@ public class HeaderInfo extends SwaggerElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -753,7 +754,7 @@ public class HeaderInfo extends SwaggerElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public HeaderInfo setRef(String value) {
ref = value;
return this;
diff --git a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
index 5e9eceaee4..9eb02c644a 100644
--- a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
+++ b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/Items.java
@@ -25,6 +25,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.marshaller.*;
@@ -344,7 +345,7 @@ public class Items extends SwaggerElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -697,7 +698,7 @@ public class Items extends SwaggerElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public Items setRef(String value) {
ref = value;
return this;
diff --git a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SchemaInfo.java b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SchemaInfo.java
index 5509982b37..93ffc2f8a1 100644
--- a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SchemaInfo.java
+++ b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SchemaInfo.java
@@ -24,6 +24,7 @@ import static org.apache.juneau.internal.ConverterUtils.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
/**
@@ -563,7 +564,7 @@ public class SchemaInfo extends SwaggerElement {
*
* @return The property value, or <jk>null</jk> if it is not set.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public String getRef() { return ref; }
/**
@@ -1103,7 +1104,7 @@ public class SchemaInfo extends SwaggerElement {
* <br>Can be <jk>null</jk> to unset the property.
* @return This object.
*/
- @MarshalledProp("$ref")
+ @BeanProp("$ref")
public SchemaInfo setRef(String value) {
ref = value;
return this;
diff --git a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SwaggerElement.java b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SwaggerElement.java
index d0e013e1c5..5f08bd180e 100644
--- a/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SwaggerElement.java
+++ b/juneau-bean/juneau-bean-swagger-v2/src/main/java/org/apache/juneau/bean/swagger/SwaggerElement.java
@@ -26,6 +26,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.json.*;
/**
@@ -75,7 +76,7 @@ public abstract class SwaggerElement {
* All the non-standard keys on this element.
* <br>Never <jk>null</jk>.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public Set<String> extraKeys() {
return extra == null ? Collections.emptySet() : extra.keySet();
}
@@ -89,7 +90,7 @@ public abstract class SwaggerElement {
* @param property The property name to retrieve. Must not be <jk>null</jk>.
* @return The property value, or <jk>null</jk> if the property does not exist or is not set.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public Object get(String property) {
assertArgNotNull(ARG_property, property);
return opt(extra).map(x -> x.get(property)).orElse(null);
@@ -132,7 +133,7 @@ public abstract class SwaggerElement {
* @param value The new value for the property.
* @return This object.
*/
- @MarshalledProp("*")
+ @BeanProp("*")
public SwaggerElement set(String property, Object value) {
assertArgNotNull(ARG_property, property);
if (strict)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtor.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtor.java
similarity index 61%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtor.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtor.java
index 9cd030452d..11102bab05 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtor.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtor.java
@@ -14,25 +14,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
-import org.apache.juneau.*;
-
/**
* Maps constructor arguments to property names on beans with read-only properties.
*
* <p>
+ * The bean-modeling sibling to {@code @MarshalledProp}/{@code @BeanProp}: where those describe
+ * individual bean properties, this annotation describes how a constructor's parameters map to the
+ * bean's logical property set so the framework can instantiate read-only beans during parsing and
+ * deserialize property values through the constructor instead of via setters.
+ *
+ * <p>
+ * Lives in <c>juneau-commons</c> so the bean-modeling layer can describe constructor argument
+ * mappings without depending on the marshalling layer.
+ *
+ * <p>
* Can be used in the following locations:
* <ul>
* <li>Bean constructors.
- * <li><ja>@Rest</ja>-annotated classes and <ja>@RestOp</ja>-annotated methods when used with {@link MarshalledCtorApply @MarshalledCtorApply}.
* </ul>
-
+ *
* <p>
* This annotation can be used in the case of beans with properties whose values can only be set by passing them in
* through a constructor on the class.
@@ -46,29 +53,17 @@ import org.apache.juneau.*;
* <p>
* For Java records, the canonical constructor and its property mappings are automatically detected, so this
* annotation is not required. It can still be used to specify a non-canonical constructor if needed, for example
- * to provide default values for certain components. When using a non-canonical constructor on a record, use
- * {@link Bean#properties() @Marshalled(properties)} to limit the visible properties to match the constructor parameters.
- *
- * <p>
- * When present, bean instantiation is delayed until the call to {@link BeanMap#getBean()}.
- * Until then, bean property values are stored in a local cache until <c>getBean()</c> is called.
- * Because of this additional caching step, parsing into read-only beans tends to be slower and use more memory than
- * parsing into beans with writable properties.
- *
- * <p>
- * Attempting to call {@link BeanMap#put(String,Object)} on a read-only property after calling {@link BeanMap#getBean()}
- * will result in a {@link org.apache.juneau.commons.reflect.BeanRuntimeException} being thrown.
- * Multiple calls to {@link BeanMap#getBean()} will return the same bean instance.
+ * to provide default values for certain components.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MarshalledCtorAnnotation">@MarshalledCtor Annotation</a>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/BeancAnnotation">@BeanCtor Annotation</a>
* </ul>
*/
@Documented
@Target({ CONSTRUCTOR })
@Retention(RUNTIME)
@Inherited
-public @interface MarshalledCtor {
+public @interface BeanCtor {
/**
* Optional description for the exposed API.
@@ -82,8 +77,8 @@ public @interface MarshalledCtor {
* The names of the properties of the constructor arguments.
*
* <p>
- * The {@link org.apache.juneau.annotation.MarshalledCtor @MarshalledCtor} annotation is used to map constructor arguments to property
- * names on bean with read-only properties.
+ * The {@link BeanCtor @BeanCtor} annotation is used to map constructor arguments to property
+ * names on beans with read-only properties.
* <br>Since method parameter names are lost during compilation, this annotation essentially redefines them so that
* they are available at runtime.
*
@@ -95,7 +90,7 @@ public @interface MarshalledCtor {
* <jk>private final</jk> String <jf>name</jf>;
* <jk>private final int</jk> <jf>age</jf>;
*
- * <ja>@MarshalledCtor</ja>(properties=<js>"name,age"</js>)
+ * <ja>@BeanCtor</ja>(properties=<js>"name,age"</js>)
* <jk>public</jk> Person(String <jv>name</jv>, <jk>int</jk> <jv>age</jv>) {
* <jk>this</jk>.<jf>name</jf> = <jv>name</jv>;
* <jk>this</jk>.<jf>age</jf> = <jv>age</jv>;
@@ -113,20 +108,13 @@ public @interface MarshalledCtor {
* }
* }
* </p>
- * <p class='bjava'>
- * <jc>// Parsing into a read-only bean.</jc>
- * String <jv>json</jv> = <js>"{name:'John Smith',age:45}"</js>;
- * Person <jv>person</jv> = JsonParser.<jsf>DEFAULT</jsf>.parse(<jv>json</jv>);
- * String <jv>name</jv> = <jv>person</jv>.getName(); <jc>// "John Smith"</jc>
- * <jk>int</jk> <jv>age</jv> = <jv>person</jv>.getAge(); <jc>// 45</jc>
- * </p>
* <p>
- * Note that the {@link Name @Name} annotation can also be used to identify bean property names on constructor
- * arguments. If neither this annotation or {@link Name @Name} is used, then we try to get the property names
+ * Note that the {@link org.apache.juneau.annotation.Name @Name} annotation can also be used to identify bean property names on constructor
+ * arguments. If neither this annotation or {@link org.apache.juneau.annotation.Name @Name} is used, then we try to get the property names
* from the parameter names if they are available in the bytecode.
* </p>
*
* @return The annotation value.
*/
String properties() default "";
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorAnnotation.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtorAnnotation.java
similarity index 70%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorAnnotation.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtorAnnotation.java
index d6cc70ed8d..24e9361f14 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorAnnotation.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanCtorAnnotation.java
@@ -14,31 +14,33 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import java.lang.annotation.*;
-
import org.apache.juneau.commons.annotation.*;
/**
- * Utility classes and methods for the {@link MarshalledCtor @MarshalledCtor} annotation.
+ * Utility classes and methods for the {@link BeanCtor @BeanCtor} annotation.
+ *
+ * <p>
+ * Provides a {@link Builder} that constructs a synthetic {@link BeanCtor @BeanCtor} annotation instance
+ * programmatically without requiring it to be declared on a program element at compile time.
*
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanCtor}
+ * <li class='jc'>{@link AnnotationObject}
+ * </ul>
*/
-public class MarshalledCtorAnnotation {
+public class BeanCtorAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledCtorAnnotation() {}
+ private BeanCtorAnnotation() {}
/**
* Builder class.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
- * </ul>
*/
public static class Builder extends AnnotationObject.Builder {
@@ -49,15 +51,15 @@ public class MarshalledCtorAnnotation {
* Constructor.
*/
protected Builder() {
- super(MarshalledCtor.class);
+ super(BeanCtor.class);
}
/**
- * Instantiates a new {@link MarshalledCtor @MarshalledCtor} object initialized with this builder.
+ * Instantiates a new {@link BeanCtor @BeanCtor} object initialized with this builder.
*
- * @return A new {@link MarshalledCtor @MarshalledCtor} object.
+ * @return A new {@link BeanCtor @BeanCtor} object.
*/
- public MarshalledCtor build() {
+ public BeanCtor build() {
return new Object(this);
}
@@ -73,7 +75,7 @@ public class MarshalledCtorAnnotation {
}
/**
- * Sets the {@link MarshalledCtor#properties()} property on this annotation.
+ * Sets the {@link BeanCtor#properties()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -88,30 +90,30 @@ public class MarshalledCtorAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AnnotationObject implements MarshalledCtor {
+ private static class Object extends AnnotationObject implements BeanCtor {
private final String[] description;
private final String properties;
- Object(MarshalledCtorAnnotation.Builder b) {
+ Object(BeanCtorAnnotation.Builder b) {
super(b);
description = copyOf(b.description);
properties = b.properties;
}
- @Override /* Overridden from MarshalledCtor */
+ @Override /* Overridden from BeanCtor */
public String[] description() {
return description;
}
- @Override /* Overridden from MarshalledCtor */
+ @Override /* Overridden from BeanCtor */
public String properties() {
return properties;
}
}
/** Default value */
- public static final MarshalledCtor DEFAULT = create().build();
+ public static final BeanCtor DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -121,4 +123,4 @@ public class MarshalledCtorAnnotation {
public static Builder create() {
return new Builder();
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanProp.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanProp.java
new file mode 100644
index 0000000000..63e9ef8e90
--- /dev/null
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanProp.java
@@ -0,0 +1,299 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.commons.bean;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+import java.lang.annotation.*;
+import java.util.*;
+
+/**
+ * Annotation that can be applied to bean fields, getter/setter methods, and constructor parameters
+ * to control bean introspection and property modeling.
+ *
+ * <p>
+ * The bean-modeling sibling of {@code @MarshalledProp}.
+ * Where {@code @MarshalledProp} (in <c>juneau-marshall</c>) carries the marshalling-only attributes
+ * (such as {@code dictionary}, {@code format}, and {@code properties}), this annotation carries the
+ * attributes that describe the bean property itself — its name, accessibility (read/write only),
+ * concrete type, generic type parameters, element type, and the bean factory used to instantiate
+ * its value.
+ *
+ * <p>
+ * Splitting the annotations lets a property participate in the bean model (for example, to declare
+ * its name or read-only semantics) without dragging in any marshalling concerns, and lets the
+ * bean-modeling layer live in <c>juneau-commons</c> independent of <c>juneau-marshall</c>.
+ *
+ * <p>
+ * Can be used in the following locations:
+ * <ul>
+ * <li>Bean fields, getter methods, and setter methods.
+ * <li>Constructor parameters.
+ * </ul>
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/BeanpAnnotation">@BeanProp Annotation</a>
+ * </ul>
+ */
+@Documented
+@Target({ FIELD, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Inherited
+public @interface BeanProp {
+
+ /**
+ * Optional description for the exposed API.
+ *
+ * @return The annotation value.
+ * @since 9.2.0
+ */
+ String[] description() default {};
+
+ /**
+ * Element type for streaming/consuming bean properties.
+ *
+ * <p>
+ * Specifies the element type for properties of type {@link java.util.stream.Stream},
+ * {@link org.apache.juneau.commons.function.BeanSupplier},
+ * {@link org.apache.juneau.commons.function.BeanConsumer}, or
+ * {@link org.apache.juneau.commons.function.BeanChannel} when type erasure prevents
+ * the framework from inferring the generic type argument at runtime.
+ *
+ * <p>
+ * This attribute also supports:
+ * <ul>
+ * <li><b>Narrowing</b> - Specify a more specific subtype than the declared type
+ * <li><b>Concrete implementation</b> - Specify a concrete class for an abstract/interface element type
+ * </ul>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> OrderCollection {
+ * <jc>// Stream property - element type cannot be inferred at runtime due to erasure</jc>
+ * <ja>@BeanProp</ja>(elementType=Order.<jk>class</jk>)
+ * <jk>public</jk> Stream<Order> getOrders() { ... }
+ *
+ * <jc>// BeanChannel with concrete impl specified instead of abstract element type</jc>
+ * <ja>@BeanProp</ja>(elementType=ConcreteItem.<jk>class</jk>)
+ * <jk>public</jk> BeanChannel<AbstractItem> getItems() { ... }
+ * }
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='jc'>{@link org.apache.juneau.commons.function.BeanSupplier}
+ * <li class='jc'>{@link org.apache.juneau.commons.function.BeanConsumer}
+ * <li class='jc'>{@link org.apache.juneau.commons.function.BeanChannel}
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ Class<?> elementType() default void.class;
+
+ /**
+ * Bean factory class for this property's value.
+ *
+ * <p>
+ * Specifies a {@link org.apache.juneau.commons.function.BeanFactory} class to use when instantiating
+ * the value of this specific bean property, overriding the class-level {@link BeanType#factory()} if present.
+ *
+ * <p>
+ * When a factory class is specified, the framework resolves it in the following order:
+ * <ol>
+ * <li>Look up the factory class in the configured {@link org.apache.juneau.commons.inject.BeanStore}
+ * <li>Attempt direct instantiation via no-arg constructor or {@code getInstance()} static method
+ * <li>Throw {@link IllegalArgumentException} if both fail
+ * </ol>
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> MyBean {
+ * <ja>@BeanProp</ja>(factory=ItemChannelFactory.<jk>class</jk>, elementType=Item.<jk>class</jk>)
+ * <jk>public</jk> BeanChannel<Item> getItems() { ... }
+ * }
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='jc'>{@link org.apache.juneau.commons.function.BeanFactory}
+ * <li class='ja'>{@link BeanType#factory()}
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ @SuppressWarnings({
+ "rawtypes" // Raw BeanFactory type required for annotation attribute declaration
+ })
+ Class<? extends org.apache.juneau.commons.function.BeanFactory> factory() default org.apache.juneau.commons.function.BeanFactory.Void.class;
+
+ /**
+ * Identifies the name of the property.
+ *
+ * <p>
+ * Normally, this is automatically inferred from the field name or getter method name of the property.
+ * However, this property can be used to assign a different property name from the automatically inferred value.
+ *
+ * <h5 class='topic'>Dynamic beans</h5>
+ * <p>
+ * On a <strong>field</strong> whose type is not a {@link Map}, <js>"*"</js> does not create a dynamic property:
+ * the property name is the field name (same as omitting {@code name}/{@code value}), while other attributes on
+ * this annotation still apply.
+ * </p>
+ * <p>
+ * The bean property named <js>"*"</js> is the designated "dynamic property" which allows for "extra" bean
+ * properties not otherwise defined.
+ *
+ * <p>
+ * The following examples show how to define dynamic bean properties.
+ * <p class='bjava'>
+ * <jc>// Option #1 - A simple public Map field.
+ * // The field name can be anything.</jc>
+ * <jk>public class</jk> BeanWithDynaField {
+ *
+ * <ja>@BeanProp</ja>(name=<js>"*"</js>)
+ * <jk>public</jk> Map<String,Object> <jf>extraStuff</jf> = <jk>new</jk> LinkedHashMap<>();
+ * }
+ *
+ * <jc>// Option #2 - Getters and setters.
+ * // Method names can be anything.
+ * // Getter must return a Map with String keys.
+ * // Setter must take in two arguments.</jc>
+ * <jk>public class</jk> BeanWithDynaMethods {
+ *
+ * <ja>@BeanProp</ja>(name=<js>"*"</js>)
+ * <jk>public</jk> Map<String,Object> getMyExtraStuff() {
+ * ...
+ * }
+ *
+ * <ja>@BeanProp</ja>(name=<js>"*"</js>)
+ * <jk>public void</jk> setAnExtraField(String <jv>name</jv>, Object <jv>value</jv>) {
+ * ...
+ * }
+ * }
+ * </p>
+ *
+ * <div class='info'>
+ * Note that the {@link org.apache.juneau.annotation.Name @Name} annotation can also be used for identifying a property name.
+ * </div>
+ *
+ * @return The annotation value.
+ */
+ String name() default "";
+
+ /**
+ * For bean properties of maps and collections, this annotation can be used to identify the class types of the
+ * contents of the bean property object when the generic parameter types are interfaces or abstract classes.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> MyBean {
+ *
+ * <jc>// Identify concrete map type with String keys and Integer values.</jc>
+ * <ja>@BeanProp</ja>(type=HashMap.<jk>class</jk>, params={String.<jk>class</jk>,Integer.<jk>class</jk>})
+ * <jk>public</jk> Map <jf>p1</jf>;
+ * }
+ * </p>
+ *
+ * @return The annotation value.
+ */
+ Class<?>[] params() default {};
+
+ /**
+ * Identifies a property as read-only.
+ *
+ * <p>
+ * Serializers will serialize such properties as usual, but parsers will silently ignore them.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> MyBean {
+ * <ja>@BeanProp</ja>(ro=<js>"true"</js>)
+ * <jk>public float</jk> <jf>price</jf>;
+ * }
+ * </p>
+ *
+ * <h5 class='section'>Notes:</h5><ul>
+ * <li class='note'>
+ * <b>Java Records:</b> Marking record components as read-only is not supported during parsing.
+ * Because records are immutable, all components must be provided to the canonical constructor.
+ * Read-only components will be serialized as usual, but the parser will be unable to instantiate the
+ * record if the read-only component values are missing from the input.
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ String ro() default "";
+
+ /**
+ * Identifies a specialized class type for the property.
+ *
+ * <p>
+ * Normally this can be inferred through reflection of the field type or getter return type.
+ * However, you'll want to specify this value if you're parsing beans where the bean property class is an interface
+ * or abstract class to identify the bean type to instantiate.
+ * Otherwise, you may cause an {@link InstantiationException} when trying to set these fields.
+ *
+ * <p>
+ * This property must denote a concrete bean class with a no-arg constructor.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> MyBean {
+ *
+ * <jc>// Identify concrete map type.</jc>
+ * <ja>@BeanProp</ja>(type=HashMap.<jk>class</jk>)
+ * <jk>public</jk> Map <jf>p1</jf>;
+ * }
+ * </p>
+ *
+ * @return The annotation value.
+ */
+ Class<?> type() default void.class;
+
+ /**
+ * A synonym for {@link #name()}.
+ *
+ * <p>
+ * The following annotations are equivalent:
+ *
+ * <p class='bjava'>
+ * <ja>@BeanProp</ja>(name=<js>"foo"</js>)
+ *
+ * <ja>@BeanProp</ja>(<js>"foo"</js>)
+ * </p>
+ *
+ * @return The annotation value.
+ */
+ String value() default "";
+
+ /**
+ * Identifies a property as write-only.
+ *
+ * <p>
+ * Parsers will parse such properties as usual, but serializers will silently ignore them.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <jk>public class</jk> MyBean {
+ * <ja>@BeanProp</ja>(wo=<js>"true"</js>)
+ * <jk>public float</jk> <jf>price</jf>;
+ * }
+ * </p>
+ *
+ * @return The annotation value.
+ */
+ String wo() default "";
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanPropAnnotation.java
similarity index 60%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanPropAnnotation.java
index 19bc7f6ac1..69ab1062c5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanPropAnnotation.java
@@ -14,45 +14,51 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import java.lang.annotation.*;
-
import org.apache.juneau.commons.annotation.*;
import org.apache.juneau.commons.function.*;
/**
- * Utility classes and methods for the {@link MarshalledProp @MarshalledProp} annotation.
+ * Utility classes and methods for the {@link BeanProp @BeanProp} annotation.
+ *
+ * <p>
+ * Provides a {@link Builder} that constructs a synthetic {@link BeanProp @BeanProp} annotation instance
+ * programmatically without requiring it to be declared on a program element at compile time.
+ *
+ * <p>
+ * Phase 2 of the bean-layer split keeps this builder pure-data: it captures the annotation attribute
+ * values and produces an annotation instance that is functionally equivalent to a declared one, but
+ * does <i>not</i> apply itself to a marshalling context. The application logic remains in
+ * <c>juneau-marshall</c> (see {@code MarshalledPropAnnotation} and {@code BeanPropApplyAnnotation})
+ * until later phases move that machinery down into <c>juneau-commons</c>.
*
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanProp}
+ * <li class='jc'>{@link AnnotationObject}
+ * </ul>
*/
-public class MarshalledPropAnnotation {
+public class BeanPropAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledPropAnnotation() {}
+ private BeanPropAnnotation() {}
/**
* Builder class.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
- * </ul>
*/
public static class Builder extends AnnotationObject.Builder {
private String[] description = {};
private Class<?> type = void.class;
private Class<?> elementType = void.class;
- private Class<?>[] dictionary = new Class[0];
private Class<?>[] params = new Class[0];
@SuppressWarnings("rawtypes")
private Class<? extends BeanFactory> factory = BeanFactory.Void.class;
- private String format = "";
private String name = "";
- private String properties = "";
private String ro = "";
private String value = "";
private String wo = "";
@@ -61,15 +67,15 @@ public class MarshalledPropAnnotation {
* Constructor.
*/
protected Builder() {
- super(MarshalledProp.class);
+ super(BeanProp.class);
}
/**
- * Instantiates a new {@link MarshalledProp @MarshalledProp} object initialized with this builder.
+ * Instantiates a new {@link BeanProp @BeanProp} object initialized with this builder.
*
- * @return A new {@link MarshalledProp @MarshalledProp} object.
+ * @return A new {@link BeanProp @BeanProp} object.
*/
- public MarshalledProp build() {
+ public BeanProp build() {
return new Object(this);
}
@@ -85,18 +91,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#dictionary()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder dictionary(Class<?>...value) {
- dictionary = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#elementType()} property on this annotation.
+ * Sets the {@link BeanProp#elementType()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -107,7 +102,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#factory()} property on this annotation.
+ * Sets the {@link BeanProp#factory()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -119,18 +114,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#format()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder format(String value) {
- format = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#name()} property on this annotation.
+ * Sets the {@link BeanProp#name()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -141,7 +125,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#params()} property on this annotation.
+ * Sets the {@link BeanProp#params()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -152,18 +136,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#properties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder properties(String value) {
- properties = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#ro()} property on this annotation.
+ * Sets the {@link BeanProp#ro()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -174,7 +147,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#type()} property on this annotation.
+ * Sets the {@link BeanProp#type()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -185,7 +158,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#value()} property on this annotation.
+ * Sets the {@link BeanProp#value()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -196,7 +169,7 @@ public class MarshalledPropAnnotation {
}
/**
- * Sets the {@link MarshalledProp#wo()} property on this annotation.
+ * Sets the {@link BeanProp#wo()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -211,102 +184,81 @@ public class MarshalledPropAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AnnotationObject implements MarshalledProp {
+ private static class Object extends AnnotationObject implements BeanProp {
private final String[] description;
private final Class<?> type;
private final Class<?> elementType;
private final Class<?>[] params;
- private final Class<?>[] dictionary;
@SuppressWarnings("rawtypes")
private final Class<? extends BeanFactory> factory;
private final String name;
private final String value;
- private final String properties;
- private final String format;
private final String ro;
private final String wo;
- Object(MarshalledPropAnnotation.Builder b) {
+ Object(BeanPropAnnotation.Builder b) {
super(b);
description = copyOf(b.description);
- dictionary = copyOf(b.dictionary);
elementType = b.elementType;
factory = b.factory;
- format = b.format;
name = b.name;
params = copyOf(b.params);
- properties = b.properties;
ro = b.ro;
type = b.type;
value = b.value;
wo = b.wo;
}
- @Override /* Overridden from MarshalledProp */
- public Class<?>[] dictionary() {
- return dictionary;
+ @Override /* Overridden from BeanProp */
+ public String[] description() {
+ return description;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public Class<?> elementType() {
return elementType;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
@SuppressWarnings("rawtypes")
public Class<? extends BeanFactory> factory() {
return factory;
}
- @Override /* Overridden from MarshalledProp */
- public String format() {
- return format;
- }
-
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public String name() {
return name;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public Class<?>[] params() {
return params;
}
- @Override /* Overridden from MarshalledProp */
- public String properties() {
- return properties;
- }
-
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public String ro() {
return ro;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public Class<?> type() {
return type;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public String value() {
return value;
}
- @Override /* Overridden from MarshalledProp */
+ @Override /* Overridden from BeanProp */
public String wo() {
return wo;
}
-
- @Override /* Overridden from annotation */
- public String[] description() {
- return description;
- }
}
/** Default value */
- public static final MarshalledProp DEFAULT = create().build();
+ public static final BeanProp DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -316,4 +268,4 @@ public class MarshalledPropAnnotation {
public static Builder create() {
return new Builder();
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
index e5642f8654..b101d881dc 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
@@ -16,6 +16,7 @@
*/
package org.apache.juneau.commons.function;
+import org.apache.juneau.commons.bean.*;
/**
* A universal factory interface used with <ja>@Marshalled</ja><c>(factory=X.class)</c> for any bean type the
* framework needs to instantiate.
@@ -75,7 +76,7 @@ public interface BeanFactory<T> {
/**
* Sentinel class used as the default value for {@code @BeanType(factory=...)} and
- * {@code @MarshalledProp(factory=...)} when no factory is specified.
+ * {@code @BeanProp(factory=...)} when no factory is specified.
*/
@SuppressWarnings({
"rawtypes" // Raw type required for use as annotation sentinel
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/ListBeanChannel.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/ListBeanChannel.java
index 56f5e50b00..4563b49a66 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/ListBeanChannel.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/ListBeanChannel.java
@@ -36,7 +36,7 @@ import java.util.*;
* <jk>public class</jk> ItemCollection {
* <jk>private final</jk> ListBeanChannel<Item> <jv>items</jv> = <jk>new</jk> ListBeanChannel<>();
*
- * <ja>@MarshalledProp</ja>(elementType=Item.<jk>class</jk>)
+ * <ja>@BeanProp</ja>(elementType=Item.<jk>class</jk>)
* <jk>public</jk> ListBeanChannel<Item> getItems() { <jk>return</jk> <jv>items</jv>; }
* <jc>// No setter needed — parser calls acceptThrows() on the existing instance</jc>
* }
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
index 0e52063f69..29fba605b8 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
@@ -287,7 +287,7 @@
* <jk>private final</jk> ListBeanChannel<Employee> <jv>employees</jv> = <jk>new</jk> ListBeanChannel<>();
*
* <jc>// No setter needed — parser calls acceptThrows() on the existing instance.</jc>
- * <ja>@MarshalledProp</ja>(elementType=Employee.<jk>class</jk>)
+ * <ja>@BeanProp</ja>(elementType=Employee.<jk>class</jk>)
* <jk>public</jk> ListBeanChannel<Employee> getEmployees() { <jk>return</jk> <jv>employees</jv>; }
* }
*
@@ -448,12 +448,12 @@
* <td>Specifies the {@link org.apache.juneau.commons.function.BeanFactory} class used to instantiate this type during parsing. The factory is resolved from the {@code BeanStore}.</td>
* </tr>
* <tr>
- * <td>{@code @MarshalledProp(factory=X.class)}</td>
+ * <td>{@code @BeanProp(factory=X.class)}</td>
* <td>Bean property</td>
* <td>Specifies a property-level factory for instantiating the value of a specific bean property.</td>
* </tr>
* <tr>
- * <td>{@code @MarshalledProp(elementType=Y.class)}</td>
+ * <td>{@code @BeanProp(elementType=Y.class)}</td>
* <td>Bean property</td>
* <td>Declares the element type for generic streaming properties ({@code Stream<Y>}, {@code BeanSupplier<Y>}, etc.) overcoming Java type erasure. Also supports narrowing to concrete implementation types.</td>
* </tr>
@@ -494,3 +494,5 @@
* </div>
*/
package org.apache.juneau.commons.function;
+
+import org.apache.juneau.commons.bean.*;
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
index 1fc104274f..5c3c064363 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
@@ -28,6 +28,7 @@ import java.util.function.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.json5.*;
@@ -368,7 +369,7 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
*
* <p>
* Triggers bean creation if bean has read-only properties set through a constructor defined by the
- * {@link MarshalledCtor @MarshalledCtor} annotation.
+ * {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation.
*
* @return The inner bean object.
*/
@@ -409,7 +410,7 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
*
* <p>
* If <c>create</c> is <jk>false</jk>, then this method may return <jk>null</jk> if the bean has read-only
- * properties set through a constructor defined by the {@link MarshalledCtor @MarshalledCtor} annotation.
+ * properties set through a constructor defined by the {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation.
*
* <p>
* This method does NOT always return the bean in it's final state.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
index 3ea5606878..5e73b2ae68 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
@@ -61,7 +61,7 @@ import org.apache.juneau.commons.bean.*;
* <ul>
* <li>Public fields (same order as {@code Class.getFields()}).
* <li>Properties returned by {@code BeanInfo.getPropertyDescriptors()}.
- * <li>Non-standard getters/setters with {@link MarshalledProp @MarshalledProp} annotation defined on them.
+ * <li>Non-standard getters/setters with {@link BeanProp @BeanProp} annotation defined on them.
* </ul>
* </ul>
*
@@ -243,18 +243,18 @@ public class BeanMeta<T> {
}
/*
- * Extracts the property name from {@link MarshalledProp @MarshalledProp} or {@link Name @Name} annotations.
+ * Extracts the property name from {@link BeanProp @BeanProp} or {@link Name @Name} annotations.
*
* <p>
* If {@link Name @Name} annotations are present, returns the value from the last one.
- * Otherwise, searches through {@link MarshalledProp @MarshalledProp} annotations and returns the first non-empty
- * {@link MarshalledProp#value() value()} or {@link MarshalledProp#name() name()} found.
+ * Otherwise, searches through {@link BeanProp @BeanProp} annotations and returns the first non-empty
+ * {@link BeanProp#value() value()} or {@link BeanProp#name() name()} found.
*
- * @param p List of {@link MarshalledProp @MarshalledProp} annotations.
+ * @param p List of {@link BeanProp @BeanProp} annotations.
* @param n List of {@link Name @Name} annotations.
* @return The property name, or <jk>null</jk> if no name is found.
*/
- private static String bpName(List<MarshalledProp> p, List<Name> n) {
+ private static String bpName(List<BeanProp> p, List<Name> n) {
if (p.isEmpty() && n.isEmpty())
return null;
if (! n.isEmpty())
@@ -312,13 +312,13 @@ public class BeanMeta<T> {
}
/*
- * Extracts the property name from a single {@link MarshalledProp @MarshalledProp} or {@link Name @Name} annotation.
+ * Extracts the property name from a single {@link BeanProp @BeanProp} or {@link Name @Name} annotation.
*
* <p>
- * For {@link MarshalledProp @MarshalledProp} annotations, returns the first non-empty value found in the following order:
+ * For {@link BeanProp @BeanProp} annotations, returns the first non-empty value found in the following order:
* <ol>
- * <li>{@link MarshalledProp#name() name()}
- * <li>{@link MarshalledProp#value() value()}
+ * <li>{@link BeanProp#name() name()}
+ * <li>{@link BeanProp#value() value()}
* </ol>
*
* <p>
@@ -328,13 +328,13 @@ public class BeanMeta<T> {
* This method is used to extract property names from individual annotations, typically when processing
* annotation lists in stream operations.
*
- * @param ai The annotation info containing either a {@link MarshalledProp @MarshalledProp} or {@link Name @Name} annotation.
+ * @param ai The annotation info containing either a {@link BeanProp @BeanProp} or {@link Name @Name} annotation.
* @return The property name extracted from the annotation, or <jk>null</jk> if no name is found.
* @see #bpName(List, List)
*/
private static String name(AnnotationInfo<?> ai) {
- if (ai.isType(MarshalledProp.class)) {
- var p = ai.cast(MarshalledProp.class).inner();
+ if (ai.isType(BeanProp.class)) {
+ var p = ai.cast(BeanProp.class).inner();
if (ne(p.name()))
return p.name();
if (ne(p.value()))
@@ -459,7 +459,7 @@ public class BeanMeta<T> {
findBeanFields().forEach(x -> {
var name = ap.find(x).stream()
- .filter(x2 -> x2.isType(MarshalledProp.class) || x2.isType(Name.class))
+ .filter(x2 -> x2.isType(BeanProp.class) || x2.isType(Name.class))
.map(BeanMeta::name)
.filter(Objects::nonNull)
.findFirst()
@@ -482,9 +482,9 @@ public class BeanMeta<T> {
if (x.methodType == GETTER) {
// Two getters. Pick the best.
if (nn(bpm.getter)
- && ((! ap.has(MarshalledProp.class, mi) && ap.has(MarshalledProp.class, bpm.getter))
+ && ((! ap.has(BeanProp.class, mi) && ap.has(BeanProp.class, bpm.getter))
|| (m.getName().startsWith("is") && bpm.getter.getNameSimple().startsWith("get")))) {
- // @MarshalledProp on existing getter takes precedence; else getX() overrides isX().
+ // @BeanProp on existing getter takes precedence; else getX() overrides isX().
m = bpm.getter.inner();
}
bpm.setGetter(info(m));
@@ -541,7 +541,7 @@ public class BeanMeta<T> {
for (var fp : beanConstructor.args()) {
var m = normalProps.get(fp);
if (m == null)
- throw bex(c, "The property ''{0}'' was defined on the @MarshalledCtor(properties=X) annotation but was not found on the class definition.", fp);
+ throw bex(c, "The property ''{0}'' was defined on the @BeanCtor(properties=X) annotation but was not found on the class definition.", fp);
m.setAsConstructorArg();
}
@@ -819,7 +819,7 @@ public class BeanMeta<T> {
* <p>
* The constructor is determined by {@link #findBeanConstructor()} and may be:
* <ul>
- * <li>A constructor annotated with {@link MarshalledCtor @MarshalledCtor}
+ * <li>A constructor annotated with {@link BeanCtor @BeanCtor}
* <li>An implementation class constructor (if provided)
* <li>A no-argument constructor
* <li><jk>null</jk> if no suitable constructor was found
@@ -843,7 +843,7 @@ public class BeanMeta<T> {
* <p>
* The property names are determined from:
* <ul>
- * <li>The {@link MarshalledCtor#properties() properties()} value in the {@link MarshalledCtor @MarshalledCtor} annotation (if present)
+ * <li>The {@link BeanCtor#properties() properties()} value in the {@link BeanCtor @BeanCtor} annotation (if present)
* <li>Otherwise, the parameter names from the constructor (if available in bytecode)
* </ul>
*
@@ -907,7 +907,7 @@ public class BeanMeta<T> {
* A bean has a constructor if {@link #findBeanConstructor()} was able to find a suitable constructor,
* which may be:
* <ul>
- * <li>A constructor annotated with {@link MarshalledCtor @MarshalledCtor}
+ * <li>A constructor annotated with {@link BeanCtor @BeanCtor}
* <li>An implementation class constructor (if provided)
* <li>A no-argument constructor
* </ul>
@@ -988,13 +988,13 @@ public class BeanMeta<T> {
* <p>
* This method searches for a constructor in the following order of precedence:
* <ol>
- * <li><b>{@link MarshalledCtor @MarshalledCtor} annotated constructor:</b> If a constructor is annotated with {@link MarshalledCtor @MarshalledCtor},
+ * <li><b>{@link BeanCtor @BeanCtor} annotated constructor:</b> If a constructor is annotated with {@link BeanCtor @BeanCtor},
* it is used. The property names are determined from:
* <ul>
- * <li>The {@link MarshalledCtor#properties() properties()} value in the annotation, if specified
+ * <li>The {@link BeanCtor#properties() properties()} value in the annotation, if specified
* <li>Otherwise, the parameter names from the constructor (if available in bytecode)
* </ul>
- * If multiple constructors are annotated with {@link MarshalledCtor @MarshalledCtor}, an exception is thrown.
+ * If multiple constructors are annotated with {@link BeanCtor @BeanCtor}, an exception is thrown.
* <li><b>Implementation class constructor:</b> If an {@link #implClassConstructor} was provided during bean
* metadata creation, it is used with an empty property list.
* <li><b>No-arg constructor:</b> Searches for a no-argument constructor. The visibility required depends on
@@ -1014,8 +1014,8 @@ public class BeanMeta<T> {
* </ul>
*
* @return A {@link BeanConstructor} containing the found constructor and its associated property names.
- * @throws BeanRuntimeException If multiple constructors are annotated with {@link MarshalledCtor @MarshalledCtor}, or if
- * the number of properties specified in {@link MarshalledCtor @MarshalledCtor} doesn't match the number of constructor parameters,
+ * @throws BeanRuntimeException If multiple constructors are annotated with {@link BeanCtor @BeanCtor}, or if
+ * the number of properties specified in {@link BeanCtor @BeanCtor} doesn't match the number of constructor parameters,
* or if parameter names cannot be determined from the bytecode.
*/
@SuppressWarnings({
@@ -1026,17 +1026,17 @@ public class BeanMeta<T> {
var vis = marshallingContext.getBeanConstructorVisibility();
var ci = classMeta;
- var l = ci.getPublicConstructors().stream().filter(x -> ap.has(MarshalledCtor.class, x)).toList();
+ var l = ci.getPublicConstructors().stream().filter(x -> ap.has(BeanCtor.class, x)).toList();
if (l.isEmpty())
- l = ci.getDeclaredConstructors().stream().filter(x -> ap.has(MarshalledCtor.class, x)).toList();
+ l = ci.getDeclaredConstructors().stream().filter(x -> ap.has(BeanCtor.class, x)).toList();
if (l.size() > 1)
- throw bex(ci, "Multiple instances of '@MarshalledCtor' found.");
+ throw bex(ci, "Multiple instances of '@BeanCtor' found.");
if (l.size() == 1) {
var con = first(l).orElseThrow(() -> bex(ci, "No constructor found.")).accessible();
- var args = ap.find(MarshalledCtor.class, con).stream().map(x -> x.inner().properties()).filter(StringUtils::isNotBlank).map(x -> split(x)).findFirst().orElse(liste());
+ var args = ap.find(BeanCtor.class, con).stream().map(x -> x.inner().properties()).filter(StringUtils::isNotBlank).map(x -> split(x)).findFirst().orElse(liste());
if (! con.hasNumParameters(args.size())) {
if (ne(args))
- throw bex(ci, "Number of properties defined in '@MarshalledCtor' annotation does not match number of parameters in constructor.");
+ throw bex(ci, "Number of properties defined in '@BeanCtor' annotation does not match number of parameters in constructor.");
args = con.getParameters().stream().map(x -> x.getName()).toList();
for (int i = 0; i < args.size(); i++) {
if (isBlank(args.get(i)))
@@ -1067,17 +1067,17 @@ public class BeanMeta<T> {
}
/**
- * Resolves the bean property name for a field when {@link MarshalledProp @MarshalledProp} or {@link Name @Name} supplies
+ * Resolves the bean property name for a field when {@link BeanProp @BeanProp} or {@link Name @Name} supplies
* <js>"*"</js>.
*
* <p>
* On a {@link Map} field, <js>"*"</js> remains the dyna-property name. On any other field type, <js>"*"</js> is
- * treated like an unnamed {@code @MarshalledProp} (apply other attributes) but the property name is taken from the field
+ * treated like an unnamed {@code @BeanProp} (apply other attributes) but the property name is taken from the field
* (via {@link PropertyNamer#getPropertyName(String)}).
* </p>
*
* @param x Field being registered.
- * @param nameFromAnnotations Name from {@code @MarshalledProp}/{@code @Name}, or already-resolved default from the field name.
+ * @param nameFromAnnotations Name from {@code @BeanProp}/{@code @Name}, or already-resolved default from the field name.
* @param propertyNamer Namer for raw field names.
* @return Property key to use in {@link BeanMeta}.
*/
@@ -1100,7 +1100,7 @@ public class BeanMeta<T> {
* <li>Not transient (unless transient fields are not ignored)
* <li>Not annotated with {@link Transient @Transient} (unless transient fields are not ignored)
* <li>Not annotated with {@link MarshalledIgnore @MarshalledIgnore}
- * <li>Visible according to the specified visibility level, or annotated with {@link MarshalledProp @MarshalledProp}
+ * <li>Visible according to the specified visibility level, or annotated with {@link BeanProp @BeanProp}
* </ul>
*
* @return A collection of all bean fields found in the class hierarchy.
@@ -1120,7 +1120,7 @@ public class BeanMeta<T> {
&& (x.isNotTransient() || noIgnoreTransients)
&& (! x.hasAnnotation(Transient.class) || noIgnoreTransients)
&& ! ap.has(MarshalledIgnore.class, x)
- && (v.isVisible(x.inner()) || ap.has(MarshalledProp.class, x)
+ && (v.isVisible(x.inner()) || ap.has(BeanProp.class, x)
|| (isRecord && recordComponentNames.contains(x.getName()))))
.toList();
// @formatter:on
@@ -1137,18 +1137,18 @@ public class BeanMeta<T> {
* <ul>
* <li><c>getX()</c> - standard getter pattern
* <li><c>isX()</c> - boolean getter pattern (returns boolean or Boolean)
- * <li>Methods annotated with {@link MarshalledProp @MarshalledProp} or {@link Name @Name}
- * <li>Methods with {@link MarshalledProp @MarshalledProp} annotation with value <js>"*"</js> that return a Map
+ * <li>Methods annotated with {@link BeanProp @BeanProp} or {@link Name @Name}
+ * <li>Methods with {@link BeanProp @BeanProp} annotation with value <js>"*"</js> that return a Map
* </ul>
* <li><b>Setters:</b> Methods with one parameter that match patterns like:
* <ul>
* <li><c>setX(value)</c> - standard setter pattern
* <li><c>withX(value)</c> - fluent setter pattern (returns the bean type)
- * <li>Methods annotated with {@link MarshalledProp @MarshalledProp} or {@link Name @Name}
- * <li>Methods with {@link MarshalledProp @MarshalledProp} annotation with value <js>"*"</js> that accept a Map
+ * <li>Methods annotated with {@link BeanProp @BeanProp} or {@link Name @Name}
+ * <li>Methods with {@link BeanProp @BeanProp} annotation with value <js>"*"</js> that accept a Map
* <li>Fluent setters (if enabled) - methods that return the bean type and accept one parameter
* </ul>
- * <li><b>ExtraKeys:</b> Methods with {@link MarshalledProp @MarshalledProp} annotation with value <js>"*"</js> that return a Collection
+ * <li><b>ExtraKeys:</b> Methods with {@link BeanProp @BeanProp} annotation with value <js>"*"</js> that return a Collection
* </ul>
*
* <p>
@@ -1158,13 +1158,13 @@ public class BeanMeta<T> {
* <li>Parameter count ≤ 2
* <li>Not annotated with {@link MarshalledIgnore @MarshalledIgnore}
* <li>Not annotated with {@link Transient @Transient}
- * <li>Visible according to the specified visibility level, or annotated with {@link MarshalledProp @MarshalledProp} or {@link Name @Name}
+ * <li>Visible according to the specified visibility level, or annotated with {@link BeanProp @BeanProp} or {@link Name @Name}
* </ul>
*
* <p>
* Property names are determined from:
* <ul>
- * <li>{@link MarshalledProp @MarshalledProp} or {@link Name @Name} annotations (if present)
+ * <li>{@link BeanProp @BeanProp} or {@link Name @Name} annotations (if present)
* <li>Otherwise, derived from the method name using the provided {@link PropertyNamer}
* </ul>
*
@@ -1184,7 +1184,7 @@ public class BeanMeta<T> {
classHierarchy.get().stream().forEach(c2 -> {
for (var m : c2.getDeclaredMethods()) {
var mm = m.getMatchingMethods();
- var beanps = ap.find(MarshalledProp.class, m).stream().map(AnnotationInfo::inner).toList();
+ var beanps = ap.find(BeanProp.class, m).stream().map(AnnotationInfo::inner).toList();
var names = ap.find(Name.class, m).stream().map(AnnotationInfo::inner).toList();
// Skip static, bridge, or methods with >2 params; skip if ignored, transient, or not visible
if (m.isStatic() || m.isBridge() || m.getParameterCount() > 2
@@ -1266,7 +1266,7 @@ public class BeanMeta<T> {
n = pn.getPropertyName(n);
if ("*".equals(bpName) && methodType == UNKNOWN)
- throw bex(ci, "Found @MarshalledProp(\"*\") but could not determine method type on method ''{0}''.", m.getNameSimple());
+ throw bex(ci, "Found @BeanProp(\"*\") but could not determine method type on method ''{0}''.", m.getNameSimple());
if (methodType != UNKNOWN) {
if (nn(bpName) && ! bpName.isEmpty())
@@ -1489,7 +1489,7 @@ public class BeanMeta<T> {
if (! fieldMarshalledIgnoreIgnoresAccessors(x))
continue;
var name = ap.find(x).stream()
- .filter(x2 -> x2.isType(MarshalledProp.class) || x2.isType(Name.class))
+ .filter(x2 -> x2.isType(BeanProp.class) || x2.isType(Name.class))
.map(BeanMeta::name)
.filter(Objects::nonNull)
.findFirst()
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
index ac0047aca3..72f1a580fc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
@@ -34,6 +34,7 @@ import java.util.stream.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.commons.lang.*;
import org.apache.juneau.commons.reflect.*;
@@ -165,7 +166,7 @@ public class BeanPropertyMeta implements Comparable<BeanPropertyMeta> {
return this;
}
- private static ObjectSwap beanpSwap(AnnotationInfo<MarshalledProp> ai) {
+ private static ObjectSwap marshalledPropSwap(AnnotationInfo<MarshalledProp> ai) {
var p = ai.inner();
if (! p.format().isEmpty())
return BeanInstantiator.of(ObjectSwap.class).type(StringFormatSwap.class).addBean(String.class, p.format()).run();
@@ -321,66 +322,78 @@ public class BeanPropertyMeta implements Comparable<BeanPropertyMeta> {
var si = setter;
if (nn(innerField)) {
- var lp = ap.find(MarshalledProp.class, ifi);
- if (nn(field) || ne(lp)) {
- // Only use field type if it's a bean property or has @MarshalledProp annotation.
+ var lbp = ap.find(BeanProp.class, ifi);
+ var lmp = ap.find(MarshalledProp.class, ifi);
+ if (nn(field) || ne(lbp)) {
+ // Only use field type if it's a bean property or has @BeanProp annotation.
// Otherwise, we want to infer the type from the getter or setter.
- rawTypeMeta = bc.resolveClassMeta(opt(last(lp)).orElse(null), innerField.getFieldType(), typeVarImpls);
+ rawTypeMeta = bc.resolveClassMeta(opt(last(lbp)).orElse(null), innerField.getFieldType(), typeVarImpls);
isUri |= (rawTypeMeta.isUri());
}
- lp.forEach(x -> {
+ lbp.forEach(x -> {
var beanp = x.inner();
- if (swap == null)
- swap = beanpSwap(x);
- if (ne(beanp.properties()))
- properties = split(beanp.properties());
- bdClasses.addAll(l(beanp.dictionary()));
if (ne(beanp.ro()))
readOnly = bool(beanp.ro());
if (ne(beanp.wo()))
writeOnly = bool(beanp.wo());
});
+ lmp.forEach(x -> {
+ var beanp = x.inner();
+ if (swap == null)
+ swap = marshalledPropSwap(x);
+ if (ne(beanp.properties()))
+ properties = split(beanp.properties());
+ bdClasses.addAll(l(beanp.dictionary()));
+ });
ap.find(Swap.class, ifi).stream().findFirst().ifPresent(x -> swap = swapSwap(x));
isUri |= ap.has(Uri.class, ifi);
}
if (nn(getter)) {
- var lp = ap.find(MarshalledProp.class, gi);
+ var lbp = ap.find(BeanProp.class, gi);
+ var lmp = ap.find(MarshalledProp.class, gi);
if (rawTypeMeta == null)
- rawTypeMeta = bc.resolveClassMeta(opt(last(lp)).orElse(null), getter.getReturnType(), typeVarImpls);
+ rawTypeMeta = bc.resolveClassMeta(opt(last(lbp)).orElse(null), getter.getReturnType(), typeVarImpls);
isUri |= (rawTypeMeta.isUri() || ap.has(Uri.class, gi));
- lp.forEach(x -> {
+ lbp.forEach(x -> {
var beanp = x.inner();
- if (swap == null)
- swap = beanpSwap(x);
- if (nn(properties) && ne(beanp.properties()))
- properties = split(beanp.properties());
- bdClasses.addAll(l(beanp.dictionary()));
if (ne(beanp.ro()))
readOnly = bool(beanp.ro());
if (ne(beanp.wo()))
writeOnly = bool(beanp.wo());
});
+ lmp.forEach(x -> {
+ var beanp = x.inner();
+ if (swap == null)
+ swap = marshalledPropSwap(x);
+ if (nn(properties) && ne(beanp.properties()))
+ properties = split(beanp.properties());
+ bdClasses.addAll(l(beanp.dictionary()));
+ });
ap.find(Swap.class, gi).stream().forEach(x -> swap = swapSwap(x));
}
if (nn(setter)) {
- var lp = ap.find(MarshalledProp.class, si);
+ var lbp = ap.find(BeanProp.class, si);
+ var lmp = ap.find(MarshalledProp.class, si);
if (rawTypeMeta == null)
- rawTypeMeta = bc.resolveClassMeta(opt(last(lp)).orElse(null), setter.getParameterTypes().get(0), typeVarImpls);
+ rawTypeMeta = bc.resolveClassMeta(opt(last(lbp)).orElse(null), setter.getParameterTypes().get(0), typeVarImpls);
isUri |= (rawTypeMeta.isUri() || ap.has(Uri.class, si));
- lp.forEach(x -> {
+ lbp.forEach(x -> {
var beanp = x.inner();
- if (swap == null)
- swap = beanpSwap(x);
- if (nn(properties) && ne(beanp.properties()))
- properties = split(beanp.properties());
- bdClasses.addAll(l(beanp.dictionary()));
if (ne(beanp.ro()))
readOnly = bool(beanp.ro());
if (ne(beanp.wo()))
writeOnly = bool(beanp.wo());
});
+ lmp.forEach(x -> {
+ var beanp = x.inner();
+ if (swap == null)
+ swap = marshalledPropSwap(x);
+ if (nn(properties) && ne(beanp.properties()))
+ properties = split(beanp.properties());
+ bdClasses.addAll(l(beanp.dictionary()));
+ });
ap.find(Swap.class, si).stream().forEach(x -> swap = swapSwap(x));
}
@@ -494,7 +507,7 @@ public class BeanPropertyMeta implements Comparable<BeanPropertyMeta> {
private final ClassMeta<?> rawTypeMeta; // The real class type of the bean property.
private final boolean readOnly; // True if this property is read-only.
private final MethodInfo setter; // The bean property setter.
- private final ObjectSwap swap; // ObjectSwap defined only via @MarshalledProp annotation.
+ private final ObjectSwap swap; // ObjectSwap defined only via @MarshalledProp(format=...) annotation.
private final ClassMeta<?> typeMeta; // The transformed class type of the bean property.
private final boolean writeOnly; // True if this property is write-only.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index 41b8616640..9c51445e85 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -206,8 +206,9 @@ public abstract class Context {
* and passed into the builder class:
* <ul class='javatreec'>
* <li class='ja'>{@link MarshalledAnnotation}
- * <li class='ja'>{@link MarshalledCtorAnnotation}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanCtorAnnotation}
* <li class='ja'>{@link MarshalledIgnoreAnnotation}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanPropAnnotation}
* <li class='ja'>{@link MarshalledPropAnnotation}
* <li class='ja'>{@link ExampleAnnotation}
* <li class='ja'>{@link NamePropertyAnnotation}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
index 50f13cd64f..f3e03db63d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
@@ -30,7 +30,6 @@ import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.inject.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.swap.*;
-import org.apache.juneau.commons.bean.*;
/**
* Filter for customizing how POJOs and beans are handled during serialization and parsing.
@@ -448,7 +447,7 @@ public class MarshalledFilter {
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#readOnlyProperties()}
- * <li class='ja'>{@link MarshalledProp#ro()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp#ro()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(Map)}
@@ -558,7 +557,7 @@ public class MarshalledFilter {
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#writeOnlyProperties()}
- * <li class='ja'>{@link MarshalledProp#wo()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp#wo()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(Map)}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
index 9cb1593d14..a30c4f9b84 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
@@ -484,7 +484,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledCtor @MarshalledCtor} annotation can also be used to expose a non-public constructor.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean constructor to ignore it.
* </ul>
*
@@ -680,7 +680,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used to expose a non-public field.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public field.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
* </ul>
*
@@ -830,7 +830,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used to expose a non-public method.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public method.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
* </ul>
*
@@ -1703,7 +1703,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can be used on the getter to override this setting.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can be used on the getter to override this setting.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters to ignore them as bean properties.
* </ul>
*
@@ -1729,7 +1729,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <p>
* The bean store is used to resolve {@link BeanFactory} instances registered via
- * <ja>@Marshalled</ja><c>(factory=X.class)</c> and <ja>@MarshalledProp</ja><c>(factory=X.class)</c> annotations.
+ * <ja>@BeanType</ja><c>(factory=X.class)</c> and <ja>@BeanProp</ja><c>(factory=X.class)</c> annotations.
* When a factory class is encountered, the framework first looks it up in the bean store
* before attempting direct instantiation.
*
@@ -1961,7 +1961,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used on transient fields to keep them from being ignored.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on transient fields to keep them from being ignored.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -2192,7 +2192,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used on methods to individually identify them as fluent setters.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on methods to individually identify them as fluent setters.
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanType#findFluentSetters() @BeanType.findFluentSetters()} annotation can also be used on classes to specify to look for fluent setters.
* </ul>
*
@@ -4843,7 +4843,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
}
/**
- * Used for determining the class type on a method or field where a {@code @MarshalledProp} annotation may be present.
+ * Used for determining the class type on a method or field where a {@code @BeanProp} annotation may be present.
*
* @param <T> The class type we're wrapping.
* @param p The property annotation info on the type if there is one.
@@ -4857,7 +4857,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
@SuppressWarnings({
"java:S3776" // Cognitive complexity acceptable for ClassMeta resolution with property annotations
})
- protected final <T> ClassMeta<T> resolveClassMeta(AnnotationInfo<MarshalledProp> p, ClassInfo ci, TypeVariables typeVarImpls) {
+ protected final <T> ClassMeta<T> resolveClassMeta(AnnotationInfo<org.apache.juneau.commons.bean.BeanProp> p, ClassInfo ci, TypeVariables typeVarImpls) {
var cm = resolveClassMeta(ci, typeVarImpls);
var cm2 = cm;
@@ -4897,7 +4897,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
return new ClassMeta<>(cm2, null, null, elementType);
}
- // Handle @MarshalledProp(elementType=) for BeanSupplier, BeanConsumer, BeanChannel, and Stream properties.
+ // Handle @BeanProp(elementType=) for BeanSupplier, BeanConsumer, BeanChannel, and Stream properties.
if (isNotVoid(beanp.elementType()) && (cm2.isIterable() || cm2.isStream())) {
var elementType = resolveClassMeta(beanp.elementType(), typeVarImpls);
if (! elementType.isObject())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
index 0b783fee4c..f0f0ff8590 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
@@ -216,7 +216,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledCtor @MarshalledCtor} annotation can also be used to expose a non-public constructor.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean constructor to ignore it.
* </ul>
*
@@ -426,7 +426,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used to expose a non-public field.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public field.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
* </ul>
*
@@ -566,7 +566,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used to expose a non-public method.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public method.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
* </ul>
*
@@ -1411,7 +1411,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can be used on the getter to override this setting.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can be used on the getter to override this setting.
* <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters to ignore them as bean properties.
* </ul>
*
@@ -1603,7 +1603,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used on transient fields to keep them from being ignored.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on transient fields to keep them from being ignored.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1809,7 +1809,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used on methods to individually identify them as fluent setters.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on methods to individually identify them as fluent setters.
* <li class='note'>The {@link Bean#findFluentSetters() @Marshalled.fluentSetters()} annotation can also be used on classes to specify to look for fluent setters.
* </ul>
*
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
index 40b2f332d7..724aa9d8f4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/UriContext.java
@@ -25,6 +25,7 @@ import java.util.function.Supplier;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.parser.*;
@@ -190,7 +191,7 @@ public class UriContext {
* @param pathInfo
* The path info (e.g. <js>"/path-info"</js>, or <js>"path-info"</js>)
*/
- @MarshalledCtor
+ @BeanCtor
public UriContext(@Name("authority") String authority, @Name("contextRoot") String contextRoot, @Name("servletPath") String servletPath, @Name("pathInfo") String pathInfo) {
this.authority = nullIfEmpty(trimSlashes(authority));
this.contextRoot = nullIfEmpty(trimSlashes(contextRoot));
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApply.java
similarity index 75%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApply.java
index 885c650b4b..d18450b780 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApply.java
@@ -21,17 +21,19 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.bean.*;
+
/**
- * Dynamically applies a {@link MarshalledCtor @MarshalledCtor} annotation to specified classes, methods, or fields.
+ * Dynamically applies a {@link BeanCtor @BeanCtor} annotation to specified constructors.
*
* <p>
* This annotation separates the <b>targeting</b> concern ({@link #on()}/{@link #onClass()}) from the
- * <b>content</b> concern ({@link #value()}), enabling {@link MarshalledCtor @MarshalledCtor} to be a pure data annotation
+ * <b>content</b> concern ({@link #value()}), enabling {@link BeanCtor @BeanCtor} to be a pure data annotation
* without marshall-specific application machinery.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
- * <ja>@MarshalledCtorApply</ja>(on=<js>"Person(String,int)"</js>, value=<ja>@MarshalledCtor</ja>(properties=<js>"name,age"</js>))
+ * <ja>@BeanCtorApply</ja>(on=<js>"Person(String,int)"</js>, value=<ja>@BeanCtor</ja>(properties=<js>"name,age"</js>))
* <jk>public class</jk> MyConfig {}
* </p>
*
@@ -42,19 +44,19 @@ import java.lang.annotation.*;
@Documented
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
-@Repeatable(MarshalledCtorApply.Array.class)
-@ContextApply(MarshalledCtorApplyAnnotation.Applier.class)
-public @interface MarshalledCtorApply {
+@Repeatable(BeanCtorApply.Array.class)
+@ContextApply(BeanCtorApplyAnnotation.Applier.class)
+public @interface BeanCtorApply {
/**
- * The {@link MarshalledCtor @MarshalledCtor} annotation to apply.
+ * The {@link BeanCtor @BeanCtor} annotation to apply.
*
* @return The annotation value.
*/
- MarshalledCtor value();
+ BeanCtor value();
/**
- * Dynamically apply this annotation to the specified classes/methods/fields.
+ * Dynamically apply this annotation to the specified constructors.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
@@ -79,7 +81,7 @@ public @interface MarshalledCtorApply {
Class<?>[] onClass() default {};
/**
- * A collection of {@link MarshalledCtorApply @MarshalledCtorApply annotations}.
+ * A collection of {@link BeanCtorApply @BeanCtorApply annotations}.
*/
@Documented
@Target({ TYPE, METHOD })
@@ -91,6 +93,6 @@ public @interface MarshalledCtorApply {
*
* @return The annotation value.
*/
- MarshalledCtorApply[] value();
+ BeanCtorApply[] value();
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApplyAnnotation.java
similarity index 72%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApplyAnnotation.java
index 2990cf3744..6c42e87deb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanCtorApplyAnnotation.java
@@ -23,24 +23,31 @@ import java.lang.reflect.*;
import org.apache.juneau.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
/**
- * Utility classes and methods for the {@link MarshalledCtorApply @MarshalledCtorApply} annotation.
+ * Utility classes and methods for the {@link BeanCtorApply @BeanCtorApply} annotation.
*
*/
-public class MarshalledCtorApplyAnnotation {
+public class BeanCtorApplyAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledCtorApplyAnnotation() {}
+ private BeanCtorApplyAnnotation() {}
/**
- * Applies targeted {@link MarshalledCtorApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ * Applies targeted {@link BeanCtorApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ *
+ * <p>
+ * Passes the {@link BeanCtorApply @BeanCtorApply} annotation through to the builder's annotation list.
+ * The {@link org.apache.juneau.commons.reflect.AnnotationProvider.Builder#addRuntimeAnnotations(java.util.List)}
+ * method handles unwrapping the nested {@link BeanCtor @BeanCtor} from {@link BeanCtorApply#value()} and registering it
+ * under the targets specified by {@link BeanCtorApply#on()} and {@link BeanCtorApply#onClass()}.
*/
- public static class Applier extends AnnotationApplier<MarshalledCtorApply,Context.Builder> {
+ public static class Applier extends AnnotationApplier<BeanCtorApply,Context.Builder> {
/**
* Constructor.
@@ -48,12 +55,12 @@ public class MarshalledCtorApplyAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public Applier(VarResolverSession vr) {
- super(MarshalledCtorApply.class, Context.Builder.class, vr);
+ super(BeanCtorApply.class, Context.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<MarshalledCtorApply> ai, Context.Builder b) {
- MarshalledCtorApply a = ai.inner();
+ public void apply(AnnotationInfo<BeanCtorApply> ai, Context.Builder b) {
+ BeanCtorApply a = ai.inner();
if (isEmptyArray(a.on()) && isEmptyArray(a.onClass()))
return;
b.annotations(a);
@@ -69,22 +76,22 @@ public class MarshalledCtorApplyAnnotation {
*/
public static class Builder extends AppliedAnnotationObject.BuilderTMF {
- MarshalledCtor value = MarshalledCtorAnnotation.DEFAULT;
+ BeanCtor value = BeanCtorAnnotation.DEFAULT;
/**
* Constructor.
*/
protected Builder() {
- super(MarshalledCtorApply.class);
+ super(BeanCtorApply.class);
}
/**
- * Sets the {@link MarshalledCtorApply#value()} property on this annotation.
+ * Sets the {@link BeanCtorApply#value()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
*/
- public Builder value(MarshalledCtor value) {
+ public Builder value(BeanCtor value) {
this.value = value;
return this;
}
@@ -144,11 +151,11 @@ public class MarshalledCtorApplyAnnotation {
}
/**
- * Instantiates a new {@link MarshalledCtorApply @MarshalledCtorApply} object initialized with this builder.
+ * Instantiates a new {@link BeanCtorApply @BeanCtorApply} object initialized with this builder.
*
- * @return A new {@link MarshalledCtorApply} object.
+ * @return A new {@link BeanCtorApply} object.
*/
- public MarshalledCtorApply build() {
+ public BeanCtorApply build() {
return new Object(this);
}
}
@@ -156,33 +163,33 @@ public class MarshalledCtorApplyAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AppliedOnClassAnnotationObject implements MarshalledCtorApply {
+ private static class Object extends AppliedOnClassAnnotationObject implements BeanCtorApply {
- private final MarshalledCtor value;
+ private final BeanCtor value;
- Object(MarshalledCtorApplyAnnotation.Builder b) {
+ Object(BeanCtorApplyAnnotation.Builder b) {
super(b);
value = b.value;
}
- @Override /* Overridden from MarshalledCtorApply */
- public MarshalledCtor value() {
+ @Override /* Overridden from BeanCtorApply */
+ public BeanCtor value() {
return value;
}
- @Override /* Overridden from MarshalledCtorApply */
+ @Override /* Overridden from BeanCtorApply */
public String[] on() {
return super.on();
}
- @Override /* Overridden from MarshalledCtorApply */
+ @Override /* Overridden from BeanCtorApply */
public Class<?>[] onClass() {
return super.onClass();
}
}
/** Default value */
- public static final MarshalledCtorApply DEFAULT = create().build();
+ public static final BeanCtorApply DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -219,7 +226,7 @@ public class MarshalledCtorApplyAnnotation {
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
- public static boolean empty(MarshalledCtorApply a) {
+ public static boolean empty(BeanCtorApply a) {
return a == null || DEFAULT.equals(a);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApply.java
similarity index 78%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApply.java
index 885c650b4b..648c91c39c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApply.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApply.java
@@ -21,17 +21,19 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.bean.*;
+
/**
- * Dynamically applies a {@link MarshalledCtor @MarshalledCtor} annotation to specified classes, methods, or fields.
+ * Dynamically applies a {@link BeanProp @BeanProp} annotation to specified classes, methods, or fields.
*
* <p>
* This annotation separates the <b>targeting</b> concern ({@link #on()}/{@link #onClass()}) from the
- * <b>content</b> concern ({@link #value()}), enabling {@link MarshalledCtor @MarshalledCtor} to be a pure data annotation
+ * <b>content</b> concern ({@link #value()}), enabling {@link BeanProp @BeanProp} to be a pure data annotation
* without marshall-specific application machinery.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
- * <ja>@MarshalledCtorApply</ja>(on=<js>"Person(String,int)"</js>, value=<ja>@MarshalledCtor</ja>(properties=<js>"name,age"</js>))
+ * <ja>@BeanPropApply</ja>(on=<js>"com.example.Foo.bar"</js>, value=<ja>@BeanProp</ja>(ro=<js>"true"</js>))
* <jk>public class</jk> MyConfig {}
* </p>
*
@@ -42,16 +44,16 @@ import java.lang.annotation.*;
@Documented
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
-@Repeatable(MarshalledCtorApply.Array.class)
-@ContextApply(MarshalledCtorApplyAnnotation.Applier.class)
-public @interface MarshalledCtorApply {
+@Repeatable(BeanPropApply.Array.class)
+@ContextApply(BeanPropApplyAnnotation.Applier.class)
+public @interface BeanPropApply {
/**
- * The {@link MarshalledCtor @MarshalledCtor} annotation to apply.
+ * The {@link BeanProp @BeanProp} annotation to apply.
*
* @return The annotation value.
*/
- MarshalledCtor value();
+ BeanProp value();
/**
* Dynamically apply this annotation to the specified classes/methods/fields.
@@ -79,7 +81,7 @@ public @interface MarshalledCtorApply {
Class<?>[] onClass() default {};
/**
- * A collection of {@link MarshalledCtorApply @MarshalledCtorApply annotations}.
+ * A collection of {@link BeanPropApply @BeanPropApply annotations}.
*/
@Documented
@Target({ TYPE, METHOD })
@@ -91,6 +93,6 @@ public @interface MarshalledCtorApply {
*
* @return The annotation value.
*/
- MarshalledCtorApply[] value();
+ BeanPropApply[] value();
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApplyAnnotation.java
similarity index 72%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApplyAnnotation.java
index 2990cf3744..00b9b13580 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledCtorApplyAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanPropApplyAnnotation.java
@@ -23,24 +23,31 @@ import java.lang.reflect.*;
import org.apache.juneau.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
/**
- * Utility classes and methods for the {@link MarshalledCtorApply @MarshalledCtorApply} annotation.
+ * Utility classes and methods for the {@link BeanPropApply @BeanPropApply} annotation.
*
*/
-public class MarshalledCtorApplyAnnotation {
+public class BeanPropApplyAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledCtorApplyAnnotation() {}
+ private BeanPropApplyAnnotation() {}
/**
- * Applies targeted {@link MarshalledCtorApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ * Applies targeted {@link BeanPropApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ *
+ * <p>
+ * Passes the {@link BeanPropApply @BeanPropApply} annotation through to the builder's annotation list.
+ * The {@link org.apache.juneau.commons.reflect.AnnotationProvider.Builder#addRuntimeAnnotations(java.util.List)}
+ * method handles unwrapping the nested {@link BeanProp @BeanProp} from {@link BeanPropApply#value()} and registering it
+ * under the targets specified by {@link BeanPropApply#on()} and {@link BeanPropApply#onClass()}.
*/
- public static class Applier extends AnnotationApplier<MarshalledCtorApply,Context.Builder> {
+ public static class Applier extends AnnotationApplier<BeanPropApply,Context.Builder> {
/**
* Constructor.
@@ -48,12 +55,12 @@ public class MarshalledCtorApplyAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public Applier(VarResolverSession vr) {
- super(MarshalledCtorApply.class, Context.Builder.class, vr);
+ super(BeanPropApply.class, Context.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<MarshalledCtorApply> ai, Context.Builder b) {
- MarshalledCtorApply a = ai.inner();
+ public void apply(AnnotationInfo<BeanPropApply> ai, Context.Builder b) {
+ BeanPropApply a = ai.inner();
if (isEmptyArray(a.on()) && isEmptyArray(a.onClass()))
return;
b.annotations(a);
@@ -69,22 +76,22 @@ public class MarshalledCtorApplyAnnotation {
*/
public static class Builder extends AppliedAnnotationObject.BuilderTMF {
- MarshalledCtor value = MarshalledCtorAnnotation.DEFAULT;
+ BeanProp value = BeanPropAnnotation.DEFAULT;
/**
* Constructor.
*/
protected Builder() {
- super(MarshalledCtorApply.class);
+ super(BeanPropApply.class);
}
/**
- * Sets the {@link MarshalledCtorApply#value()} property on this annotation.
+ * Sets the {@link BeanPropApply#value()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
*/
- public Builder value(MarshalledCtor value) {
+ public Builder value(BeanProp value) {
this.value = value;
return this;
}
@@ -144,11 +151,11 @@ public class MarshalledCtorApplyAnnotation {
}
/**
- * Instantiates a new {@link MarshalledCtorApply @MarshalledCtorApply} object initialized with this builder.
+ * Instantiates a new {@link BeanPropApply @BeanPropApply} object initialized with this builder.
*
- * @return A new {@link MarshalledCtorApply} object.
+ * @return A new {@link BeanPropApply} object.
*/
- public MarshalledCtorApply build() {
+ public BeanPropApply build() {
return new Object(this);
}
}
@@ -156,33 +163,33 @@ public class MarshalledCtorApplyAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AppliedOnClassAnnotationObject implements MarshalledCtorApply {
+ private static class Object extends AppliedOnClassAnnotationObject implements BeanPropApply {
- private final MarshalledCtor value;
+ private final BeanProp value;
- Object(MarshalledCtorApplyAnnotation.Builder b) {
+ Object(BeanPropApplyAnnotation.Builder b) {
super(b);
value = b.value;
}
- @Override /* Overridden from MarshalledCtorApply */
- public MarshalledCtor value() {
+ @Override /* Overridden from BeanPropApply */
+ public BeanProp value() {
return value;
}
- @Override /* Overridden from MarshalledCtorApply */
+ @Override /* Overridden from BeanPropApply */
public String[] on() {
return super.on();
}
- @Override /* Overridden from MarshalledCtorApply */
+ @Override /* Overridden from BeanPropApply */
public Class<?>[] onClass() {
return super.onClass();
}
}
/** Default value */
- public static final MarshalledCtorApply DEFAULT = create().build();
+ public static final BeanPropApply DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -219,7 +226,7 @@ public class MarshalledCtorApplyAnnotation {
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
- public static boolean empty(MarshalledCtorApply a) {
+ public static boolean empty(BeanPropApply a) {
return a == null || DEFAULT.equals(a);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
index 7fef514db5..a817d67a00 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
@@ -20,13 +20,17 @@ import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
-import java.util.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.reflect.Visibility;
/**
- * Used tailor how bean properties get interpreted by the framework.
+ * Used to tailor how bean properties get marshalled by the framework.
+ *
+ * <p>
+ * The marshalling-only sibling of {@link org.apache.juneau.commons.bean.BeanProp @BeanProp}.
+ * Where {@code @BeanProp} (in <c>juneau-commons</c>) carries the bean-modeling attributes
+ * (such as {@code name}, {@code ro}, {@code wo}, {@code type}, {@code params}, {@code elementType},
+ * and {@code factory}), this annotation carries the wire-format-specific attributes used by serializers
+ * and parsers: a per-property format string, a bean dictionary for polymorphic types, and a list of
+ * child properties to render.
*
* <p>
* Can be used in the following locations:
@@ -34,12 +38,10 @@ import org.apache.juneau.commons.reflect.Visibility;
* <li>Methods/Fields - Bean getters/setters and properties.
* <li><ja>@Rest</ja>-annotated classes and <ja>@RestOp</ja>-annotated methods when used with {@link MarshalledPropApply @MarshalledPropApply}.
* </ul>
- * <p>
- * This annotation is applied to public fields and public getter/setter methods of beans.
*
* <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp}
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MarshalledPropAnnotation">@MarshalledProp Annotation</a>
-
* </ul>
*/
@Documented
@@ -60,7 +62,8 @@ public @interface MarshalledProp {
* Bean dictionary.
*
* <p>
- * The list of classes that make up the bean dictionary this bean property.
+ * The list of classes that make up the bean dictionary for this bean property, used during
+ * polymorphic marshalling.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='ja'>{@link org.apache.juneau.annotation.Marshalled#dictionary()}
@@ -76,82 +79,6 @@ public @interface MarshalledProp {
*/
Class<?>[] dictionary() default {};
- /**
- * Element type for streaming/consuming bean properties.
- *
- * <p>
- * Specifies the element type for properties of type {@link java.util.stream.Stream},
- * {@link org.apache.juneau.commons.function.BeanSupplier},
- * {@link org.apache.juneau.commons.function.BeanConsumer}, or
- * {@link org.apache.juneau.commons.function.BeanChannel} when type erasure prevents
- * the framework from inferring the generic type argument at runtime.
- *
- * <p>
- * This attribute also supports:
- * <ul>
- * <li><b>Narrowing</b> - Specify a more specific subtype than the declared type
- * <li><b>Concrete implementation</b> - Specify a concrete class for an abstract/interface element type
- * </ul>
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> OrderCollection {
- * <jc>// Stream property - element type cannot be inferred at runtime due to erasure</jc>
- * <ja>@MarshalledProp</ja>(elementType=Order.<jk>class</jk>)
- * <jk>public</jk> Stream<Order> getOrders() { ... }
- *
- * <jc>// BeanChannel with concrete impl specified instead of abstract element type</jc>
- * <ja>@MarshalledProp</ja>(elementType=ConcreteItem.<jk>class</jk>)
- * <jk>public</jk> BeanChannel<AbstractItem> getItems() { ... }
- * }
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link org.apache.juneau.commons.function.BeanSupplier}
- * <li class='jc'>{@link org.apache.juneau.commons.function.BeanConsumer}
- * <li class='jc'>{@link org.apache.juneau.commons.function.BeanChannel}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?> elementType() default void.class;
-
- /**
- * Bean factory class for this property's value.
- *
- * <p>
- * Specifies a {@link org.apache.juneau.commons.function.BeanFactory} class to use when instantiating
- * the value of this specific bean property, overriding the class-level {@link Bean#factory()} if present.
- *
- * <p>
- * When a factory class is specified, the framework resolves it in the following order:
- * <ol>
- * <li>Look up the factory class in the configured {@link org.apache.juneau.commons.inject.BeanStore}
- * <li>Attempt direct instantiation via no-arg constructor or {@code getInstance()} static method
- * <li>Throw {@link IllegalArgumentException} if both fail
- * </ol>
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- * <ja>@MarshalledProp</ja>(factory=ItemChannelFactory.<jk>class</jk>, elementType=Item.<jk>class</jk>)
- * <jk>public</jk> BeanChannel<Item> getItems() { ... }
- * }
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link org.apache.juneau.commons.function.BeanFactory}
- * <li class='ja'>{@link Bean#factory()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanStore(org.apache.juneau.commons.inject.BeanStore)}
- * </ul>
- *
- * @return The annotation value.
- */
- @SuppressWarnings({
- "rawtypes" // Raw BeanFactory type required for annotation attribute declaration
- })
- Class<? extends org.apache.juneau.commons.function.BeanFactory> factory() default org.apache.juneau.commons.function.BeanFactory.Void.class;
-
/**
* Specifies a String format for converting the bean property value to a formatted string.
*
@@ -160,7 +87,7 @@ public @interface MarshalledProp {
*
* <p>
* During parsing, we will attempt to convert the value to the original form by using the
- * {@link MarshallingSession#convertToType(Object, Class)} but there is no guarantee that this will succeed.
+ * {@link org.apache.juneau.MarshallingSession#convertToType(Object, Class)} but there is no guarantee that this will succeed.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
@@ -188,160 +115,6 @@ public @interface MarshalledProp {
*/
String format() default "";
- /**
- * Identifies the name of the property.
- *
- * <p>
- * Normally, this is automatically inferred from the field name or getter method name of the property.
- * However, this property can be used to assign a different property name from the automatically inferred value.
- *
- * <p>
- * If the {@link org.apache.juneau.MarshallingContext.Builder#beanFieldVisibility(Visibility)} setting on the bean context excludes this field (e.g. the
- * visibility is set to PUBLIC, but the field is PROTECTED), this annotation can be used to force the field to be
- * identified as a property.
- *
- * <h5 class='topic'>Dynamic beans</h5>
- * <p>
- * On a <strong>field</strong> whose type is not a {@link Map}, <js>"*"</js> does not create a dynamic property:
- * the property name is the field name (same as omitting {@code name}/{@code value}), while other attributes on
- * this annotation (e.g. {@link #format()}, {@link Swap @Swap}) still apply.
- * </p>
- * <p>
- * The bean property named <js>"*"</js> is the designated "dynamic property" which allows for "extra" bean
- * properties not otherwise defined.
- * This is similar in concept to the Jackson <ja>@JsonGetterAll</ja> and <ja>@JsonSetterAll</ja> annotations.
- * The primary purpose is for backwards compatibility in parsing newer streams with addition information into older
- * beans.
- *
- * <p>
- * The following examples show how to define dynamic bean properties.
- * <p class='bjava'>
- * <jc>// Option #1 - A simple public Map field.
- * // The field name can be anything.</jc>
- * <jk>public class</jk> BeanWithDynaField {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Map<String,Object> <jf>extraStuff</jf> = <jk>new</jk> LinkedHashMap<>();
- * }
- *
- * <jc>// Option #2 - Getters and setters.
- * // Method names can be anything.
- * // Getter must return a Map with String keys.
- * // Setter must take in two arguments.</jc>
- * <jk>public class</jk> BeanWithDynaMethods {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Map<String,Object> getMyExtraStuff() {
- * ...
- * }
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public void</jk> setAnExtraField(String <jv>name</jv>, Object <jv>value</jv>) {
- * ...
- * }
- * }
- *
- * <jc>// Option #3 - Getter only.
- * // Properties will be added through the getter.</jc>
- * <jk>public class</jk> BeanWithDynaGetterOnly {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Map<String,Object> getMyExtraStuff() {
- * ...
- * }
- * }
- *
- * <jc>// Option #4 - Getter, setter, and extra-keys method .
- * // Define a method that returns a Collection<String> with currently-set property names.</jc>
- * <jk>public class</jk> BeanWithDynaExtraKeys {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Object get(String <jv>name</jv>) {
- * ...
- * }
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public void</jk> set(String <jv>name</jv>, Object <jv>value</jv>) {
- * ...
- * }
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Collection<String> extraKeys() {
- * ...
- * }
- * }
- * </p>
- *
- *<p>
- * Similar rules apply for value types and swaps.
- * The property values optionally can be any serializable type or use swaps.
- * <p class='bjava'>
- * <jc>// A serializable type other than Object.</jc>
- * <jk>public class</jk> BeanWithDynaFieldWithListValues {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>)
- * <jk>public</jk> Map<String,List<String>> getMyExtraStuff() {
- * ...
- * }
- * }
- *
- * <jc>// A swapped value.</jc>
- * <jk>public class</jk> BeanWithDynaFieldWithSwappedValues {
- *
- * <ja>@MarshalledProp</ja>(name=<js>"*"</js>, swap=TemporalCalendarSwap.IsoLocalDateTime.<jk>class</jk>)
- * <jk>public</jk> Map<String,Calendar> getMyExtraStuff() {
- * ...
- * }
- * }
- * </p>
- *
- * <div class='info'>
- * Note that if you're not interested in these additional properties, you can also use the
- * {@link org.apache.juneau.MarshallingContext.Builder#ignoreUnknownBeanProperties()} setting to ignore values that don't fit into existing
- * properties.
- * </div>
- * <div class='info'>
- * Note that the {@link Name @Name} annotation can also be used for identifying a property name.
- * </div>
- *
- * @return The annotation value.
- */
- String name() default "";
-
- /**
- * For bean properties of maps and collections, this annotation can be used to identify the class types of the
- * contents of the bean property object when the generic parameter types are interfaces or abstract classes.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- *
- * <jc>// Identify concrete map type with String keys and Integer values.</jc>
- * <ja>@MarshalledProp</ja>(type=HashMap.<jk>class</jk>, params={String.<jk>class</jk>,Integer.<jk>class</jk>})
- * <jk>public</jk> Map <jf>p1</jf>;
- * }
- * </p>
- *
- * <p>
- * This annotation can also be used on private fields of a property like so:
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- *
- * <ja>@MarshalledProp</ja>(type=HashMap.<jk>class</jk>, params={String.<jk>class</jk>,Integer.<jk>class</jk>})
- * <jk>private</jk> Map <jf>p1</jf>;
- *
- * <jk>public</jk> Map getP1() {
- * <jk>return</jk> <jf>p1</jf>;
- * }
- * }
- * </p>
- *
- * @return The annotation value.
- */
- Class<?>[] params() default {};
-
/**
* Used to limit which child properties are rendered by the serializers.
*
@@ -372,137 +145,7 @@ public @interface MarshalledProp {
* String <jv>json</jv> = JsonSerializer.<jsf>DEFAULT</jsf>.serialize(<jk>new</jk> MyClass());
* </p>
*
- * <p>
- * This annotation can also be used on private fields of a property like so:
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- *
- * <ja>@MarshalledProp</ja>(properties=<js>"f1"</js>)
- * <jk>private</jk> MyChildClass <jf>x1</jf>;
- *
- * <jk>public</jk> MyChildClass getX1() {
- * <jk>return</jk> <jf>x1</jf>;
- * }
- * }
- * </p>
- *
* @return The annotation value.
*/
String properties() default "";
-
- /**
- * Identifies a property as read-only.
- *
- * <p>
- * Serializers will serialize such properties as usual, but parsers will silently ignore them.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- * <ja>@MarshalledProp</ja>(ro=<js>"true"</js>)
- * <jk>public float</jk> <jf>price</jf>;
- * }
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * <b>Java Records:</b> Marking record components as read-only is not supported during parsing.
- * Because records are immutable, all components must be provided to the canonical constructor.
- * Read-only components will be serialized as usual, but the parser will be unable to instantiate the
- * record if the read-only component values are missing from the input.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String ro() default "";
-
- /**
- * Identifies a specialized class type for the property.
- *
- * <p>
- * Normally this can be inferred through reflection of the field type or getter return type.
- * However, you'll want to specify this value if you're parsing beans where the bean property class is an interface
- * or abstract class to identify the bean type to instantiate.
- * Otherwise, you may cause an {@link InstantiationException} when trying to set these fields.
- *
- * <p>
- * This property must denote a concrete bean class with a no-arg constructor.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- *
- * <jc>// Identify concrete map type.</jc>
- * <ja>@MarshalledProp</ja>(type=HashMap.<jk>class</jk>)
- * <jk>public</jk> Map <jf>p1</jf>;
- * }
- * </p>
- *
- * <p>
- * This annotation can also be used on private fields of a property like so:
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- *
- * <ja>@MarshalledProp</ja>(type=HashMap.<jk>class</jk>)
- * <jk>private</jk> Map <jf>p1</jf>;
- *
- * <jk>public</jk> Map getP1() {
- * <jk>return</jk> <jf>p1</jf>;
- * }
- * }
- * </p>
- *
- * @return The annotation value.
- */
- Class<?> type() default void.class;
-
- /**
- * A synonym for {@link #name()}.
- *
- * <p>
- * The following annotations are equivalent:
- *
- * <p class='bjava'>
- * <ja>@MarshalledProp</ja>(name=<js>"foo"</js>)
- *
- * <ja>@MarshalledProp</ja>(<js>"foo"</js>)
- * </p>
- *
- * @return The annotation value.
- */
- String value() default "";
-
- /**
- * Identifies a property as write-only.
- *
- * <p>
- * Parsers will parse such properties as usual, but serializers will silently ignore them.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jk>public class</jk> MyBean {
- * <ja>@MarshalledProp</ja>(wo=<js>"true"</js>)
- * <jk>public float</jk> <jf>price</jf>;
- * }
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String wo() default "";
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java
index 19bc7f6ac1..ff6ec00815 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledPropAnnotation.java
@@ -21,7 +21,6 @@ import static org.apache.juneau.commons.utils.CollectionUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.commons.annotation.*;
-import org.apache.juneau.commons.function.*;
/**
* Utility classes and methods for the {@link MarshalledProp @MarshalledProp} annotation.
@@ -44,18 +43,9 @@ public class MarshalledPropAnnotation {
public static class Builder extends AnnotationObject.Builder {
private String[] description = {};
- private Class<?> type = void.class;
- private Class<?> elementType = void.class;
private Class<?>[] dictionary = new Class[0];
- private Class<?>[] params = new Class[0];
- @SuppressWarnings("rawtypes")
- private Class<? extends BeanFactory> factory = BeanFactory.Void.class;
private String format = "";
- private String name = "";
private String properties = "";
- private String ro = "";
- private String value = "";
- private String wo = "";
/**
* Constructor.
@@ -95,29 +85,6 @@ public class MarshalledPropAnnotation {
return this;
}
- /**
- * Sets the {@link MarshalledProp#elementType()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder elementType(Class<?> value) {
- elementType = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#factory()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- @SuppressWarnings("rawtypes")
- public Builder factory(Class<? extends BeanFactory> value) {
- factory = value;
- return this;
- }
-
/**
* Sets the {@link MarshalledProp#format()} property on this annotation.
*
@@ -129,28 +96,6 @@ public class MarshalledPropAnnotation {
return this;
}
- /**
- * Sets the {@link MarshalledProp#name()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder name(String value) {
- name = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#params()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder params(Class<?>...value) {
- params = value;
- return this;
- }
-
/**
* Sets the {@link MarshalledProp#properties()} property on this annotation.
*
@@ -162,50 +107,6 @@ public class MarshalledPropAnnotation {
return this;
}
- /**
- * Sets the {@link MarshalledProp#ro()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder ro(String value) {
- ro = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#type()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder type(Class<?> value) {
- type = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#value()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder value(String value) {
- this.value = value;
- return this;
- }
-
- /**
- * Sets the {@link MarshalledProp#wo()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder wo(String value) {
- wo = value;
- return this;
- }
-
}
@SuppressWarnings({
@@ -214,33 +115,16 @@ public class MarshalledPropAnnotation {
private static class Object extends AnnotationObject implements MarshalledProp {
private final String[] description;
- private final Class<?> type;
- private final Class<?> elementType;
- private final Class<?>[] params;
private final Class<?>[] dictionary;
- @SuppressWarnings("rawtypes")
- private final Class<? extends BeanFactory> factory;
- private final String name;
- private final String value;
- private final String properties;
private final String format;
- private final String ro;
- private final String wo;
+ private final String properties;
Object(MarshalledPropAnnotation.Builder b) {
super(b);
description = copyOf(b.description);
dictionary = copyOf(b.dictionary);
- elementType = b.elementType;
- factory = b.factory;
format = b.format;
- name = b.name;
- params = copyOf(b.params);
properties = b.properties;
- ro = b.ro;
- type = b.type;
- value = b.value;
- wo = b.wo;
}
@Override /* Overridden from MarshalledProp */
@@ -248,57 +132,16 @@ public class MarshalledPropAnnotation {
return dictionary;
}
- @Override /* Overridden from MarshalledProp */
- public Class<?> elementType() {
- return elementType;
- }
-
- @Override /* Overridden from MarshalledProp */
- @SuppressWarnings("rawtypes")
- public Class<? extends BeanFactory> factory() {
- return factory;
- }
-
@Override /* Overridden from MarshalledProp */
public String format() {
return format;
}
- @Override /* Overridden from MarshalledProp */
- public String name() {
- return name;
- }
-
- @Override /* Overridden from MarshalledProp */
- public Class<?>[] params() {
- return params;
- }
-
@Override /* Overridden from MarshalledProp */
public String properties() {
return properties;
}
- @Override /* Overridden from MarshalledProp */
- public String ro() {
- return ro;
- }
-
- @Override /* Overridden from MarshalledProp */
- public Class<?> type() {
- return type;
- }
-
- @Override /* Overridden from MarshalledProp */
- public String value() {
- return value;
- }
-
- @Override /* Overridden from MarshalledProp */
- public String wo() {
- return wo;
- }
-
@Override /* Overridden from annotation */
public String[] description() {
return description;
@@ -316,4 +159,4 @@ public class MarshalledPropAnnotation {
public static Builder create() {
return new Builder();
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/Xml.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/Xml.java
index 5f664c0f9d..6d3d9b7365 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/Xml.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/annotation/Xml.java
@@ -20,6 +20,7 @@ import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Annotation for specifying various XML options for the XML and RDF/XML serializers.
@@ -111,7 +112,7 @@ public @interface Xml {
*
* <jc>// Normally, bean URL properties would be rendered as XML attributes on the bean element.</jc>
* <jc>// Override so that it's rendered as an <href>http://foo</href> child element instead.</jc>
- * <ja>@MarshalledProp</ja>(uri=<jk>true</jk>)
+ * <ja>@BeanProp</ja>(uri=<jk>true</jk>)
* <ja>@Xml</ja>(format=XmlFormat.<jsf>ELEMENT</jsf>}
* <jk>public</jk> URL <jf>href</jf> = <jk>new</jk> URL(<js>"http://foo"</js>);
*
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlComplexExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlComplexExample.java
index b82d9636fc..bc8cb7a1bf 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlComplexExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlComplexExample.java
@@ -76,7 +76,7 @@ public class HtmlComplexExample {
assert parse.getInnerPojo().getName().equals(pojoc.getInnerPojo().getName());
assert parse.getInnerPojo().getId().equals(pojoc.getInnerPojo().getId());
- // The object above can be parsed thanks to the @MarshalledCtor(properties = id,name) annotation on Pojo
+ // The object above can be parsed thanks to the @BeanCtor(properties = id,name) annotation on Pojo
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlSimpleExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlSimpleExample.java
index 623f709713..9378d5a46c 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlSimpleExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/html/HtmlSimpleExample.java
@@ -63,7 +63,7 @@ public class HtmlSimpleExample {
var docSerialized = HtmlDocSerializer.DEFAULT.serialize(pojo);
Logger.getLogger(HtmlSimpleExample.class).info(docSerialized);
- // The object above can be parsed thanks to the @MarshalledCtor(properties = id,name) annotation on Pojo
+ // The object above can be parsed thanks to the @BeanCtor(properties = id,name) annotation on Pojo
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonComplexExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonComplexExample.java
index 5dad6bf691..20d361161d 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonComplexExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonComplexExample.java
@@ -72,7 +72,7 @@ public class JsonComplexExample {
assert parse.getInnerPojo().getName().equals(pojoc.getInnerPojo().getName());
assert parse.getInnerPojo().getId().equals(pojoc.getInnerPojo().getId());
- // The object above can be parsed thanks to the @MarshalledCtor(properties = id,name) annotation on Pojo
+ // The object above can be parsed thanks to the @BeanCtor(properties = id,name) annotation on Pojo
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonSimpleExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonSimpleExample.java
index eef94f7208..6a052e1bcf 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonSimpleExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/json/JsonSimpleExample.java
@@ -77,7 +77,7 @@ public class JsonSimpleExample {
var l3 = jsonParser.parse(json, Long.class);
var f3 = jsonParser.parse(json, Float.class);
- // The object above can be parsed thanks to the @MarshalledCtor(properties = id,name) annotation on Pojo
+ // The object above can be parsed thanks to the @BeanCtor(properties = id,name) annotation on Pojo
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/oapi/OapiExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/oapi/OapiExample.java
index d378f6ac9a..6dd7a1e126 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/oapi/OapiExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/oapi/OapiExample.java
@@ -79,7 +79,7 @@ public class OapiExample {
var p = OpenApiParser.DEFAULT;
pojo = p.getPartSession().parse(HEADER, schemab, httpPart, oapiParser.getClassMeta(Pojo.class));
- // The object above can be parsed thanks to the @MarshalledCtor(properties = id,name) annotation on Pojo
+ // The object above can be parsed thanks to the @BeanCtor(properties = id,name) annotation on Pojo
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/Pojo.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/Pojo.java
index 4ffb2c205a..0e3626c139 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/Pojo.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/Pojo.java
@@ -17,6 +17,7 @@
package org.apache.juneau.examples.core.pojo;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Sample pojo class.
@@ -30,7 +31,7 @@ public class Pojo {
* @param id The <bc>id</bc> property value.
* @param name The <bc>name</bc> property value.
*/
- @MarshalledCtor
+ @BeanCtor
public Pojo(@Name("id") String id, @Name("name") String name) {
this.id = id;
this.name = name;
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/PojoComplex.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/PojoComplex.java
index 7e56e4bc54..8ece89ba46 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/PojoComplex.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/pojo/PojoComplex.java
@@ -19,6 +19,7 @@ package org.apache.juneau.examples.core.pojo;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Complex Pojo class.
@@ -37,7 +38,7 @@ public class PojoComplex {
* @param innerPojo The <bc>innerPojo</bc> property value.
* @param values The <bc>values</bc> property value.
*/
- @MarshalledCtor
+ @BeanCtor
public PojoComplex(@Name("id") String id, @Name("innerPojo") Pojo innerPojo, @Name("values") Map<String,List<Pojo>> values) {
this.id = id;
this.innerPojo = innerPojo;
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/uon/UonExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/uon/UonExample.java
index 4a3f2f7ad9..40290fb260 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/uon/UonExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/uon/UonExample.java
@@ -52,7 +52,7 @@ public class UonExample {
assert obj.getId().equals(pojo.getId());
assert obj.getName().equals(pojo.getName());
- // The object above can be parsed thanks to the @MarshalledCtor annotation on PojoComplex
+ // The object above can be parsed thanks to the @BeanCtor annotation on PojoComplex
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlComplexExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlComplexExample.java
index cad13e88d4..b2372f3e36 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlComplexExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlComplexExample.java
@@ -60,7 +60,7 @@ public class XmlComplexExample {
assert obj.getClass().equals(pojoc.getClass());
assert obj.getInnerPojo().getId().equals(pojoc.getInnerPojo().getId());
- // The object above can be parsed thanks to the @MarshalledCtor annotation on PojoComplex
+ // The object above can be parsed thanks to the @BeanCtor annotation on PojoComplex
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlSimpleExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlSimpleExample.java
index 879289a405..c5bc401239 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlSimpleExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlSimpleExample.java
@@ -55,7 +55,7 @@ public class XmlSimpleExample {
assert obj.getId().equals(pojo.getId());
assert obj.getName().equals(pojo.getName());
- // The object above can be parsed thanks to the @MarshalledCtor annotation on PojoComplex
+ // The object above can be parsed thanks to the @BeanCtor annotation on PojoComplex
// Using this approach, you can keep your POJOs immutable, and still serialize and deserialize them.
}
diff --git a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/annotation/Header.java b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/annotation/Header.java
index 00b90288f0..f111526927 100644
--- a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/annotation/Header.java
+++ b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/annotation/Header.java
@@ -150,7 +150,7 @@ public @interface Header {
*
* <jc>// Equivalent to @Header("Foo")</jc>
* <ja>@Header</ja>
- * <ja>@MarshalledProp</ja>(<js>"Foo"</js>)
+ * <ja>@BeanProp</ja>(<js>"Foo"</js>)
* String getFoo();
* }
* </p>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/AnnotationInheritance_Test.java b/juneau-utest/src/test/java/org/apache/juneau/AnnotationInheritance_Test.java
index 4db0db62b0..841a4e6cb8 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/AnnotationInheritance_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/AnnotationInheritance_Test.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.json5.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.api.*;
@@ -47,7 +48,7 @@ class AnnotationInheritance_Test extends TestBase {
return value;
}
- @MarshalledProp("v")
+ @BeanProp("v")
public A1_Parent setValue(String value) {
this.value = value;
return this;
@@ -71,7 +72,7 @@ class AnnotationInheritance_Test extends TestBase {
var bm = bc.getBeanMeta(A1_Child.class);
var prop = bm.getPropertyMeta("v");
- assertNotNull(prop, "Property 'v' should exist (inherited from @MarshalledProp in parent)");
+ assertNotNull(prop, "Property 'v' should exist (inherited from @BeanProp in parent)");
}
@Test
@@ -92,7 +93,7 @@ class AnnotationInheritance_Test extends TestBase {
return items;
}
- @MarshalledProp("i")
+ @BeanProp("i")
@Xml(format=XmlFormat.COLLAPSED, childName="item")
public B1_Parent setItems(List<String> items) {
this.items = items;
@@ -115,7 +116,7 @@ class AnnotationInheritance_Test extends TestBase {
var bm = bc.getBeanMeta(B1_Child.class);
var prop = bm.getPropertyMeta("i");
- assertNotNull(prop, "Property 'i' should exist (inherited from @MarshalledProp)");
+ assertNotNull(prop, "Property 'i' should exist (inherited from @BeanProp)");
}
//====================================================================================================
@@ -129,7 +130,7 @@ class AnnotationInheritance_Test extends TestBase {
return name;
}
- @MarshalledProp(name="n", ro="false")
+ @BeanProp(name="n", ro="false")
public C1_Parent setName(String name) {
this.name = name;
return this;
@@ -164,7 +165,7 @@ class AnnotationInheritance_Test extends TestBase {
return count;
}
- @MarshalledProp("c")
+ @BeanProp("c")
public D1_GrandParent setCount(int count) {
this.count = count;
return this;
@@ -194,7 +195,7 @@ class AnnotationInheritance_Test extends TestBase {
public static class E1_Parent {
private String data;
- @MarshalledProp("d")
+ @BeanProp("d")
public String getData() {
return data;
}
@@ -218,7 +219,7 @@ class AnnotationInheritance_Test extends TestBase {
var bm = bc.getBeanMeta(E1_Child.class);
var prop = bm.getPropertyMeta("d");
- assertNotNull(prop, "Property 'd' should exist (inherited from getter's @MarshalledProp)");
+ assertNotNull(prop, "Property 'd' should exist (inherited from getter's @BeanProp)");
var bean = new E1_Child();
bean.setData("test");
@@ -237,7 +238,7 @@ class AnnotationInheritance_Test extends TestBase {
return tags;
}
- @MarshalledProp("t")
+ @BeanProp("t")
public F1_Parent setTags(List<String> tags) {
this.tags = tags;
return this;
@@ -265,12 +266,12 @@ class AnnotationInheritance_Test extends TestBase {
private List<Object> children;
@Xml(format=XmlFormat.ELEMENTS)
- @MarshalledProp(name="c")
+ @BeanProp(name="c")
public List<Object> getChildren() {
return children;
}
- @MarshalledProp("c")
+ @BeanProp("c")
public G1_Parent setChildren(List<Object> children) {
this.children = children;
return this;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
index 695e4b83fb..ed14c2dc90 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
@@ -22,6 +22,7 @@ import java.beans.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.json5.*;
import org.junit.jupiter.api.*;
@@ -82,7 +83,7 @@ class BasicBeans_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
public static class B {
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Map<String,Integer> f1 = new TreeMap<>();
public static B create() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
index 7d94342a36..76e8e76112 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
@@ -50,7 +50,7 @@ class BeanMapErrors_Test extends TestBase {
public int f1;
private int f2 = -1;
- @MarshalledProp("f2") public int f2() { return f2; }
+ @BeanProp("f2") public int f2() { return f2; }
public void setF2(int v) { f2 = v; }
}
@@ -68,15 +68,15 @@ class BeanMapErrors_Test extends TestBase {
@BeanTypeApply(on="Dummy",value=@BeanType(p="dummy"))
@BeanTypeApply(on="B1",value=@BeanType(p="f1"))
- @MarshalledPropApply(on="Dummy",value=@MarshalledProp("dummy"))
- @MarshalledPropApply(on="B1.f2",value=@MarshalledProp("f2"))
+ @BeanPropApply(on="Dummy",value=@BeanProp("dummy"))
+ @BeanPropApply(on="B1.f2",value=@BeanProp("f2"))
private static class B1Config {}
public static class B1 {
public int f1;
private int f2 = -1;
- @MarshalledProp("f2") public int f2() { return f2; }
+ @BeanProp("f2") public int f2() { return f2; }
public void setF2(int v) { f2 = v; }
}
@@ -100,7 +100,7 @@ class BeanMapErrors_Test extends TestBase {
public static class A2 {
public int f1;
- @MarshalledProp("f2")
+ @BeanProp("f2")
public int f2 = -1;
}
@@ -118,8 +118,8 @@ class BeanMapErrors_Test extends TestBase {
@BeanTypeApply(on="Dummy",value=@BeanType(p="dummy"))
@BeanTypeApply(on="B2",value=@BeanType(p="f1"))
- @MarshalledPropApply(on="Dummy",value=@MarshalledProp("dummy"))
- @MarshalledPropApply(on="B2.f2",value=@MarshalledProp("f2"))
+ @BeanPropApply(on="Dummy",value=@BeanProp("dummy"))
+ @BeanPropApply(on="B2.f2",value=@BeanProp("f2"))
private static class B2Config {}
public static class B2 {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
index acbcd82f0f..6650a346e0 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
@@ -595,10 +595,10 @@ class BeanMap_Test extends TestBase {
public List<G> l2 = new LinkedList<>();
- @MarshalledProp(type=List.class,params={G.class})
+ @BeanProp(type=List.class, params={G.class})
public List<G> l3;
- @MarshalledProp(type=LinkedList.class,params={G.class})
+ @BeanProp(type=LinkedList.class, params={G.class})
public List<G> l4;
private List<G> m1;
@@ -610,16 +610,16 @@ class BeanMap_Test extends TestBase {
public void setM2(List<G> v) { m2 = v; }
private List<G> m3;
- @MarshalledProp(type=List.class,params={G.class})
+ @BeanProp(type=List.class, params={G.class})
public List<G> getM3() { return m3; }
public void setM3(List<G> v) { m3 = v; }
private List<G> m4;
- @MarshalledProp(type=LinkedList.class,params={G.class})
+ @BeanProp(type=LinkedList.class, params={G.class})
public List<G> getM4() { return m4; }
public void setM4(List<G> v) { m4 = v; }
- @MarshalledProp(type=LinkedList.class,params={G.class})
+ @BeanProp(type=LinkedList.class, params={G.class})
private List<G> m5;
public List<G> getM5() { return m5; }
public void setM5(List<G> v) { m5 = v; }
@@ -707,12 +707,12 @@ class BeanMap_Test extends TestBase {
}
public static class J {
- @MarshalledProp(params={Float.class}) public List<String> p1;
- @MarshalledProp(params={Float.class}) public List<Integer> getP2() { return null; }
- @MarshalledProp(params={Float.class}) public List<? extends Integer> p3;
- @MarshalledProp(params={Object.class, Float.class}) public Map<String,Integer> p4;
- @MarshalledProp(params={Object.class, Float.class}) public Map<String,Integer> getP5() { return null; }
- @MarshalledProp(params={String.class, Float.class}) public Map<String,? extends Integer> p6;
+ @BeanProp(params={Float.class}) public List<String> p1;
+ @BeanProp(params={Float.class}) public List<Integer> getP2() { return null; }
+ @BeanProp(params={Float.class}) public List<? extends Integer> p3;
+ @BeanProp(params={Object.class, Float.class}) public Map<String,Integer> p4;
+ @BeanProp(params={Object.class, Float.class}) public Map<String,Integer> getP5() { return null; }
+ @BeanProp(params={String.class, Float.class}) public Map<String,? extends Integer> p6;
}
//====================================================================================================
@@ -732,12 +732,12 @@ class BeanMap_Test extends TestBase {
}
public static class K {
- @MarshalledProp(params=Float.class) public List<String> p1;
- @MarshalledProp(params=Float.class) public List<Integer> getP2() { return null; }
- @MarshalledProp(params=Float.class) public List<? extends Integer> p3;
- @MarshalledProp(params={String.class,Float.class}) public Map<String,Integer> p4;
- @MarshalledProp(params={String.class,Float.class}) public Map<String,Integer> getP5() { return null; }
- @MarshalledProp(params={String.class,Float.class}) public Map<String,? extends Integer> p6;
+ @BeanProp(params=Float.class) public List<String> p1;
+ @BeanProp(params=Float.class) public List<Integer> getP2() { return null; }
+ @BeanProp(params=Float.class) public List<? extends Integer> p3;
+ @BeanProp(params={String.class,Float.class}) public Map<String,Integer> p4;
+ @BeanProp(params={String.class,Float.class}) public Map<String,Integer> getP5() { return null; }
+ @BeanProp(params={String.class,Float.class}) public Map<String,? extends Integer> p6;
}
//====================================================================================================
@@ -1806,7 +1806,7 @@ class BeanMap_Test extends TestBase {
/** Bean with a Map-backed dyna property for extra entries (see BasicBeans_Test.B). */
public static class DynaExtrasBean {
- @MarshalledProp(name = "*")
+ @BeanProp(name="*")
public Map<String, Object> extras = new LinkedHashMap<>();
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/DynaBean_ComboRoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/DynaBean_ComboRoundTripTest.java
index 116f08321b..696f457f54 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/DynaBean_ComboRoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/DynaBean_ComboRoundTripTest.java
@@ -23,6 +23,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.swaps.*;
@@ -198,7 +199,7 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
@Marshalled
public static class BeanWithDynaField {
public int f1;
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Map<String,Object> f2 = map();
public int f3;
@@ -224,12 +225,12 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
public int getF3() { return f3; }
public void setF3(int v) { f3 = v; }
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Map<String, Object> xxx() {
return f2;
}
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public void setYYY(String name, Object o) {
setterCalled = true;
this.f2.put(name, o);
@@ -257,18 +258,18 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
public int getF3() { return f3; }
public void setF3(int v) { f3 = v; }
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Object get(String name) {
return f2.get(name);
}
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public void set(String name, Object o) {
setterCalled = true;
this.f2.put(name, o);
}
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Collection<String> getExtraKeys() {
return f2.keySet();
}
@@ -294,7 +295,7 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
public int getF3() { return f3; }
public void setF3(int v) { f3 = v; }
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Map<String, Object> xxx() {
return f2;
}
@@ -309,7 +310,7 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
@Marshalled
public static class BeanWithDynaFieldSwapped {
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
@Swap(TemporalCalendarSwap.IsoInstant.class)
public Map<String,Calendar> f1 = map();
@@ -321,7 +322,7 @@ class DynaBean_ComboRoundTripTest extends ComboRoundTripTest_Base {
@Marshalled
public static class BeanWithDynaFieldStringList {
- @MarshalledProp(name="*")
+ @BeanProp(name="*")
public Map<String,List<String>> f1 = map();
public BeanWithDynaFieldStringList init() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java b/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
index 7c29be843c..4513c10930 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
@@ -322,7 +322,7 @@ class MarshalledConfig_Test extends TestBase {
public static class ReadOnlyPerson {
private final int age;
- @MarshalledCtor(properties="name,age")
+ @BeanCtor(properties="name,age")
public ReadOnlyPerson(String name, int age) {
this.name = name;
this.age = age;
@@ -371,9 +371,9 @@ class MarshalledConfig_Test extends TestBase {
@BeanTypeApply(on="Dummy1",value=@BeanType(p="dummy"))
@BeanTypeApply(on="ReadOnlyPerson2",value=@BeanType(p="name,age"))
@BeanTypeApply(on="Dummy2",value=@BeanType(p="dummy"))
- @MarshalledCtorApply(on="Dummy1",value=@MarshalledCtor(properties="dummy"))
- @MarshalledCtorApply(on="ReadOnlyPerson2(String,int)",value=@MarshalledCtor(properties="name,age"))
- @MarshalledCtorApply(on="Dummy2",value=@MarshalledCtor(properties="dummy"))
+ @BeanCtorApply(on="Dummy1",value=@BeanCtor(properties="dummy"))
+ @BeanCtorApply(on="ReadOnlyPerson2(String,int)",value=@BeanCtor(properties="name,age"))
+ @BeanCtorApply(on="Dummy2",value=@BeanCtor(properties="dummy"))
private static class ReadOnlyPerson2Config {}
//====================================================================================================
diff --git a/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java b/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
index f197e2e950..a60215b4c8 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
@@ -33,10 +33,10 @@ class ReadWriteOnlyProperties_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
public static class A {
- @MarshalledProp(ro="true")
+ @BeanProp(ro="true")
public int f1;
- @MarshalledProp(wo="true")
+ @BeanProp(wo="true")
public int f2;
static A create() {
@@ -63,8 +63,8 @@ class ReadWriteOnlyProperties_Test extends TestBase {
@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2")
public static class B {
- @MarshalledProp(ro="true") public int f1;
- @MarshalledProp(wo="true") public int f2;
+ @BeanProp(ro="true") public int f1;
+ @BeanProp(wo="true") public int f2;
static B create() {
var x = new B();
@@ -87,8 +87,8 @@ class ReadWriteOnlyProperties_Test extends TestBase {
@BeanTypeApply(on="Dummy1",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
@BeanTypeApply(on="Bc",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
@BeanTypeApply(on="Dummy2",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
- @MarshalledPropApply(on="Bc.f1",value=@MarshalledProp(ro="true"))
- @MarshalledPropApply(on="Bc.f2",value=@MarshalledProp(wo="true"))
+ @BeanPropApply(on="Bc.f1",value=@BeanProp(ro="true"))
+ @BeanPropApply(on="Bc.f2",value=@BeanProp(wo="true"))
private static class BcConfig {}
public static class Bc {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/ReadOnlyBeans_RoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/ReadOnlyBeans_RoundTripTest.java
index f86f74f468..cbf1e26b53 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/ReadOnlyBeans_RoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/ReadOnlyBeans_RoundTripTest.java
@@ -19,6 +19,7 @@ package org.apache.juneau.a.rttests;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
@@ -50,7 +51,7 @@ class ReadOnlyBeans_RoundTripTest extends RoundTripTest_Base {
private B f1;
private final B f2;
- @MarshalledCtor(properties="f2")
+ @BeanCtor(properties="f2")
public A(B f2) {
this.f2 = f2;
}
@@ -70,7 +71,7 @@ class ReadOnlyBeans_RoundTripTest extends RoundTripTest_Base {
private int f1;
private final String f2;
- @MarshalledCtor(properties="f2")
+ @BeanCtor(properties="f2")
public B(String sField) {
this.f2 = sField;
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
index c5ad056731..90f6bc7d07 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
@@ -58,7 +58,7 @@ class Records_RoundTripTest extends RoundTripTest_Base {
@BeanType(properties="age,name")
public record AnnotatedOrder(String name, int age) {}
- public record WithMarshalledProp(@MarshalledProp(name="fullName") String name, int age) {}
+ public record WithMarshalledProp(@BeanProp(name="fullName") String name, int age) {}
public record WithCompactConstructor(String name, int age) {
public WithCompactConstructor {
@@ -73,7 +73,7 @@ class Records_RoundTripTest extends RoundTripTest_Base {
@BeanType(properties="name")
public record WithMarshalledCtor(String name, int age) {
- @MarshalledCtor(properties="name")
+ @BeanCtor(properties="name")
public WithMarshalledCtor(String name) {
this(name, 0);
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
index 02df3deee8..7b280c03b5 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
@@ -972,7 +972,7 @@ class RoundTripBeanMaps_Test extends TestBase {
}
@MarshalledIgnore public KEnum getA() { return KEnum.FOO; }
- @MarshalledProp(name="a") public String getA2() { return a.toString(); }
+ @BeanProp(name="a") public String getA2() { return a.toString(); }
public void setA(KEnum v) {
// This method should not be interpreted as the setter for this
// property because it doesn't match the getter return type above.
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanCtorAnnotation_Test.java
similarity index 88%
copy from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java
copy to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanCtorAnnotation_Test.java
index f6d4f249e4..248cc806db 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanCtorAnnotation_Test.java
@@ -21,20 +21,21 @@ import static org.apache.juneau.junit.bct.BctAssertions.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
-class MarshalledCtorAnnotation_Test extends TestBase {
+class BeanCtorAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
// Basic tests
//------------------------------------------------------------------------------------------------------------------
- MarshalledCtor a1 = MarshalledCtorAnnotation.create()
+ BeanCtor a1 = BeanCtorAnnotation.create()
.description("a")
.properties("c")
.build();
- MarshalledCtor a2 = MarshalledCtorAnnotation.create()
+ BeanCtor a2 = BeanCtorAnnotation.create()
.description("a")
.properties("c")
.build();
@@ -64,7 +65,7 @@ class MarshalledCtorAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
public static class D1 {
- @MarshalledCtor(
+ @BeanCtor(
description={ "a" },
properties="c"
)
@@ -72,18 +73,18 @@ class MarshalledCtorAnnotation_Test extends TestBase {
}
public static class D2 {
- @MarshalledCtor(
+ @BeanCtor(
description={ "a" },
properties="c"
)
public D2() {}
}
- MarshalledCtor d1, d2;
+ BeanCtor d1, d2;
{
try {
- d1 = D1.class.getConstructor().getAnnotationsByType(MarshalledCtor.class)[0];
- d2 = D2.class.getConstructor().getAnnotationsByType(MarshalledCtor.class)[0];
+ d1 = D1.class.getConstructor().getAnnotationsByType(BeanCtor.class)[0];
+ d2 = D2.class.getConstructor().getAnnotationsByType(BeanCtor.class)[0];
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -94,4 +95,4 @@ class MarshalledCtorAnnotation_Test extends TestBase {
assertNotEqualsAny(a1.hashCode(), 0, -1);
assertEqualsAll(a1.hashCode(), d1.hashCode(), d2.hashCode());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanPropAnnotation_Test.java
similarity index 64%
rename from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java
rename to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanPropAnnotation_Test.java
index f6d4f249e4..ce23ff3d4a 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledCtorAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanPropAnnotation_Test.java
@@ -21,42 +21,48 @@ import static org.apache.juneau.junit.bct.BctAssertions.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
-class MarshalledCtorAnnotation_Test extends TestBase {
+@SuppressWarnings({
+ "java:S1186" // Empty test method intentional for framework testing
+})
+class BeanPropAnnotation_Test extends TestBase {
+
+ public static class X1 {}
//------------------------------------------------------------------------------------------------------------------
// Basic tests
//------------------------------------------------------------------------------------------------------------------
- MarshalledCtor a1 = MarshalledCtorAnnotation.create()
+ BeanProp a1 = BeanPropAnnotation.create()
.description("a")
- .properties("c")
+ .name("c")
+ .params(X1.class)
+ .ro("f")
+ .type(X1.class)
+ .value("g")
+ .wo("h")
.build();
- MarshalledCtor a2 = MarshalledCtorAnnotation.create()
+ BeanProp a2 = BeanPropAnnotation.create()
.description("a")
- .properties("c")
+ .name("c")
+ .params(X1.class)
+ .ro("f")
+ .type(X1.class)
+ .value("g")
+ .wo("h")
.build();
@Test void a01_basic() {
- assertBean(a1, "description,properties", "[a],c");
+ assertBean(a1, "description,name,params,ro,type,value,wo", "[a],c,[X1],f,X1,g,h");
}
@Test void a02_testEquivalency() {
assertEquals(a2, a1);
- assertNotEqualsAny(a1.hashCode(), 0, -1);
- assertEquals(a1.hashCode(), a2.hashCode());
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // PropertyStore equivalency.
- //------------------------------------------------------------------------------------------------------------------
-
- @Test void b01_testEquivalencyInPropertyStores() {
- var bc1 = MarshallingContext.create().annotations(a1).build();
- var bc2 = MarshallingContext.create().annotations(a2).build();
- assertSame(bc1, bc2);
+ assertNotEqualsAny(a2.hashCode(), 0, -1);
+ assertEquals(a2.hashCode(), a1.hashCode());
}
//------------------------------------------------------------------------------------------------------------------
@@ -64,26 +70,20 @@ class MarshalledCtorAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
public static class D1 {
- @MarshalledCtor(
- description={ "a" },
- properties="c"
- )
- public D1() {}
+ @BeanProp(description={ "a" }, name="c", params=X1.class, ro="f", type=X1.class, value="g", wo="h")
+ public int f;
}
public static class D2 {
- @MarshalledCtor(
- description={ "a" },
- properties="c"
- )
- public D2() {}
+ @BeanProp(description={ "a" }, name="c", params=X1.class, ro="f", type=X1.class, value="g", wo="h")
+ public int f;
}
- MarshalledCtor d1, d2;
+ BeanProp d1, d2;
{
try {
- d1 = D1.class.getConstructor().getAnnotationsByType(MarshalledCtor.class)[0];
- d2 = D2.class.getConstructor().getAnnotationsByType(MarshalledCtor.class)[0];
+ d1 = D1.class.getField("f").getAnnotationsByType(BeanProp.class)[0];
+ d2 = D2.class.getField("f").getAnnotationsByType(BeanProp.class)[0];
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -94,4 +94,4 @@ class MarshalledCtorAnnotation_Test extends TestBase {
assertNotEqualsAny(a1.hashCode(), 0, -1);
assertEqualsAll(a1.hashCode(), d1.hashCode(), d2.hashCode());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledProp_StarPlainField_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanProp_StarPlainField_Test.java
similarity index 87%
rename from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledProp_StarPlainField_Test.java
rename to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanProp_StarPlainField_Test.java
index 0f9bf9a957..303665e49f 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledProp_StarPlainField_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanProp_StarPlainField_Test.java
@@ -22,29 +22,30 @@ import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.Test;
/**
- * {@link MarshalledProp @MarshalledProp} with name/value {@code "*"} on non-{@link Map} fields exposes a normal property named after the
+ * {@link BeanProp @BeanProp} with name/value {@code "*"} on non-{@link Map} fields exposes a normal property named after the
* field; {@code Map} fields keep the dyna property {@code *}.
*/
-class MarshalledProp_StarPlainField_Test extends TestBase {
+class BeanProp_StarPlainField_Test extends TestBase {
- /** {@code *} via shorthand {@link MarshalledProp#value()}. */
+ /** {@code *} via shorthand {@link BeanProp#value()}. */
public static class A {
- @MarshalledProp("*")
+ @BeanProp("*")
public String taggedValue;
}
- /** {@code *} via {@link MarshalledProp#name()}. */
+ /** {@code *} via {@link BeanProp#name()}. */
public static class B {
- @MarshalledProp(name = "*")
+ @BeanProp(name="*")
public int count;
}
/** Dynamic {@code Map} field must remain the dyna property {@code *}. */
public static class C {
- @MarshalledProp("*")
+ @BeanProp("*")
public Map<String, Object> extra = new LinkedHashMap<>();
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledPropAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledPropAnnotation_Test.java
index 5d55600308..01246caa43 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledPropAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledPropAnnotation_Test.java
@@ -38,30 +38,18 @@ class MarshalledPropAnnotation_Test extends TestBase {
.description("a")
.dictionary(X1.class)
.format("b")
- .name("c")
- .params(X1.class)
.properties("e")
- .ro("f")
- .type(X1.class)
- .value("g")
- .wo("h")
.build();
MarshalledProp a2 = MarshalledPropAnnotation.create()
.description("a")
.dictionary(X1.class)
.format("b")
- .name("c")
- .params(X1.class)
.properties("e")
- .ro("f")
- .type(X1.class)
- .value("g")
- .wo("h")
.build();
@Test void a01_basic() {
- assertBean(a1, "description,dictionary,format,name,params,properties,ro,type,value,wo", "[a],[X1],b,c,[X1],e,f,X1,g,h");
+ assertBean(a1, "description,dictionary,format,properties", "[a],[X1],b,e");
}
@Test void a02_testEquivalency() {
@@ -85,34 +73,12 @@ class MarshalledPropAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
public static class D1 {
- @MarshalledProp(
- description={ "a" },
- dictionary=X1.class,
- format="b",
- name="c",
- params=X1.class,
- properties="e",
- ro="f",
- type=X1.class,
- value="g",
- wo="h"
- )
+ @MarshalledProp(description={ "a" }, dictionary=X1.class, format="b", properties="e")
public int f;
}
public static class D2 {
- @MarshalledProp(
- description={ "a" },
- dictionary=X1.class,
- format="b",
- name="c",
- params=X1.class,
- properties="e",
- ro="f",
- type=X1.class,
- value="g",
- wo="h"
- )
+ @MarshalledProp(description={ "a" }, dictionary=X1.class, format="b", properties="e")
public int f;
}
@@ -131,4 +97,4 @@ class MarshalledPropAnnotation_Test extends TestBase {
assertNotEqualsAny(a1.hashCode(), 0, -1);
assertEqualsAll(a1.hashCode(), d1.hashCode(), d2.hashCode());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
index 9a1bc42154..a956d471f2 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
@@ -87,27 +87,27 @@ class Marshalled_Test extends TestBase {
}
//------------------------------------------------------------------------------------------------------------------
- // @MarshalledCtor and @MarshalledProp annotations overrides visibility rules on constructors/properties.
+ // @BeanCtor and @BeanProp annotations overrides visibility rules on constructors/properties.
//------------------------------------------------------------------------------------------------------------------
public static class B1 {
- @MarshalledProp
+ @BeanProp
private int f1;
private int f2;
- @MarshalledProp
+ @BeanProp
private void setF2(int f2) {
this.f2 = f2;
}
- @MarshalledProp
+ @BeanProp
private int getF2() {
return f2;
}
- @MarshalledCtor
+ @BeanCtor
private B1() {}
public static B1 create() {
@@ -126,10 +126,10 @@ class Marshalled_Test extends TestBase {
assertEquals("{f1:1,f2:2}", json);
}
- @MarshalledCtorApply(on="B2()",value=@MarshalledCtor())
- @MarshalledPropApply(on="B2.f1",value=@MarshalledProp())
- @MarshalledPropApply(on="B2.setF2",value=@MarshalledProp())
- @MarshalledPropApply(on="B2.getF2",value=@MarshalledProp())
+ @BeanCtorApply(on="B2()",value=@BeanCtor())
+ @BeanPropApply(on="B2.f1",value=@BeanProp)
+ @BeanPropApply(on="B2.setF2",value=@BeanProp)
+ @BeanPropApply(on="B2.getF2",value=@BeanProp)
private static class B2Config {}
public static class B2 {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/csv/CsvParser_Test.java b/juneau-utest/src/test/java/org/apache/juneau/csv/CsvParser_Test.java
index b5d481e69b..90d22cd28f 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/csv/CsvParser_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/csv/CsvParser_Test.java
@@ -24,6 +24,7 @@ import java.util.stream.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
@@ -272,10 +273,10 @@ class CsvParser_Test extends TestBase {
}
public static class E {
- @MarshalledProp(name = "full_name")
+ @BeanProp(name="full_name")
public String name;
- @MarshalledProp(name = "years")
+ @BeanProp(name="years")
public int age;
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
index aade698565..9e7e360faa 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
@@ -2750,11 +2750,11 @@ class BasicHtml_Test extends TestBase {
}
public static class BeanWithMapProperties {
- @MarshalledProp(type=MapWithStrings.class)
+ @BeanProp(type=MapWithStrings.class)
public Map<String,String> a;
- @MarshalledProp(type=MapWithNumbers.class)
+ @BeanProp(type=MapWithNumbers.class)
public Map<String,Number> b;
- @MarshalledProp(type=MapWithObjects.class)
+ @BeanProp(type=MapWithObjects.class)
public Map<String,Object> c;
BeanWithMapProperties init() {
@@ -2923,7 +2923,7 @@ class BasicHtml_Test extends TestBase {
@Marshalled(typeName=" \b\f\n\t\r ")
public static class BeanWithSpecialCharacters2 {
- @MarshalledProp(name=" \b\f\n\t\r ")
+ @BeanProp(name=" \b\f\n\t\r ")
public String a;
BeanWithSpecialCharacters2 init() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/markdown/MarkdownParser_Test.java b/juneau-utest/src/test/java/org/apache/juneau/markdown/MarkdownParser_Test.java
index 67e06ce2f8..de2963fcb5 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/markdown/MarkdownParser_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/markdown/MarkdownParser_Test.java
@@ -22,6 +22,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
/**
@@ -231,10 +232,10 @@ class MarkdownParser_Test {
}
public static class F {
- @MarshalledProp(name = "full_name")
+ @BeanProp(name="full_name")
public String name;
- @MarshalledProp(name = "years")
+ @BeanProp(name="years")
public int age;
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
index 7f47037a49..e829df4333 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
@@ -273,7 +273,7 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class X1 {
public int a;
- @MarshalledProp("_b") public String b;
+ @BeanProp("_b") public String b;
X1 init() {
a = 1;
@@ -285,7 +285,7 @@ class RestOp_MarshalledConfig_Test extends TestBase {
@BeanType(properties="_b,a")
public static class X2 {
public int a;
- @MarshalledProp("_b") public String b;
+ @BeanProp("_b") public String b;
X2 init() {
a = 1;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transforms/Builder_ComboRoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/transforms/Builder_ComboRoundTripTest.java
index 5b03e7aa03..74f4f72bc8 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/transforms/Builder_ComboRoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transforms/Builder_ComboRoundTripTest.java
@@ -22,6 +22,7 @@ import java.lang.reflect.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Round-trip testing for beans created via builder patterns.
@@ -370,7 +371,7 @@ class Builder_ComboRoundTripTest extends ComboRoundTripTest_Base {
return x;
}
- @MarshalledProp
+ @BeanProp
public HBuilder fooBar(int fooBar) {
this.fooBar = fooBar;
return this;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializer_Test.java b/juneau-utest/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializer_Test.java
index 505814da17..4f1fdde143 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializer_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/urlencoding/UrlEncodingSerializer_Test.java
@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
@SuppressWarnings({
@@ -566,16 +567,16 @@ class UrlEncodingSerializer_Test extends TestBase {
@Marshalled
public static class A {
- @MarshalledProp(name="foo")
+ @BeanProp(name="foo")
public String f1 = "foo";
- @MarshalledProp(name="'foo'")
+ @BeanProp(name="'foo'")
public String f2 = "'foo'";
- @MarshalledProp(name="(foo)")
+ @BeanProp(name="(foo)")
public String f3 = "(foo)";
- @MarshalledProp(name="@(foo)")
+ @BeanProp(name="@(foo)")
public String f4 = "@(foo)";
}
}
\ No newline at end of file
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
index 1c4c51eec8..c1184ebcbf 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
@@ -1343,11 +1343,11 @@ class BasicXml_Test extends TestBase {
}
public static class BeanWithMapProperties {
- @MarshalledProp(type=MapWithStrings.class)
+ @BeanProp(type=MapWithStrings.class)
public Map<String,String> a;
- @MarshalledProp(type=MapWithNumbers.class)
+ @BeanProp(type=MapWithNumbers.class)
public Map<String,Number> b;
- @MarshalledProp(type=MapWithObjects.class)
+ @BeanProp(type=MapWithObjects.class)
public Map<String,Object> c;
BeanWithMapProperties init() {
@@ -1623,7 +1623,7 @@ class BasicXml_Test extends TestBase {
@Marshalled(typeName=" \b\f\n\t\r ")
public static class BeanWithSpecialCharacters2 {
- @MarshalledProp(name=" \b\f\n\t\r ")
+ @BeanProp(name=" \b\f\n\t\r ")
public String a;
BeanWithSpecialCharacters2 init() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlIgnoreComments_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlIgnoreComments_Test.java
index 1c0d840deb..f76e698b7b 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlIgnoreComments_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlIgnoreComments_Test.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
@@ -807,11 +808,11 @@ class XmlIgnoreComments_Test extends TestBase {
}
public static class BeanWithMapProperties {
- @MarshalledProp(type=MapWithStrings.class)
+ @BeanProp(type=MapWithStrings.class)
public Map<String,String> a;
- @MarshalledProp(type=MapWithNumbers.class)
+ @BeanProp(type=MapWithNumbers.class)
public Map<String,Number> b;
- @MarshalledProp(type=MapWithObjects.class)
+ @BeanProp(type=MapWithObjects.class)
public Map<String,Object> c;
BeanWithMapProperties init() {
@@ -1087,7 +1088,7 @@ class XmlIgnoreComments_Test extends TestBase {
@Marshalled(typeName=" \b\f\n\t\r ")
public static class BeanWithSpecialCharacters2 {
- @MarshalledProp(name=" \b\f\n\t\r ")
+ @BeanProp(name=" \b\f\n\t\r ")
public String a;
BeanWithSpecialCharacters2 init() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
index ed929b6ac2..98574e4393 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
@@ -461,8 +461,8 @@ class Xml_Test extends TestBase {
@BeanType(properties="url2,id2,name")
public static class O {
- @MarshalledProp(name="url2") @Xml(format=ELEMENT) public URL url;
- @MarshalledProp(name="id2") public int id;
+ @BeanProp(name="url2") @Xml(format=ELEMENT) public URL url;
+ @BeanProp(name="id2") public int id;
public String name;
public O() {}
public O(String url, int id, String name) {
@@ -493,8 +493,8 @@ class Xml_Test extends TestBase {
@BeanType(properties="url2,id2,name")
public static class P {
- @MarshalledProp(name="url2") @Xml(format=ATTR) public URL url;
- @MarshalledProp(name="id2") @Xml(format=ATTR) public int id;
+ @BeanProp(name="url2") @Xml(format=ATTR) public URL url;
+ @BeanProp(name="id2") @Xml(format=ATTR) public int id;
public String name;
public P() {}
public P(String url, int id, String name) {
@@ -994,7 +994,7 @@ class Xml_Test extends TestBase {
@Xml(format=ATTR)
public String f2;
- @MarshalledProp(name="x3")
+ @BeanProp(name="x3")
@Xml(format=ATTR, prefix="nsf3", namespace="http://nsf3")
public String f3;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/xml1b/T7.java b/juneau-utest/src/test/java/org/apache/juneau/xml/xml1b/T7.java
index 26385cfc40..b3d8edd5d4 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/xml1b/T7.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/xml1b/T7.java
@@ -17,22 +17,23 @@
package org.apache.juneau.xml.xml1b;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.xml.annotation.*;
@Marshalled
public class T7 {
- @MarshalledProp(name="g1") public int f1 = 1;
+ @BeanProp(name="g1") public int f1 = 1;
- @Xml(prefix="bar",namespace="http://bar") @MarshalledProp(name="g2") public int f2 = 2;
+ @Xml(prefix="bar",namespace="http://bar") @BeanProp(name="g2") public int f2 = 2;
private int f3 = 3;
- @MarshalledProp(name="g3") public int getF3() { return f3; }
- @MarshalledProp(name="g3") public void setF3(int v) { f3 = v; }
+ @BeanProp(name="g3") public int getF3() { return f3; }
+ @BeanProp(name="g3") public void setF3(int v) { f3 = v; }
private int f4 = 4;
- @MarshalledProp(name="g4") @Xml(prefix="baz",namespace="http://baz") public int getF4() { return f4; }
- @MarshalledProp(name="g4") public void setF4(int v) { f4 = v; }
+ @BeanProp(name="g4") @Xml(prefix="baz",namespace="http://baz") public int getF4() { return f4; }
+ @BeanProp(name="g4") public void setF4(int v) { f4 = v; }
public boolean equals(T7 x) {
return x.f1 == f1 && x.f2 == f2 && x.f3 == f3 && x.f4 == f4;
diff --git a/scripts/check-fluent-setter-overrides.py b/scripts/check-fluent-setter-overrides.py
index 96b86ca0d4..4ed85c5447 100755
--- a/scripts/check-fluent-setter-overrides.py
+++ b/scripts/check-fluent-setter-overrides.py
@@ -168,11 +168,11 @@ def extract_class_info(file_path): # NOSONAR python:S3776 -- Cognitive complexi
method_name = method_match.group(1)
params = method_match.group(2).strip()
- # Check if method has @MarshalledProp annotation
+ # Check if method has @BeanProp annotation
# Look backwards from the method declaration to check for annotations
method_start_pos = method_match.start()
preceding_text = class_body[max(0, method_start_pos - 200):method_start_pos]
- has_beanp = '@MarshalledProp' in preceding_text
+ has_beanp = '@BeanProp' in preceding_text
# Check if this method returns 'this'
# Look ahead to see if there's a 'return this;' in the method body
@@ -275,7 +275,7 @@ def check_missing_overrides(classes, class_map): # NOSONAR python:S3776 -- Cogn
normalized_params = normalize_params(params)
signature = f"{method_name}({normalized_params})"
- # Skip methods marked with @MarshalledProp in the parent
+ # Skip methods marked with @BeanProp in the parent
# These are automatically handled by annotation inheritance (since 9.2.0)
# and are less critical for type safety
if setter.get('has_beanp'):
(juneau) 03/06: refactor: extract @BeanConfig from @MarshalledConfig (Phase 3 of bean-layer split)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit fc54e2a5e5cb877160d5b16134a977ede3b2949b
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 09:35:18 2026 -0400
refactor: extract @BeanConfig from @MarshalledConfig (Phase 3 of bean-layer split)
Splits the bean-detection / introspection attributes off of @MarshalledConfig
into a new @BeanConfig annotation that lives in juneau-commons (commons.bean),
leaving @MarshalledConfig with only marshalling-specific knobs (typePropertyName,
dictionary[/_replace], swaps[/_replace], locale, mediaType, timeZone, debug).
@BeanConfig in commons.bean is a plain annotation without @ContextApply because
commons cannot reference marshall-layer types. Context.CONTEXT_APPLY_FILTER and
AnnotationWorkList.applyAnnotation now special-case @BeanConfig and route it to
a dedicated BeanConfigAnnotation.Applier in juneau-marshall, which knows how to
push the attributes into MarshallingContext.Builder.
Callsite migrations:
- BasicBeans_Test: @MarshalledConfig(disableIgnoreTransientFields) -> @BeanConfig
- DefaultConfig (juneau-rest-server): @MarshalledConfig(ignoreUnknownBeanProperties,
ignoreUnknownEnumValues) -> @BeanConfig
- MarshalledConfig_Swaps_Test, BasicRestOperations: unchanged (swaps-only).
Test files:
- MarshalledConfigAnnotation_Test.java trimmed to cover only marshalling attrs.
- New BeanConfigAnnotation_Test.java added covering bean-detection attrs.
Co-authored-by: Cursor <cu...@cursor.com>
---
.../apache/juneau/commons/bean/BeanConfig.java} | 361 +----------
.../juneau/commons/bean/BeanConfigAnnotation.java | 39 ++
.../java/org/apache/juneau/AnnotationWorkList.java | 7 +
.../src/main/java/org/apache/juneau/Context.java | 9 +-
...igAnnotation.java => BeanConfigAnnotation.java} | 43 +-
.../apache/juneau/annotation/MarshalledConfig.java | 720 +--------------------
.../annotation/MarshalledConfigAnnotation.java | 29 -
.../apache/juneau/rest/config/DefaultConfig.java | 3 +-
.../java/org/apache/juneau/BasicBeans_Test.java | 2 +-
...on_Test.java => BeanConfigAnnotation_Test.java} | 96 +--
.../MarshalledConfigAnnotation_Test.java | 98 +--
11 files changed, 131 insertions(+), 1276 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfig.java
similarity index 59%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfig.java
index e73e65bb5d..d0388ae825 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfig.java
@@ -14,37 +14,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
-import org.apache.juneau.commons.http.MediaType;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.io.*;
import java.lang.annotation.*;
import java.lang.reflect.*;
-import java.util.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.commons.reflect.Visibility;
-import org.apache.juneau.swap.*;
-import org.apache.juneau.commons.bean.*;
/**
- * Annotation for specifying config properties defined in {@link MarshallingContext} and {@link MarshallingTraverseContext}.
+ * Annotation for specifying bean-modeling config properties on REST classes and methods.
+ *
+ * <p>
+ * The bean-modeling sibling of {@code @MarshalledConfig}.
+ * Where {@code @MarshalledConfig} (in <c>juneau-marshall</c>) carries the marshalling-only attributes
+ * (such as {@code dictionary}, {@code swaps}, {@code typePropertyName}, {@code locale}, {@code mediaType},
+ * and {@code timeZone}), this annotation carries the attributes that describe how the bean MODEL is
+ * detected and introspected — visibility settings, required-properties toggles, fluent-setter detection,
+ * property naming, not-bean exclusions, etc.
*
* <p>
- * Used primarily for specifying marshalling configuration properties on REST classes and methods.
+ * Splitting the annotations lets a class/method participate in bean-modeling configuration without
+ * dragging in any marshalling concerns, and lets the bean-modeling layer live in <c>juneau-commons</c>
+ * independent of <c>juneau-marshall</c>.
*
+ * <p>
+ * Can be used in the following locations:
+ * <ul>
+ * <li>Classes and methods (typically REST classes/methods).
+ * </ul>
*/
+@Documented
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
@Inherited
-@ContextApply(MarshalledConfigAnnotation.Applier.class)
@SuppressWarnings({
"java:S100" // Annotation methods use underscore suffix to avoid Java keyword conflicts
})
-public @interface MarshalledConfig {
+public @interface BeanConfig {
/**
* Minimum bean class visibility.
@@ -69,10 +77,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanClassVisibility(Visibility)}
- * </ul>
- *
* @return The annotation value.
*/
String beanClassVisibility() default "";
@@ -100,10 +104,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanConstructorVisibility(Visibility)}
- * </ul>
- *
* @return The annotation value.
*/
String beanConstructorVisibility() default "";
@@ -131,10 +131,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanFieldVisibility(Visibility)}
- * </ul>
- *
* @return The annotation value.
*/
String beanFieldVisibility() default "";
@@ -143,8 +139,7 @@ public @interface MarshalledConfig {
* BeanMap.put() returns old property value.
*
* <p>
- * If <js>"true"</js>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
- * values.
+ * If <js>"true"</js>, then the {@code BeanMap.put()} method will return old property values.
* <br>Otherwise, it returns <jk>null</jk>.
*
* <ul class='values'>
@@ -157,10 +152,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanMapPutReturnsOldValue()}
- * </ul>
- *
* @return The annotation value.
*/
String beanMapPutReturnsOldValue() default "";
@@ -188,10 +179,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanMethodVisibility(Visibility)}
- * </ul>
- *
* @return The annotation value.
*/
String beanMethodVisibility() default "";
@@ -211,12 +198,6 @@ public @interface MarshalledConfig {
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * <li class='note'>
- * The {@link Bean @Marshalled} annotation can be used on a class to override this setting when <js>"true"</js>.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireDefaultConstructor()}
* </ul>
*
* @return The annotation value.
@@ -238,12 +219,6 @@ public @interface MarshalledConfig {
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * <li class='note'>
- * The {@link Bean @Marshalled} annotation can be used on a class to override this setting when <js>"true"</js>.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireSerializable()}
* </ul>
*
* @return The annotation value.
@@ -267,98 +242,10 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireSettersForGetters()}
- * </ul>
- *
* @return The annotation value.
*/
String beansRequireSettersForGetters() default "";
- /**
- * Debug mode.
- *
- * <p>
- * Enables the following additional information during serialization:
- * <ul class='spaced-list'>
- * <li>
- * When bean getters throws exceptions, the exception includes the object stack information
- * in order to determine how that method was invoked.
- * <li>
- * Enables {@link org.apache.juneau.MarshallingTraverseContext.Builder#detectRecursions()}.
- * </ul>
- *
- * <p>
- * Enables the following additional information during parsing:
- * <ul class='spaced-list'>
- * <li>
- * When bean setters throws exceptions, the exception includes the object stack information
- * in order to determine how that method was invoked.
- * </ul>
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.Context.Builder#debug()}
- * </ul>
- *
- * @return The annotation value.
- */
- String debug() default "";
-
- /**
- * Bean dictionary.
- *
- * <p>
- * The list of classes that make up the bean dictionary in this bean context.
- *
- * <p>
- * A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
- * through reflection.
- * <br>The names are defined through the {@link Bean#typeName() @Marshalled(typeName)} annotation defined on the bean class.
- * <br>For example, if a class <c>Foo</c> has a type-name of <js>"myfoo"</js>, then it would end up serialized
- * as <js>"{_type:'myfoo',...}"</js>.
- *
- * <p>
- * This setting tells the parsers which classes to look for when resolving <js>"_type"</js> attributes.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Bean#dictionary()}
- * <li class='ja'>{@link MarshalledProp#dictionary()}
- * <li class='ja'>{@link MarshalledConfig#dictionary_replace()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanDictionary(Class...)}
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/BeanDictionaryBasics">Bean Dictionary Basics</a>
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] dictionary() default {};
-
- /**
- * Replace bean dictionary.
- *
- * <p>
- * Same as {@link #dictionary()} but replaces any existing value.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Bean#dictionary()}
- * <li class='ja'>{@link MarshalledProp#dictionary()}
- * <li class='ja'>{@link MarshalledConfig#dictionary()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanDictionary(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] dictionary_replace() default {};
-
/**
* Beans don't require at least one property.
*
@@ -376,10 +263,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableBeansRequireSomeProperties()}
- * </ul>
- *
* @return The annotation value.
*/
String disableBeansRequireSomeProperties() default "";
@@ -401,10 +284,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreMissingSetters()}
- * </ul>
- *
* @return The annotation value.
*/
String disableIgnoreMissingSetters() default "";
@@ -425,10 +304,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreTransientFields()}
- * </ul>
- *
* @return The annotation value.
*/
String disableIgnoreTransientFields() default "";
@@ -450,10 +325,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreUnknownNullBeanProperties()}
- * </ul>
- *
* @return The annotation value.
*/
String disableIgnoreUnknownNullBeanProperties() default "";
@@ -476,10 +347,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableInterfaceProxies()}
- * </ul>
- *
* @return The annotation value.
*/
String disableInterfaceProxies() default "";
@@ -510,8 +377,7 @@ public @interface MarshalledConfig {
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Bean#findFluentSetters()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#findFluentSetters()}
+ * <li class='ja'>{@link BeanType#findFluentSetters()}
* </ul>
*
* @return The annotation value.
@@ -535,10 +401,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreInvocationExceptionsOnGetters()}
- * </ul>
- *
* @return The annotation value.
*/
String ignoreInvocationExceptionsOnGetters() default "";
@@ -560,10 +422,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreInvocationExceptionsOnSetters()}
- * </ul>
- *
* @return The annotation value.
*/
String ignoreInvocationExceptionsOnSetters() default "";
@@ -585,10 +443,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreUnknownBeanProperties()}
- * </ul>
- *
* @return The annotation value.
*/
String ignoreUnknownBeanProperties() default "";
@@ -609,10 +463,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreUnknownEnumValues()}
- * </ul>
- *
* @return The annotation value.
*/
String ignoreUnknownEnumValues() default "";
@@ -636,7 +486,7 @@ public @interface MarshalledConfig {
* }
*
* <jc>// Apply it to a config</jc>
- * <ja>@MarshalledConfig</ja>(
+ * <ja>@BeanConfig</ja>(
* interfaces={
* A.<jk>class</jk>
* }
@@ -648,53 +498,13 @@ public @interface MarshalledConfig {
* individually on the child classes.
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link Bean#interfaceClass() @Marshalled(interfaceClass)} annotation is the equivalent annotation-based solution.
+ * <li class='note'>The {@link BeanType#interfaceClass() @BeanType(interfaceClass)} annotation is the equivalent annotation-based solution.
* </ul>
*
* @return The annotation value.
*/
Class<?>[] interfaces() default {};
- /**
- * Locale.
- *
- * <p>
- * Specifies the default locale for serializer and parser sessions.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingSession.Builder#locale(Locale)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#locale(Locale)}
- * </ul>
- *
- * @return The annotation value.
- */
- String locale() default "";
-
- /**
- * Media type.
- *
- * <p>
- * Specifies the default media type value for serializer and parser sessions.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingSession.Builder#mediaType(MediaType)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#mediaType(MediaType)}
- * </ul>
- *
- * @return The annotation value.
- */
- String mediaType() default "";
-
/**
* Bean class exclusions.
*
@@ -707,11 +517,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledIgnore}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanClasses(Class...)}
- * </ul>
- *
* @return The annotation value.
*/
Class<?>[] notBeanClasses() default {};
@@ -722,10 +527,6 @@ public @interface MarshalledConfig {
* <p>
* Same as {@link #notBeanClasses()} but replaces any existing value.
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanClasses(Class...)}
- * </ul>
- *
* @return The annotation value.
*/
Class<?>[] notBeanClasses_replace() default {};
@@ -759,10 +560,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanPackages(String...)}
- * </ul>
- *
* @return The annotation value.
*/
String[] notBeanPackages() default {};
@@ -773,10 +570,6 @@ public @interface MarshalledConfig {
* <p>
* Same as {@link #notBeanPackages()} but replaces any existing value.
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanPackages(String...)}
- * </ul>
- *
* @return The annotation value.
*/
String[] notBeanPackages_replace() default {};
@@ -795,10 +588,6 @@ public @interface MarshalledConfig {
* <li>{@link PropertyNamerULC} - Dashed-upper-case names.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#propertyNamer(Class)}
- * </ul>
- *
* @return The annotation value.
*/
Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Void.class;
@@ -829,100 +618,10 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#unsortedProperties()}
- * </ul>
- *
* @return The annotation value.
*/
String unsortedProperties() default "";
- /**
- * Java object swaps.
- *
- * <p>
- * Swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization,
- * and "swap in" the non-serializable class during parsing.
- *
- * <p>
- * An example of a swap would be a <c>Calendar</c> object that gets swapped out for an ISO8601 string.
- *
- * <p>
- * Multiple swaps can be associated with a single class.
- * <br>When multiple swaps are applicable to the same class, the media type pattern defined by
- * {@link ObjectSwap#forMediaTypes()} or {@link Swap#mediaTypes() @Swap(mediaTypes)} are used to come up with the best match.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#swaps(Class...)}
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/SwapBasics">Swap Basics</a>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/PerMediaTypeSwaps">Per-media-type Swaps</a>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/OneWaySwaps">One-way Swaps</a>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/SwapAnnotation">@Swap Annotation</a>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/AutoSwaps">Auto-detected swaps</a>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/SurrogateClasses">Surrogate Classes</a>
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] swaps() default {};
-
- /**
- * Replace Java object swap classes.
- *
- * <p>
- * Same as {@link #swaps()} but replaces any existing value.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#swaps(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] swaps_replace() default {};
-
- /**
- * Time zone.
- *
- * <p>
- * Specifies the default timezone for serializer and parser sessions.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingSession.Builder#timeZone(TimeZone)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#timeZone(TimeZone)}
- * </ul>
- *
- * @return The annotation value.
- */
- String timeZone() default "";
-
- /**
- * Bean type property name.
- *
- * <p>
- * This specifies the name of the bean property used to store the dictionary name of a bean type so that the
- * parser knows the data type to reconstruct.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Default value: <js>"_type"</js>.
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Bean#typePropertyName()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#typePropertyName(String)}
- * </ul>
- *
- * @return The annotation value.
- */
- String typePropertyName() default "";
-
/**
* Use enum names.
*
@@ -939,10 +638,6 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#useEnumNames()}
- * </ul>
- *
* @return The annotation value.
*/
String useEnumNames() default "";
@@ -952,7 +647,7 @@ public @interface MarshalledConfig {
*
* <p>
* Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
- * <br>Most {@link Bean @Marshalled} annotations will be ignored.
+ * <br>Most {@link BeanType @BeanType} annotations will be ignored.
*
* <ul class='values'>
* <li><js>"true"</js>
@@ -964,11 +659,7 @@ public @interface MarshalledConfig {
* Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#useJavaBeanIntrospector()}
- * </ul>
- *
* @return The annotation value.
*/
String useJavaBeanIntrospector() default "";
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfigAnnotation.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfigAnnotation.java
new file mode 100644
index 0000000000..17b9c33991
--- /dev/null
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfigAnnotation.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.commons.bean;
+
+/**
+ * Utility classes and methods for the {@link BeanConfig @BeanConfig} annotation.
+ *
+ * <p>
+ * This class is intentionally a metadata-only placeholder in the bean-modeling layer.
+ * The actual application logic that pushes {@link BeanConfig @BeanConfig} attributes into a
+ * marshalling context builder lives in {@code juneau-marshall} (in the sibling
+ * {@code org.apache.juneau.annotation.BeanConfigAnnotation.Applier} class), since
+ * {@code juneau-commons} cannot depend on {@code juneau-marshall}.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanConfig}
+ * </ul>
+ */
+public class BeanConfigAnnotation {
+
+ /**
+ * Prevents instantiation.
+ */
+ private BeanConfigAnnotation() {}
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationWorkList.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationWorkList.java
index a46bb868b6..145d76a98d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationWorkList.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/AnnotationWorkList.java
@@ -25,6 +25,7 @@ import java.util.*;
import java.util.stream.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.BeanConfig;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
@@ -131,6 +132,12 @@ public class AnnotationWorkList extends ArrayList<AnnotationWork> {
})
private void applyAnnotation(AnnotationInfo<?> ai) {
var a = ai.inner();
+ // Special-case @BeanConfig from juneau-commons. The annotation cannot reference @ContextApply
+ // (which lives in juneau-marshall), so we route it to its Applier directly.
+ if (a.annotationType() == BeanConfig.class) {
+ add(ai, (AnnotationApplier<Annotation,Object>)(AnnotationApplier<?,?>) new BeanConfigAnnotation.Applier(vrs));
+ return;
+ }
var cpa = assertNotNull(a.annotationType().getAnnotation(ContextApply.class), "Annotation found without @ContextApply: %s", cn(ai.annotationType()));
Arrays.stream(cpa.value())
.map(x -> safe(() -> (Constructor<? extends AnnotationApplier<?,?>>)x.getConstructor(VarResolverSession.class)))
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index 9c51445e85..87f4496858 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -29,6 +29,7 @@ import java.util.function.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.bson.annotation.BsonConfig;
import org.apache.juneau.cbor.annotation.CborConfig;
+import org.apache.juneau.commons.bean.BeanConfig;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.commons.utils.*;
@@ -877,8 +878,14 @@ public abstract class Context {
/**
* Predicate for annotations that themselves are annotated with {@link ContextApply}.
+ *
+ * <p>
+ * Also matches {@link BeanConfig} from {@code juneau-commons}, which intentionally lacks a
+ * {@link ContextApply @ContextApply} meta-annotation because {@code juneau-commons} cannot reference
+ * marshall-layer types. {@link AnnotationWorkList} routes {@link BeanConfig} to its
+ * {@link BeanConfigAnnotation.Applier} via an explicit special case.
*/
- public static final Predicate<AnnotationInfo<?>> CONTEXT_APPLY_FILTER = x -> x.hasAnnotation(ContextApply.class);
+ public static final Predicate<AnnotationInfo<?>> CONTEXT_APPLY_FILTER = x -> x.hasAnnotation(ContextApply.class) || x.annotationType() == BeanConfig.class;
/**
* Instantiates a builder of the specified context class.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanConfigAnnotation.java
similarity index 72%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanConfigAnnotation.java
index c5708159ce..9960d212ba 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanConfigAnnotation.java
@@ -16,31 +16,41 @@
*/
package org.apache.juneau.annotation;
-import org.apache.juneau.commons.http.MediaType;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import java.util.*;
-
import org.apache.juneau.*;
import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
/**
- * Utility classes and methods for the {@link MarshalledConfig @MarshalledConfig} annotation.
+ * Utility classes and methods for the {@link BeanConfig @BeanConfig} annotation.
+ *
+ * <p>
+ * Houses the {@link Applier} that pushes {@link BeanConfig @BeanConfig} attributes into a
+ * {@link org.apache.juneau.MarshallingContext.Builder}. The annotation itself lives in
+ * {@code juneau-commons} (in {@link org.apache.juneau.commons.bean.BeanConfig}), but
+ * the application logic lives here in {@code juneau-marshall} because it depends on
+ * marshall-layer types ({@link AnnotationApplier}, {@link MarshallingContext.Builder},
+ * {@link VarResolverSession}, etc.).
*
+ * <p>
+ * Because {@link BeanConfig @BeanConfig} cannot carry a {@link ContextApply @ContextApply}
+ * meta-annotation (that annotation lives in {@code juneau-marshall} and cannot be referenced
+ * from {@code juneau-commons}), {@link AnnotationWorkList} special-cases the
+ * {@link BeanConfig} annotation type and instantiates this {@link Applier} directly.
*/
-public class MarshalledConfigAnnotation {
+public class BeanConfigAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledConfigAnnotation() {}
+ private BeanConfigAnnotation() {}
/**
- * Applies {@link MarshalledConfig} annotations to a {@link org.apache.juneau.MarshallingContext.Builder}.
+ * Applies {@link BeanConfig} annotations to a {@link org.apache.juneau.MarshallingContext.Builder}.
*/
- public static class Applier extends AnnotationApplier<MarshalledConfig,MarshallingContext.Builder> {
+ public static class Applier extends AnnotationApplier<BeanConfig,MarshallingContext.Builder> {
/**
* Constructor.
@@ -48,12 +58,12 @@ public class MarshalledConfigAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public Applier(VarResolverSession vr) {
- super(MarshalledConfig.class, MarshallingContext.Builder.class, vr);
+ super(BeanConfig.class, MarshallingContext.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<MarshalledConfig> ai, MarshallingContext.Builder b) {
- MarshalledConfig a = ai.inner();
+ public void apply(AnnotationInfo<BeanConfig> ai, MarshallingContext.Builder b) {
+ BeanConfig a = ai.inner();
// @formatter:off
string(a.beanClassVisibility()).map(Visibility::valueOf).ifPresent(b::beanClassVisibility);
@@ -65,7 +75,6 @@ public class MarshalledConfigAnnotation {
bool(a.beansRequireSerializable()).ifPresent(b::beansRequireSerializable);
bool(a.beansRequireSettersForGetters()).ifPresent(b::beansRequireSettersForGetters);
bool(a.disableBeansRequireSomeProperties()).ifPresent(b::disableBeansRequireSomeProperties);
- bool(a.debug()).ifPresent(b::debug);
bool(a.findFluentSetters()).ifPresent(b::findFluentSetters);
bool(a.ignoreInvocationExceptionsOnGetters()).ifPresent(b::ignoreInvocationExceptionsOnGetters);
bool(a.ignoreInvocationExceptionsOnSetters()).ifPresent(b::ignoreInvocationExceptionsOnSetters);
@@ -78,14 +87,6 @@ public class MarshalledConfigAnnotation {
bool(a.useEnumNames()).ifPresent(b::useEnumNames);
bool(a.disableInterfaceProxies()).ifPresent(b::disableInterfaceProxies);
bool(a.useJavaBeanIntrospector()).ifPresent(b::useJavaBeanIntrospector);
- string(a.typePropertyName()).ifPresent(b::typePropertyName);
- string(a.locale()).map(Locale::forLanguageTag).ifPresent(b::locale);
- string(a.mediaType()).map(MediaType::of).ifPresent(b::mediaType);
- string(a.timeZone()).map(TimeZone::getTimeZone).ifPresent(b::timeZone);
- classes(a.dictionary()).ifPresent(b::beanDictionary);
- classes(a.dictionary_replace()).ifPresent(x -> { b.beanDictionary().clear(); b.beanDictionary(x);});
- classes(a.swaps()).ifPresent(b::swaps);
- classes(a.swaps_replace()).ifPresent(x -> { b.swaps().clear(); b.swaps(x);});
classes(a.notBeanClasses()).ifPresent(b::notBeanClasses);
classes(a.notBeanClasses_replace()).ifPresent(x -> { b.notBeanClasses().clear(); b.notBeanClasses(x);});
type(a.propertyNamer()).ifPresent(b::propertyNamer);
@@ -95,4 +96,4 @@ public class MarshalledConfigAnnotation {
// @formatter:on
}
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
index e73e65bb5d..aec1ef5fda 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
@@ -20,22 +20,24 @@ import org.apache.juneau.commons.http.MediaType;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
-import java.io.*;
import java.lang.annotation.*;
-import java.lang.reflect.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.commons.reflect.Visibility;
import org.apache.juneau.swap.*;
-import org.apache.juneau.commons.bean.*;
/**
- * Annotation for specifying config properties defined in {@link MarshallingContext} and {@link MarshallingTraverseContext}.
+ * Annotation for specifying marshalling-only config properties defined in {@link MarshallingContext} and {@link MarshallingTraverseContext}.
*
* <p>
* Used primarily for specifying marshalling configuration properties on REST classes and methods.
*
+ * <p>
+ * This annotation is the marshalling-only sibling of {@code @BeanConfig}. After the Phase 3 split,
+ * bean-modeling attributes (visibility settings, fluent-setter detection, property naming, not-bean
+ * exclusions, etc.) live on {@link org.apache.juneau.commons.bean.BeanConfig @BeanConfig} in
+ * {@code juneau-commons}. Attributes that affect wire format, type discriminators, swap classes,
+ * locale/media-type/timezone, and debug mode stay here on {@code @MarshalledConfig}.
*/
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
@@ -46,235 +48,6 @@ import org.apache.juneau.commons.bean.*;
})
public @interface MarshalledConfig {
- /**
- * Minimum bean class visibility.
- *
- * <p>
- * Classes are not considered beans unless they meet the minimum visibility requirements.
- *
- * <p>
- * For example, if the visibility is <c>PUBLIC</c> and the bean class is <jk>protected</jk>, then the class
- * will not be interpreted as a bean class and be serialized as a string.
- * <br>Use this setting to reduce the visibility requirement.
- *
- * <ul class='values'>
- * <li><js>"PUBLIC"</js> (default)
- * <li><js>"PROTECTED"</js>
- * <li><js>"DEFAULT"</js>
- * <li><js>"PRIVATE"</js>
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanClassVisibility(Visibility)}
- * </ul>
- *
- * @return The annotation value.
- */
- String beanClassVisibility() default "";
-
- /**
- * Minimum bean constructor visibility.
- *
- * <p>
- * Only look for constructors with the specified minimum visibility.
- *
- * <p>
- * This setting affects the logic for finding no-arg constructors for bean.
- * <br>Normally, only <jk>public</jk> no-arg constructors are used.
- * <br>Use this setting if you want to reduce the visibility requirement.
- *
- * <ul class='values'>
- * <li><js>"PUBLIC"</js> (default)
- * <li><js>"PROTECTED"</js>
- * <li><js>"DEFAULT"</js>
- * <li><js>"PRIVATE"</js>
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanConstructorVisibility(Visibility)}
- * </ul>
- *
- * @return The annotation value.
- */
- String beanConstructorVisibility() default "";
-
- /**
- * Minimum bean field visibility.
- *
- * <p>
- * Only look for bean fields with the specified minimum visibility.
- *
- * <p>
- * This affects which fields on a bean class are considered bean properties.
- * <br>Normally only <jk>public</jk> fields are considered.
- * <br>Use this setting if you want to reduce the visibility requirement.
- *
- * <ul class='values'>
- * <li><js>"PUBLIC"</js> (default)
- * <li><js>"PROTECTED"</js>
- * <li><js>"DEFAULT"</js>
- * <li><js>"PRIVATE"</js>
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanFieldVisibility(Visibility)}
- * </ul>
- *
- * @return The annotation value.
- */
- String beanFieldVisibility() default "";
-
- /**
- * BeanMap.put() returns old property value.
- *
- * <p>
- * If <js>"true"</js>, then the {@link BeanMap#put(String,Object) BeanMap.put()} method will return old property
- * values.
- * <br>Otherwise, it returns <jk>null</jk>.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default because it introduces a slight performance penalty during serialization)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanMapPutReturnsOldValue()}
- * </ul>
- *
- * @return The annotation value.
- */
- String beanMapPutReturnsOldValue() default "";
-
- /**
- * Minimum bean method visibility.
- *
- * <p>
- * Only look for bean methods with the specified minimum visibility.
- *
- * <p>
- * This affects which methods are detected as getters and setters on a bean class.
- * <br>Normally only <jk>public</jk> getters and setters are considered.
- * <br>Use this setting if you want to reduce the visibility requirement.
- *
- * <ul class='values'>
- * <li><js>"PUBLIC"</js> (default)
- * <li><js>"PROTECTED"</js>
- * <li><js>"DEFAULT"</js>
- * <li><js>"PRIVATE"</js>
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanMethodVisibility(Visibility)}
- * </ul>
- *
- * @return The annotation value.
- */
- String beanMethodVisibility() default "";
-
- /**
- * Beans require no-arg constructors.
- *
- * <p>
- * If <js>"true"</js>, a Java class must implement a default no-arg constructor to be considered a bean.
- * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * <li class='note'>
- * The {@link Bean @Marshalled} annotation can be used on a class to override this setting when <js>"true"</js>.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireDefaultConstructor()}
- * </ul>
- *
- * @return The annotation value.
- */
- String beansRequireDefaultConstructor() default "";
-
- /**
- * Beans require Serializable interface.
- *
- * <p>
- * If <js>"true"</js>, a Java class must implement the {@link Serializable} interface to be considered a bean.
- * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * <li class='note'>
- * The {@link Bean @Marshalled} annotation can be used on a class to override this setting when <js>"true"</js>.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireSerializable()}
- * </ul>
- *
- * @return The annotation value.
- */
- String beansRequireSerializable() default "";
-
- /**
- * Beans require setters for getters.
- *
- * <p>
- * If <js>"true"</js>, only getters that have equivalent setters will be considered as properties on a bean.
- * <br>Otherwise, they will be ignored.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beansRequireSettersForGetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- String beansRequireSettersForGetters() default "";
-
/**
* Debug mode.
*
@@ -359,302 +132,6 @@ public @interface MarshalledConfig {
*/
Class<?>[] dictionary_replace() default {};
- /**
- * Beans don't require at least one property.
- *
- * <p>
- * If <js>"true"</js>, then a Java class doesn't need to contain at least 1 property to be considered a bean.
- * <br>Otherwise, the bean will be serialized as a string using the {@link Object#toString()} method.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableBeansRequireSomeProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- String disableBeansRequireSomeProperties() default "";
-
- /**
- * Don't silently ignore missing setters.
- *
- * <p>
- * If <js>"true"</js>, trying to set a value on a bean property without a setter will throw a {@code BeanRuntimeException}.
- * <br>Otherwise it will be sliently ignored.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreMissingSetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- String disableIgnoreMissingSetters() default "";
-
- /**
- * Don't ignore transient fields.
- *
- * <p>
- * If <jk>true</jk>, methods and fields marked as <jk>transient</jk> will not be ignored as bean properties.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreTransientFields()}
- * </ul>
- *
- * @return The annotation value.
- */
- String disableIgnoreTransientFields() default "";
-
- /**
- * Don't ignore unknown properties with null values.
- *
- * <p>
- * If <js>"true"</js>, trying to set a <jk>null</jk> value on a non-existent bean property will throw a {@code BeanRuntimeException}.
- * Otherwise it will be silently ignored.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableIgnoreUnknownNullBeanProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- String disableIgnoreUnknownNullBeanProperties() default "";
-
- /**
- * Don't use interface proxies.
- *
- * <p>
- * Disables the feature where interfaces will be instantiated as proxy classes through the use of an
- * {@link InvocationHandler} if there is no other way of instantiating them.
- * <br>Setting this to <js>"true"</js> causes this to be a {@link org.apache.juneau.commons.reflect.BeanRuntimeException}.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#disableInterfaceProxies()}
- * </ul>
- *
- * @return The annotation value.
- */
- String disableInterfaceProxies() default "";
-
- /**
- * Find fluent setters.
- *
- * <p>
- * When enabled, fluent setters are detected on beans.
- *
- * <p>
- * Fluent setters must have the following attributes:
- * <ul>
- * <li>Public.
- * <li>Not static.
- * <li>Take in one parameter.
- * <li>Return the bean itself.
- * </ul>
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Bean#findFluentSetters()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#findFluentSetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- String findFluentSetters() default "";
-
- /**
- * Ignore invocation errors on getters.
- *
- * <p>
- * If <js>"true"</js>, errors thrown when calling bean getter methods will silently be ignored.
- * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreInvocationExceptionsOnGetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- String ignoreInvocationExceptionsOnGetters() default "";
-
- /**
- * Ignore invocation errors on setters.
- *
- * <p>
- * If <js>"true"</js>, errors thrown when calling bean setter methods will silently be ignored.
- * <br>Otherwise, a {@code BeanRuntimeException} is thrown.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreInvocationExceptionsOnSetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- String ignoreInvocationExceptionsOnSetters() default "";
-
- /**
- * Ignore unknown properties.
- *
- * <p>
- * If <js>"true"</js>, trying to set a value on a non-existent bean property will silently be ignored.
- * <br>Otherwise, a {@code RuntimeException} is thrown.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreUnknownBeanProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- String ignoreUnknownBeanProperties() default "";
-
- /**
- * Ignore unknown enum values.
- *
- * <p>
- * If <js>"true"</js>, unknown enum values are set to <jk>null</jk> instead of throwing an exception.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#ignoreUnknownEnumValues()}
- * </ul>
- *
- * @return The annotation value.
- */
- String ignoreUnknownEnumValues() default "";
-
- /**
- * Identifies a set of interfaces.
- *
- * <p>
- * When specified, only the list of properties defined on the interface class will be used during serialization
- * of implementation classes. Additional properties on subclasses will be ignored.
- *
- * <p class='bjava'>
- * <jc>// Parent class or interface</jc>
- * <jk>public abstract class</jk> A {
- * <jk>public</jk> String <jf>foo</jf> = <js>"foo"</js>;
- * }
- *
- * <jc>// Sub class</jc>
- * <jk>public class</jk> A1 <jk>extends</jk> A {
- * <jk>public</jk> String <jf>bar</jf> = <js>"bar"</js>;
- * }
- *
- * <jc>// Apply it to a config</jc>
- * <ja>@MarshalledConfig</ja>(
- * interfaces={
- * A.<jk>class</jk>
- * }
- * )
- * </p>
- *
- * <p>
- * This annotation can be used on the parent class so that it filters to all child classes, or can be set
- * individually on the child classes.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link Bean#interfaceClass() @Marshalled(interfaceClass)} annotation is the equivalent annotation-based solution.
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] interfaces() default {};
-
/**
* Locale.
*
@@ -695,114 +172,6 @@ public @interface MarshalledConfig {
*/
String mediaType() default "";
- /**
- * Bean class exclusions.
- *
- * <p>
- * List of classes that should not be treated as beans even if they appear to be bean-like.
- * <br>Not-bean classes are converted to <c>Strings</c> during serialization.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledIgnore}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanClasses(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] notBeanClasses() default {};
-
- /**
- * Replace classes that should not be considered beans.
- *
- * <p>
- * Same as {@link #notBeanClasses()} but replaces any existing value.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanClasses(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] notBeanClasses_replace() default {};
-
- /**
- * Bean package exclusions.
- *
- * <p>
- * When specified, the current list of ignore packages are appended to.
- *
- * <p>
- * Any classes within these packages will be serialized to strings using {@link Object#toString()}.
- *
- * <p>
- * Note that you can specify suffix patterns to include all subpackages.
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * The default value excludes the following packages:
- * <ul class='compact'>
- * <li class='jp'><c>java.lang</c>
- * <li class='jp'><c>java.lang.annotation</c>
- * <li class='jp'><c>java.lang.ref</c>
- * <li class='jp'><c>java.lang.reflect</c>
- * <li class='jp'><c>java.io</c>
- * <li class='jp'><c>java.net</c>
- * <li class='jp'><c>java.nio.*</c>
- * <li class='jp'><c>java.util.*</c>
- * </ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanPackages(String...)}
- * </ul>
- *
- * @return The annotation value.
- */
- String[] notBeanPackages() default {};
-
- /**
- * Replace packages whose classes should not be considered beans.
- *
- * <p>
- * Same as {@link #notBeanPackages()} but replaces any existing value.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#notBeanPackages(String...)}
- * </ul>
- *
- * @return The annotation value.
- */
- String[] notBeanPackages_replace() default {};
-
- /**
- * Bean property namer.
- *
- * <p>
- * The class to use for calculating bean property names.
- *
- * <p>
- * Predefined classes:
- * <ul>
- * <li>{@link BasicPropertyNamer} (default)
- * <li>{@link PropertyNamerDLC} - Dashed-lower-case names.
- * <li>{@link PropertyNamerULC} - Dashed-upper-case names.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#propertyNamer(Class)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Void.class;
-
/**
* Optional rank for this config.
*
@@ -813,30 +182,6 @@ public @interface MarshalledConfig {
*/
int rank() default 0;
- /**
- * Disable sorted bean properties.
- *
- * <p>
- * When <jk>true</jk>, bean properties are serialized and accessed in natural JVM order instead of the default alphabetical order.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default — properties are sorted alphabetically)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#unsortedProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- String unsortedProperties() default "";
-
/**
* Java object swaps.
*
@@ -922,53 +267,4 @@ public @interface MarshalledConfig {
* @return The annotation value.
*/
String typePropertyName() default "";
-
- /**
- * Use enum names.
- *
- * <p>
- * When enabled, enums are always serialized by name, not using {@link Object#toString()}.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#useEnumNames()}
- * </ul>
- *
- * @return The annotation value.
- */
- String useEnumNames() default "";
-
- /**
- * Use Java Introspector.
- *
- * <p>
- * Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
- * <br>Most {@link Bean @Marshalled} annotations will be ignored.
- *
- * <ul class='values'>
- * <li><js>"true"</js>
- * <li><js>"false"</js> (default)
- * </ul>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#useJavaBeanIntrospector()}
- * </ul>
- *
- * @return The annotation value.
- */
- String useJavaBeanIntrospector() default "";
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
index c5708159ce..9bc6c9d01a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
@@ -17,12 +17,10 @@
package org.apache.juneau.annotation;
import org.apache.juneau.commons.http.MediaType;
-import static org.apache.juneau.commons.utils.CollectionUtils.*;
import java.util.*;
import org.apache.juneau.*;
-import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
@@ -56,28 +54,7 @@ public class MarshalledConfigAnnotation {
MarshalledConfig a = ai.inner();
// @formatter:off
- string(a.beanClassVisibility()).map(Visibility::valueOf).ifPresent(b::beanClassVisibility);
- string(a.beanConstructorVisibility()).map(Visibility::valueOf).ifPresent(b::beanConstructorVisibility);
- string(a.beanFieldVisibility()).map(Visibility::valueOf).ifPresent(b::beanFieldVisibility);
- string(a.beanMethodVisibility()).map(Visibility::valueOf).ifPresent(b::beanMethodVisibility);
- bool(a.beanMapPutReturnsOldValue()).ifPresent(b::beanMapPutReturnsOldValue);
- bool(a.beansRequireDefaultConstructor()).ifPresent(b::beansRequireDefaultConstructor);
- bool(a.beansRequireSerializable()).ifPresent(b::beansRequireSerializable);
- bool(a.beansRequireSettersForGetters()).ifPresent(b::beansRequireSettersForGetters);
- bool(a.disableBeansRequireSomeProperties()).ifPresent(b::disableBeansRequireSomeProperties);
bool(a.debug()).ifPresent(b::debug);
- bool(a.findFluentSetters()).ifPresent(b::findFluentSetters);
- bool(a.ignoreInvocationExceptionsOnGetters()).ifPresent(b::ignoreInvocationExceptionsOnGetters);
- bool(a.ignoreInvocationExceptionsOnSetters()).ifPresent(b::ignoreInvocationExceptionsOnSetters);
- bool(a.disableIgnoreMissingSetters()).ifPresent(b::disableIgnoreMissingSetters);
- bool(a.disableIgnoreTransientFields()).ifPresent(b::disableIgnoreTransientFields);
- bool(a.ignoreUnknownBeanProperties()).ifPresent(b::ignoreUnknownBeanProperties);
- bool(a.ignoreUnknownEnumValues()).ifPresent(b::ignoreUnknownEnumValues);
- bool(a.disableIgnoreUnknownNullBeanProperties()).ifPresent(b::disableIgnoreUnknownNullBeanProperties);
- bool(a.unsortedProperties()).ifPresent(b::unsortedProperties);
- bool(a.useEnumNames()).ifPresent(b::useEnumNames);
- bool(a.disableInterfaceProxies()).ifPresent(b::disableInterfaceProxies);
- bool(a.useJavaBeanIntrospector()).ifPresent(b::useJavaBeanIntrospector);
string(a.typePropertyName()).ifPresent(b::typePropertyName);
string(a.locale()).map(Locale::forLanguageTag).ifPresent(b::locale);
string(a.mediaType()).map(MediaType::of).ifPresent(b::mediaType);
@@ -86,12 +63,6 @@ public class MarshalledConfigAnnotation {
classes(a.dictionary_replace()).ifPresent(x -> { b.beanDictionary().clear(); b.beanDictionary(x);});
classes(a.swaps()).ifPresent(b::swaps);
classes(a.swaps_replace()).ifPresent(x -> { b.swaps().clear(); b.swaps(x);});
- classes(a.notBeanClasses()).ifPresent(b::notBeanClasses);
- classes(a.notBeanClasses_replace()).ifPresent(x -> { b.notBeanClasses().clear(); b.notBeanClasses(x);});
- type(a.propertyNamer()).ifPresent(b::propertyNamer);
- l(a.interfaces()).stream().map(x -> BeanTypeApplyAnnotation.create(x).value(BeanTypeAnnotation.create().interfaceClass(x).build()).build()).forEach(b::annotations);
- strings(a.notBeanPackages()).ifPresent(b::notBeanPackages);
- strings(a.notBeanPackages_replace()).ifPresent(x -> {b.notBeanPackages().clear(); b.notBeanPackages(x);});
// @formatter:on
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/config/DefaultConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/config/DefaultConfig.java
index b5d4f64e7e..d4b1aa7172 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/config/DefaultConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/config/DefaultConfig.java
@@ -17,6 +17,7 @@
package org.apache.juneau.rest.config;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.oapi.*;
import org.apache.juneau.rest.annotation.*;
@@ -126,7 +127,7 @@ import org.apache.juneau.serializer.annotation.*;
staticFiles=StaticFiles.Void.class, // Defaults to BasicStaticFiles.
swaggerProvider=SwaggerProvider.Void.class // Defaults to BasicSwaggerProvider.
)
-@MarshalledConfig(
+@BeanConfig(
// When parsing generated beans, ignore unknown properties that may only exist as getters and not setters.
ignoreUnknownBeanProperties="true",
ignoreUnknownEnumValues="true"
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
index ed14c2dc90..76b761b111 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BasicBeans_Test.java
@@ -44,7 +44,7 @@ class BasicBeans_Test extends TestBase {
}
}
- @MarshalledConfig(disableIgnoreTransientFields="true")
+ @BeanConfig(disableIgnoreTransientFields="true")
public static class A {}
@Test void a01_testTransientFieldsIgnored() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
similarity index 67%
copy from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
copy to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
index 2aa142fe50..dba55f5826 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanConfigAnnotation_Test.java
@@ -30,23 +30,27 @@ import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.json.*;
import org.apache.juneau.marshaller.*;
import org.apache.juneau.svl.*;
-import org.apache.juneau.swap.*;
import org.junit.jupiter.api.*;
import org.apache.juneau.commons.bean.*;
/**
- * Tests the @MarshalledConfig annotation.
+ * Tests the bean-modeling attributes of the @BeanConfig annotation.
+ *
+ * <p>
+ * These tests were extracted from {@code MarshalledConfigAnnotation_Test} during Phase 3 of the
+ * bean-layer split, when bean-modeling attributes moved off {@code @MarshalledConfig} onto
+ * {@code @BeanConfig} in {@code juneau-commons}.
*/
@SuppressWarnings({
"java:S5961" // High assertion count acceptable in comprehensive test
})
-class MarshalledConfigAnnotation_Test extends TestBase {
+class BeanConfigAnnotation_Test extends TestBase {
private static void check(String expected, Object o) {
assertEquals(expected, TO_STRING.apply(o));
}
- private static final Function<Object,String> TO_STRING = new Function<>() {
+ private static final Function<Object,String> TO_STRING = new Function<>() {
@Override
public String apply(Object t) {
if (t == null)
@@ -108,18 +112,10 @@ class MarshalledConfigAnnotation_Test extends TestBase {
public static class A3 {
public int foo;
}
- public static class AB1 extends ObjectSwap<String,Integer> {
- }
- public static class AB2 extends ObjectSwap<String,Integer> {
- }
- public static class AB3 extends ObjectSwap<String,Integer> {
- }
- @MarshalledConfig(
+ @BeanConfig(
beanClassVisibility="$X{PRIVATE}",
beanConstructorVisibility="$X{PRIVATE}",
- dictionary={A1.class,A2.class},
- dictionary_replace={A1.class,A2.class,A3.class},
beanFieldVisibility="$X{PRIVATE}",
beanMapPutReturnsOldValue="$X{true}",
beanMethodVisibility="$X{PRIVATE}",
@@ -127,8 +123,6 @@ class MarshalledConfigAnnotation_Test extends TestBase {
beansRequireSerializable="$X{true}",
beansRequireSettersForGetters="$X{true}",
disableBeansRequireSomeProperties="$X{true}",
- typePropertyName="$X{foo}",
- debug="$X{true}",
disableIgnoreUnknownNullBeanProperties="$X{true}",
disableIgnoreMissingSetters="$X{true}",
disableInterfaceProxies="$X{true}",
@@ -136,17 +130,12 @@ class MarshalledConfigAnnotation_Test extends TestBase {
ignoreInvocationExceptionsOnGetters="$X{true}",
ignoreInvocationExceptionsOnSetters="$X{true}",
ignoreUnknownBeanProperties="$X{true}",
- locale="$X{en-US}",
- mediaType="$X{text/foo}",
notBeanClasses={A1.class,A2.class},
notBeanClasses_replace={A1.class,A2.class,A3.class},
notBeanPackages={"$X{foo1}","$X{foo2}"},
notBeanPackages_replace={"$X{foo1}","$X{foo2}","$X{foo3}"},
- swaps={AB1.class,AB2.class},
- swaps_replace={AB1.class,AB2.class,AB3.class},
propertyNamer=PropertyNamerULC.class,
unsortedProperties="$X{false}",
- timeZone="$X{z}",
useEnumNames="$X{true}",
useJavaBeanIntrospector="$X{true}"
)
@@ -159,7 +148,6 @@ class MarshalledConfigAnnotation_Test extends TestBase {
check("PRIVATE", bs.getBeanClassVisibility());
check("PRIVATE", bs.getBeanConstructorVisibility());
- check("A1,A2,A3", bs.getBeanDictionary());
check("PRIVATE", bs.getBeanFieldVisibility());
check("true", bs.isBeanMapPutReturnsOldValue());
check("PRIVATE", bs.getBeanMethodVisibility());
@@ -167,22 +155,16 @@ class MarshalledConfigAnnotation_Test extends TestBase {
check("true", bs.isBeansRequireSerializable());
check("true", bs.isBeansRequireSettersForGetters());
check("false", bs.isBeansRequireSomeProperties());
- check("foo", bs.getBeanTypePropertyName());
- check("true", bs.isDebug());
check("true", bs.isFindFluentSetters());
check("true", bs.isIgnoreInvocationExceptionsOnGetters());
check("true", bs.isIgnoreInvocationExceptionsOnSetters());
check("false", bs.isIgnoreMissingSetters());
check("true", bs.isIgnoreUnknownBeanProperties());
check("false", bs.isIgnoreUnknownNullBeanProperties());
- check("en_US", bs.getLocale());
- check("text/foo", bs.getMediaType());
check("A1,A2,A3,Map,Collection,Reader,Writer,InputStream,OutputStream,Throwable", bs.getNotBeanClasses());
check("foo1,foo2,foo3,java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bs.getNotBeanPackagesNames());
- check("AB1<String,Integer>,AB2<String,Integer>,AB3<String,Integer>", bs.getSwaps());
check("PropertyNamerULC", bs.getPropertyNamer());
check("false", bs.isUnsortedProperties());
- check("GMT", bs.getTimeZone());
check("true", bs.isUseEnumNames());
check("false", bs.isUseInterfaceProxies());
check("true", bs.isUseJavaBeanIntrospector());
@@ -192,7 +174,7 @@ class MarshalledConfigAnnotation_Test extends TestBase {
// Annotation with no values.
//-----------------------------------------------------------------------------------------------------------------
- @MarshalledConfig()
+ @BeanConfig()
static class B {}
static ClassInfo b = ClassInfo.of(B.class);
@@ -202,52 +184,6 @@ class MarshalledConfigAnnotation_Test extends TestBase {
var bc = js.getMarshallingContext();
check("PUBLIC", bc.getBeanClassVisibility());
check("PUBLIC", bc.getBeanConstructorVisibility());
- check("", bc.getBeanDictionary());
- check("PUBLIC", bc.getBeanFieldVisibility());
- check("false", bc.isBeanMapPutReturnsOldValue());
- check("PUBLIC", bc.getBeanMethodVisibility());
- check("false", bc.isBeansRequireDefaultConstructor());
- check("false", bc.isBeansRequireSerializable());
- check("false", bc.isBeansRequireSettersForGetters());
- check("true", bc.isBeansRequireSomeProperties());
- check("_type", bc.getBeanTypePropertyName());
- check("false", js.isDebug());
- check("false", js.isDetectRecursions());
- check("false", bc.isFindFluentSetters());
- check("false", bc.isIgnoreInvocationExceptionsOnGetters());
- check("false", bc.isIgnoreInvocationExceptionsOnSetters());
- check("true", bc.isIgnoreMissingSetters());
- check("false", js.isIgnoreRecursions());
- check("false", bc.isIgnoreUnknownBeanProperties());
- check("true", bc.isIgnoreUnknownNullBeanProperties());
- check("0", js.getInitialDepth());
- check(Locale.getDefault().toString(), bc.getDefaultLocale());
- check("100", js.getMaxDepth());
- check(null, bc.getDefaultMediaType());
- check("java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bc.getNotBeanPackagesNames());
- check("", bc.getSwaps());
- check("BasicPropertyNamer", bc.getPropertyNamer());
- check("false", bc.isUnsortedProperties());
- check(null, bc.getDefaultTimeZone());
- check("false", bc.isUseEnumNames());
- check("true", bc.isUseInterfaceProxies());
- check("false", bc.isUseJavaBeanIntrospector());
- }
-
- //-----------------------------------------------------------------------------------------------------------------
- // No annotation.
- //-----------------------------------------------------------------------------------------------------------------
-
- static class C {}
- static ClassInfo c = ClassInfo.of(C.class);
-
- @Test void c01_noAnnotation() {
- var al = AnnotationWorkList.of(sr, rstream(c.getAnnotations()));
- var js = JsonSerializer.create().apply(al).build();
- var bc = js.getMarshallingContext();
- check("PUBLIC", bc.getBeanClassVisibility());
- check("PUBLIC", bc.getBeanConstructorVisibility());
- check("", bc.getBeanDictionary());
check("PUBLIC", bc.getBeanFieldVisibility());
check("false", bc.isBeanMapPutReturnsOldValue());
check("PUBLIC", bc.getBeanMethodVisibility());
@@ -255,27 +191,17 @@ class MarshalledConfigAnnotation_Test extends TestBase {
check("false", bc.isBeansRequireSerializable());
check("false", bc.isBeansRequireSettersForGetters());
check("true", bc.isBeansRequireSomeProperties());
- check("_type", bc.getBeanTypePropertyName());
- check("false", js.isDebug());
- check("false", js.isDetectRecursions());
check("false", bc.isFindFluentSetters());
check("false", bc.isIgnoreInvocationExceptionsOnGetters());
check("false", bc.isIgnoreInvocationExceptionsOnSetters());
check("true", bc.isIgnoreMissingSetters());
- check("false", js.isIgnoreRecursions());
check("false", bc.isIgnoreUnknownBeanProperties());
check("true", bc.isIgnoreUnknownNullBeanProperties());
- check("0", js.getInitialDepth());
- check(Locale.getDefault().toString(), bc.getDefaultLocale());
- check("100", js.getMaxDepth());
- check(null, bc.getDefaultMediaType());
check("java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bc.getNotBeanPackagesNames());
- check("", bc.getSwaps());
check("BasicPropertyNamer", bc.getPropertyNamer());
check("false", bc.isUnsortedProperties());
- check(null, bc.getDefaultTimeZone());
check("false", bc.isUseEnumNames());
check("true", bc.isUseInterfaceProxies());
check("false", bc.isUseJavaBeanIntrospector());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
index 2aa142fe50..c0d6b2a06e 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
@@ -35,7 +35,11 @@ import org.junit.jupiter.api.*;
import org.apache.juneau.commons.bean.*;
/**
- * Tests the @MarshalledConfig annotation.
+ * Tests the marshalling-only attributes of the @MarshalledConfig annotation.
+ *
+ * <p>
+ * The bean-modeling attributes were moved to {@code @BeanConfig} in Phase 3 of the bean-layer split.
+ * See {@code BeanConfigAnnotation_Test} for tests on those attributes.
*/
@SuppressWarnings({
"java:S5961" // High assertion count acceptable in comprehensive test
@@ -116,39 +120,15 @@ class MarshalledConfigAnnotation_Test extends TestBase {
}
@MarshalledConfig(
- beanClassVisibility="$X{PRIVATE}",
- beanConstructorVisibility="$X{PRIVATE}",
dictionary={A1.class,A2.class},
dictionary_replace={A1.class,A2.class,A3.class},
- beanFieldVisibility="$X{PRIVATE}",
- beanMapPutReturnsOldValue="$X{true}",
- beanMethodVisibility="$X{PRIVATE}",
- beansRequireDefaultConstructor="$X{true}",
- beansRequireSerializable="$X{true}",
- beansRequireSettersForGetters="$X{true}",
- disableBeansRequireSomeProperties="$X{true}",
typePropertyName="$X{foo}",
debug="$X{true}",
- disableIgnoreUnknownNullBeanProperties="$X{true}",
- disableIgnoreMissingSetters="$X{true}",
- disableInterfaceProxies="$X{true}",
- findFluentSetters="$X{true}",
- ignoreInvocationExceptionsOnGetters="$X{true}",
- ignoreInvocationExceptionsOnSetters="$X{true}",
- ignoreUnknownBeanProperties="$X{true}",
locale="$X{en-US}",
mediaType="$X{text/foo}",
- notBeanClasses={A1.class,A2.class},
- notBeanClasses_replace={A1.class,A2.class,A3.class},
- notBeanPackages={"$X{foo1}","$X{foo2}"},
- notBeanPackages_replace={"$X{foo1}","$X{foo2}","$X{foo3}"},
swaps={AB1.class,AB2.class},
swaps_replace={AB1.class,AB2.class,AB3.class},
- propertyNamer=PropertyNamerULC.class,
- unsortedProperties="$X{false}",
- timeZone="$X{z}",
- useEnumNames="$X{true}",
- useJavaBeanIntrospector="$X{true}"
+ timeZone="$X{z}"
)
static class A {}
static ClassInfo a = ClassInfo.of(A.class);
@@ -157,35 +137,13 @@ class MarshalledConfigAnnotation_Test extends TestBase {
var al = AnnotationWorkList.of(sr, rstream(a.getAnnotations()));
var bs = JsonSerializer.create().apply(al).build().getSession();
- check("PRIVATE", bs.getBeanClassVisibility());
- check("PRIVATE", bs.getBeanConstructorVisibility());
check("A1,A2,A3", bs.getBeanDictionary());
- check("PRIVATE", bs.getBeanFieldVisibility());
- check("true", bs.isBeanMapPutReturnsOldValue());
- check("PRIVATE", bs.getBeanMethodVisibility());
- check("true", bs.isBeansRequireDefaultConstructor());
- check("true", bs.isBeansRequireSerializable());
- check("true", bs.isBeansRequireSettersForGetters());
- check("false", bs.isBeansRequireSomeProperties());
check("foo", bs.getBeanTypePropertyName());
check("true", bs.isDebug());
- check("true", bs.isFindFluentSetters());
- check("true", bs.isIgnoreInvocationExceptionsOnGetters());
- check("true", bs.isIgnoreInvocationExceptionsOnSetters());
- check("false", bs.isIgnoreMissingSetters());
- check("true", bs.isIgnoreUnknownBeanProperties());
- check("false", bs.isIgnoreUnknownNullBeanProperties());
check("en_US", bs.getLocale());
check("text/foo", bs.getMediaType());
- check("A1,A2,A3,Map,Collection,Reader,Writer,InputStream,OutputStream,Throwable", bs.getNotBeanClasses());
- check("foo1,foo2,foo3,java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bs.getNotBeanPackagesNames());
check("AB1<String,Integer>,AB2<String,Integer>,AB3<String,Integer>", bs.getSwaps());
- check("PropertyNamerULC", bs.getPropertyNamer());
- check("false", bs.isUnsortedProperties());
check("GMT", bs.getTimeZone());
- check("true", bs.isUseEnumNames());
- check("false", bs.isUseInterfaceProxies());
- check("true", bs.isUseJavaBeanIntrospector());
}
//-----------------------------------------------------------------------------------------------------------------
@@ -200,38 +158,17 @@ class MarshalledConfigAnnotation_Test extends TestBase {
var al = AnnotationWorkList.of(sr, rstream(b.getAnnotations()));
var js = JsonSerializer.create().apply(al).build();
var bc = js.getMarshallingContext();
- check("PUBLIC", bc.getBeanClassVisibility());
- check("PUBLIC", bc.getBeanConstructorVisibility());
check("", bc.getBeanDictionary());
- check("PUBLIC", bc.getBeanFieldVisibility());
- check("false", bc.isBeanMapPutReturnsOldValue());
- check("PUBLIC", bc.getBeanMethodVisibility());
- check("false", bc.isBeansRequireDefaultConstructor());
- check("false", bc.isBeansRequireSerializable());
- check("false", bc.isBeansRequireSettersForGetters());
- check("true", bc.isBeansRequireSomeProperties());
check("_type", bc.getBeanTypePropertyName());
check("false", js.isDebug());
check("false", js.isDetectRecursions());
- check("false", bc.isFindFluentSetters());
- check("false", bc.isIgnoreInvocationExceptionsOnGetters());
- check("false", bc.isIgnoreInvocationExceptionsOnSetters());
- check("true", bc.isIgnoreMissingSetters());
check("false", js.isIgnoreRecursions());
- check("false", bc.isIgnoreUnknownBeanProperties());
- check("true", bc.isIgnoreUnknownNullBeanProperties());
check("0", js.getInitialDepth());
check(Locale.getDefault().toString(), bc.getDefaultLocale());
check("100", js.getMaxDepth());
check(null, bc.getDefaultMediaType());
- check("java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bc.getNotBeanPackagesNames());
check("", bc.getSwaps());
- check("BasicPropertyNamer", bc.getPropertyNamer());
- check("false", bc.isUnsortedProperties());
check(null, bc.getDefaultTimeZone());
- check("false", bc.isUseEnumNames());
- check("true", bc.isUseInterfaceProxies());
- check("false", bc.isUseJavaBeanIntrospector());
}
//-----------------------------------------------------------------------------------------------------------------
@@ -245,37 +182,16 @@ class MarshalledConfigAnnotation_Test extends TestBase {
var al = AnnotationWorkList.of(sr, rstream(c.getAnnotations()));
var js = JsonSerializer.create().apply(al).build();
var bc = js.getMarshallingContext();
- check("PUBLIC", bc.getBeanClassVisibility());
- check("PUBLIC", bc.getBeanConstructorVisibility());
check("", bc.getBeanDictionary());
- check("PUBLIC", bc.getBeanFieldVisibility());
- check("false", bc.isBeanMapPutReturnsOldValue());
- check("PUBLIC", bc.getBeanMethodVisibility());
- check("false", bc.isBeansRequireDefaultConstructor());
- check("false", bc.isBeansRequireSerializable());
- check("false", bc.isBeansRequireSettersForGetters());
- check("true", bc.isBeansRequireSomeProperties());
check("_type", bc.getBeanTypePropertyName());
check("false", js.isDebug());
check("false", js.isDetectRecursions());
- check("false", bc.isFindFluentSetters());
- check("false", bc.isIgnoreInvocationExceptionsOnGetters());
- check("false", bc.isIgnoreInvocationExceptionsOnSetters());
- check("true", bc.isIgnoreMissingSetters());
check("false", js.isIgnoreRecursions());
- check("false", bc.isIgnoreUnknownBeanProperties());
- check("true", bc.isIgnoreUnknownNullBeanProperties());
check("0", js.getInitialDepth());
check(Locale.getDefault().toString(), bc.getDefaultLocale());
check("100", js.getMaxDepth());
check(null, bc.getDefaultMediaType());
- check("java.lang,java.lang.annotation,java.lang.ref,java.lang.reflect,java.io,java.net", bc.getNotBeanPackagesNames());
check("", bc.getSwaps());
- check("BasicPropertyNamer", bc.getPropertyNamer());
- check("false", bc.isUnsortedProperties());
check(null, bc.getDefaultTimeZone());
- check("false", bc.isUseEnumNames());
- check("true", bc.isUseInterfaceProxies());
- check("false", bc.isUseJavaBeanIntrospector());
}
-}
\ No newline at end of file
+}
(juneau) 01/06: refactor: extract @BeanType from @Marshalled and create commons.bean package (Phase 1 of bean-layer split)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit b66b76b180c206a6f2f51e681bf09b14b3bcae78
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 08:35:14 2026 -0400
refactor: extract @BeanType from @Marshalled and create commons.bean package (Phase 1 of bean-layer split)
Splits the @Marshalled annotation into two annotations:
- @Marshalled (juneau-marshall) - keeps marshalling-only attrs
(as, description, dictionary, example, implClass, interceptor, typeName, typePropertyName)
- @BeanType (new, juneau-commons commons.bean package) - bean-modeling attrs
(description, excludeProperties/xp, factory, findFluentSetters, interfaceClass,
p/properties, propertyNamer, readOnlyProperties/ro, stopClass, unsorted,
writeOnlyProperties/wo)
Also moves PropertyNamer + impls (PropertyNamerDLC, PropertyNamerULC,
PropertyNamerDUCS, BasicPropertyNamer) from juneau-marshall to commons.bean.
Adds @BeanTypeApply / BeanTypeApplyAnnotation to mirror @MarshalledApply.
Adds BeanTypeAnnotation as a thin metadata-only builder in commons.bean.
@MarshalledConfig now applies bean-modeling overrides via BeanTypeApply.
Phase 1 of the 6-phase bean-layer split. Subsequent phases will split
@MarshalledProp/@MarshalledCtor/@MarshalledConfig/@MarshalledIgnore and
move runtime types (BeanMap/BeanMeta/etc.) into commons.bean.
Co-authored-by: Cursor <cu...@cursor.com>
---
.../java/org/apache/juneau/bean/LinkString.java | 3 +-
.../juneau/commons/bean}/BasicPropertyNamer.java | 2 +-
.../org/apache/juneau/commons/bean/BeanType.java} | 254 +++--------------
.../juneau/commons/bean/BeanTypeAnnotation.java} | 260 +++++------------
.../apache/juneau/commons/bean}/PropertyNamer.java | 6 +-
.../juneau/commons/bean}/PropertyNamerDLC.java | 2 +-
.../juneau/commons/bean}/PropertyNamerDUCS.java | 2 +-
.../juneau/commons/bean}/PropertyNamerULC.java | 2 +-
.../apache/juneau/commons/bean/package-info.java} | 26 +-
.../juneau/commons/function/BeanFactory.java | 2 +-
.../juneau/commons/function/package-info.java | 4 +-
.../java/org/apache/juneau/jena/RdfParser.java | 4 +-
.../java/org/apache/juneau/jena/RdfSerializer.java | 4 +-
.../src/main/java/org/apache/juneau/BeanMeta.java | 23 +-
.../src/main/java/org/apache/juneau/ClassMeta.java | 10 +-
.../java/org/apache/juneau/MarshalledFilter.java | 62 ++--
.../java/org/apache/juneau/MarshallingContext.java | 45 +--
.../org/apache/juneau/MarshallingContextable.java | 1 +
.../java/org/apache/juneau/MarshallingSession.java | 1 +
.../apache/juneau/MarshallingTraverseContext.java | 4 +-
.../apache/juneau/annotation/BeanTypeApply.java | 101 +++++++
.../juneau/annotation/BeanTypeApplyAnnotation.java | 232 +++++++++++++++
.../org/apache/juneau/annotation/Marshalled.java | 315 +--------------------
.../juneau/annotation/MarshalledAnnotation.java | 273 ------------------
.../apache/juneau/annotation/MarshalledConfig.java | 1 +
.../annotation/MarshalledConfigAnnotation.java | 3 +-
.../main/java/org/apache/juneau/csv/CsvParser.java | 4 +-
.../java/org/apache/juneau/csv/CsvSerializer.java | 4 +-
.../org/apache/juneau/html/HtmlDocSerializer.java | 4 +-
.../java/org/apache/juneau/html/HtmlParser.java | 4 +-
.../juneau/html/HtmlSchemaDocSerializer.java | 4 +-
.../apache/juneau/html/HtmlSchemaSerializer.java | 4 +-
.../org/apache/juneau/html/HtmlSerializer.java | 4 +-
.../juneau/html/HtmlStrippedDocSerializer.java | 4 +-
.../java/org/apache/juneau/json/JsonParser.java | 4 +-
.../apache/juneau/json/JsonSchemaSerializer.java | 4 +-
.../org/apache/juneau/json/JsonSerializer.java | 4 +-
.../java/org/apache/juneau/json5/Json5Parser.java | 4 +-
.../org/apache/juneau/json5/Json5Serializer.java | 4 +-
.../juneau/jsonschema/JsonSchemaGenerator.java | 4 +-
.../org/apache/juneau/markdown/MarkdownParser.java | 4 +-
.../apache/juneau/markdown/MarkdownSerializer.java | 4 +-
.../org/apache/juneau/msgpack/MsgPackParser.java | 4 +-
.../apache/juneau/msgpack/MsgPackSerializer.java | 4 +-
.../java/org/apache/juneau/oapi/OpenApiParser.java | 4 +-
.../org/apache/juneau/oapi/OpenApiSerializer.java | 4 +-
.../apache/juneau/parser/InputStreamParser.java | 4 +-
.../main/java/org/apache/juneau/parser/Parser.java | 4 +-
.../org/apache/juneau/parser/ReaderParser.java | 4 +-
.../apache/juneau/plaintext/PlainTextParser.java | 4 +-
.../juneau/plaintext/PlainTextSerializer.java | 4 +-
.../juneau/serializer/OutputStreamSerializer.java | 4 +-
.../org/apache/juneau/serializer/Serializer.java | 4 +-
.../apache/juneau/serializer/WriterSerializer.java | 4 +-
.../org/apache/juneau/soap/SoapXmlSerializer.java | 4 +-
.../main/java/org/apache/juneau/uon/UonParser.java | 4 +-
.../java/org/apache/juneau/uon/UonSerializer.java | 4 +-
.../juneau/urlencoding/UrlEncodingParser.java | 4 +-
.../juneau/urlencoding/UrlEncodingSerializer.java | 4 +-
.../main/java/org/apache/juneau/xml/XmlParser.java | 4 +-
.../java/org/apache/juneau/xml/XmlSerializer.java | 4 +-
.../java/org/apache/juneau/yaml/YamlParser.java | 4 +-
.../org/apache/juneau/yaml/YamlSerializer.java | 4 +-
.../juneau/examples/rest/RequestEchoResource.java | 7 +-
.../juneau/examples/rest/UtilityBeansResource.java | 3 +-
.../microservice/resources/DirectoryResource.java | 3 +-
.../microservice/resources/LogsResource.java | 3 +-
.../org/apache/juneau/rest/client/RestClient.java | 4 +-
.../org/apache/juneau/rest/client/RestRequest.java | 1 +
.../apache/juneau/rest/mock/MockRestClient.java | 4 +-
.../apache/juneau/rest/beans/BeanDescription.java | 3 +-
.../juneau/rest/beans/ResourceDescription.java | 3 +-
.../apache/juneau/rest/stats/RestContextStats.java | 3 +-
.../java/org/apache/juneau/Annotations_Test.java | 9 +-
.../java/org/apache/juneau/BeanMapErrors_Test.java | 13 +-
.../test/java/org/apache/juneau/BeanMap_Test.java | 23 +-
.../java/org/apache/juneau/BeanStreaming_Test.java | 3 +-
.../org/apache/juneau/MarshalledConfig_Test.java | 9 +-
.../java/org/apache/juneau/PropertyNamerTest.java | 1 +
.../juneau/ReadWriteOnlyProperties_Test.java | 17 +-
.../juneau/a/rttests/Generics_RoundTripTest.java | 3 +-
.../juneau/a/rttests/Records_RoundTripTest.java | 5 +-
.../juneau/a/rttests/RoundTripBeanMaps_Test.java | 11 +-
.../a/rttests/RoundTripBeansWithBuilders_Test.java | 13 +-
.../annotation/MarshalledAnnotation_Test.java | 103 +++----
.../MarshalledConfigAnnotation_Test.java | 1 +
.../apache/juneau/annotation/Marshalled_Test.java | 35 +--
.../org/apache/juneau/html/BasicHtml_Test.java | 7 +-
.../juneau/html/HtmlSchemaSerializer_Test.java | 5 +-
.../java/org/apache/juneau/html/Html_Test.java | 3 +-
.../org/apache/juneau/ini/IniRoundTrip_Test.java | 7 +-
.../org/apache/juneau/jena/RdfParser_Test.java | 1 +
.../org/apache/juneau/jena/RdfSerializer_Test.java | 1 +
.../org/apache/juneau/jsonl/JsonlParser_Test.java | 3 +-
.../apache/juneau/jsonl/JsonlRoundTrip_Test.java | 7 +-
.../java/org/apache/juneau/jsonl/Jsonl_Test.java | 3 +-
.../apache/juneau/objecttools/ObjectRest_Test.java | 6 +-
.../annotation/RestOp_MarshalledConfig_Test.java | 35 +--
.../RestClient_Config_MarshallingContext_Test.java | 1 +
.../juneau/transforms/MarshalledFilter_Test.java | 13 +-
.../java/org/apache/juneau/xml/BasicXml_Test.java | 10 +-
.../java/org/apache/juneau/xml/CommonXml_Test.java | 3 +-
.../org/apache/juneau/xml/XmlCollapsed_Test.java | 5 +-
.../test/java/org/apache/juneau/xml/Xml_Test.java | 10 +-
104 files changed, 838 insertions(+), 1352 deletions(-)
diff --git a/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java b/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
index cd63728d6e..73c3e71de5 100644
--- a/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
+++ b/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
@@ -28,6 +28,7 @@ import org.apache.juneau.commons.httppart.*;
import org.apache.juneau.oapi.*;
import org.apache.juneau.objecttools.*;
import org.apache.juneau.serializer.*;
+import org.apache.juneau.commons.bean.*;
/**
* Simple bean that implements a hyperlink for the HTML serializer.
@@ -44,7 +45,7 @@ import org.apache.juneau.serializer.*;
*
*/
@HtmlLink
-@Marshalled(findFluentSetters = true)
+@BeanType(findFluentSetters = true)
public class LinkString implements Comparable<LinkString> {
private String name;
private java.net.URI uri;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BasicPropertyNamer.java
similarity index 97%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BasicPropertyNamer.java
index 14fd3868b1..987252fd41 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BasicPropertyNamer.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
+package org.apache.juneau.commons.bean;
import java.beans.*;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanType.java
similarity index 51%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanType.java
index 6fd9f49d4e..d43c1a3807 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanType.java
@@ -14,27 +14,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.beans.*;
import java.lang.annotation.*;
-import java.util.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
- * Annotation that can be applied to classes to control how they are marshalled.
+ * Annotation that can be applied to classes to control bean introspection and modeling.
+ *
+ * <p>
+ * The bean-modeling sibling of {@code @Marshalled}.
+ * Where {@code @Marshalled} (in <c>juneau-marshall</c>) carries the marshalling-only attributes (such as
+ * {@code as}, {@code dictionary}, {@code example}, {@code implClass}, {@code interceptor}, {@code typeName},
+ * and {@code typePropertyName}), this annotation carries the attributes that describe the bean itself —
+ * which properties to include or exclude, how to name them, what stop class to use, and so on.
+ *
+ * <p>
+ * Splitting the annotations lets a class participate in the bean model (for example, to declare its
+ * property list) without dragging in any marshalling concerns, and lets the bean-modeling layer live in
+ * <c>juneau-commons</c> independent of <c>juneau-marshall</c>.
*
* <p>
* Can be used in the following locations:
* <ul>
* <li>Bean classes and parent interfaces.
- * <li>Non-bean marshalled classes.
- * <li><ja>@Rest</ja>-annotated classes and <ja>@RestOp</ja>-annotated methods when used with {@link MarshalledApply @MarshalledApply}.
+ * <li>Non-bean modelled classes.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -45,23 +53,7 @@ import org.apache.juneau.swap.*;
@Target({ TYPE })
@Retention(RUNTIME)
@Inherited
-@SuppressWarnings({
- "java:S1452" // Wildcard required - Class<? extends MarshallingInterceptor<?>> for interceptor definition
-})
-public @interface Marshalled {
-
- /**
- * Specifies the marshalling strategy for this type.
- *
- * <p>
- * Defaults to {@link MarshalledAs#DETECT} (auto-detection).
- * Use {@link MarshalledAs#STRING} to serialize via {@code toString()} and deserialize via
- * {@code fromString}/{@code valueOf}/single-String constructor — equivalent to the former
- * {@code MarshallingStringSwap} pattern.
- *
- * @return The marshalling strategy.
- */
- MarshalledAs as() default MarshalledAs.DETECT;
+public @interface BeanType {
/**
* Optional description for the exposed API.
@@ -71,73 +63,16 @@ public @interface Marshalled {
*/
String[] description() default {};
- /**
- * Bean dictionary.
- *
- * <p>
- * The list of classes that make up the bean dictionary for all properties in this class and all subclasses.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledProp#dictionary()}
- * <li class='ja'>{@link MarshalledConfig#dictionary()}
- * <li class='ja'>{@link MarshalledConfig#dictionary_replace()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanDictionary(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<?>[] dictionary() default {};
-
- /**
- * POJO example.
- *
- * <p>
- * Specifies an example of the specified class in Simplified JSON format.
- *
- * <p>
- * Examples are used in cases such as POJO examples in Swagger documents.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <ja>@Marshalled</ja>(example=<js>"{foo:'bar'}"</js>)
- * <jk>public class</jk> MyClass {...}
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * Setting applies to specified class and all subclasses.
- * <li class='note'>
- * Keys are the class of the example.
- * <br>Values are JSON 5 representation of that class.
- * <li class='note'>
- * POJO examples can also be defined on classes via the following:
- * <ul class='spaced-list'>
- * <li>A static field annotated with {@link Example @Example}.
- * <li>A static method annotated with {@link Example @Example} with zero arguments or one {@link MarshallingSession} argument.
- * <li>A static method with name <c>example</c> with no arguments or one {@link MarshallingSession} argument.
- * </ul>
- * <li class='note'>
- * Supports <a class="doclink" href="https://juneau.apache.org/docs/topics/DefaultVarResolver">VarResolver.DEFAULT</a> (e.g. <js>"$C{myConfigVar}"</js>).
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Example}
- * </ul>
- *
- * @return The annotation value.
- */
- String example() default "";
-
/**
* Bean property excludes.
*
* <p>
- * Specifies a list of properties that should be excluded from {@link BeanMap#entrySet()}.
+ * Specifies a list of properties that should be excluded from the bean's property set.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Exclude the 'city' and 'state' properties from the Address class.</jc>
- * <ja>@Marshalled</ja>(excludeProperties=<js>"city,state"</js>})
+ * <ja>@BeanType</ja>(excludeProperties=<js>"city,state"</js>})
* <jk>public class</jk> Address {...}
* </p>
*
@@ -151,12 +86,6 @@ public @interface Marshalled {
* instantiate the record if the excluded component values are missing from the input.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(Map)}
- * </ul>
- *
* @return The annotation value.
*/
String excludeProperties() default "";
@@ -170,8 +99,6 @@ public @interface Marshalled {
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='jc'>{@link org.apache.juneau.commons.function.BeanFactory}
- * <li class='ja'>{@link MarshalledProp#factory()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanStore(org.apache.juneau.commons.inject.BeanStore)}
* </ul>
*
* @return The annotation value.
@@ -189,7 +116,7 @@ public @interface Marshalled {
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
- * <ja>@Marshalled</ja>(findFluentSetters=<jk>true</jk>)
+ * <ja>@BeanType</ja>(findFluentSetters=<jk>true</jk>)
* <jk>public class</jk> MyBean {
* <jk>public int</jk> getId() {...}
* <jk>public</jk> MyBean id(<jk>int</jk> <jv>id</jv>) {...}
@@ -205,47 +132,10 @@ public @interface Marshalled {
* <li>Return the bean itself.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledConfig#findFluentSetters()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#findFluentSetters()}
- * </ul>
- *
* @return The annotation value.
*/
boolean findFluentSetters() default false;
- /**
- * Implementation class.
- *
- * <p>
- * For interfaces and abstract classes this method can be used to specify an implementation class for the
- * interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a
- * parse).
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <ja>@Marshalled</ja>(implClass=MyInterfaceImpl.<jk>class</jk>)
- * <jk>public class</jk> MyInterface {...}
- * <p>
- *
- * @return The annotation value.
- */
- Class<?> implClass() default void.class;
-
- /**
- * Bean property interceptor.
- *
- * <p>
- * Bean interceptors can be used to intercept calls to getters and setters and alter their values in transit.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link MarshallingInterceptor}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<? extends MarshallingInterceptor<?>> interceptor() default MarshallingInterceptor.Void.class;
-
/**
* Identifies a class to be used as the interface class for this and all subclasses.
*
@@ -255,7 +145,7 @@ public @interface Marshalled {
*
* <p class='bjava'>
* <jc>// Parent class</jc>
- * <ja>@Marshalled</ja>(interfaceClass=A.<jk>class</jk>)
+ * <ja>@BeanType</ja>(interfaceClass=A.<jk>class</jk>)
* <jk>public abstract class</jk> A {
* <jk>public</jk> String <jf>f0</jf> = <js>"f0"</js>;
* }
@@ -291,13 +181,12 @@ public @interface Marshalled {
* The set and order of names of properties associated with a bean class.
*
* <p>
- * The order specified is the same order that the entries will be returned by the {@link BeanMap#entrySet()} and
- * related methods.
+ * The order specified is the same order that the entries will be returned by the bean's property set.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Address class with only street/city/state properties (in that order).</jc>
- * <ja>@Marshalled</ja>(properties=<js>"street,city,state"</js>)
+ * <ja>@BeanType</ja>(properties=<js>"street,city,state"</js>)
* <jk>public class</jk> Address {...}
* </p>
*
@@ -306,12 +195,6 @@ public @interface Marshalled {
* {@link #p()} is a shortened synonym for this value.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(Map)}
- * </ul>
- *
* @return The annotation value.
*/
String properties() default "";
@@ -325,14 +208,10 @@ public @interface Marshalled {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Define a class with dashed-lowercase property names.</jc>
- * <ja>@Marshalled</ja>(propertyNamer=PropertyNamerDashedLC.<jk>class</jk>)
+ * <ja>@BeanType</ja>(propertyNamer=PropertyNamerDLC.<jk>class</jk>)
* <jk>public class</jk> MyBean {...}
* </p>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#propertyNamer(Class)}
- * </ul>
- *
* @return The annotation value.
*/
Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Void.class;
@@ -347,7 +226,7 @@ public @interface Marshalled {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Exclude the 'city' and 'state' properties from being parsed, but not serialized.</jc>
- * <ja>@Marshalled</ja>(readOnlyProperties=<js>"city,state"</js>})
+ * <ja>@BeanType</ja>(readOnlyProperties=<js>"city,state"</js>})
* <jk>public class</jk> Address {...}
* </p>
*
@@ -356,12 +235,6 @@ public @interface Marshalled {
* {@link #ro()} is a shortened synonym for this value.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Map)}
- * </ul>
- *
* @return The annotation value.
*/
String readOnlyProperties() default "";
@@ -392,7 +265,7 @@ public @interface Marshalled {
* <jk>public int</jk> getP2();
* }
*
- * <ja>@Marshalled</ja>(stopClass=C2.<jk>class</jk>)
+ * <ja>@BeanType</ja>(stopClass=C2.<jk>class</jk>)
* <jk>public class</jk> C3 <jk>extends</jk> C2 {
* <jk>public int</jk> getP3();
* }
@@ -403,55 +276,22 @@ public @interface Marshalled {
Class<?> stopClass() default void.class;
/**
- * An identifying name for this class.
- *
- * <p>
- * The name is used to identify the class type during parsing when it cannot be inferred through reflection.
- * <br>For example, if a bean property is of type <c>Object</c>, then the serializer will add the name to the
- * output so that the class can be determined during parsing.
- *
- * <p>
- * It is also used to specify element names in XML.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Use _type='mybean' to identify this bean.</jc>
- * <ja>@Marshalled</ja>(typeName=<js>"mybean"</js>)
- * <jk>public class</jk> MyBean {...}
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanDictionary(Class...)}
- * </ul>
- *
- * @return The annotation value.
- */
- String typeName() default "";
-
- /**
- * The property name to use for representing the type name.
- *
- * <p>
- * This can be used to override the name used for the <js>"_type"</js> property used by the {@link #typeName()} setting.
+ * Opt out of alphabetical sorting for this specific bean's properties.
*
* <p>
- * The default value if not specified is <js>"_type"</js>.
+ * By default, bean properties are serialized in alphabetical order.
+ * When <jk>true</jk>, properties of this bean will use the natural JVM-dependent order instead.
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
- * <jc>// Use 'type' instead of '_type' for bean names.</jc>
- * <ja>@Marshalled</ja>(typePropertyName=<js>"type"</js>)
+ * <jc>// Disable sorted properties for this specific bean.</jc>
+ * <ja>@BeanType</ja>(unsorted=<jk>true</jk>)
* <jk>public class</jk> MyBean {...}
* </p>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledConfig#typePropertyName()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#typePropertyName(String)}
- * </ul>
- *
* @return The annotation value.
*/
- String typePropertyName() default "";
+ boolean unsorted() default false;
/**
* Synonym for {@link #writeOnlyProperties()}.
@@ -470,7 +310,7 @@ public @interface Marshalled {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Exclude the 'city' and 'state' properties from being serialized, but not parsed.</jc>
- * <ja>@Marshalled</ja>(writeOnlyProperties=<js>"city,state"</js>})
+ * <ja>@BeanType</ja>(writeOnlyProperties=<js>"city,state"</js>})
* <jk>public class</jk> Address {...}
* </p>
*
@@ -479,12 +319,6 @@ public @interface Marshalled {
* {@link #wo()} is a shortened synonym for this value.
* </ul>
*
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Map)}
- * </ul>
- *
* @return The annotation value.
*/
String writeOnlyProperties() default "";
@@ -495,26 +329,4 @@ public @interface Marshalled {
* @return The annotation value.
*/
String xp() default "";
-
- /**
- * Opt out of alphabetical sorting for this specific bean's properties.
- *
- * <p>
- * By default, bean properties are serialized in alphabetical order.
- * When <jk>true</jk>, properties of this bean will use the natural JVM-dependent order instead.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Disable sorted properties for this specific bean.</jc>
- * <ja>@Marshalled</ja>(unsorted=<jk>true</jk>)
- * <jk>public class</jk> MyBean {...}
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#unsortedProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- boolean unsorted() default false;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanTypeAnnotation.java
similarity index 54%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanTypeAnnotation.java
index 49f7fe311f..3fd552ab72 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanTypeAnnotation.java
@@ -14,55 +14,56 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import java.lang.annotation.*;
-
-import org.apache.juneau.*;
import org.apache.juneau.commons.annotation.*;
import org.apache.juneau.commons.function.*;
-import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
- * Utility classes and methods for the {@link Marshalled @Marshalled} annotation.
+ * Utility classes and methods for the {@link BeanType @BeanType} annotation.
+ *
+ * <p>
+ * Provides a {@link Builder} that constructs a synthetic {@link BeanType @BeanType} annotation instance
+ * programmatically without requiring it to be declared on a program element at compile time.
+ *
+ * <p>
+ * Phase 1 of the bean-layer split keeps this builder pure-data: it captures the annotation attribute
+ * values and produces an annotation instance that is functionally equivalent to a declared one, but
+ * does <i>not</i> apply itself to a marshalling context. The application logic remains in
+ * <c>juneau-marshall</c> (see {@code MarshalledAnnotation}) until later phases move that machinery
+ * down into <c>juneau-commons</c>.
*
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanType}
+ * <li class='jc'>{@link AnnotationObject}
+ * </ul>
*/
-public class MarshalledAnnotation {
+public class BeanTypeAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledAnnotation() {}
+ private BeanTypeAnnotation() {}
/**
* Builder class.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
- * </ul>
*/
public static class Builder extends AnnotationObject.Builder {
- private MarshalledAs as = MarshalledAs.DETECT;
private String[] description = {};
- private Class<?>[] dictionary = new Class[0];
- private Class<?> implClass = void.class;
private Class<?> interfaceClass = void.class;
private Class<?> stopClass = void.class;
- private Class<? extends MarshallingInterceptor<?>> interceptor = MarshallingInterceptor.Void.class;
- private Class<? extends PropertyNamer> propertyNamer = BasicPropertyNamer.class;
+ private Class<? extends PropertyNamer> propertyNamer = PropertyNamer.Void.class;
@SuppressWarnings("rawtypes")
private Class<? extends BeanFactory> factory = BeanFactory.Void.class;
- private String example = "";
private String excludeProperties = "";
private String p = "";
private String properties = "";
private String readOnlyProperties = "";
private String ro = "";
- private String typeName = "";
- private String typePropertyName = "";
private String wo = "";
private String writeOnlyProperties = "";
private String xp = "";
@@ -73,29 +74,18 @@ public class MarshalledAnnotation {
* Constructor.
*/
protected Builder() {
- super(Marshalled.class);
+ super(BeanType.class);
}
/**
- * Instantiates a new {@link Marshalled @Marshalled} object initialized with this builder.
+ * Instantiates a new {@link BeanType @BeanType} object initialized with this builder.
*
- * @return A new {@link Marshalled @Marshalled} object.
+ * @return A new {@link BeanType @BeanType} object.
*/
- public Marshalled build() {
+ public BeanType build() {
return new Object(this);
}
- /**
- * Sets the {@link Marshalled#as()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder as(MarshalledAs value) {
- as = value;
- return this;
- }
-
/**
* Sets the description property on this annotation.
*
@@ -108,18 +98,18 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#dictionary()} property on this annotation.
+ * Sets the {@link BeanType#excludeProperties()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
*/
- public Builder dictionary(Class<?>...value) {
- dictionary = value;
+ public Builder excludeProperties(String value) {
+ excludeProperties = value;
return this;
}
/**
- * Sets the {@link Marshalled#factory()} property on this annotation.
+ * Sets the {@link BeanType#factory()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -131,29 +121,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#example()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder example(String value) {
- example = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#excludeProperties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder excludeProperties(String value) {
- excludeProperties = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#findFluentSetters()} property on this annotation.
+ * Sets the {@link BeanType#findFluentSetters()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -164,29 +132,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#implClass()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder implClass(Class<?> value) {
- implClass = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#interceptor()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder interceptor(Class<? extends MarshallingInterceptor<?>> value) {
- interceptor = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#interfaceClass()} property on this annotation.
+ * Sets the {@link BeanType#interfaceClass()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -197,7 +143,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#p()} property on this annotation.
+ * Sets the {@link BeanType#p()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -208,7 +154,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#properties()} property on this annotation.
+ * Sets the {@link BeanType#properties()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -219,7 +165,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#propertyNamer()} property on this annotation.
+ * Sets the {@link BeanType#propertyNamer()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -230,7 +176,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#readOnlyProperties()} property on this annotation.
+ * Sets the {@link BeanType#readOnlyProperties()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -241,7 +187,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#ro()} property on this annotation.
+ * Sets the {@link BeanType#ro()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -252,18 +198,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#unsorted()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder unsorted(boolean value) {
- unsorted = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#stopClass()} property on this annotation.
+ * Sets the {@link BeanType#stopClass()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -274,29 +209,18 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#typeName()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder typeName(String value) {
- typeName = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#typePropertyName()} property on this annotation.
+ * Sets the {@link BeanType#unsorted()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
*/
- public Builder typePropertyName(String value) {
- typePropertyName = value;
+ public Builder unsorted(boolean value) {
+ unsorted = value;
return this;
}
/**
- * Sets the {@link Marshalled#wo()} property on this annotation.
+ * Sets the {@link BeanType#wo()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -307,7 +231,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#writeOnlyProperties()} property on this annotation.
+ * Sets the {@link BeanType#writeOnlyProperties()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -318,7 +242,7 @@ public class MarshalledAnnotation {
}
/**
- * Sets the {@link Marshalled#xp()} property on this annotation.
+ * Sets the {@link BeanType#xp()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
@@ -327,49 +251,36 @@ public class MarshalledAnnotation {
xp = value;
return this;
}
-
}
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AnnotationObject implements Marshalled {
+ private static class Object extends AnnotationObject implements BeanType {
- private final MarshalledAs as;
private final String[] description;
private final boolean findFluentSetters;
private final boolean unsorted;
- private final Class<? extends MarshallingInterceptor<?>> interceptor;
private final Class<? extends PropertyNamer> propertyNamer;
- private final Class<?> implClass;
private final Class<?> interfaceClass;
private final Class<?> stopClass;
- private final Class<?>[] dictionary;
@SuppressWarnings("rawtypes")
private final Class<? extends BeanFactory> factory;
- private final String example;
private final String excludeProperties;
private final String p;
private final String properties;
private final String readOnlyProperties;
private final String ro;
- private final String typeName;
- private final String typePropertyName;
private final String wo;
private final String writeOnlyProperties;
private final String xp;
- Object(MarshalledAnnotation.Builder b) {
+ Object(BeanTypeAnnotation.Builder b) {
super(b);
- as = b.as;
description = copyOf(b.description);
- dictionary = copyOf(b.dictionary);
- example = b.example;
excludeProperties = b.excludeProperties;
factory = b.factory;
findFluentSetters = b.findFluentSetters;
- implClass = b.implClass;
- interceptor = b.interceptor;
interfaceClass = b.interfaceClass;
p = b.p;
properties = b.properties;
@@ -378,127 +289,90 @@ public class MarshalledAnnotation {
ro = b.ro;
unsorted = b.unsorted;
stopClass = b.stopClass;
- typeName = b.typeName;
- typePropertyName = b.typePropertyName;
wo = b.wo;
writeOnlyProperties = b.writeOnlyProperties;
xp = b.xp;
}
- @Override /* Overridden from Marshalled */
- public MarshalledAs as() {
- return as;
+ @Override /* Overridden from BeanType */
+ public String[] description() {
+ return description;
}
- @Override /* Overridden from Marshalled */
- public Class<?>[] dictionary() {
- return dictionary;
+ @Override /* Overridden from BeanType */
+ public String excludeProperties() {
+ return excludeProperties;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
@SuppressWarnings("rawtypes")
public Class<? extends BeanFactory> factory() {
return factory;
}
- @Override /* Overridden from Marshalled */
- public String example() {
- return example;
- }
-
- @Override /* Overridden from Marshalled */
- public String excludeProperties() {
- return excludeProperties;
- }
-
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public boolean findFluentSetters() {
return findFluentSetters;
}
- @Override /* Overridden from Marshalled */
- public Class<?> implClass() {
- return implClass;
- }
-
- @Override /* Overridden from Marshalled */
- public Class<? extends MarshallingInterceptor<?>> interceptor() {
- return interceptor;
- }
-
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public Class<?> interfaceClass() {
return interfaceClass;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String p() {
return p;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String properties() {
return properties;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public Class<? extends PropertyNamer> propertyNamer() {
return propertyNamer;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String readOnlyProperties() {
return readOnlyProperties;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String ro() {
return ro;
}
- @Override /* Overridden from Marshalled */
- public boolean unsorted() {
- return unsorted;
- }
-
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public Class<?> stopClass() {
return stopClass;
}
- @Override /* Overridden from Marshalled */
- public String typeName() {
- return typeName;
- }
-
- @Override /* Overridden from Marshalled */
- public String typePropertyName() {
- return typePropertyName;
+ @Override /* Overridden from BeanType */
+ public boolean unsorted() {
+ return unsorted;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String wo() {
return wo;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String writeOnlyProperties() {
return writeOnlyProperties;
}
- @Override /* Overridden from Marshalled */
+ @Override /* Overridden from BeanType */
public String xp() {
return xp;
}
-
- @Override /* Overridden from annotation */
- public String[] description() {
- return description;
- }
}
/** Default value */
- public static final Marshalled DEFAULT = create().build();
+ public static final BeanType DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamer.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamer.java
similarity index 88%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamer.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamer.java
index 79079d4a3c..1201e73617 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamer.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamer.java
@@ -14,9 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
-
-import org.apache.juneau.annotation.*;
+package org.apache.juneau.commons.bean;
/**
* Defines an API for converting conventional bean property names to some other form.
@@ -26,7 +24,7 @@ import org.apache.juneau.annotation.*;
* this to <js>"foo-bar-url"</js>.
*
* <p>
- * Property namers are associated with beans through the {@link Bean#propertyNamer @Marshalled(propertyNamer)} annotation.
+ * Property namers are associated with beans through the {@code @BeanType(propertyNamer)} annotation.
*
*/
public interface PropertyNamer {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDLC.java
similarity index 98%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDLC.java
index 2a11cce3de..78bb5910f6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDLC.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
+package org.apache.juneau.commons.bean;
import static java.lang.Character.*;
import static org.apache.juneau.commons.utils.Utils.*;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDUCS.java
similarity index 98%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDUCS.java
index 7de9de93ec..d61b7e39d7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerDUCS.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
+package org.apache.juneau.commons.bean;
import static java.lang.Character.*;
import static org.apache.juneau.commons.utils.Utils.*;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerULC.java
similarity index 98%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerULC.java
index d9cb920f87..235e2fcc9f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/PropertyNamerULC.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
+package org.apache.juneau.commons.bean;
import static java.lang.Character.*;
import static org.apache.juneau.commons.utils.Utils.*;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/package-info.java
similarity index 57%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/package-info.java
index 14fd3868b1..6f2972a22c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BasicPropertyNamer.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/package-info.java
@@ -14,29 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau;
-
-import java.beans.*;
/**
- * Default property namer.
- *
- * <h5 class='section'>Example:</h5>
- * <ul>
- * <li><js>"fooBar"</js> -> <js>"fooBar"</js>
- * <li><js>"fooBarURL"</js> -> <js>"fooBarURL"</js>
- * <li><js>"FooBarURL"</js> -> <js>"fooBarURL"</js>
- * <li><js>"URL"</js> -> <js>"URL"</js>
- * </ul>
+ * Bean-modeling layer for Juneau.
*
* <p>
- * See {@link Introspector#decapitalize(String)} for exact rules.
- *
+ * Contains bean-modeling annotations (such as {@link org.apache.juneau.commons.bean.BeanType @BeanType})
+ * and supporting types (such as {@link org.apache.juneau.commons.bean.PropertyNamer}) that describe how
+ * Java types map to bean property sets, independent of any marshalling concerns.
*/
-public class BasicPropertyNamer implements PropertyNamer {
-
- @Override /* Overridden from PropertyNamer */
- public String getPropertyName(String name) {
- return Introspector.decapitalize(name);
- }
-}
\ No newline at end of file
+package org.apache.juneau.commons.bean;
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
index 8f77f76cae..e5642f8654 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/BeanFactory.java
@@ -74,7 +74,7 @@ public interface BeanFactory<T> {
T create() throws Exception;
/**
- * Sentinel class used as the default value for {@code @Marshalled(factory=...)} and
+ * Sentinel class used as the default value for {@code @BeanType(factory=...)} and
* {@code @MarshalledProp(factory=...)} when no factory is specified.
*/
@SuppressWarnings({
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
index bbe9894522..0e52063f69 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/function/package-info.java
@@ -425,7 +425,7 @@
*
* <p>
* With this wiring in place, any class annotated with
- * {@code @Marshalled(factory=EmployeeSupplier.Factory.class)} is automatically instantiated by
+ * {@code @BeanType(factory=EmployeeSupplier.Factory.class)} is automatically instantiated by
* retrieving the factory from the Spring {@code ApplicationContext} and calling
* {@link org.apache.juneau.commons.function.BeanFactory#create()}. No manual construction or
* injection is needed in individual REST methods.
@@ -443,7 +443,7 @@
* <th>Purpose</th>
* </tr>
* <tr>
- * <td>{@code @Marshalled(factory=X.class)}</td>
+ * <td>{@code @BeanType(factory=X.class)}</td>
* <td>Class</td>
* <td>Specifies the {@link org.apache.juneau.commons.function.BeanFactory} class used to instantiate this type during parsing. The factory is resolved from the {@code BeanStore}.</td>
* </tr>
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index 9b3824d25b..e3ca843ffe 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -921,13 +921,13 @@ public class RdfParser extends ReaderParser implements RdfMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index b6ac1c4e96..8eddd4cce2 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -1247,13 +1247,13 @@ public class RdfSerializer extends WriterSerializer implements RdfMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
index 7e05d4abfd..3ea5606878 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
@@ -38,6 +38,7 @@ import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.commons.reflect.Visibility;
import org.apache.juneau.commons.utils.*;
import org.apache.juneau.commons.inject.*;
+import org.apache.juneau.commons.bean.*;
/**
* Encapsulates all access to the properties of a bean class (like a souped-up {@link java.beans.BeanInfo}).
@@ -221,13 +222,13 @@ public class BeanMeta<T> {
if (bc.isNotABean(cm))
return notABean("Class matches exclude-class list");
- if (bc.isBeansRequireSerializable() && ! cm.isAssignableTo(Serializable.class) && ! ap.has(Marshalled.class, cm))
+ if (bc.isBeansRequireSerializable() && ! cm.isAssignableTo(Serializable.class) && ! ap.has(Marshalled.class, cm) && ! ap.has(org.apache.juneau.commons.bean.BeanType.class, cm))
return notABean("Class is not serializable");
if (ap.has(MarshalledIgnore.class, cm) || ap.has(org.apache.juneau.commons.annotation.MarshalledIgnore.class, cm))
return notABean("Class is annotated with @MarshalledIgnore");
- if ((! bc.getBeanClassVisibility().isVisible(cm.getModifiers()) || cm.isAnonymousClass()) && ! ap.has(Marshalled.class, cm))
+ if ((! bc.getBeanClassVisibility().isVisible(cm.getModifiers()) || cm.isAnonymousClass()) && ! ap.has(Marshalled.class, cm) && ! ap.has(org.apache.juneau.commons.bean.BeanType.class, cm))
return notABean("Class is not public");
var bm = new BeanMeta<>(cm, findMarshalledFilter(cm), null, implClass);
@@ -301,9 +302,13 @@ public class BeanMeta<T> {
private static <T> MarshalledFilter findMarshalledFilter(ClassMeta<T> cm) {
var ap = cm.getMarshallingContext().getAnnotationProvider();
var l = ap.find(Marshalled.class, cm);
- if (l.isEmpty())
+ var bt = ap.find(org.apache.juneau.commons.bean.BeanType.class, cm);
+ if (l.isEmpty() && bt.isEmpty())
return null;
- return MarshalledFilter.create(cm).applyAnnotations(reverse(l.stream().map(AnnotationInfo::inner).toList())).build();
+ return MarshalledFilter.create(cm)
+ .applyAnnotations(reverse(l.stream().map(AnnotationInfo::inner).toList()))
+ .applyBeanTypeAnnotations(reverse(bt.stream().map(AnnotationInfo::inner).toList()))
+ .build();
}
/*
@@ -359,7 +364,7 @@ public class BeanMeta<T> {
private final Supplier<String> dictionaryName; // The @Marshalled(typeName) annotation defined on this bean class.
private final BeanPropertyMeta dynaProperty; // "extras" property.
@SuppressWarnings("rawtypes")
- private final Class<? extends org.apache.juneau.commons.function.BeanFactory> factoryClass; // @Marshalled(factory=X.class) — null means no factory.
+ private final Class<? extends org.apache.juneau.commons.function.BeanFactory> factoryClass; // @BeanType(factory=X.class) — null means no factory.
private final boolean fluentSetters; // Whether fluent setters are enabled.
private final Map<Method,String> getterProps; // The getter properties on the target class.
private final Map<String,BeanPropertyMeta> hiddenProperties; // The hidden properties on the target class.
@@ -421,6 +426,7 @@ public class BeanMeta<T> {
var dynaPropertyValue = Value.<BeanPropertyMeta>empty();
var unsortedPropertiesTemp = false;
var ba = ap.find(Marshalled.class, cm);
+ var btList = ap.find(org.apache.juneau.commons.bean.BeanType.class, cm);
var propertyNamer = opt(bf).map(x -> x.getPropertyNamer()).orElse(marshallingContext.getPropertyNamer());
this.typePropertyName = ba.stream().map(x -> x.inner().typePropertyName()).filter(Utils::ne).findFirst().orElseGet(marshallingContext::getBeanTypePropertyName);
@@ -507,7 +513,7 @@ public class BeanMeta<T> {
}
// Check for missing properties.
- fixedBeanProps.stream().filter(x -> ! normalProps.containsKey(x)).findFirst().ifPresent(x -> { throw bex(c, "The property ''{0}'' was defined on the @Marshalled(properties=X) annotation of class ''{1}'' but was not found on the class definition.", x, ci.getNameSimple()); });
+ fixedBeanProps.stream().filter(x -> ! normalProps.containsKey(x)).findFirst().ifPresent(x -> { throw bex(c, "The property ''{0}'' was defined on the @BeanType(properties=X) annotation of class ''{1}'' but was not found on the class definition.", x, ci.getNameSimple()); });
// For records with renamed properties, remap constructor args to use the actual property names.
if (ci.isRecord() && ne(beanConstructor.args())) {
@@ -602,7 +608,7 @@ public class BeanMeta<T> {
typeProperty = BeanPropertyMeta.builder(this, typePropertyName).canRead().canWrite().rawMetaType(marshallingContext.string()).beanRegistry(beanRegistry.get()).build();
dictionaryName = memoize(this::findDictionaryName);
beanProxyInvocationHandler = memoize(()->marshallingContext.isUseInterfaceProxies() && c.isInterface() ? new BeanProxyInvocationHandler<>(this) : null);
- var factoryClassTemp = ba.stream().map(x -> x.inner().factory()).filter(x -> x != org.apache.juneau.commons.function.BeanFactory.Void.class).findFirst().orElse(null);
+ var factoryClassTemp = btList.stream().map(x -> x.inner().factory()).filter(x -> x != org.apache.juneau.commons.function.BeanFactory.Void.class).findFirst().orElse(null);
factoryClass = factoryClassTemp;
}
@@ -1052,7 +1058,8 @@ public class BeanMeta<T> {
return new BeanConstructor(opt(implClassConstructor.accessible()), liste());
var ba = ap.find(Marshalled.class, classMeta);
- var con = ci.getNoArgConstructor(! ba.isEmpty() ? Visibility.PRIVATE : vis).orElse(null);
+ var btList = ap.find(org.apache.juneau.commons.bean.BeanType.class, classMeta);
+ var con = ci.getNoArgConstructor((! ba.isEmpty() || ! btList.isEmpty()) ? Visibility.PRIVATE : vis).orElse(null);
if (con != null)
return new BeanConstructor(opt(con.accessible()), liste());
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index 99f41e0469..dd8393c7f6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -66,7 +66,7 @@ import org.apache.juneau.swap.*;
*
* @param <T> The class type of the wrapped class.
*/
-@Marshalled(properties = "innerClass,elementType,keyType,valueType,notABeanReason,initException,beanMeta")
+@org.apache.juneau.commons.bean.BeanType(properties = "innerClass,elementType,keyType,valueType,notABeanReason,initException,beanMeta")
@SuppressWarnings({
"java:S1200", // Class has 23 dependencies, acceptable for this core reflection metadata class
"java:S1452", // Wildcard required - ClassMeta<?>, ObjectSwap<T,?>, etc. for element/component types
@@ -1670,9 +1670,13 @@ public class ClassMeta<T> extends ClassInfoTyped<T> {
private MarshalledFilter findMarshalledFilter() {
var ap = marshallingContext.getAnnotationProvider();
var l = ap.find(Marshalled.class, this);
- if (l.isEmpty())
+ var bt = ap.find(org.apache.juneau.commons.bean.BeanType.class, this);
+ if (l.isEmpty() && bt.isEmpty())
return null;
- return MarshalledFilter.create(inner()).applyAnnotations(reverse(l.stream().map(AnnotationInfo::inner).toList())).build();
+ return MarshalledFilter.create(inner())
+ .applyAnnotations(reverse(l.stream().map(AnnotationInfo::inner).toList()))
+ .applyBeanTypeAnnotations(reverse(bt.stream().map(AnnotationInfo::inner).toList()))
+ .build();
}
@SuppressWarnings({
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
index 17f986a75e..50f13cd64f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
@@ -26,9 +26,11 @@ import java.beans.*;
import java.util.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.inject.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
* Filter for customizing how POJOs and beans are handled during serialization and parsing.
@@ -130,11 +132,35 @@ public class MarshalledFilter {
* @param annotations The annotations to apply.
* @return This object.
*/
- @SuppressWarnings({
- "java:S3776" // Cognitive complexity acceptable for annotation application
- })
public Builder applyAnnotations(List<Marshalled> annotations) {
+ annotations.forEach(x -> {
+ if (ne(x.typeName()))
+ typeName(x.typeName());
+ if (isNotVoid(x.interceptor()))
+ interceptor(x.interceptor());
+ if (isNotVoid(x.implClass()))
+ implClass(x.implClass());
+ if (isNotEmptyArray(x.dictionary()))
+ dictionary(x.dictionary());
+ if (ne(x.example()))
+ example(x.example());
+ });
+ return this;
+ }
+
+ /**
+ * Applies the information in the specified list of {@link BeanType @BeanType} annotations to this filter.
+ *
+ * <p>
+ * Carries the bean-modeling attributes (property lists, ordering, fluent setters, stop class, etc.)
+ * that used to live on {@link Marshalled @Marshalled} before the bean-layer split.
+ *
+ * @param annotations The annotations to apply.
+ * @return This object.
+ */
+ public Builder applyBeanTypeAnnotations(List<BeanType> annotations) {
+
annotations.forEach(x -> {
if (isAnyNotEmpty(x.properties(), x.p()))
properties(x.properties(), x.p());
@@ -148,22 +174,12 @@ public class MarshalledFilter {
readOnlyProperties(x.readOnlyProperties(), x.ro());
if (isAnyNotEmpty(x.writeOnlyProperties(), x.wo()))
writeOnlyProperties(x.writeOnlyProperties(), x.wo());
- if (ne(x.typeName()))
- typeName(x.typeName());
if (isNotVoid(x.propertyNamer()))
propertyNamer(x.propertyNamer());
if (isNotVoid(x.interfaceClass()))
interfaceClass(x.interfaceClass());
if (isNotVoid(x.stopClass()))
stopClass(x.stopClass());
- if (isNotVoid(x.interceptor()))
- interceptor(x.interceptor());
- if (isNotVoid(x.implClass()))
- implClass(x.implClass());
- if (isNotEmptyArray(x.dictionary()))
- dictionary(x.dictionary());
- if (ne(x.example()))
- example(x.example());
});
return this;
}
@@ -233,7 +249,7 @@ public class MarshalledFilter {
* Specifies properties to exclude from the bean class.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#excludeProperties()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#excludeProperties()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(Map)}
@@ -258,7 +274,7 @@ public class MarshalledFilter {
* When enabled, fluent setters are detected on beans.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#findFluentSetters()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#findFluentSetters()}
* <li class='jm'>{@link MarshallingContext.Builder#findFluentSetters()}
* </ul>
*
@@ -338,7 +354,7 @@ public class MarshalledFilter {
* When specified, only the list of properties defined on the interface class will be used during serialization.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#interfaceClass()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#interfaceClass()}
* </ul>
*
* @param value The new value for this setting.
@@ -370,7 +386,7 @@ public class MarshalledFilter {
* Specifies the set and order of names of properties associated with the bean class.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#properties()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#properties()}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(Map)}
@@ -395,7 +411,7 @@ public class MarshalledFilter {
* The class to use for calculating bean property names.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#propertyNamer()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#propertyNamer()}
* <li class='jm'>{@link MarshallingContext.Builder#propertyNamer(Class)}
* <li class='jc'>{@link PropertyNamer}
* </ul>
@@ -431,7 +447,7 @@ public class MarshalledFilter {
* Specifies one or more properties on a bean that are read-only despite having valid getters.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#readOnlyProperties()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#readOnlyProperties()}
* <li class='ja'>{@link MarshalledProp#ro()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
@@ -454,7 +470,7 @@ public class MarshalledFilter {
* Opt out of alphabetical property sorting for this specific bean.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#unsorted()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#unsorted()}
* <li class='jf'>{@link MarshallingContext.Builder#unsortedProperties()}
* </ul>
*
@@ -469,7 +485,7 @@ public class MarshalledFilter {
* Opt out of alphabetical property sorting for this specific bean.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#unsorted()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#unsorted()}
* <li class='jf'>{@link MarshallingContext.Builder#unsortedProperties()}
* </ul>
*
@@ -491,7 +507,7 @@ public class MarshalledFilter {
* Identical in purpose to the stop class specified by {@link Introspector#getBeanInfo(Class, Class)}.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#stopClass()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#stopClass()}
* </ul>
*
* @param value The new value for this setting.
@@ -541,7 +557,7 @@ public class MarshalledFilter {
* Specifies one or more properties on a bean that are write-only despite having valid setters.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link Marshalled#writeOnlyProperties()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#writeOnlyProperties()}
* <li class='ja'>{@link MarshalledProp#wo()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
index 5fcb842777..9cb1593d14 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
@@ -46,6 +46,7 @@ import org.apache.juneau.marshaller.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.swap.*;
import org.apache.juneau.utils.*;
+import org.apache.juneau.commons.bean.*;
/**
* Bean context.
@@ -907,7 +908,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanProperties(Class<?> beanClass, String properties) {
assertArgNotNull(ARG_beanClass, beanClass);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClass).value(MarshalledAnnotation.create().p(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClass).value(BeanTypeAnnotation.create().p(properties).build()).build());
}
/**
@@ -970,7 +971,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*/
public Builder beanProperties(Map<String,Object> values) {
assertArgNotNull(ARG_values, values);
- values.forEach((k, v) -> annotations(MarshalledApplyAnnotation.create(k).value(MarshalledAnnotation.create().p(s(v)).build()).build()));
+ values.forEach((k, v) -> annotations(BeanTypeApplyAnnotation.create(k).value(BeanTypeAnnotation.create().p(s(v)).build()).build()));
return this;
}
@@ -1035,7 +1036,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanProperties(String beanClassName, String properties) {
assertArgNotNull(ARG_beanClassName, beanClassName);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClassName).value(MarshalledAnnotation.create().p(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClassName).value(BeanTypeAnnotation.create().p(properties).build()).build());
}
/**
@@ -1090,7 +1091,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesExcludes(Class<?> beanClass, String properties) {
assertArgNotNull(ARG_beanClass, beanClass);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClass).value(MarshalledAnnotation.create().xp(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClass).value(BeanTypeAnnotation.create().xp(properties).build()).build());
}
/**
@@ -1145,7 +1146,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*/
public Builder beanPropertiesExcludes(Map<String,Object> values) {
assertArgNotNull(ARG_values, values);
- values.forEach((k, v) -> annotations(MarshalledApplyAnnotation.create(k).value(MarshalledAnnotation.create().xp(s(v)).build()).build()));
+ values.forEach((k, v) -> annotations(BeanTypeApplyAnnotation.create(k).value(BeanTypeAnnotation.create().xp(s(v)).build()).build()));
return this;
}
@@ -1203,7 +1204,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesExcludes(String beanClassName, String properties) {
assertArgNotNull(ARG_beanClassName, beanClassName);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClassName).value(MarshalledAnnotation.create().xp(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClassName).value(BeanTypeAnnotation.create().xp(properties).build()).build());
}
/**
@@ -1261,7 +1262,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesReadOnly(Class<?> beanClass, String properties) {
assertArgNotNull(ARG_beanClass, beanClass);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClass).value(MarshalledAnnotation.create().ro(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClass).value(BeanTypeAnnotation.create().ro(properties).build()).build());
}
/**
@@ -1319,7 +1320,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*/
public Builder beanPropertiesReadOnly(Map<String,Object> values) {
assertArgNotNull(ARG_values, values);
- values.forEach((k, v) -> annotations(MarshalledApplyAnnotation.create(k).value(MarshalledAnnotation.create().ro(s(v)).build()).build()));
+ values.forEach((k, v) -> annotations(BeanTypeApplyAnnotation.create(k).value(BeanTypeAnnotation.create().ro(s(v)).build()).build()));
return this;
}
@@ -1378,7 +1379,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesReadOnly(String beanClassName, String properties) {
assertArgNotNull(ARG_beanClassName, beanClassName);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClassName).value(MarshalledAnnotation.create().ro(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClassName).value(BeanTypeAnnotation.create().ro(properties).build()).build());
}
/**
@@ -1435,7 +1436,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesWriteOnly(Class<?> beanClass, String properties) {
assertArgNotNull(ARG_beanClass, beanClass);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClass).value(MarshalledAnnotation.create().wo(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClass).value(BeanTypeAnnotation.create().wo(properties).build()).build());
}
/**
@@ -1492,7 +1493,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*/
public Builder beanPropertiesWriteOnly(Map<String,Object> values) {
assertArgNotNull(ARG_values, values);
- values.forEach((k, v) -> annotations(MarshalledApplyAnnotation.create(k).value(MarshalledAnnotation.create().wo(s(v)).build()).build()));
+ values.forEach((k, v) -> annotations(BeanTypeApplyAnnotation.create(k).value(BeanTypeAnnotation.create().wo(s(v)).build()).build()));
return this;
}
@@ -1550,7 +1551,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder beanPropertiesWriteOnly(String beanClassName, String properties) {
assertArgNotNull(ARG_beanClassName, beanClassName);
assertArgNotNull(ARG_properties, properties);
- return annotations(MarshalledApplyAnnotation.create(beanClassName).value(MarshalledAnnotation.create().wo(properties).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(beanClassName).value(BeanTypeAnnotation.create().wo(properties).build()).build());
}
/**
@@ -2192,11 +2193,11 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link MarshalledProp @MarshalledProp} annotation can also be used on methods to individually identify them as fluent setters.
- * <li class='note'>The {@link Bean#findFluentSetters() @Marshalled.fluentSetters()} annotation can also be used on classes to specify to look for fluent setters.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanType#findFluentSetters() @BeanType.findFluentSetters()} annotation can also be used on classes to specify to look for fluent setters.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.annotation.Marshalled#findFluentSetters()}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#findFluentSetters()}
* <li class='ja'>{@link org.apache.juneau.annotation.MarshalledConfig#findFluentSetters()}
* </ul>
*
@@ -2255,7 +2256,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*/
public Builder findFluentSetters(Class<?> on) {
assertArgNotNull(ARG_on, on);
- return annotations(MarshalledApplyAnnotation.create(on).value(MarshalledAnnotation.create().findFluentSetters(true).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(on).value(BeanTypeAnnotation.create().findFluentSetters(true).build()).build());
}
@Override /* Overridden from Context.Builder */
@@ -2601,7 +2602,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder interfaceClass(Class<?> on, Class<?> value) {
assertArgNotNull(ARG_on, on);
assertArgNotNull(ARG_value, value);
- return annotations(MarshalledApplyAnnotation.create(on).value(MarshalledAnnotation.create().interfaceClass(value).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(on).value(BeanTypeAnnotation.create().interfaceClass(value).build()).build());
}
/**
@@ -2648,7 +2649,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder interfaces(Class<?>...value) {
assertArgNoNulls(ARG_value, value);
for (var v : value)
- annotations(MarshalledApplyAnnotation.create(v).value(MarshalledAnnotation.create().interfaceClass(v).build()).build());
+ annotations(BeanTypeApplyAnnotation.create(v).value(BeanTypeAnnotation.create().interfaceClass(v).build()).build());
return this;
}
@@ -2945,7 +2946,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder propertyNamer(Class<?> on, Class<? extends PropertyNamer> value) {
assertArgNotNull(ARG_on, on);
assertArgNotNull(ARG_value, value);
- return annotations(MarshalledApplyAnnotation.create(on).value(MarshalledAnnotation.create().propertyNamer(value).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(on).value(BeanTypeAnnotation.create().propertyNamer(value).build()).build());
}
/**
@@ -3017,7 +3018,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link Bean#unsorted() @Marshalled.unsorted()} annotation can also be used to opt out of sorting on a single class.
+ * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanType#unsorted() @BeanType.unsorted()} annotation can also be used to opt out of sorting on a single class.
* </ul>
*
* @return This object.
@@ -3041,7 +3042,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* Opt specific bean classes out of alphabetical property sorting.
*
* <p>
- * Applies the {@link Bean#unsorted() @Marshalled(unsorted=true)} annotation to the specified classes,
+ * Applies the {@link Bean#unsorted() @BeanType(unsorted=true)} annotation to the specified classes,
* overriding the default sorted behavior for those specific beans.
*
* <h5 class='section'>See Also:</h5><ul>
@@ -3055,7 +3056,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder unsortedProperties(Class<?>...on) {
assertArgNoNulls(ARG_on, on);
for (var c : on)
- annotations(MarshalledApplyAnnotation.create(c).value(MarshalledAnnotation.create().unsorted(true).build()).build());
+ annotations(BeanTypeApplyAnnotation.create(c).value(BeanTypeAnnotation.create().unsorted(true).build()).build());
return this;
}
@@ -3104,7 +3105,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
public Builder stopClass(Class<?> on, Class<?> value) {
assertArgNotNull(ARG_on, on);
assertArgNotNull(ARG_value, value);
- return annotations(MarshalledApplyAnnotation.create(on).value(MarshalledAnnotation.create().stopClass(value).build()).build());
+ return annotations(BeanTypeApplyAnnotation.create(on).value(BeanTypeAnnotation.create().stopClass(value).build()).build());
}
/**
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
index e8dadb4eb5..0b783fee4c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
@@ -33,6 +33,7 @@ import org.apache.juneau.commons.function.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.commons.reflect.Visibility;
import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
* Context class for classes that use {@link MarshallingContext} objects.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingSession.java
index 0608212e4b..75cd894bea 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingSession.java
@@ -37,6 +37,7 @@ import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.commons.lang.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
* Session object that lives for the duration of a single use of {@link MarshallingContext}.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
index 6b14795158..875f2c0b66 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
@@ -610,13 +610,13 @@ public abstract class MarshallingTraverseContext extends MarshallingContextable
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApply.java
new file mode 100644
index 0000000000..359d412119
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApply.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.annotation;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.commons.bean.*;
+
+/**
+ * Dynamically applies a {@link BeanType @BeanType} annotation to specified classes.
+ *
+ * <p>
+ * This annotation separates the <b>targeting</b> concern ({@link #on()}/{@link #onClass()}) from the
+ * <b>content</b> concern ({@link #value()}), enabling {@link BeanType @BeanType} to be a pure data annotation
+ * without marshall-specific application machinery.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <ja>@BeanTypeApply</ja>(on=<js>"com.example.Foo"</js>, value=<ja>@BeanType</ja>(properties=<js>"a,b"</js>))
+ * <jk>public class</jk> MyConfig {}
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ */
+@Documented
+@Target({ TYPE, METHOD })
+@Retention(RUNTIME)
+@Repeatable(BeanTypeApply.Array.class)
+@ContextApply(BeanTypeApplyAnnotation.Applier.class)
+public @interface BeanTypeApply {
+
+ /**
+ * The {@link BeanType @BeanType} annotation to apply.
+ *
+ * @return The annotation value.
+ */
+ BeanType value();
+
+ /**
+ * Dynamically apply this annotation to the specified classes.
+ *
+ * <p>
+ * Identifies the targets this annotation applies to using fully-qualified names.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ String[] on() default {};
+
+ /**
+ * Dynamically apply this annotation to the specified classes.
+ *
+ * <p>
+ * Identical to {@link #on()} except allows you to specify class objects instead of strings.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ Class<?>[] onClass() default {};
+
+ /**
+ * A collection of {@link BeanTypeApply @BeanTypeApply annotations}.
+ */
+ @Documented
+ @Target({ TYPE, METHOD })
+ @Retention(RUNTIME)
+ public @interface Array {
+
+ /**
+ * The child annotations.
+ *
+ * @return The annotation value.
+ */
+ BeanTypeApply[] value();
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApplyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApplyAnnotation.java
new file mode 100644
index 0000000000..2290ccc2e4
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanTypeApplyAnnotation.java
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.annotation;
+
+import static org.apache.juneau.commons.utils.CollectionUtils.*;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.bean.*;
+import org.apache.juneau.commons.reflect.*;
+import org.apache.juneau.svl.*;
+
+/**
+ * Utility classes and methods for the {@link BeanTypeApply @BeanTypeApply} annotation.
+ *
+ */
+public class BeanTypeApplyAnnotation {
+
+ /**
+ * Prevents instantiation.
+ */
+ private BeanTypeApplyAnnotation() {}
+
+ /**
+ * Applies targeted {@link BeanTypeApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ *
+ * <p>
+ * Passes the {@link BeanTypeApply @BeanTypeApply} annotation through to the builder's annotation list.
+ * The {@link org.apache.juneau.commons.reflect.AnnotationProvider.Builder#addRuntimeAnnotations(java.util.List)}
+ * method handles unwrapping the nested {@link BeanType @BeanType} from {@link BeanTypeApply#value()} and registering it
+ * under the targets specified by {@link BeanTypeApply#on()} and {@link BeanTypeApply#onClass()}.
+ */
+ public static class Applier extends AnnotationApplier<BeanTypeApply,Context.Builder> {
+
+ /**
+ * Constructor.
+ *
+ * @param vr The resolver for resolving values in annotations.
+ */
+ public Applier(VarResolverSession vr) {
+ super(BeanTypeApply.class, Context.Builder.class, vr);
+ }
+
+ @Override
+ public void apply(AnnotationInfo<BeanTypeApply> ai, Context.Builder b) {
+ BeanTypeApply a = ai.inner();
+ if (isEmptyArray(a.on()) && isEmptyArray(a.onClass()))
+ return;
+ b.annotations(a);
+ }
+ }
+
+ /**
+ * Builder class.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
+ * </ul>
+ */
+ public static class Builder extends AppliedAnnotationObject.BuilderTMF {
+
+ BeanType value = BeanTypeAnnotation.DEFAULT;
+
+ /**
+ * Constructor.
+ */
+ protected Builder() {
+ super(BeanTypeApply.class);
+ }
+
+ /**
+ * Sets the {@link BeanTypeApply#value()} property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object.
+ */
+ public Builder value(BeanType value) {
+ this.value = value;
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.Builder */
+ public Builder on(String...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder on(Class<?>...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedOnClassAnnotationObject.Builder */
+ public Builder onClass(Class<?>...value) {
+ super.onClass(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderM */
+ public Builder on(Method...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderMF */
+ public Builder on(Field...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder on(ClassInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder onClass(ClassInfo...value) {
+ super.onClass(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderTMF */
+ public Builder on(FieldInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderTMF */
+ public Builder on(MethodInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ /**
+ * Instantiates a new {@link BeanTypeApply @BeanTypeApply} object initialized with this builder.
+ *
+ * @return A new {@link BeanTypeApply} object.
+ */
+ public BeanTypeApply build() {
+ return new Object(this);
+ }
+ }
+
+ @SuppressWarnings({
+ "java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
+ })
+ private static class Object extends AppliedOnClassAnnotationObject implements BeanTypeApply {
+
+ private final BeanType value;
+
+ Object(BeanTypeApplyAnnotation.Builder b) {
+ super(b);
+ value = b.value;
+ }
+
+ @Override /* Overridden from BeanTypeApply */
+ public BeanType value() {
+ return value;
+ }
+
+ @Override /* Overridden from BeanTypeApply */
+ public String[] on() {
+ return super.on();
+ }
+
+ @Override /* Overridden from BeanTypeApply */
+ public Class<?>[] onClass() {
+ return super.onClass();
+ }
+ }
+
+ /** Default value */
+ public static final BeanTypeApply DEFAULT = create().build();
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @return A new builder object.
+ */
+ public static Builder create() {
+ return new Builder();
+ }
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @param on The targets this annotation applies to.
+ * @return A new builder object.
+ */
+ public static Builder create(Class<?>...on) {
+ return create().on(on);
+ }
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @param on The targets this annotation applies to.
+ * @return A new builder object.
+ */
+ public static Builder create(String...on) {
+ return create().on(on);
+ }
+
+ /**
+ * Returns <jk>true</jk> if the specified annotation contains all default values.
+ *
+ * @param a The annotation to check.
+ * @return <jk>true</jk> if the specified annotation contains all default values.
+ */
+ public static boolean empty(BeanTypeApply a) {
+ return a == null || DEFAULT.equals(a);
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
index 6fd9f49d4e..0bcb010ddd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
@@ -19,9 +19,7 @@ package org.apache.juneau.annotation;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
-import java.beans.*;
import java.lang.annotation.*;
-import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.swap.*;
@@ -30,6 +28,12 @@ import org.apache.juneau.swap.*;
* Annotation that can be applied to classes to control how they are marshalled.
*
* <p>
+ * Carries the marshalling-only attributes for a class — bean-modeling attributes (such as
+ * {@code properties}, {@code excludeProperties}, {@code findFluentSetters}, {@code interfaceClass},
+ * {@code stopClass}, {@code propertyNamer}, {@code unsorted}, {@code factory}, etc.) live on
+ * {@link org.apache.juneau.commons.bean.BeanType @BeanType} in <c>juneau-commons</c>.
+ *
+ * <p>
* Can be used in the following locations:
* <ul>
* <li>Bean classes and parent interfaces.
@@ -128,92 +132,6 @@ public @interface Marshalled {
*/
String example() default "";
- /**
- * Bean property excludes.
- *
- * <p>
- * Specifies a list of properties that should be excluded from {@link BeanMap#entrySet()}.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Exclude the 'city' and 'state' properties from the Address class.</jc>
- * <ja>@Marshalled</ja>(excludeProperties=<js>"city,state"</js>})
- * <jk>public class</jk> Address {...}
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * {@link #xp()} is a shortened synonym for this value.
- * <li class='note'>
- * <b>Java Records:</b> Excluding record components is not supported during parsing.
- * Because records are immutable, all components must be provided to the canonical constructor.
- * Excluded components will be omitted from serialization output, but the parser will be unable to
- * instantiate the record if the excluded component values are missing from the input.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesExcludes(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String excludeProperties() default "";
-
- /**
- * Bean factory class.
- *
- * <p>
- * Specifies a {@link org.apache.juneau.commons.function.BeanFactory} class to use for instantiating
- * this class instead of relying on a no-arg constructor or static {@code getInstance()} method.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link org.apache.juneau.commons.function.BeanFactory}
- * <li class='ja'>{@link MarshalledProp#factory()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanStore(org.apache.juneau.commons.inject.BeanStore)}
- * </ul>
- *
- * @return The annotation value.
- */
- @SuppressWarnings({
- "rawtypes" // Raw BeanFactory type required for annotation attribute declaration
- })
- Class<? extends org.apache.juneau.commons.function.BeanFactory> factory() default org.apache.juneau.commons.function.BeanFactory.Void.class;
-
- /**
- * Find fluent setters.
- *
- * <p>
- * When <jk>true</jk>, fluent setters will be detected on beans.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <ja>@Marshalled</ja>(findFluentSetters=<jk>true</jk>)
- * <jk>public class</jk> MyBean {
- * <jk>public int</jk> getId() {...}
- * <jk>public</jk> MyBean id(<jk>int</jk> <jv>id</jv>) {...}
- * }
- * </p>
- *
- * <p>
- * Fluent setters must have the following attributes:
- * <ul>
- * <li>Public.
- * <li>Not static.
- * <li>Take in one parameter.
- * <li>Return the bean itself.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledConfig#findFluentSetters()}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#findFluentSetters()}
- * </ul>
- *
- * @return The annotation value.
- */
- boolean findFluentSetters() default false;
-
/**
* Implementation class.
*
@@ -246,162 +164,6 @@ public @interface Marshalled {
*/
Class<? extends MarshallingInterceptor<?>> interceptor() default MarshallingInterceptor.Void.class;
- /**
- * Identifies a class to be used as the interface class for this and all subclasses.
- *
- * <p>
- * When specified, only the list of properties defined on the interface class will be used during serialization.
- * Additional properties on subclasses will be ignored.
- *
- * <p class='bjava'>
- * <jc>// Parent class</jc>
- * <ja>@Marshalled</ja>(interfaceClass=A.<jk>class</jk>)
- * <jk>public abstract class</jk> A {
- * <jk>public</jk> String <jf>f0</jf> = <js>"f0"</js>;
- * }
- *
- * <jc>// Sub class</jc>
- * <jk>public class</jk> A1 <jk>extends</jk> A {
- * <jk>public</jk> String <jf>f1</jf> = <js>"f1"</js>;
- * }
- *
- * <jc>// Produces "{f0:'f0'}"</jc>
- * String <jv>json</jv> = Json5Serializer.<jsf>DEFAULT</jsf>.serialize(<jk>new</jk> A1());
- * </p>
- *
- * <p>
- * Note that this annotation can be used on the parent class so that it filters to all child classes,
- * or can be set individually on the child classes.
- *
- * @return The annotation value.
- */
- Class<?> interfaceClass() default void.class;
-
- /**
- * Synonym for {@link #properties()}.
- *
- * @return The annotation value.
- */
- String p() default "";
-
- /**
- * Bean property includes.
- *
- * <p>
- * The set and order of names of properties associated with a bean class.
- *
- * <p>
- * The order specified is the same order that the entries will be returned by the {@link BeanMap#entrySet()} and
- * related methods.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Address class with only street/city/state properties (in that order).</jc>
- * <ja>@Marshalled</ja>(properties=<js>"street,city,state"</js>)
- * <jk>public class</jk> Address {...}
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * {@link #p()} is a shortened synonym for this value.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanProperties(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String properties() default "";
-
- /**
- * Associates a {@link PropertyNamer} with this bean to tailor the names of the bean properties.
- *
- * <p>
- * Property namers are used to transform bean property names from standard form to some other form.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Define a class with dashed-lowercase property names.</jc>
- * <ja>@Marshalled</ja>(propertyNamer=PropertyNamerDashedLC.<jk>class</jk>)
- * <jk>public class</jk> MyBean {...}
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#propertyNamer(Class)}
- * </ul>
- *
- * @return The annotation value.
- */
- Class<? extends PropertyNamer> propertyNamer() default PropertyNamer.Void.class;
-
- /**
- * Read-only bean properties.
- *
- * <p>
- * Specifies one or more properties on a bean that are read-only despite having valid getters.
- * Serializers will serialize such properties as usual, but parsers will silently ignore them.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Exclude the 'city' and 'state' properties from being parsed, but not serialized.</jc>
- * <ja>@Marshalled</ja>(readOnlyProperties=<js>"city,state"</js>})
- * <jk>public class</jk> Address {...}
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * {@link #ro()} is a shortened synonym for this value.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesReadOnly(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String readOnlyProperties() default "";
-
- /**
- * Synonym for {@link #readOnlyProperties()}.
- *
- * @return The annotation value.
- */
- String ro() default "";
-
- /**
- * Identifies a stop class for the annotated class.
- *
- * <p>
- * Identical in purpose to the stop class specified by {@link Introspector#getBeanInfo(Class, Class)}.
- * Any properties in the stop class or in its base classes will be ignored during analysis.
- *
- * <p>
- * For example, in the following class hierarchy, instances of <c>C3</c> will include property <c>p3</c>,
- * but not <c>p1</c> or <c>p2</c>.
- * <p class='bjava'>
- * <jk>public class</jk> C1 {
- * <jk>public int</jk> getP1();
- * }
- *
- * <jk>public class</jk> C2 <jk>extends</jk> C1 {
- * <jk>public int</jk> getP2();
- * }
- *
- * <ja>@Marshalled</ja>(stopClass=C2.<jk>class</jk>)
- * <jk>public class</jk> C3 <jk>extends</jk> C2 {
- * <jk>public int</jk> getP3();
- * }
- * </p>
- *
- * @return The annotation value.
- */
- Class<?> stopClass() default void.class;
-
/**
* An identifying name for this class.
*
@@ -452,69 +214,4 @@ public @interface Marshalled {
* @return The annotation value.
*/
String typePropertyName() default "";
-
- /**
- * Synonym for {@link #writeOnlyProperties()}.
- *
- * @return The annotation value.
- */
- String wo() default "";
-
- /**
- * Write-only bean properties.
- *
- * <p>
- * Specifies one or more properties on a bean that are write-only despite having valid setters.
- * Parsers will parse such properties as usual, but serializers will silently ignore them.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Exclude the 'city' and 'state' properties from being serialized, but not parsed.</jc>
- * <ja>@Marshalled</ja>(writeOnlyProperties=<js>"city,state"</js>})
- * <jk>public class</jk> Address {...}
- * </p>
- *
- * <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>
- * {@link #wo()} is a shortened synonym for this value.
- * </ul>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanPropertiesWriteOnly(Map)}
- * </ul>
- *
- * @return The annotation value.
- */
- String writeOnlyProperties() default "";
-
- /**
- * Synonym for {@link #excludeProperties()}.
- *
- * @return The annotation value.
- */
- String xp() default "";
-
- /**
- * Opt out of alphabetical sorting for this specific bean's properties.
- *
- * <p>
- * By default, bean properties are serialized in alphabetical order.
- * When <jk>true</jk>, properties of this bean will use the natural JVM-dependent order instead.
- *
- * <h5 class='section'>Example:</h5>
- * <p class='bjava'>
- * <jc>// Disable sorted properties for this specific bean.</jc>
- * <ja>@Marshalled</ja>(unsorted=<jk>true</jk>)
- * <jk>public class</jk> MyBean {...}
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#unsortedProperties()}
- * </ul>
- *
- * @return The annotation value.
- */
- boolean unsorted() default false;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
index 49f7fe311f..51c0fcfe74 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
@@ -20,9 +20,7 @@ import static org.apache.juneau.commons.utils.CollectionUtils.*;
import java.lang.annotation.*;
-import org.apache.juneau.*;
import org.apache.juneau.commons.annotation.*;
-import org.apache.juneau.commons.function.*;
import org.apache.juneau.swap.*;
/**
@@ -49,25 +47,10 @@ public class MarshalledAnnotation {
private String[] description = {};
private Class<?>[] dictionary = new Class[0];
private Class<?> implClass = void.class;
- private Class<?> interfaceClass = void.class;
- private Class<?> stopClass = void.class;
private Class<? extends MarshallingInterceptor<?>> interceptor = MarshallingInterceptor.Void.class;
- private Class<? extends PropertyNamer> propertyNamer = BasicPropertyNamer.class;
- @SuppressWarnings("rawtypes")
- private Class<? extends BeanFactory> factory = BeanFactory.Void.class;
private String example = "";
- private String excludeProperties = "";
- private String p = "";
- private String properties = "";
- private String readOnlyProperties = "";
- private String ro = "";
private String typeName = "";
private String typePropertyName = "";
- private String wo = "";
- private String writeOnlyProperties = "";
- private String xp = "";
- private boolean findFluentSetters;
- private boolean unsorted;
/**
* Constructor.
@@ -118,18 +101,6 @@ public class MarshalledAnnotation {
return this;
}
- /**
- * Sets the {@link Marshalled#factory()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- @SuppressWarnings("rawtypes")
- public Builder factory(Class<? extends BeanFactory> value) {
- factory = value;
- return this;
- }
-
/**
* Sets the {@link Marshalled#example()} property on this annotation.
*
@@ -141,28 +112,6 @@ public class MarshalledAnnotation {
return this;
}
- /**
- * Sets the {@link Marshalled#excludeProperties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder excludeProperties(String value) {
- excludeProperties = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#findFluentSetters()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder findFluentSetters(boolean value) {
- findFluentSetters = value;
- return this;
- }
-
/**
* Sets the {@link Marshalled#implClass()} property on this annotation.
*
@@ -185,94 +134,6 @@ public class MarshalledAnnotation {
return this;
}
- /**
- * Sets the {@link Marshalled#interfaceClass()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder interfaceClass(Class<?> value) {
- interfaceClass = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#p()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder p(String value) {
- p = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#properties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder properties(String value) {
- properties = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#propertyNamer()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder propertyNamer(Class<? extends PropertyNamer> value) {
- propertyNamer = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#readOnlyProperties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder readOnlyProperties(String value) {
- readOnlyProperties = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#ro()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder ro(String value) {
- ro = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#unsorted()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder unsorted(boolean value) {
- unsorted = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#stopClass()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder stopClass(Class<?> value) {
- stopClass = value;
- return this;
- }
-
/**
* Sets the {@link Marshalled#typeName()} property on this annotation.
*
@@ -294,40 +155,6 @@ public class MarshalledAnnotation {
typePropertyName = value;
return this;
}
-
- /**
- * Sets the {@link Marshalled#wo()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder wo(String value) {
- wo = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#writeOnlyProperties()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder writeOnlyProperties(String value) {
- writeOnlyProperties = value;
- return this;
- }
-
- /**
- * Sets the {@link Marshalled#xp()} property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object.
- */
- public Builder xp(String value) {
- xp = value;
- return this;
- }
-
}
@SuppressWarnings({
@@ -337,27 +164,12 @@ public class MarshalledAnnotation {
private final MarshalledAs as;
private final String[] description;
- private final boolean findFluentSetters;
- private final boolean unsorted;
private final Class<? extends MarshallingInterceptor<?>> interceptor;
- private final Class<? extends PropertyNamer> propertyNamer;
private final Class<?> implClass;
- private final Class<?> interfaceClass;
- private final Class<?> stopClass;
private final Class<?>[] dictionary;
- @SuppressWarnings("rawtypes")
- private final Class<? extends BeanFactory> factory;
private final String example;
- private final String excludeProperties;
- private final String p;
- private final String properties;
- private final String readOnlyProperties;
- private final String ro;
private final String typeName;
private final String typePropertyName;
- private final String wo;
- private final String writeOnlyProperties;
- private final String xp;
Object(MarshalledAnnotation.Builder b) {
super(b);
@@ -365,24 +177,10 @@ public class MarshalledAnnotation {
description = copyOf(b.description);
dictionary = copyOf(b.dictionary);
example = b.example;
- excludeProperties = b.excludeProperties;
- factory = b.factory;
- findFluentSetters = b.findFluentSetters;
implClass = b.implClass;
interceptor = b.interceptor;
- interfaceClass = b.interfaceClass;
- p = b.p;
- properties = b.properties;
- propertyNamer = b.propertyNamer;
- readOnlyProperties = b.readOnlyProperties;
- ro = b.ro;
- unsorted = b.unsorted;
- stopClass = b.stopClass;
typeName = b.typeName;
typePropertyName = b.typePropertyName;
- wo = b.wo;
- writeOnlyProperties = b.writeOnlyProperties;
- xp = b.xp;
}
@Override /* Overridden from Marshalled */
@@ -395,27 +193,11 @@ public class MarshalledAnnotation {
return dictionary;
}
- @Override /* Overridden from Marshalled */
- @SuppressWarnings("rawtypes")
- public Class<? extends BeanFactory> factory() {
- return factory;
- }
-
@Override /* Overridden from Marshalled */
public String example() {
return example;
}
- @Override /* Overridden from Marshalled */
- public String excludeProperties() {
- return excludeProperties;
- }
-
- @Override /* Overridden from Marshalled */
- public boolean findFluentSetters() {
- return findFluentSetters;
- }
-
@Override /* Overridden from Marshalled */
public Class<?> implClass() {
return implClass;
@@ -426,46 +208,6 @@ public class MarshalledAnnotation {
return interceptor;
}
- @Override /* Overridden from Marshalled */
- public Class<?> interfaceClass() {
- return interfaceClass;
- }
-
- @Override /* Overridden from Marshalled */
- public String p() {
- return p;
- }
-
- @Override /* Overridden from Marshalled */
- public String properties() {
- return properties;
- }
-
- @Override /* Overridden from Marshalled */
- public Class<? extends PropertyNamer> propertyNamer() {
- return propertyNamer;
- }
-
- @Override /* Overridden from Marshalled */
- public String readOnlyProperties() {
- return readOnlyProperties;
- }
-
- @Override /* Overridden from Marshalled */
- public String ro() {
- return ro;
- }
-
- @Override /* Overridden from Marshalled */
- public boolean unsorted() {
- return unsorted;
- }
-
- @Override /* Overridden from Marshalled */
- public Class<?> stopClass() {
- return stopClass;
- }
-
@Override /* Overridden from Marshalled */
public String typeName() {
return typeName;
@@ -476,21 +218,6 @@ public class MarshalledAnnotation {
return typePropertyName;
}
- @Override /* Overridden from Marshalled */
- public String wo() {
- return wo;
- }
-
- @Override /* Overridden from Marshalled */
- public String writeOnlyProperties() {
- return writeOnlyProperties;
- }
-
- @Override /* Overridden from Marshalled */
- public String xp() {
- return xp;
- }
-
@Override /* Overridden from annotation */
public String[] description() {
return description;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
index e35eb0266d..e73e65bb5d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfig.java
@@ -28,6 +28,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.commons.reflect.Visibility;
import org.apache.juneau.swap.*;
+import org.apache.juneau.commons.bean.*;
/**
* Annotation for specifying config properties defined in {@link MarshallingContext} and {@link MarshallingTraverseContext}.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
index 6b669cc157..c5708159ce 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledConfigAnnotation.java
@@ -22,6 +22,7 @@ import static org.apache.juneau.commons.utils.CollectionUtils.*;
import java.util.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.svl.*;
@@ -88,7 +89,7 @@ public class MarshalledConfigAnnotation {
classes(a.notBeanClasses()).ifPresent(b::notBeanClasses);
classes(a.notBeanClasses_replace()).ifPresent(x -> { b.notBeanClasses().clear(); b.notBeanClasses(x);});
type(a.propertyNamer()).ifPresent(b::propertyNamer);
- l(a.interfaces()).stream().map(x -> MarshalledApplyAnnotation.create(x).value(MarshalledAnnotation.create().interfaceClass(x).build()).build()).forEach(b::annotations);
+ l(a.interfaces()).stream().map(x -> BeanTypeApplyAnnotation.create(x).value(BeanTypeAnnotation.create().interfaceClass(x).build()).build()).forEach(b::annotations);
strings(a.notBeanPackages()).ifPresent(b::notBeanPackages);
strings(a.notBeanPackages_replace()).ifPresent(x -> {b.notBeanPackages().clear(); b.notBeanPackages(x);});
// @formatter:on
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
index fba5a5de5e..1b59553c00 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
@@ -543,13 +543,13 @@ public class CsvParser extends ReaderParser implements CsvMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
index e5b9c628b9..af26bfae09 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
@@ -613,13 +613,13 @@ public class CsvSerializer extends WriterSerializer implements CsvMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index f48fac609f..f6ee6d2dfa 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -1161,13 +1161,13 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
index 25ef9f748a..d85e0f4c53 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
@@ -484,13 +484,13 @@ public class HtmlParser extends XmlParser implements HtmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
index c5ab474d4a..d03b9ea76f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
@@ -824,13 +824,13 @@ public class HtmlSchemaDocSerializer extends HtmlDocSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
index fe27b0f34d..14044ae929 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
@@ -780,13 +780,13 @@ public class HtmlSchemaSerializer extends HtmlSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 2976aa4ff2..11b33d89b3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -1015,13 +1015,13 @@ public class HtmlSerializer extends XmlSerializer implements HtmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
index 08c90cd4d0..25e1d799dd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
@@ -646,13 +646,13 @@ public class HtmlStrippedDocSerializer extends HtmlSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
index 72f5100662..8a27228858 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
@@ -547,13 +547,13 @@ public class JsonParser extends ReaderParser implements JsonMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
index 2dd9700a44..9eb3a2b136 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
@@ -671,13 +671,13 @@ public class JsonSchemaSerializer extends JsonSerializer implements JsonSchemaMe
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
index 14b1f64f62..1c26424ccd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -699,13 +699,13 @@ public class JsonSerializer extends WriterSerializer implements JsonMetaProvider
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
index b51bbbad76..69585603f1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
@@ -474,13 +474,13 @@ public class Json5Parser extends JsonParser {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
index d7ff53814c..26d3d467fe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
@@ -569,13 +569,13 @@ public class Json5Serializer extends JsonSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
index def2119a24..203cb8325e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
@@ -715,13 +715,13 @@ public class JsonSchemaGenerator extends MarshallingTraverseContext implements J
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
index cbefc0e389..7276ac79af 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
@@ -511,13 +511,13 @@ public class MarkdownParser extends ReaderParser implements MarkdownMetaProvider
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
index fea9a46c5c..6032effc96 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
@@ -591,13 +591,13 @@ public class MarkdownSerializer extends WriterSerializer implements MarkdownMeta
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
index f66ab9a73f..55f40e4017 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
@@ -486,13 +486,13 @@ public class MsgPackParser extends InputStreamParser implements MsgPackMetaProvi
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
index ae3fe9c5a5..5fafa5aa9b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
@@ -592,13 +592,13 @@ public class MsgPackSerializer extends OutputStreamSerializer implements MsgPack
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
index 3827c99d40..a402d0a76d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
@@ -581,13 +581,13 @@ public class OpenApiParser extends UonParser implements OpenApiMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
index c6dd362259..779e11dc38 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
@@ -676,13 +676,13 @@ public class OpenApiSerializer extends UonSerializer implements OpenApiMetaProvi
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
index 62af86ef2b..42bbddb2f2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
@@ -497,13 +497,13 @@ public class InputStreamParser extends Parser {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index 2bd8e6f722..e93cd5e0ca 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -698,13 +698,13 @@ public class Parser extends MarshallingContextable {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
index daddb0a66d..de6a76a938 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
@@ -509,13 +509,13 @@ public class ReaderParser extends Parser {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
index e33ef409d5..f3d726d342 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
@@ -470,13 +470,13 @@ public class PlainTextParser extends ReaderParser implements PlainTextMetaProvid
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
index 80275df5b6..2227c6aae3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
@@ -533,13 +533,13 @@ public class PlainTextSerializer extends WriterSerializer implements PlainTextMe
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
index 6bc62d5542..0fee077300 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
@@ -551,13 +551,13 @@ public class OutputStreamSerializer extends Serializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index f03f48497f..074e74debe 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -836,13 +836,13 @@ public class Serializer extends MarshallingTraverseContext {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
index 84db50c8c1..1a528dea26 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
@@ -617,13 +617,13 @@ public class WriterSerializer extends Serializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
index ab8a7434fb..96a8d909bc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
@@ -614,13 +614,13 @@ public class SoapXmlSerializer extends XmlSerializer implements SoapXmlMetaProvi
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
index 64a0514f55..0696375e72 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
@@ -537,13 +537,13 @@ public class UonParser extends ReaderParser implements HttpPartParser, UonMetaPr
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
index 072113fcde..8e89a90853 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
@@ -820,13 +820,13 @@ public class UonSerializer extends WriterSerializer implements HttpPartSerialize
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index 101666abb4..465ecc88b7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -547,13 +547,13 @@ public class UrlEncodingParser extends UonParser implements UrlEncodingMetaProvi
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index fe2c26f16e..9068975a12 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -710,13 +710,13 @@ public class UrlEncodingSerializer extends UonSerializer implements UrlEncodingM
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
index b49b51c1bf..373d7d91c6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -598,13 +598,13 @@ public class XmlParser extends ReaderParser implements XmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index 431b872c1f..7af660fd8e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -880,13 +880,13 @@ public class XmlSerializer extends WriterSerializer implements XmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
index 368986c0d1..9211543d8b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
@@ -506,13 +506,13 @@ public class YamlParser extends ReaderParser {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
index 5d8f9fbe7c..0a66e39b83 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
@@ -653,13 +653,13 @@ public class YamlSerializer extends WriterSerializer {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RequestEchoResource.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RequestEchoResource.java
index 2fb127ec5f..6ffb9006c7 100644
--- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RequestEchoResource.java
+++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RequestEchoResource.java
@@ -29,6 +29,7 @@ import org.apache.juneau.serializer.annotation.*;
import jakarta.servlet.*;
import jakarta.servlet.http.*;
+import org.apache.juneau.commons.bean.*;
/**
* Sample REST resource for echoing HttpServletRequests back to the browser.
@@ -69,9 +70,9 @@ import jakarta.servlet.http.*;
maxDepth="5",
detectRecursions="true"
)
-@MarshalledApply(on="HttpServletRequest",value=@Marshalled(interfaceClass=HttpServletRequest.class))
-@MarshalledApply(on="HttpSession",value=@Marshalled(interfaceClass=HttpSession.class))
-@MarshalledApply(on="ServletContext",value=@Marshalled(interfaceClass=ServletContext.class))
+@BeanTypeApply(on="HttpServletRequest",value=@BeanType(interfaceClass=HttpServletRequest.class))
+@BeanTypeApply(on="HttpSession",value=@BeanType(interfaceClass=HttpSession.class))
+@BeanTypeApply(on="ServletContext",value=@BeanType(interfaceClass=ServletContext.class))
public class RequestEchoResource extends BasicRestObject {
/**
diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UtilityBeansResource.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UtilityBeansResource.java
index 4541811252..b661f1b170 100644
--- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UtilityBeansResource.java
+++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UtilityBeansResource.java
@@ -22,6 +22,7 @@ import org.apache.juneau.rest.annotation.*;
import org.apache.juneau.rest.beans.*;
import org.apache.juneau.rest.servlet.*;
import org.apache.juneau.rest.widget.*;
+import org.apache.juneau.commons.bean.*;
/**
* Sample resource that allows images to be uploaded and retrieved.
@@ -62,7 +63,7 @@ public class UtilityBeansResource extends BasicRestObject {
@SuppressWarnings({
"java:S1104" // All public fields intentional for direct bean serialization in REST example demonstrations
})
- @Marshalled(p = "street,city,state,zip,isCurrent")
+ @BeanType(p = "street,city,state,zip,isCurrent")
public static class Address {
/** Street address. */
diff --git a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
index 5d464687a4..eb2ab5a80d 100755
--- a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
+++ b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/DirectoryResource.java
@@ -37,6 +37,7 @@ import org.apache.juneau.rest.*;
import org.apache.juneau.rest.annotation.*;
import org.apache.juneau.rest.beans.*;
import org.apache.juneau.rest.servlet.*;
+import org.apache.juneau.commons.bean.*;
/**
* REST resource that allows access to a file system directory.
@@ -133,7 +134,7 @@ public class DirectoryResource extends BasicRestServlet {
/** File or directory details for REST response. */
@Response
@Schema(description = "File or directory details")
- @Marshalled(properties = "type,name,size,lastModified,actions,files")
+ @BeanType(properties = "type,name,size,lastModified,actions,files")
public class FileResource {
private final File f;
private final String path;
diff --git a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/LogsResource.java b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/LogsResource.java
index 0ef744ffaf..ab5b4c3e9a 100644
--- a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/LogsResource.java
+++ b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/LogsResource.java
@@ -38,6 +38,7 @@ import org.apache.juneau.rest.annotation.*;
import org.apache.juneau.rest.beans.*;
import org.apache.juneau.rest.converter.*;
import org.apache.juneau.rest.servlet.*;
+import org.apache.juneau.commons.bean.*;
/**
* REST resource for viewing and accessing log files.
@@ -100,7 +101,7 @@ public class LogsResource extends BasicRestServlet {
/** File or directory details for REST response. */
@Response(schema = @Schema(description = "File or directory details"))
- @Marshalled(properties = "type,name,size,lastModified,actions,files")
+ @BeanType(properties = "type,name,size,lastModified,actions,files")
@SuppressWarnings({
"java:S1135" // TODO in getFiles() - will address later
})
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index e932ac8a80..412a543863 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -4510,13 +4510,13 @@ public class RestClient extends MarshallingContextable implements HttpClient, Cl
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
index 28bbf92ac7..a09e11cab9 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequest.java
@@ -76,6 +76,7 @@ import org.apache.juneau.serializer.*;
import org.apache.juneau.uon.*;
import org.apache.juneau.urlencoding.*;
import org.apache.juneau.xml.*;
+import org.apache.juneau.commons.bean.*;
/**
* Represents a request to a remote REST resource.
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
index e398cbe4fe..b015630cab 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
@@ -1304,13 +1304,13 @@ public class MockRestClient extends RestClient implements HttpClientConnection {
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<?> on, Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(on, value);
return this;
}
@Override /* Overridden from Builder */
- public Builder propertyNamer(Class<? extends org.apache.juneau.PropertyNamer> value) {
+ public Builder propertyNamer(Class<? extends org.apache.juneau.commons.bean.PropertyNamer> value) {
super.propertyNamer(value);
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/BeanDescription.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/BeanDescription.java
index b478461c81..5945473ea0 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/BeanDescription.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/BeanDescription.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.commons.utils.Utils.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Simple serializable bean description.
@@ -37,7 +38,7 @@ import org.apache.juneau.annotation.*;
* </ul>
*/
-@Marshalled(properties = "type,properties")
+@BeanType(properties = "type,properties")
@SuppressWarnings({
"java:S1104" // Public fields required for @Marshalled serialization
})
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/ResourceDescription.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/ResourceDescription.java
index e1d8a013c7..8721074920 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/ResourceDescription.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/beans/ResourceDescription.java
@@ -22,6 +22,7 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.commons.annotation.Schema;
import org.apache.juneau.html.annotation.*;
import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.commons.bean.*;
/**
* Shortcut label for child resources.
@@ -39,7 +40,7 @@ import org.apache.juneau.http.annotation.*;
* </ul>
*/
-@Marshalled(properties = "name,description", findFluentSetters = true)
+@BeanType(properties = "name,description", findFluentSetters = true)
@Response(schema = @Schema(ignore = true))
public class ResourceDescription implements Comparable<ResourceDescription> {
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/stats/RestContextStats.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/stats/RestContextStats.java
index eae61a8924..15ac2e53ac 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/stats/RestContextStats.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/stats/RestContextStats.java
@@ -22,6 +22,7 @@ import java.util.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.rest.*;
import org.apache.juneau.swaps.*;
+import org.apache.juneau.commons.bean.*;
/**
* A snapshot of execution statistics for REST resource classes.
@@ -30,7 +31,7 @@ import org.apache.juneau.swaps.*;
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ExecutionStatistics">REST method execution statistics</a>
* </ul>
*/
-@Marshalled(properties = "startTime,upTime,methodStats")
+@BeanType(properties = "startTime,upTime,methodStats")
public class RestContextStats {
private final Instant startTime;
private final List<MethodExecStats> methodStats;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/Annotations_Test.java b/juneau-utest/src/test/java/org/apache/juneau/Annotations_Test.java
index aa12ac35a5..0b2ee38fbb 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/Annotations_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/Annotations_Test.java
@@ -20,6 +20,7 @@ import static org.apache.juneau.junit.bct.BctAssertions.*;
import org.apache.juneau.annotation.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"unused" // Test beans with intentionally unused private fields for visibility testing
@@ -43,7 +44,7 @@ class Annotations_Test extends TestBase {
}
/** Class with explicitly specified properties */
- @Marshalled(properties="age,name")
+ @BeanType(properties="age,name")
public static class Person1 {
public int age;
@@ -66,7 +67,7 @@ class Annotations_Test extends TestBase {
}
/** Class with explicitly specified properties */
- @Marshalled(p="age,name")
+ @BeanType(p="age,name")
public static class Person2 {
public int age;
@@ -89,7 +90,7 @@ class Annotations_Test extends TestBase {
}
/** Class with explicitly specified properties */
- @Marshalled(properties="age",p="name")
+ @BeanType(properties="age", p="name")
public static class Person3 {
public int age;
@@ -120,7 +121,7 @@ class Annotations_Test extends TestBase {
public void setName(String v) { name = v; }
}
- @MarshalledApply(on="Person4",value=@Marshalled(properties="age,name"))
+ @BeanTypeApply(on="Person4",value=@BeanType(properties="age,name"))
public static class PersonConfig {}
//====================================================================================================
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
index 1220544ed3..7d94342a36 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanMapErrors_Test.java
@@ -22,6 +22,7 @@ import java.util.Map.*;
import org.apache.juneau.annotation.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests various error conditions when defining beans.
@@ -44,7 +45,7 @@ class BeanMapErrors_Test extends TestBase {
assertFalse(bm.entrySet().stream().map(Entry::getKey).toList().contains("f2"));
}
- @Marshalled(p="f1")
+ @BeanType(p="f1")
public static class A1 {
public int f1;
@@ -65,8 +66,8 @@ class BeanMapErrors_Test extends TestBase {
assertFalse(bm.entrySet().stream().map(Entry::getKey).toList().contains("f2"));
}
- @MarshalledApply(on="Dummy",value=@Marshalled(p="dummy"))
- @MarshalledApply(on="B1",value=@Marshalled(p="f1"))
+ @BeanTypeApply(on="Dummy",value=@BeanType(p="dummy"))
+ @BeanTypeApply(on="B1",value=@BeanType(p="f1"))
@MarshalledPropApply(on="Dummy",value=@MarshalledProp("dummy"))
@MarshalledPropApply(on="B1.f2",value=@MarshalledProp("f2"))
private static class B1Config {}
@@ -95,7 +96,7 @@ class BeanMapErrors_Test extends TestBase {
assertFalse(bm.entrySet().stream().map(Entry::getKey).toList().contains("f2"));
}
- @Marshalled(p="f1")
+ @BeanType(p="f1")
public static class A2 {
public int f1;
@@ -115,8 +116,8 @@ class BeanMapErrors_Test extends TestBase {
assertFalse(bm.entrySet().stream().map(Entry::getKey).toList().contains("f2"));
}
- @MarshalledApply(on="Dummy",value=@Marshalled(p="dummy"))
- @MarshalledApply(on="B2",value=@Marshalled(p="f1"))
+ @BeanTypeApply(on="Dummy",value=@BeanType(p="dummy"))
+ @BeanTypeApply(on="B2",value=@BeanType(p="f1"))
@MarshalledPropApply(on="Dummy",value=@MarshalledProp("dummy"))
@MarshalledPropApply(on="B2.f2",value=@MarshalledProp("f2"))
private static class B2Config {}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
index ed6aa1fb88..acbcd82f0f 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
@@ -34,6 +34,7 @@ import org.apache.juneau.uon.*;
import org.apache.juneau.urlencoding.*;
import org.apache.juneau.xml.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"rawtypes",
@@ -526,7 +527,7 @@ class BeanMap_Test extends TestBase {
assertEquals("{s:['foo'],s2:[['foo']],i:[0,0,0],i2:[[0,0,0],[0,0,0]]}", Json5Serializer.DEFAULT.serialize(t));
}
- @Marshalled(p="s,s2,i,i2")
+ @BeanType(p="s,s2,i,i2")
public static class E {
public String[] s;
public String[][] s2;
@@ -929,7 +930,7 @@ class BeanMap_Test extends TestBase {
assertBean(m.getBean(), "foo,barBaz,bingBooURL", "4,5,6");
}
- @Marshalled(propertyNamer=PropertyNamerDLC.class)
+ @BeanType(propertyNamer=PropertyNamerDLC.class)
public static class P1 {
public int foo, barBaz, bingBooURL;
}
@@ -944,9 +945,9 @@ class BeanMap_Test extends TestBase {
assertBean(m.getBean(), "foo,barBaz,bingBooURL", "4,5,6");
}
- @MarshalledApply(on="Dummy1",value=@Marshalled(propertyNamer=PropertyNamerDLC.class))
- @MarshalledApply(on="P1c",value=@Marshalled(propertyNamer=PropertyNamerDLC.class))
- @MarshalledApply(on="Dummy2",value=@Marshalled(propertyNamer=PropertyNamerDLC.class))
+ @BeanTypeApply(on="Dummy1",value=@BeanType(propertyNamer=PropertyNamerDLC.class))
+ @BeanTypeApply(on="P1c",value=@BeanType(propertyNamer=PropertyNamerDLC.class))
+ @BeanTypeApply(on="Dummy2",value=@BeanType(propertyNamer=PropertyNamerDLC.class))
private static class P1cConfig {}
public static class P1c {
@@ -966,7 +967,7 @@ class BeanMap_Test extends TestBase {
assertBean(m.getBean(), "fooBar,bazBING", "3,4");
}
- @Marshalled(propertyNamer=PropertyNamerDLC.class)
+ @BeanType(propertyNamer=PropertyNamerDLC.class)
public static class P2 {
private int fooBar;
public int getFooBar() { return fooBar; }
@@ -1661,7 +1662,7 @@ class BeanMap_Test extends TestBase {
public String a3="3", a4="4";
}
- @Marshalled(stopClass=V.class)
+ @BeanType(stopClass=V.class)
public static class V3 extends V2 {
public String a5="5", a6="6";
}
@@ -1672,9 +1673,9 @@ class BeanMap_Test extends TestBase {
assertEquals("{a3:'3',a4:'4',a5:'5',a6:'6'}", ws.toString(new V3c()));
}
- @MarshalledApply(on="Dummy1",value=@Marshalled(stopClass=Vc.class))
- @MarshalledApply(on="V3c",value=@Marshalled(stopClass=Vc.class))
- @MarshalledApply(on="Dummy2",value=@Marshalled(stopClass=Vc.class))
+ @BeanTypeApply(on="Dummy1",value=@BeanType(stopClass=Vc.class))
+ @BeanTypeApply(on="V3c",value=@BeanType(stopClass=Vc.class))
+ @BeanTypeApply(on="Dummy2",value=@BeanType(stopClass=Vc.class))
private static class VcConfig {}
public static class Vc {
@@ -1707,7 +1708,7 @@ class BeanMap_Test extends TestBase {
public String getA4() {return "4";}
}
- @Marshalled(stopClass=W.class)
+ @BeanType(stopClass=W.class)
public static class W3 extends W2 {
public String getA5() {return "5";}
public String getA6() {return "6";}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanStreaming_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanStreaming_Test.java
index b7c47079a6..535bf1d6c9 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanStreaming_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanStreaming_Test.java
@@ -27,6 +27,7 @@ import org.apache.juneau.json5.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Integration tests for large-dataset streaming via {@link BeanSupplier}, {@link BeanConsumer},
@@ -260,7 +261,7 @@ class BeanStreaming_Test extends TestBase {
}
// ====================================================================================================
- // @Marshalled(factory=) tests
+ // @BeanType(factory=) tests
// ====================================================================================================
@Nested
diff --git a/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java b/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
index c3653a2814..7c29be843c 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/MarshalledConfig_Test.java
@@ -34,6 +34,7 @@ import org.apache.juneau.json.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.swap.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"rawtypes", // Raw types necessary for test bean handling
@@ -317,7 +318,7 @@ class MarshalledConfig_Test extends TestBase {
assertEquals(1, bc.convertToType(o2, ReadOnlyPerson[].class)[0].getAge());
}
- @Marshalled(p="name,age")
+ @BeanType(p="name,age")
public static class ReadOnlyPerson {
private final int age;
@@ -367,9 +368,9 @@ class MarshalledConfig_Test extends TestBase {
}
}
- @MarshalledApply(on="Dummy1",value=@Marshalled(p="dummy"))
- @MarshalledApply(on="ReadOnlyPerson2",value=@Marshalled(p="name,age"))
- @MarshalledApply(on="Dummy2",value=@Marshalled(p="dummy"))
+ @BeanTypeApply(on="Dummy1",value=@BeanType(p="dummy"))
+ @BeanTypeApply(on="ReadOnlyPerson2",value=@BeanType(p="name,age"))
+ @BeanTypeApply(on="Dummy2",value=@BeanType(p="dummy"))
@MarshalledCtorApply(on="Dummy1",value=@MarshalledCtor(properties="dummy"))
@MarshalledCtorApply(on="ReadOnlyPerson2(String,int)",value=@MarshalledCtor(properties="name,age"))
@MarshalledCtorApply(on="Dummy2",value=@MarshalledCtor(properties="dummy"))
diff --git a/juneau-utest/src/test/java/org/apache/juneau/PropertyNamerTest.java b/juneau-utest/src/test/java/org/apache/juneau/PropertyNamerTest.java
index fb990d1418..1868fded16 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/PropertyNamerTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/PropertyNamerTest.java
@@ -19,6 +19,7 @@ package org.apache.juneau;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
class PropertyNamerTest extends TestBase {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java b/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
index c840ffbd7e..f197e2e950 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/ReadWriteOnlyProperties_Test.java
@@ -24,6 +24,7 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.json5.*;
import org.apache.juneau.marshaller.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
class ReadWriteOnlyProperties_Test extends TestBase {
@@ -60,7 +61,7 @@ class ReadWriteOnlyProperties_Test extends TestBase {
// @Marshalled(bpro/bpwo)
//------------------------------------------------------------------------------------------------------------------
- @Marshalled(readOnlyProperties="f1", writeOnlyProperties="f2")
+ @BeanType(readOnlyProperties="f1", writeOnlyProperties="f2")
public static class B {
@MarshalledProp(ro="true") public int f1;
@MarshalledProp(wo="true") public int f2;
@@ -83,9 +84,9 @@ class ReadWriteOnlyProperties_Test extends TestBase {
assertEquals(2, x.f2);
}
- @MarshalledApply(on="Dummy1",value=@Marshalled(readOnlyProperties="f1",writeOnlyProperties="f2"))
- @MarshalledApply(on="Bc",value=@Marshalled(readOnlyProperties="f1",writeOnlyProperties="f2"))
- @MarshalledApply(on="Dummy2",value=@Marshalled(readOnlyProperties="f1",writeOnlyProperties="f2"))
+ @BeanTypeApply(on="Dummy1",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
+ @BeanTypeApply(on="Bc",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
+ @BeanTypeApply(on="Dummy2",value=@BeanType(readOnlyProperties="f1", writeOnlyProperties="f2"))
@MarshalledPropApply(on="Bc.f1",value=@MarshalledProp(ro="true"))
@MarshalledPropApply(on="Bc.f2",value=@MarshalledProp(wo="true"))
private static class BcConfig {}
@@ -206,7 +207,7 @@ class ReadWriteOnlyProperties_Test extends TestBase {
// @Marshalled(bpro="*")
//------------------------------------------------------------------------------------------------------------------
- @Marshalled(readOnlyProperties="*")
+ @BeanType(readOnlyProperties="*")
public static class D {
public int f1;
public int f2;
@@ -229,7 +230,7 @@ class ReadWriteOnlyProperties_Test extends TestBase {
assertEquals(0, x.f2);
}
- @MarshalledApply(on="Dc",value=@Marshalled(readOnlyProperties="*"))
+ @BeanTypeApply(on="Dc",value=@BeanType(readOnlyProperties="*"))
private static class DcConfig {}
public static class Dc {
@@ -258,7 +259,7 @@ class ReadWriteOnlyProperties_Test extends TestBase {
// @Marshalled(bpwo="*")
//------------------------------------------------------------------------------------------------------------------
- @Marshalled(writeOnlyProperties="*")
+ @BeanType(writeOnlyProperties="*")
public static class E {
public int f1;
public int f2;
@@ -281,7 +282,7 @@ class ReadWriteOnlyProperties_Test extends TestBase {
assertEquals(2, x.f2);
}
- @MarshalledApply(on="Ec",value=@Marshalled(writeOnlyProperties="*"))
+ @BeanTypeApply(on="Ec",value=@BeanType(writeOnlyProperties="*"))
private static class EcConfig {}
public static class Ec {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Generics_RoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Generics_RoundTripTest.java
index 77ce0b9de7..599eecf32c 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Generics_RoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Generics_RoundTripTest.java
@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.annotation.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests designed to serialize and parse objects to make sure we end up
@@ -57,7 +58,7 @@ class Generics_RoundTripTest extends RoundTripTest_Base {
}
// Class with unbound type variables.
- @Marshalled(p="s,t")
+ @BeanType(p="s,t")
public static class Pair<S,T> {
public Pair() {}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
index e31d14b6f3..c5ad056731 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/Records_RoundTripTest.java
@@ -26,6 +26,7 @@ import org.apache.juneau.json5.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
class Records_RoundTripTest extends RoundTripTest_Base {
@@ -54,7 +55,7 @@ class Records_RoundTripTest extends RoundTripTest_Base {
public record WithEnum(String name, Priority priority) {}
- @Marshalled(properties="age,name")
+ @BeanType(properties="age,name")
public record AnnotatedOrder(String name, int age) {}
public record WithMarshalledProp(@MarshalledProp(name="fullName") String name, int age) {}
@@ -70,7 +71,7 @@ class Records_RoundTripTest extends RoundTripTest_Base {
public record WithNullValues(String required, String optional) {}
- @Marshalled(properties="name")
+ @BeanType(properties="name")
public record WithMarshalledCtor(String name, int age) {
@MarshalledCtor(properties="name")
public WithMarshalledCtor(String name) {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
index 3172e1a49e..02df3deee8 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
@@ -46,6 +46,7 @@ import org.apache.juneau.yaml.*;
import org.apache.juneau.hjson.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests designed to serialize and parse objects to make sure we end up
@@ -582,7 +583,7 @@ class RoundTripBeanMaps_Test extends TestBase {
assertBean(d, "f3,f2", "f3,f2");
}
- @Marshalled(p="f3,f2")
+ @BeanType(p="f3,f2")
public static class D1 {
public String f1, f2, f3;
public D1 init() {
@@ -646,7 +647,7 @@ class RoundTripBeanMaps_Test extends TestBase {
assertBean(e, "f1,f3", "f1,f3");
}
- @Marshalled(excludeProperties="f2")
+ @BeanType(excludeProperties="f2")
public static class E1 {
public String f1, f2, f3;
public E1 init() {
@@ -688,7 +689,7 @@ class RoundTripBeanMaps_Test extends TestBase {
}
//====================================================================================================
- // Test @Marshalled(interfaceClass=xxx)
+ // Test @BeanType(interfaceClass=xxx)
//====================================================================================================
@ParameterizedTest
@@ -707,7 +708,7 @@ class RoundTripBeanMaps_Test extends TestBase {
assertBean(x, "f1", "f1");
}
- @Marshalled(interfaceClass=FA1.class)
+ @BeanType(interfaceClass=FA1.class)
public static class FA1 {
public String f1;
}
@@ -722,7 +723,7 @@ class RoundTripBeanMaps_Test extends TestBase {
}
//====================================================================================================
- // Test @Marshalled(interfaceClass=xxx) using MarshalledFilter
+ // Test @BeanType(interfaceClass=xxx) using MarshalledFilter
//====================================================================================================
@ParameterizedTest
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeansWithBuilders_Test.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeansWithBuilders_Test.java
index 4cf05156e8..daf6e9e1bb 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeansWithBuilders_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeansWithBuilders_Test.java
@@ -41,6 +41,7 @@ import org.apache.juneau.hjson.*;
import org.apache.juneau.markdown.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests designed to serialize and parse objects to make sure we end up
@@ -194,7 +195,7 @@ class RoundTripBeansWithBuilders_Test extends TestBase {
return new Builder();
}
- @Marshalled(findFluentSetters=true)
+ @BeanType(findFluentSetters=true)
public static class Builder {
private int f1;
@@ -216,9 +217,9 @@ class RoundTripBeansWithBuilders_Test extends TestBase {
assertBean(x, "f1", "1");
}
- @MarshalledApply(on="Dummy1",value=@Marshalled(findFluentSetters=true))
- @MarshalledApply(on="Builder",value=@Marshalled(findFluentSetters=true))
- @MarshalledApply(on="Dummy2",value=@Marshalled(findFluentSetters=true))
+ @BeanTypeApply(on="Dummy1",value=@BeanType(findFluentSetters=true))
+ @BeanTypeApply(on="Builder",value=@BeanType(findFluentSetters=true))
+ @BeanTypeApply(on="Dummy2",value=@BeanType(findFluentSetters=true))
private static class AcConfig {}
public static class Ac {
@@ -268,7 +269,7 @@ class RoundTripBeansWithBuilders_Test extends TestBase {
return new Builder();
}
- @Marshalled(findFluentSetters=true)
+ @BeanType(findFluentSetters=true)
public static class Builder {
private A f1;
@@ -338,7 +339,7 @@ class RoundTripBeansWithBuilders_Test extends TestBase {
return new Builder();
}
- @Marshalled(findFluentSetters=true)
+ @BeanType(findFluentSetters=true)
public static class Builder {
private A[] f1;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
index ce3b24b25a..2f2f3577a9 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.junit.bct.BctAssertions.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.swap.*;
import org.junit.jupiter.api.*;
@@ -37,10 +38,26 @@ class MarshalledAnnotation_Test extends TestBase {
.description("a")
.dictionary(X1.class)
.example("b")
- .excludeProperties("c")
- .findFluentSetters(true)
.implClass(X1.class)
.interceptor(X2.class)
+ .typeName("i")
+ .typePropertyName("j")
+ .build();
+
+ Marshalled a2 = MarshalledAnnotation.create()
+ .description("a")
+ .dictionary(X1.class)
+ .example("b")
+ .implClass(X1.class)
+ .interceptor(X2.class)
+ .typeName("i")
+ .typePropertyName("j")
+ .build();
+
+ BeanType bt1 = BeanTypeAnnotation.create()
+ .description("a")
+ .excludeProperties("c")
+ .findFluentSetters(true)
.interfaceClass(X1.class)
.p("e")
.properties("f")
@@ -49,21 +66,15 @@ class MarshalledAnnotation_Test extends TestBase {
.ro("h")
.unsorted(true)
.stopClass(X1.class)
- .typeName("i")
- .typePropertyName("j")
.wo("k")
.writeOnlyProperties("l")
.xp("m")
.build();
- Marshalled a2 = MarshalledAnnotation.create()
+ BeanType bt2 = BeanTypeAnnotation.create()
.description("a")
- .dictionary(X1.class)
- .example("b")
.excludeProperties("c")
.findFluentSetters(true)
- .implClass(X1.class)
- .interceptor(X2.class)
.interfaceClass(X1.class)
.p("e")
.properties("f")
@@ -72,8 +83,6 @@ class MarshalledAnnotation_Test extends TestBase {
.ro("h")
.unsorted(true)
.stopClass(X1.class)
- .typeName("i")
- .typePropertyName("j")
.wo("k")
.writeOnlyProperties("l")
.xp("m")
@@ -81,8 +90,11 @@ class MarshalledAnnotation_Test extends TestBase {
@Test void a01_basic() {
assertBean(a1,
- "description,dictionary,example,excludeProperties,findFluentSetters,implClass,interceptor,interfaceClass,p,properties,propertyNamer,readOnlyProperties,ro,stopClass,typeName,typePropertyName,unsorted,wo,writeOnlyProperties,xp",
- "[a],[X1],b,c,true,X1,X2,X1,e,f,BasicPropertyNamer,g,h,X1,i,j,true,k,l,m");
+ "description,dictionary,example,implClass,interceptor,typeName,typePropertyName",
+ "[a],[X1],b,X1,X2,i,j");
+ assertBean(bt1,
+ "description,excludeProperties,findFluentSetters,interfaceClass,p,properties,propertyNamer,readOnlyProperties,ro,stopClass,unsorted,wo,writeOnlyProperties,xp",
+ "[a],c,true,X1,e,f,BasicPropertyNamer,g,h,X1,true,k,l,m");
}
@Test void a02_testEquivalency() {
@@ -90,6 +102,11 @@ class MarshalledAnnotation_Test extends TestBase {
assertNotEquals(0, a1.hashCode());
assertNotEquals(-1, a1.hashCode());
assertEquals(a1.hashCode(), a2.hashCode());
+
+ assertEquals(bt2, bt1);
+ assertNotEquals(0, bt1.hashCode());
+ assertNotEquals(-1, bt1.hashCode());
+ assertEquals(bt1.hashCode(), bt2.hashCode());
}
//------------------------------------------------------------------------------------------------------------------
@@ -97,8 +114,8 @@ class MarshalledAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
@Test void b01_testEquivalencyInPropertyStores() {
- var b1 = MarshallingContext.create().annotations(a1).build();
- var b2 = MarshallingContext.create().annotations(a2).build();
+ var b1 = MarshallingContext.create().annotations(a1, bt1).build();
+ var b2 = MarshallingContext.create().annotations(a2, bt2).build();
assertSame(b1, b2);
}
@@ -106,59 +123,25 @@ class MarshalledAnnotation_Test extends TestBase {
// Comparison with declared annotations.
//------------------------------------------------------------------------------------------------------------------
- @Marshalled(
- description={ "a" },
- dictionary=X1.class,
- example="b",
- excludeProperties="c",
- findFluentSetters=true,
- implClass=X1.class,
- interceptor=X2.class,
- interfaceClass=X1.class,
- p="e",
- properties="f",
- propertyNamer=BasicPropertyNamer.class,
- readOnlyProperties="g",
- ro="h",
- unsorted=true,
- stopClass=X1.class,
- typeName="i",
- typePropertyName="j",
- wo="k",
- writeOnlyProperties="l",
- xp="m"
- )
+ @Marshalled(description={ "a" }, dictionary=X1.class, example="b", implClass=X1.class, interceptor=X2.class, typeName="i", typePropertyName="j")
+ @BeanType(description={ "a" }, excludeProperties="c", findFluentSetters=true, interfaceClass=X1.class, p="e", properties="f", propertyNamer=BasicPropertyNamer.class, readOnlyProperties="g", ro="h", unsorted=true, stopClass=X1.class, wo="k", writeOnlyProperties="l", xp="m")
public static class D1 {}
Marshalled d1 = D1.class.getAnnotationsByType(Marshalled.class)[0];
+ BeanType d1bt = D1.class.getAnnotationsByType(BeanType.class)[0];
- @Marshalled(
- description={ "a" },
- dictionary=X1.class,
- example="b",
- excludeProperties="c",
- findFluentSetters=true,
- implClass=X1.class,
- interceptor=X2.class,
- interfaceClass=X1.class,
- p="e",
- properties="f",
- propertyNamer=BasicPropertyNamer.class,
- readOnlyProperties="g",
- ro="h",
- unsorted=true,
- stopClass=X1.class,
- typeName="i",
- typePropertyName="j",
- wo="k",
- writeOnlyProperties="l",
- xp="m"
- )
+ @Marshalled(description={ "a" }, dictionary=X1.class, example="b", implClass=X1.class, interceptor=X2.class, typeName="i", typePropertyName="j")
+ @BeanType(description={ "a" }, excludeProperties="c", findFluentSetters=true, interfaceClass=X1.class, p="e", properties="f", propertyNamer=BasicPropertyNamer.class, readOnlyProperties="g", ro="h", unsorted=true, stopClass=X1.class, wo="k", writeOnlyProperties="l", xp="m")
public static class D2 {}
Marshalled d2 = D2.class.getAnnotationsByType(Marshalled.class)[0];
+ BeanType d2bt = D2.class.getAnnotationsByType(BeanType.class)[0];
@Test void d01_comparisonWithDeclarativeAnnotations() {
assertEqualsAll(a1, d1, d2);
assertNotEqualsAny(a1.hashCode(), 0, -1);
assertEqualsAll(a1.hashCode(), d1.hashCode(), d2.hashCode());
+
+ assertEqualsAll(bt1, d1bt, d2bt);
+ assertNotEqualsAny(bt1.hashCode(), 0, -1);
+ assertEqualsAll(bt1.hashCode(), d1bt.hashCode(), d2bt.hashCode());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
index 7a68e8d84b..2aa142fe50 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledConfigAnnotation_Test.java
@@ -32,6 +32,7 @@ import org.apache.juneau.marshaller.*;
import org.apache.juneau.svl.*;
import org.apache.juneau.swap.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests the @MarshalledConfig annotation.
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
index 9faddeb8d3..9a1bc42154 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/Marshalled_Test.java
@@ -26,6 +26,7 @@ import org.apache.juneau.json5.*;
import org.apache.juneau.marshaller.*;
import org.apache.juneau.svl.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"unused" // Private and package classes required for @Marshalled visibility testing
@@ -169,10 +170,10 @@ class Marshalled_Test extends TestBase {
}
//-----------------------------------------------------------------------------------------------------------------
- // @Marshalled(on=X,properties=) should override @Marshalled(properties=)
+ // @Marshalled(on=X) @BeanType(properties=) should override @BeanType(properties=)
//-----------------------------------------------------------------------------------------------------------------
- @Marshalled(properties="a,b,c", excludeProperties="b")
+ @BeanType(properties="a,b,c", excludeProperties="b")
static class D1 {
public int a, b, c, d;
@@ -186,7 +187,7 @@ class Marshalled_Test extends TestBase {
}
}
- @Marshalled(p="a,b,c", xp="b")
+ @BeanType(p="a,b,c", xp="b")
static class D2 {
public int a, b, c, d;
@@ -200,9 +201,9 @@ class Marshalled_Test extends TestBase {
}
}
- @MarshalledApply(on="Dummy",value=@Marshalled(p="b,c,d",xp="c"))
- @MarshalledApply(on="D1",value=@Marshalled(properties="b,c,d",excludeProperties="c"))
- @MarshalledApply(on="D2",value=@Marshalled(p="b,c,d",xp="c"))
+ @BeanTypeApply(on="Dummy",value=@BeanType(p="b,c,d", xp="c"))
+ @BeanTypeApply(on="D1",value=@BeanType(properties="b,c,d", excludeProperties="c"))
+ @BeanTypeApply(on="D2",value=@BeanType(p="b,c,d", xp="c"))
static class DConfig {}
private static ClassInfo dConfig = ClassInfo.of(DConfig.class);
@@ -248,7 +249,7 @@ class Marshalled_Test extends TestBase {
}
@Test void d05_beanPropertiesExcludePropertiesCombined_beanContextBuilderOverride() throws Exception {
- var ba = MarshalledApplyAnnotation.create("D1").value(MarshalledAnnotation.create().properties("b,c,d").excludeProperties("c").build()).build();
+ var ba = BeanTypeApplyAnnotation.create("D1").value(BeanTypeAnnotation.create().properties("b,c,d").excludeProperties("c").build()).build();
var js = Json5Serializer.create().annotations(ba).build();
var jp = Json5Parser.create().annotations(ba).build();
@@ -260,7 +261,7 @@ class Marshalled_Test extends TestBase {
}
@Test void d06_beanPXpCombined_beanContextBuilderOverride() throws Exception {
- var ba = MarshalledApplyAnnotation.create("D2").value(MarshalledAnnotation.create().p("b,c,d").xp("c").build()).build();
+ var ba = BeanTypeApplyAnnotation.create("D2").value(BeanTypeAnnotation.create().p("b,c,d").xp("c").build()).build();
var js = Json5Serializer.create().annotations(ba).build();
var jp = Json5Parser.create().annotations(ba).build();
@@ -275,12 +276,12 @@ class Marshalled_Test extends TestBase {
// @MarshalledConfig(bpi/bpx) should override @Marshalled(bpi/bpx)
//-----------------------------------------------------------------------------------------------------------------
- @Marshalled(properties="a,b,c")
+ @BeanType(properties="a,b,c")
static class E1a {
public int a, b, c, d;
}
- @Marshalled(excludeProperties="b")
+ @BeanType(excludeProperties="b")
static class E1 extends E1a {
public static E1 create() {
@@ -293,12 +294,12 @@ class Marshalled_Test extends TestBase {
}
}
- @Marshalled(p="a,b,c")
+ @BeanType(p="a,b,c")
static class E2a {
public int a, b, c, d;
}
- @Marshalled(xp="b")
+ @BeanType(xp="b")
static class E2 extends E2a {
public static E2 create() {
@@ -311,9 +312,9 @@ class Marshalled_Test extends TestBase {
}
}
- @MarshalledApply(on="Dummy",value=@Marshalled(p="b,c,d",xp="c"))
- @MarshalledApply(on="E1",value=@Marshalled(properties="b,c,d",excludeProperties="c"))
- @MarshalledApply(on="E2",value=@Marshalled(p="b,c,d",xp="c"))
+ @BeanTypeApply(on="Dummy",value=@BeanType(p="b,c,d", xp="c"))
+ @BeanTypeApply(on="E1",value=@BeanType(properties="b,c,d", excludeProperties="c"))
+ @BeanTypeApply(on="E2",value=@BeanType(p="b,c,d", xp="c"))
static class EConfig {}
private static ClassInfo eConfig = ClassInfo.of(EConfig.class);
@@ -359,7 +360,7 @@ class Marshalled_Test extends TestBase {
}
@Test void e05_beanPropertiersExcludePropertiesCombined_multipleMarshalledAnnotations_beanContextBuilderOverride() throws Exception {
- var ba = MarshalledApplyAnnotation.create("E1").value(MarshalledAnnotation.create().properties("b,c,d").excludeProperties("c").build()).build();
+ var ba = BeanTypeApplyAnnotation.create("E1").value(BeanTypeAnnotation.create().properties("b,c,d").excludeProperties("c").build()).build();
var js = Json5Serializer.create().annotations(ba).build();
var jp = Json5Parser.create().annotations(ba).build();
@@ -371,7 +372,7 @@ class Marshalled_Test extends TestBase {
}
@Test void e06_beanBpiBpxCombined_multipleMarshalledAnnotations_beanContextBuilderOverride() throws Exception {
- var ba = MarshalledApplyAnnotation.create("E2").value(MarshalledAnnotation.create().p("b,c,d").xp("c").build()).build();
+ var ba = BeanTypeApplyAnnotation.create("E2").value(BeanTypeAnnotation.create().p("b,c,d").xp("c").build()).build();
var js = Json5Serializer.create().annotations(ba).build();
var jp = Json5Parser.create().annotations(ba).build();
diff --git a/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
index 4fbb4be84d..aade698565 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/html/BasicHtml_Test.java
@@ -30,6 +30,7 @@ import org.apache.juneau.html.annotation.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({"serial","rawtypes"})
class BasicHtml_Test extends TestBase {
@@ -2936,7 +2937,8 @@ class BasicHtml_Test extends TestBase {
public String[] b;
}
- @Marshalled(dictionary={A.class},p="a,ia,aa,o")
+ @Marshalled(dictionary={A.class})
+ @BeanType(p="a,ia,aa,o")
public static class BeanWithAbstractFields {
public A a;
public IA ia;
@@ -2952,7 +2954,8 @@ class BasicHtml_Test extends TestBase {
}
}
- @Marshalled(dictionary={A.class},p="a,ia1,ia2,aa1,aa2,o1,o2")
+ @Marshalled(dictionary={A.class})
+ @BeanType(p="a,ia1,ia2,aa1,aa2,o1,o2")
public static class BeanWithAbstractArrayFields {
public A[] a;
public IA[] ia1, ia2;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/html/HtmlSchemaSerializer_Test.java b/juneau-utest/src/test/java/org/apache/juneau/html/HtmlSchemaSerializer_Test.java
index f8a79ed8bb..a128319e63 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/html/HtmlSchemaSerializer_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/html/HtmlSchemaSerializer_Test.java
@@ -24,6 +24,7 @@ import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.testutils.pojos.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Most of the heavy testing for HtmlSchemaSerializer is done in JsonSchemaGeneratorTest.
@@ -57,14 +58,14 @@ class HtmlSchemaSerializer_Test extends TestBase {
// Documentation examples
//====================================================================================================
- @Marshalled(properties="name,birthDate,addresses")
+ @BeanType(properties="name,birthDate,addresses")
public static class Person {
public String name;
public Calendar birthDate;
public List<Address> addresses;
}
- @Marshalled(properties="street,city,state,zip,isCurrent")
+ @BeanType(properties="street,city,state,zip,isCurrent")
public static class Address {
public String street, city;
public StateEnum state;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/html/Html_Test.java b/juneau-utest/src/test/java/org/apache/juneau/html/Html_Test.java
index 6b4919f271..d0c5c56fe9 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/html/Html_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/html/Html_Test.java
@@ -28,6 +28,7 @@ import org.apache.juneau.collections.*;
import org.apache.juneau.html.annotation.*;
import org.apache.juneau.testutils.pojos.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"serial" // Serialization not relevant in test code
@@ -395,7 +396,7 @@ class Html_Test extends TestBase {
// @Marshalled(bpi) on collections of beans
//-----------------------------------------------------------------------------------------------------------------
- @Marshalled(p="f3,f2,f1")
+ @BeanType(p="f3,f2,f1")
public static class E {
public Integer f1, f2, f3;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/ini/IniRoundTrip_Test.java b/juneau-utest/src/test/java/org/apache/juneau/ini/IniRoundTrip_Test.java
index 61bb89dacf..bdd5beaae8 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/ini/IniRoundTrip_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/ini/IniRoundTrip_Test.java
@@ -24,6 +24,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.junit.jupiter.api.Test;
+import org.apache.juneau.commons.bean.*;
/**
* Round-trip tests for {@link IniSerializer} and {@link IniParser}.
@@ -33,7 +34,7 @@ import org.junit.jupiter.api.Test;
})
class IniRoundTrip_Test extends TestBase {
- @Marshalled(properties = "name,age")
+ @BeanType(properties = "name,age")
public static class Person {
public String name;
public int age;
@@ -45,7 +46,7 @@ class IniRoundTrip_Test extends TestBase {
}
}
- @Marshalled(properties = "name,address,tags")
+ @BeanType(properties = "name,address,tags")
public static class ComplexPerson {
public String name;
public Address address;
@@ -59,7 +60,7 @@ class IniRoundTrip_Test extends TestBase {
}
}
- @Marshalled(properties = "street,city")
+ @BeanType(properties = "street,city")
public static class Address {
public String street;
public String city;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
index 51533ecf9f..07ad27cabd 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
@@ -28,6 +28,7 @@ import org.apache.juneau.swap.*;
import org.apache.juneau.xml.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.Nested;
+import org.apache.juneau.commons.bean.*;
class RdfParser_Test extends TestBase {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
index bed5185efc..cbef68d649 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
@@ -29,6 +29,7 @@ import org.apache.juneau.swap.*;
import org.apache.juneau.xml.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.Nested;
+import org.apache.juneau.commons.bean.*;
class RdfSerializer_Test extends TestBase {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlParser_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlParser_Test.java
index e81517fd9c..f3f4b0c6f3 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlParser_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlParser_Test.java
@@ -30,6 +30,7 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
import org.apache.juneau.marshaller.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests for {@link org.apache.juneau.jsonl.JsonlParser}.
@@ -39,7 +40,7 @@ import org.junit.jupiter.api.*;
})
class JsonlParser_Test extends TestBase {
- @Marshalled(properties = "name,age")
+ @BeanType(properties = "name,age")
public static class Person {
public String name;
public int age;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlRoundTrip_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlRoundTrip_Test.java
index 5d45126e5b..60e54f9181 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlRoundTrip_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jsonl/JsonlRoundTrip_Test.java
@@ -28,6 +28,7 @@ import org.apache.juneau.collections.*;
import org.apache.juneau.marshaller.*;
import org.apache.juneau.swaps.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Round-trip tests for {@link JsonlSerializer} and {@link JsonlParser}.
@@ -37,7 +38,7 @@ import org.junit.jupiter.api.*;
})
class JsonlRoundTrip_Test extends TestBase {
- @Marshalled(properties = "name,age")
+ @BeanType(properties = "name,age")
public static class Person {
public String name;
public int age;
@@ -49,7 +50,7 @@ class JsonlRoundTrip_Test extends TestBase {
}
}
- @Marshalled(properties = "name,address,tags")
+ @BeanType(properties = "name,address,tags")
public static class ComplexPerson {
public String name;
public Address address;
@@ -63,7 +64,7 @@ class JsonlRoundTrip_Test extends TestBase {
}
}
- @Marshalled(properties = "street,city")
+ @BeanType(properties = "street,city")
public static class Address {
public String street;
public String city;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jsonl/Jsonl_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jsonl/Jsonl_Test.java
index 7513ead7e9..2c7b024f9f 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jsonl/Jsonl_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jsonl/Jsonl_Test.java
@@ -25,13 +25,14 @@ import org.apache.juneau.collections.*;
import org.apache.juneau.marshaller.*;
import org.apache.juneau.swaps.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
/**
* Tests for {@link JsonlSerializer}.
*/
class Jsonl_Test extends TestBase {
- @Marshalled(properties = "name,age")
+ @BeanType(properties = "name,age")
public static class Person {
public String name;
public int age;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/objecttools/ObjectRest_Test.java b/juneau-utest/src/test/java/org/apache/juneau/objecttools/ObjectRest_Test.java
index 284657104d..84e28db159 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/objecttools/ObjectRest_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/objecttools/ObjectRest_Test.java
@@ -29,6 +29,7 @@ import org.apache.juneau.collections.*;
import org.apache.juneau.json5.*;
import org.apache.juneau.parser.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({"rawtypes","serial","java:S5961"})
class ObjectRest_Test extends TestBase {
@@ -219,7 +220,7 @@ class ObjectRest_Test extends TestBase {
}
}
- @Marshalled(p="street,city,state,zip,isCurrent")
+ @BeanType(p="street,city,state,zip,isCurrent")
public static class Address {
public String street;
public String city;
@@ -242,7 +243,8 @@ class ObjectRest_Test extends TestBase {
}
}
- @Marshalled(typeName="Person",p="name,age,addresses")
+ @Marshalled(typeName="Person")
+ @BeanType(p="name,age,addresses")
public static class Person {
public String name;
public int age;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
index b9a368c20d..7f47037a49 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestOp_MarshalledConfig_Test.java
@@ -21,6 +21,7 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.rest.mock.*;
import org.apache.juneau.rest.servlet.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"serial" // Serialization not relevant in test code
@@ -33,17 +34,17 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A1 extends BasicRestServlet {
@RestGet
- @MarshalledApply(onClass=X1.class, value=@Marshalled(properties="a,_b"))
+ @BeanTypeApply(onClass=X1.class, value=@BeanType(properties="a,_b"))
public Object a() {
return new X1().init();
}
@RestGet
- @MarshalledApply(onClass=X1.class, value=@Marshalled(p="a"))
+ @BeanTypeApply(onClass=X1.class, value=@BeanType(p="a"))
public Object b() {
return new X1().init();
}
@RestGet
- @MarshalledApply(onClass=X1.class, value=@Marshalled(p="_b"))
+ @BeanTypeApply(onClass=X1.class, value=@BeanType(p="_b"))
public Object c() {
return new X1().init();
}
@@ -74,17 +75,17 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A2 extends BasicRestServlet {
@RestGet
- @MarshalledApply(on="X1", value=@Marshalled(excludeProperties="a,_b"))
+ @BeanTypeApply(on="X1", value=@BeanType(excludeProperties="a,_b"))
public Object a() {
return new X1().init();
}
@RestGet
- @MarshalledApply(on="X1", value=@Marshalled(xp="a"))
+ @BeanTypeApply(on="X1", value=@BeanType(xp="a"))
public Object b() {
return new X1().init();
}
@RestGet
- @MarshalledApply(on="X1", value=@Marshalled(xp="_b"))
+ @BeanTypeApply(on="X1", value=@BeanType(xp="_b"))
public Object c() {
return new X1().init();
}
@@ -115,17 +116,17 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A3 extends BasicRestServlet {
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(p="a,_b"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(p="a,_b"))
public Object a() {
return new X2().init();
}
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(p="a"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(p="a"))
public Object b() {
return new X2().init();
}
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(p="_b"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(p="_b"))
public Object c() {
return new X2().init();
}
@@ -156,17 +157,17 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A4 extends BasicRestServlet {
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(xp="a,_b"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(xp="a,_b"))
public Object a() {
return new X2().init();
}
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(xp="a"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(xp="a"))
public Object b() {
return new X2().init();
}
@RestGet
- @MarshalledApply(onClass=X2.class, value=@Marshalled(xp="_b"))
+ @BeanTypeApply(onClass=X2.class, value=@BeanType(xp="_b"))
public Object c() {
return new X2().init();
}
@@ -197,7 +198,7 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A5 extends BasicRestServlet {
@RestGet
- @MarshalledApply(on="*", value=@Marshalled(p="a"))
+ @BeanTypeApply(on="*", value=@BeanType(p="a"))
public Object a() {
return new X1().init();
}
@@ -218,7 +219,7 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A6 extends BasicRestServlet {
@RestGet
- @MarshalledApply(on="org.apache.juneau.rest.annotation.RestOp_MarshalledConfig_Test$X1", value=@Marshalled(p="a"))
+ @BeanTypeApply(on="org.apache.juneau.rest.annotation.RestOp_MarshalledConfig_Test$X1", value=@BeanType(p="a"))
public Object a() {
return new X1().init();
}
@@ -239,13 +240,13 @@ class RestOp_MarshalledConfig_Test extends TestBase {
public static class A7 extends BasicRestServlet {
@RestGet
- @MarshalledApply(on="MyBean", value=@Marshalled(p="a"))
+ @BeanTypeApply(on="MyBean", value=@BeanType(p="a"))
public Object a() {
// Should not match.
return new X1().init();
}
@RestGet
- @MarshalledApply(on="MyBean", value=@Marshalled(p="a"))
+ @BeanTypeApply(on="MyBean", value=@BeanType(p="a"))
public Object b() {
// Should not match. We don't support meta-matches in class names.
return new X1().init();
@@ -281,7 +282,7 @@ class RestOp_MarshalledConfig_Test extends TestBase {
}
}
- @Marshalled(properties="_b,a")
+ @BeanType(properties="_b,a")
public static class X2 {
public int a;
@MarshalledProp("_b") public String b;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
index ed1cb25ca1..fd10494d0f 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
@@ -35,6 +35,7 @@ import org.apache.juneau.rest.mock.*;
import org.apache.juneau.rest.servlet.*;
import org.apache.juneau.swap.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
class RestClient_Config_MarshallingContext_Test extends TestBase {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transforms/MarshalledFilter_Test.java b/juneau-utest/src/test/java/org/apache/juneau/transforms/MarshalledFilter_Test.java
index 424c62066d..53d5b5e390 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/transforms/MarshalledFilter_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transforms/MarshalledFilter_Test.java
@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
class MarshalledFilter_Test extends TestBase {
@@ -107,7 +108,7 @@ class MarshalledFilter_Test extends TestBase {
public int getP2() { return 2; }
}
- @Marshalled(stopClass=C2.class)
+ @BeanType(stopClass=C2.class)
public class C3 extends C2 {
public int f3 = 3;
public int getP3() { return 3; }
@@ -123,7 +124,7 @@ class MarshalledFilter_Test extends TestBase {
public int getP1() { return 1; }
}
- @Marshalled(stopClass=D2.class)
+ @BeanType(stopClass=D2.class)
public class D2 extends D1 {
public int f2 = 2;
public int getP2() { return 2; }
@@ -144,13 +145,13 @@ class MarshalledFilter_Test extends TestBase {
public int getP1() { return 1; }
}
- @Marshalled(stopClass=E2.class)
+ @BeanType(stopClass=E2.class)
public class E2 extends E1 {
public int f2 = 2;
public int getP2() { return 2; }
}
- @Marshalled(xp="foo")
+ @BeanType(xp="foo")
public class E3 extends E2 {
public int f3 = 3;
public int getP3() { return 3; }
@@ -161,7 +162,7 @@ class MarshalledFilter_Test extends TestBase {
assertJson("{f3:3,p3:3}", e3);
}
- @Marshalled(stopClass=F1.class)
+ @BeanType(stopClass=F1.class)
public class F1 {
public int f1 = 1;
public int getP1() { return 1; }
@@ -172,7 +173,7 @@ class MarshalledFilter_Test extends TestBase {
public int getP2() { return 2; }
}
- @Marshalled(stopClass=F2.class)
+ @BeanType(stopClass=F2.class)
public class F3 extends F2 {
public int f3 = 3;
public int getP3() { return 3; }
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
index f8d1706f7d..1c4c51eec8 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/BasicXml_Test.java
@@ -28,6 +28,7 @@ import org.apache.juneau.collections.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({"serial"})
class BasicXml_Test extends TestBase {
@@ -1636,7 +1637,8 @@ class BasicXml_Test extends TestBase {
public String[] b;
}
- @Marshalled(dictionary={A.class},p="a,ia,aa,o")
+ @Marshalled(dictionary={A.class})
+ @BeanType(p="a,ia,aa,o")
public static class BeanWithAbstractFields {
public A a;
public IA ia;
@@ -1652,7 +1654,8 @@ class BasicXml_Test extends TestBase {
}
}
- @Marshalled(dictionary={A.class},p="a,ia1,ia2,aa1,aa2,o1,o2")
+ @Marshalled(dictionary={A.class})
+ @BeanType(p="a,ia1,ia2,aa1,aa2,o1,o2")
public static class BeanWithAbstractArrayFields {
public A[] a;
public IA[] ia1, ia2;
@@ -1688,7 +1691,8 @@ class BasicXml_Test extends TestBase {
}
}
- @Marshalled(dictionary={A.class},p="a,ia,aa,o")
+ @Marshalled(dictionary={A.class})
+ @BeanType(p="a,ia,aa,o")
public static class BeanWithAbstractMapArrayFields {
public Map<String,A[]> a;
public Map<String,IA[]> ia;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/CommonXml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/CommonXml_Test.java
index 4d6e6d7553..10f097d8c1 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/CommonXml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/CommonXml_Test.java
@@ -26,6 +26,7 @@ import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
class CommonXml_Test extends TestBase {
@@ -48,7 +49,7 @@ class CommonXml_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(p="url,id,name")
+ @BeanType(p="url,id,name")
public static class A {
@Xml(format=XmlFormat.ATTR) public URL url;
@Xml(format=ATTR) public int id;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlCollapsed_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlCollapsed_Test.java
index cb72442c97..0c09de30e7 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/XmlCollapsed_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/XmlCollapsed_Test.java
@@ -27,6 +27,7 @@ import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.xml.annotation.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({
"serial", // Serialization not relevant
@@ -183,7 +184,7 @@ class XmlCollapsed_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(properties="f1,f2,f3,f4")
+ @BeanType(properties="f1,f2,f3,f4")
public static class D {
private List<String> f1 = new LinkedList<>();
@Xml(format=COLLAPSED) public List<String> getF1() { return f1; }
@@ -222,7 +223,7 @@ class XmlCollapsed_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(properties="f1,f2")
+ @BeanType(properties="f1,f2")
public static class E {
private ArrayList<String> f1;
@Xml(format=COLLAPSED) public ArrayList<String> getF1() { return f1; }
diff --git a/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java b/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
index 75df9f2efc..ed929b6ac2 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/xml/Xml_Test.java
@@ -34,6 +34,7 @@ import org.apache.juneau.xml.xml1a.*;
import org.apache.juneau.xml.xml1b.*;
import org.apache.juneau.xml.xml1c.*;
import org.junit.jupiter.api.*;
+import org.apache.juneau.commons.bean.*;
@SuppressWarnings({"serial"})
class Xml_Test extends TestBase {
@@ -163,7 +164,8 @@ class Xml_Test extends TestBase {
}
/** Class with explicitly specified properties */
- @Marshalled(typeName="Person1", properties="name,age")
+ @Marshalled(typeName="Person1")
+ @BeanType(properties="name,age")
public static class Person1 {
public int age;
protected Person1(String name, int age) {
@@ -425,7 +427,7 @@ class Xml_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(properties="url,id,name")
+ @BeanType(properties="url,id,name")
public static class N {
@Xml(format=ELEMENT) public URL url;
public int id;
@@ -457,7 +459,7 @@ class Xml_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(properties="url2,id2,name")
+ @BeanType(properties="url2,id2,name")
public static class O {
@MarshalledProp(name="url2") @Xml(format=ELEMENT) public URL url;
@MarshalledProp(name="id2") public int id;
@@ -489,7 +491,7 @@ class Xml_Test extends TestBase {
validateXml(t, s);
}
- @Marshalled(properties="url2,id2,name")
+ @BeanType(properties="url2,id2,name")
public static class P {
@MarshalledProp(name="url2") @Xml(format=ATTR) public URL url;
@MarshalledProp(name="id2") @Xml(format=ATTR) public int id;
(juneau) 05/06: refactor: move MarshallingInterceptor to commons.bean.BeanInterceptor (Phase 5a of bean-layer split)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit 595f2273e69b50e511b341c99da68374854b161f
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 10:20:26 2026 -0400
refactor: move MarshallingInterceptor to commons.bean.BeanInterceptor (Phase 5a of bean-layer split)
The bean-interceptor type is a bean-modeling concern (intercepts bean
getter/setter calls, no marshalling-specific dependencies), so it belongs
in the commons.bean package alongside @BeanType, @BeanProp, @BeanIgnore,
@BeanConfig, BasicPropertyNamer, etc.
Reverts the 9.5 BeanInterceptor -> MarshallingInterceptor rename and
moves the class from juneau-marshall (org.apache.juneau.swap) into
juneau-commons (org.apache.juneau.commons.bean) in one step. ~50 files
updated to reference the new location; @Marshalled.interceptor() now
takes Class<? extends BeanInterceptor<?>>.
The remainder of Phase 5 -- moving BeanMap, BeanMeta, BeanPropertyMeta,
BeanMapEntry, BeanPropertyValue, BeanPropertyConsumer,
BeanProxyInvocationHandler, and BeanMetaFiltered to commons.bean --
requires untangling ClassMeta / MarshallingContext / ObjectSwap /
BeanRegistry dependencies (~140 cross-references across ~4170 lines) and
is tracked in TODO-5 with a concrete strategy.
Co-authored-by: Cursor <cu...@cursor.com>
---
.../juneau/commons/bean/BeanInterceptor.java} | 20 +--
.../java/org/apache/juneau/jena/RdfParser.java | 2 +-
.../java/org/apache/juneau/jena/RdfSerializer.java | 2 +-
.../java/org/apache/juneau/MarshalledFilter.java | 18 +--
.../java/org/apache/juneau/MarshallingContext.java | 6 +-
.../org/apache/juneau/MarshallingContextable.java | 6 +-
.../apache/juneau/MarshallingTraverseContext.java | 2 +-
.../org/apache/juneau/annotation/Marshalled.java | 7 +-
.../juneau/annotation/MarshalledAnnotation.java | 9 +-
.../main/java/org/apache/juneau/csv/CsvParser.java | 2 +-
.../java/org/apache/juneau/csv/CsvSerializer.java | 2 +-
.../org/apache/juneau/html/HtmlDocSerializer.java | 2 +-
.../java/org/apache/juneau/html/HtmlParser.java | 2 +-
.../juneau/html/HtmlSchemaDocSerializer.java | 2 +-
.../apache/juneau/html/HtmlSchemaSerializer.java | 2 +-
.../org/apache/juneau/html/HtmlSerializer.java | 2 +-
.../juneau/html/HtmlStrippedDocSerializer.java | 2 +-
.../java/org/apache/juneau/json/JsonParser.java | 2 +-
.../apache/juneau/json/JsonSchemaSerializer.java | 2 +-
.../org/apache/juneau/json/JsonSerializer.java | 2 +-
.../java/org/apache/juneau/json5/Json5Parser.java | 2 +-
.../org/apache/juneau/json5/Json5Serializer.java | 2 +-
.../juneau/jsonschema/JsonSchemaGenerator.java | 2 +-
.../org/apache/juneau/markdown/MarkdownParser.java | 2 +-
.../apache/juneau/markdown/MarkdownSerializer.java | 2 +-
.../org/apache/juneau/msgpack/MsgPackParser.java | 2 +-
.../apache/juneau/msgpack/MsgPackSerializer.java | 2 +-
.../java/org/apache/juneau/oapi/OpenApiParser.java | 2 +-
.../org/apache/juneau/oapi/OpenApiSerializer.java | 2 +-
.../apache/juneau/parser/InputStreamParser.java | 2 +-
.../main/java/org/apache/juneau/parser/Parser.java | 2 +-
.../org/apache/juneau/parser/ReaderParser.java | 2 +-
.../apache/juneau/plaintext/PlainTextParser.java | 2 +-
.../juneau/plaintext/PlainTextSerializer.java | 2 +-
.../juneau/serializer/OutputStreamSerializer.java | 2 +-
.../org/apache/juneau/serializer/Serializer.java | 2 +-
.../apache/juneau/serializer/WriterSerializer.java | 2 +-
.../org/apache/juneau/soap/SoapXmlSerializer.java | 2 +-
.../main/java/org/apache/juneau/uon/UonParser.java | 2 +-
.../java/org/apache/juneau/uon/UonSerializer.java | 2 +-
.../juneau/urlencoding/UrlEncodingParser.java | 2 +-
.../juneau/urlencoding/UrlEncodingSerializer.java | 2 +-
.../main/java/org/apache/juneau/xml/XmlParser.java | 2 +-
.../java/org/apache/juneau/xml/XmlSerializer.java | 2 +-
.../java/org/apache/juneau/yaml/YamlParser.java | 2 +-
.../org/apache/juneau/yaml/YamlSerializer.java | 2 +-
.../org/apache/juneau/rest/client/RestClient.java | 2 +-
.../apache/juneau/rest/mock/MockRestClient.java | 2 +-
.../annotation/MarshalledAnnotation_Test.java | 2 +-
.../org/apache/juneau/jena/RdfParser_Test.java | 2 +-
.../org/apache/juneau/jena/RdfSerializer_Test.java | 2 +-
.../RestClient_Config_MarshallingContext_Test.java | 2 +-
todo/TODO-5-bean-runtime-types-to-commons.md | 178 +++++++++++++++++++++
todo/TODO.md | 2 +
54 files changed, 260 insertions(+), 78 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/MarshallingInterceptor.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanInterceptor.java
similarity index 85%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/MarshallingInterceptor.java
rename to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanInterceptor.java
index c88f831624..9d037aacb3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/MarshallingInterceptor.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanInterceptor.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.swap;
+package org.apache.juneau.commons.bean;
/**
* Bean interceptor.
@@ -25,7 +25,7 @@ package org.apache.juneau.swap;
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Interceptor that strips out sensitive information on Address beans.</jc>
- * <jk>public class</jk> AddressInterceptor <jk>extends</jk> MarshallingInterceptor<Address> {
+ * <jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor<Address> {
*
* <ja>@Override</ja>
* <jk>public</jk> Object readProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
@@ -46,8 +46,8 @@ package org.apache.juneau.swap;
* <p>
* Bean interceptors are registered in the following way:
* <ul class='javatree'>
- * <li class='ja'>{@link org.apache.juneau.annotation.Bean#interceptor() @Marshalled(interceptor)}
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#beanInterceptor(Class,Class)}
+ * <li class='ja'>{@link org.apache.juneau.annotation.Marshalled#interceptor() @Marshalled(interceptor)}
+ * <li class='jm'>{@code MarshallingContext.Builder#beanInterceptor(Class,Class)}
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -66,15 +66,15 @@ package org.apache.juneau.swap;
*
* @param <T> The bean type.
*/
-public class MarshallingInterceptor<T> {
+public class BeanInterceptor<T> {
/** Non-existent bean interceptor. */
- public static final class Void extends MarshallingInterceptor<Object> {}
+ public static final class Void extends BeanInterceptor<Object> {}
/**
* Default reusable property filter instance.
*/
- public static final MarshallingInterceptor<Object> DEFAULT = new MarshallingInterceptor<>();
+ public static final BeanInterceptor<Object> DEFAULT = new BeanInterceptor<>();
/**
* Property read interceptor.
@@ -85,7 +85,7 @@ public class MarshallingInterceptor<T> {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Address filter that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressInterceptor <jk>extends</jk> MarshallingInterceptor<Address> {
+ * <jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor<Address> {
*
* <jk>public</jk> Object readProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
* <jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>))
@@ -114,7 +114,7 @@ public class MarshallingInterceptor<T> {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Address filter that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressInterceptor <jk>extends</jk> MarshallingInterceptor<Address> {
+ * <jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor<Address> {
*
* <jk>public</jk> Object writeProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
* <jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>) && <js>"redacted"</js>.equals(<jv>value</jv>))
@@ -132,4 +132,4 @@ public class MarshallingInterceptor<T> {
public Object writeProperty(T bean, String name, Object value) {
return value;
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index e3ca843ffe..c8d1e84758 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -216,7 +216,7 @@ public class RdfParser extends ReaderParser implements RdfMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
index 8eddd4cce2..0376e8d9fa 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java
@@ -358,7 +358,7 @@ public class RdfSerializer extends WriterSerializer implements RdfMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
index f3e03db63d..4afd776776 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
@@ -74,7 +74,7 @@ import org.apache.juneau.swap.*;
* <h5 class='section'>See Also:</h5>
* <ul>
* <li class='ja'>{@link Marshalled @Marshalled}
- * <li class='jc'>{@link MarshallingInterceptor}
+ * <li class='jc'>{@link BeanInterceptor}
* <li class='jc'>{@link PropertyNamer}
* </ul>
*/
@@ -104,7 +104,7 @@ public class MarshalledFilter {
private boolean fluentSetters;
private BeanInstantiator.Builder<PropertyNamer> propertyNamer = BeanInstantiator.of(PropertyNamer.class);
private List<ClassInfo> dictionary;
- private BeanInstantiator.Builder<MarshallingInterceptor> interceptor = BeanInstantiator.of(MarshallingInterceptor.class);
+ private BeanInstantiator.Builder<BeanInterceptor> interceptor = BeanInstantiator.of(BeanInterceptor.class);
/**
* Constructor for non-bean POJO filters.
@@ -317,17 +317,17 @@ public class MarshalledFilter {
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='ja'>{@link Marshalled#interceptor()}
- * <li class='jc'>{@link MarshallingInterceptor}
+ * <li class='jc'>{@link BeanInterceptor}
* </ul>
*
* @param value
* The new value for this setting.
- * <br>The default value is {@link MarshallingInterceptor}.
+ * <br>The default value is {@link BeanInterceptor}.
* @return This object.
*/
@SuppressWarnings("unchecked")
public Builder interceptor(Class<?> value) {
- interceptor.type((Class<? extends MarshallingInterceptor>) value);
+ interceptor.type((Class<? extends BeanInterceptor>) value);
return this;
}
@@ -606,7 +606,7 @@ public class MarshalledFilter {
private final boolean fluentSetters;
private final ClassInfo implClass;
private final ClassInfo interfaceClass;
- private final MarshallingInterceptor interceptor;
+ private final BeanInterceptor interceptor;
private final Set<String> properties;
private final PropertyNamer propertyNamer;
private final Set<String> readOnlyProperties;
@@ -636,7 +636,7 @@ public class MarshalledFilter {
this.fluentSetters = builder.fluentSetters;
this.propertyNamer = builder.propertyNamer.asOptional().orElse(null);
this.beanDictionary = builder.dictionary == null ? list() : u(copyOf(builder.dictionary));
- this.interceptor = builder.interceptor.asOptional().orElse(MarshallingInterceptor.DEFAULT);
+ this.interceptor = builder.interceptor.asOptional().orElse(BeanInterceptor.DEFAULT);
}
/**
@@ -751,7 +751,7 @@ public class MarshalledFilter {
public boolean isUnsortedProperties() { return unsortedProperties; }
/**
- * Calls the {@link MarshallingInterceptor#readProperty(Object, String, Object)} method on the registered property filters.
+ * Calls the {@link BeanInterceptor#readProperty(Object, String, Object)} method on the registered property filters.
*
* @param bean The bean from which the property was read.
* @param name The property name.
@@ -766,7 +766,7 @@ public class MarshalledFilter {
}
/**
- * Calls the {@link MarshallingInterceptor#writeProperty(Object, String, Object)} method on the registered property filters.
+ * Calls the {@link BeanInterceptor#writeProperty(Object, String, Object)} method on the registered property filters.
*
* @param bean The bean from which the property was read.
* @param name The property name.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
index 0573beb4c7..bfac213a84 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
@@ -708,7 +708,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Interceptor that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressInterceptor <jk>extends</jk> MarshallingInterceptor<Address> {
+ * <jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor<Address> {
*
* <jk>public</jk> Object readProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
* <jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>))
@@ -740,7 +740,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link MarshallingInterceptor}
+ * <li class='jc'>{@link BeanInterceptor}
* <li class='ja'>{@link Bean#interceptor() Bean(interceptor)}
* </ul>
*
@@ -751,7 +751,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* <br>Cannot be <jk>null</jk>.
* @return This object.
*/
- public Builder beanInterceptor(Class<?> on, Class<? extends MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends BeanInterceptor<?>> value) {
assertArgNotNull(ARG_on, on);
assertArgNotNull(ARG_value, value);
return annotations(MarshalledApplyAnnotation.create(on).value(MarshalledAnnotation.create().interceptor(value).build()).build());
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
index 3cb72fdd8f..f40e99b15b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
@@ -454,7 +454,7 @@ public abstract class MarshallingContextable extends Context {
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Interceptor that strips out sensitive information.</jc>
- * <jk>public class</jk> AddressInterceptor <jk>extends</jk> MarshallingInterceptor<Address> {
+ * <jk>public class</jk> AddressInterceptor <jk>extends</jk> BeanInterceptor<Address> {
*
* <jk>public</jk> Object readProperty(Address <jv>bean</jv>, String <jv>name</jv>, Object <jv>value</jv>) {
* <jk>if</jk> (<js>"taxInfo"</js>.equals(<jv>name</jv>))
@@ -486,7 +486,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link MarshallingInterceptor}
+ * <li class='jc'>{@link BeanInterceptor}
* <li class='ja'>{@link Bean#interceptor() Bean(interceptor)}
* </ul>
*
@@ -497,7 +497,7 @@ public abstract class MarshallingContextable extends Context {
* <br>Cannot be <jk>null</jk>.
* @return This object.
*/
- public Builder beanInterceptor(Class<?> on, Class<? extends MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends BeanInterceptor<?>> value) {
bcBuilder.beanInterceptor(assertArgNotNull(ARG_on, on), assertArgNotNull(ARG_value, value));
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
index 875f2c0b66..4b67232bea 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingTraverseContext.java
@@ -156,7 +156,7 @@ public abstract class MarshallingTraverseContext extends MarshallingContextable
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
index 0bcb010ddd..3f29ad86e0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Marshalled.java
@@ -22,6 +22,7 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.swap.*;
/**
@@ -50,7 +51,7 @@ import org.apache.juneau.swap.*;
@Retention(RUNTIME)
@Inherited
@SuppressWarnings({
- "java:S1452" // Wildcard required - Class<? extends MarshallingInterceptor<?>> for interceptor definition
+ "java:S1452" // Wildcard required - Class<? extends BeanInterceptor<?>> for interceptor definition
})
public @interface Marshalled {
@@ -157,12 +158,12 @@ public @interface Marshalled {
* Bean interceptors can be used to intercept calls to getters and setters and alter their values in transit.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='jc'>{@link MarshallingInterceptor}
+ * <li class='jc'>{@link BeanInterceptor}
* </ul>
*
* @return The annotation value.
*/
- Class<? extends MarshallingInterceptor<?>> interceptor() default MarshallingInterceptor.Void.class;
+ Class<? extends BeanInterceptor<?>> interceptor() default BeanInterceptor.Void.class;
/**
* An identifying name for this class.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
index 51c0fcfe74..b689aac81e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledAnnotation.java
@@ -21,6 +21,7 @@ import static org.apache.juneau.commons.utils.CollectionUtils.*;
import java.lang.annotation.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.swap.*;
/**
@@ -47,7 +48,7 @@ public class MarshalledAnnotation {
private String[] description = {};
private Class<?>[] dictionary = new Class[0];
private Class<?> implClass = void.class;
- private Class<? extends MarshallingInterceptor<?>> interceptor = MarshallingInterceptor.Void.class;
+ private Class<? extends BeanInterceptor<?>> interceptor = BeanInterceptor.Void.class;
private String example = "";
private String typeName = "";
private String typePropertyName = "";
@@ -129,7 +130,7 @@ public class MarshalledAnnotation {
* @param value The new value for this property.
* @return This object.
*/
- public Builder interceptor(Class<? extends MarshallingInterceptor<?>> value) {
+ public Builder interceptor(Class<? extends BeanInterceptor<?>> value) {
interceptor = value;
return this;
}
@@ -164,7 +165,7 @@ public class MarshalledAnnotation {
private final MarshalledAs as;
private final String[] description;
- private final Class<? extends MarshallingInterceptor<?>> interceptor;
+ private final Class<? extends BeanInterceptor<?>> interceptor;
private final Class<?> implClass;
private final Class<?>[] dictionary;
private final String example;
@@ -204,7 +205,7 @@ public class MarshalledAnnotation {
}
@Override /* Overridden from Marshalled */
- public Class<? extends MarshallingInterceptor<?>> interceptor() {
+ public Class<? extends BeanInterceptor<?>> interceptor() {
return interceptor;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
index 1b59553c00..af669c9da0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParser.java
@@ -240,7 +240,7 @@ public class CsvParser extends ReaderParser implements CsvMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
index af26bfae09..006c043669 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializer.java
@@ -262,7 +262,7 @@ public class CsvSerializer extends WriterSerializer implements CsvMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
index f6ee6d2dfa..36f23a6421 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializer.java
@@ -439,7 +439,7 @@ public class HtmlDocSerializer extends HtmlStrippedDocSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
index d85e0f4c53..5712a70927 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParser.java
@@ -168,7 +168,7 @@ public class HtmlParser extends XmlParser implements HtmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
index d03b9ea76f..8ef26b2455 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaDocSerializer.java
@@ -358,7 +358,7 @@ public class HtmlSchemaDocSerializer extends HtmlDocSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
index 14044ae929..6536f5aa99 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializer.java
@@ -352,7 +352,7 @@ public class HtmlSchemaSerializer extends HtmlSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 11b33d89b3..02c3ac7bdd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -436,7 +436,7 @@ public class HtmlSerializer extends XmlSerializer implements HtmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
index 25e1d799dd..d8b016680d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializer.java
@@ -228,7 +228,7 @@ public class HtmlStrippedDocSerializer extends HtmlSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
index 8a27228858..60e195be5f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParser.java
@@ -244,7 +244,7 @@ public class JsonParser extends ReaderParser implements JsonMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
index 9eb3a2b136..e62f5d9576 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializer.java
@@ -308,7 +308,7 @@ public class JsonSchemaSerializer extends JsonSerializer implements JsonSchemaMe
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
index 1c26424ccd..eb9e9125d1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java
@@ -301,7 +301,7 @@ public class JsonSerializer extends WriterSerializer implements JsonMetaProvider
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
index 69585603f1..f206d5046d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Parser.java
@@ -186,7 +186,7 @@ public class Json5Parser extends JsonParser {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
index 26d3d467fe..2c0a43f8ed 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json5/Json5Serializer.java
@@ -221,7 +221,7 @@ public class Json5Serializer extends JsonSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
index 203cb8325e..fbad360ac5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/JsonSchemaGenerator.java
@@ -345,7 +345,7 @@ public class JsonSchemaGenerator extends MarshallingTraverseContext implements J
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
index 7276ac79af..aceaa8ad81 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownParser.java
@@ -229,7 +229,7 @@ public class MarkdownParser extends ReaderParser implements MarkdownMetaProvider
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
index 6032effc96..6fa9deec64 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/markdown/MarkdownSerializer.java
@@ -261,7 +261,7 @@ public class MarkdownSerializer extends WriterSerializer implements MarkdownMeta
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
index 55f40e4017..f82d96277f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackParser.java
@@ -188,7 +188,7 @@ public class MsgPackParser extends InputStreamParser implements MsgPackMetaProvi
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
index 5fafa5aa9b..b1f310aa66 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializer.java
@@ -247,7 +247,7 @@ public class MsgPackSerializer extends OutputStreamSerializer implements MsgPack
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
index a402d0a76d..c9d28d3e7e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiParser.java
@@ -161,7 +161,7 @@ public class OpenApiParser extends UonParser implements OpenApiMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
index 779e11dc38..80b1eaac05 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializer.java
@@ -191,7 +191,7 @@ public class OpenApiSerializer extends UonSerializer implements OpenApiMetaProvi
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
index 42bbddb2f2..6b80d77aba 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/InputStreamParser.java
@@ -169,7 +169,7 @@ public class InputStreamParser extends Parser {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index e93cd5e0ca..0b296ed0f3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -304,7 +304,7 @@ public class Parser extends MarshallingContextable {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
index de6a76a938..dce0c1f24c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ReaderParser.java
@@ -174,7 +174,7 @@ public class ReaderParser extends Parser {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
index f3d726d342..56a235480b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextParser.java
@@ -172,7 +172,7 @@ public class PlainTextParser extends ReaderParser implements PlainTextMetaProvid
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
index 2227c6aae3..0843512921 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializer.java
@@ -187,7 +187,7 @@ public class PlainTextSerializer extends WriterSerializer implements PlainTextMe
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
index 0fee077300..dba3a9cdeb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializer.java
@@ -179,7 +179,7 @@ public class OutputStreamSerializer extends Serializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index 074e74debe..ce2df36a6d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -381,7 +381,7 @@ public class Serializer extends MarshallingTraverseContext {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
index 1a528dea26..58bf6f8ca5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializer.java
@@ -206,7 +206,7 @@ public class WriterSerializer extends Serializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
index 96a8d909bc..1d92a6ffd6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializer.java
@@ -216,7 +216,7 @@ public class SoapXmlSerializer extends XmlSerializer implements SoapXmlMetaProvi
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
index 0696375e72..cedb4cec65 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonParser.java
@@ -192,7 +192,7 @@ public class UonParser extends ReaderParser implements HttpPartParser, UonMetaPr
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
index 8e89a90853..5ba2658ab5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializer.java
@@ -334,7 +334,7 @@ public class UonSerializer extends WriterSerializer implements HttpPartSerialize
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index 465ecc88b7..b077461d3a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -175,7 +175,7 @@ public class UrlEncodingParser extends UonParser implements UrlEncodingMetaProvi
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
index 9068975a12..73dded5d23 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializer.java
@@ -281,7 +281,7 @@ public class UrlEncodingSerializer extends UonSerializer implements UrlEncodingM
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
index 373d7d91c6..743cf5ec1e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlParser.java
@@ -225,7 +225,7 @@ public class XmlParser extends ReaderParser implements XmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
index 7af660fd8e..6d9a45fdc1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializer.java
@@ -371,7 +371,7 @@ public class XmlSerializer extends WriterSerializer implements XmlMetaProvider {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
index 9211543d8b..f5a33c5e63 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlParser.java
@@ -203,7 +203,7 @@ public class YamlParser extends ReaderParser {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
index 0a66e39b83..1b6a757c82 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/YamlSerializer.java
@@ -299,7 +299,7 @@ public class YamlSerializer extends WriterSerializer {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 412a543863..f5d6869b79 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -1441,7 +1441,7 @@ public class RestClient extends MarshallingContextable implements HttpClient, Cl
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
index b015630cab..8d372e2b14 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock/MockRestClient.java
@@ -444,7 +444,7 @@ public class MockRestClient extends RestClient implements HttpClientConnection {
}
@Override /* Overridden from Builder */
- public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.swap.MarshallingInterceptor<?>> value) {
+ public Builder beanInterceptor(Class<?> on, Class<? extends org.apache.juneau.commons.bean.BeanInterceptor<?>> value) {
super.beanInterceptor(on, value);
return this;
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
index 2f2f3577a9..aa63d8c863 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledAnnotation_Test.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.*;
class MarshalledAnnotation_Test extends TestBase {
private static class X1 {}
- private static class X2 extends MarshallingInterceptor<MarshalledAnnotation_Test> {}
+ private static class X2 extends BeanInterceptor<MarshalledAnnotation_Test> {}
//------------------------------------------------------------------------------------------------------------------
// Basic tests
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
index 07ad27cabd..5eab3678b9 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfParser_Test.java
@@ -280,7 +280,7 @@ class RdfParser_Test extends TestBase {
assertNotNull(RdfParser.create().marshallingContext(MarshallingContext.DEFAULT).build());
assertNotNull(RdfParser.create().marshallingContext(MarshallingContext.create()).build());
assertNotNull(RdfParser.create().beanDictionary(D01_DictBean.class).build());
- assertNotNull(RdfParser.create().beanInterceptor(String.class, (Class)MarshallingInterceptor.class).build());
+ assertNotNull(RdfParser.create().beanInterceptor(String.class, (Class)BeanInterceptor.class).build());
assertNotNull(RdfParser.create().beanMapPutReturnsOldValue().build());
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
index cbef68d649..50447d20b0 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/jena/RdfSerializer_Test.java
@@ -165,7 +165,7 @@ class RdfSerializer_Test extends TestBase {
"rawtypes" // (Class) cast required by beanInterceptor API
})
@Test void b04_beanInterceptor() {
- assertNotNull(RdfSerializer.create().beanInterceptor(String.class, (Class)MarshallingInterceptor.class).build());
+ assertNotNull(RdfSerializer.create().beanInterceptor(String.class, (Class)BeanInterceptor.class).build());
}
@Test void b05_beanMapPutReturnsOldValue() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
index fd10494d0f..15e434c370 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_MarshallingContext_Test.java
@@ -792,7 +792,7 @@ class RestClient_Config_MarshallingContext_Test extends TestBase {
}
}
- public static class A30b extends MarshallingInterceptor<A30a> {
+ public static class A30b extends BeanInterceptor<A30a> {
static boolean getterCalled,setterCalled;
@Override
public Object readProperty(A30a bean,String name,Object value) {
diff --git a/todo/TODO-5-bean-runtime-types-to-commons.md b/todo/TODO-5-bean-runtime-types-to-commons.md
new file mode 100644
index 0000000000..d6f418a8e7
--- /dev/null
+++ b/todo/TODO-5-bean-runtime-types-to-commons.md
@@ -0,0 +1,178 @@
+# TODO-5 — Move bean-modeling runtime types (`BeanMap`, `BeanMeta`, `BeanPropertyMeta`, …) into `commons.bean` (remainder of Phase 5)
+
+This is the remaining work from **Phase 5 of the bean-layer split**. Phase 5a (the `MarshallingInterceptor` → `commons.bean.BeanInterceptor` move+rename) shipped in the same commit that created this plan. The big runtime types still live in `juneau-marshall` because they are deeply entangled with `ClassMeta` / `MarshallingContext` / `ObjectSwap` / `BeanRegistry`, and untangling them is the bulk of the work.
+
+---
+
+## Goal
+
+Move these eight `BeanXxx` runtime types out of `org.apache.juneau` (in `juneau-marshall`) into `org.apache.juneau.commons.bean` (in `juneau-commons`) so the **bean-modeling runtime** is independently usable without dragging in the full marshalling stack:
+
+1. `BeanMap.java` (~727 lines)
+2. `BeanMapEntry.java` (~129 lines)
+3. `BeanMeta.java` (~1547 lines)
+4. `BeanMetaFiltered.java` (~49 lines)
+5. `BeanPropertyMeta.java` (~1423 lines)
+6. `BeanPropertyValue.java` (~120 lines)
+7. `BeanPropertyConsumer.java` (~23 lines)
+8. `BeanProxyInvocationHandler.java` (~156 lines)
+
+Total: ~4,170 lines of code with ~140 cross-references to marshalling-aware types (`ClassMeta`, `MarshallingContext`, `ObjectSwap`, `BeanRegistry`, etc.).
+
+---
+
+## Why Phase 5 wasn't fully landed in one commit
+
+A first-pass survey revealed that the dependencies are too tangled to do in a single sweep without risking a broken build. The shape of the entanglement:
+
+### `BeanPropertyMeta` (74 marshalling refs)
+- `BeanPropertyMeta.Builder` carries a `MarshallingContext bc` field used everywhere.
+- Carries `ClassMeta<?> rawTypeMeta`, `ClassMeta<?> typeMeta`, `ObjectSwap swap`, `BeanRegistry beanRegistry`.
+- `get(BeanMap, String)` / `set(BeanMap, String, Object)` paths apply `ObjectSwap` transforms inline.
+- Constructor-arg detection reads `MarshallingContext.getBeanStore()`.
+- Property-type resolution flows through `MarshallingContext.resolveClassMeta(...)`.
+
+### `BeanMeta` (26 marshalling refs)
+- `marshallingContext = cm.getMarshallingContext()` is the central field; settings used:
+ - `isFindFluentSetters()`, `isBeansRequireSerializable()`, `isBeansRequireDefaultConstructor()`, `isBeansRequireSomeProperties()`, `isUnsortedProperties()`, `isIgnoreTransientFields()`, `isUseJavaBeanIntrospector()`, `isUseInterfaceProxies()`, `isNotABean()`
+ - `getBeanClassVisibility()`, `getBeanConstructorVisibility()`, `getBeanFieldVisibility()`, `getBeanMethodVisibility()`
+ - `getPropertyNamer()`, `getBeanStore()`, `getAnnotationProvider()`
+ - `string()` returns a `ClassMeta<String>` used to seed a property meta.
+- `ClassMeta` is used for `classMeta.inner()`, `classMeta.isMemberClass()`, `classMeta.isAnonymousClass()`, `classMeta.isAssignableTo(...)`, `classMeta.getRecordComponents()`, `classMeta.getProxyInvocationHandler()`, `classMeta.getClassLoader()`, plus `cm.getModifiers()`.
+
+### `BeanMap` (29 marshalling refs)
+- Constructed by `MarshallingSession.toBeanMap(...)`.
+- `get`/`put` go through `MarshallingSession` swap-aware property access.
+- Holds a back-pointer to its session and uses it for type narrowing.
+
+### `BeanProxyInvocationHandler` (5 refs), `BeanMapEntry` (3), `BeanPropertyValue` (4), `BeanMetaFiltered` (1)
+- All transitively reference `ClassMeta` and/or `MarshallingContext`.
+
+### Other affected types that stay in `juneau-marshall`
+- `BeanRegistry` (polymorphic dispatch — marshalling concern)
+- `BeanDictionaryMap`, `BeanDictionaryList` (same)
+- `MarshalledFilter` (reads marshalling-only annotation attributes; bean-modeling attributes now read via `commons.bean` annotation processors)
+- `MarshallingContext`, `MarshallingSession` (stay; `MarshallingContext` will compose a new `BeanConfigContext` POJO)
+- `ClassMeta` (marshalling-aware type metadata; will *consume* a `commons.bean.BeanMeta` after the move)
+
+---
+
+## Strategy
+
+The whole point is to make `commons.bean` self-contained, so the untangling has to address every leaf of the dependency graph. Recommended sequencing:
+
+### Step 1 — Introduce `BeanConfigContext` (runtime POJO) in `commons.bean`
+
+Create `juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanConfigContext.java` as a **plain immutable POJO** with builder. Suggested name: **`BeanConfigContext`** (not `BeanConfig` — that name is already taken by the existing annotation in the same package from Phase 3). Alternatives if `BeanConfigContext` reads awkwardly at use sites: `BeanModelContext`, `BeanIntrospectionConfig`.
+
+Carries:
+- `Visibility beanClassVisibility`, `Visibility beanConstructorVisibility`, `Visibility beanFieldVisibility`, `Visibility beanMethodVisibility`
+- `boolean findFluentSetters`
+- `boolean sortProperties`, `Set<Class<?>> unsortedProperties` (or equivalent)
+- `PropertyNamer propertyNamer`
+- `boolean beansRequireSomeProperties`, `boolean beansRequireDefaultConstructor`, `boolean beansRequireSerializable`, `boolean beansRequireSettersForGetters`
+- `boolean useJavaBeanIntrospector`, `boolean useInterfaceProxies`, `boolean ignoreTransientFields`
+- `boolean ignoreUnknownBeanProperties`, `boolean ignoreMissingSetters`
+- A lambda/predicate for `isNotABean(Class<?>)`
+- Reference to a commons-compatible `BeanStore` (already exists at `commons.inject.BeanInstantiator` — confirm scope)
+- Reference to a commons-compatible `AnnotationProvider` (need to confirm where this currently lives — probably `commons.reflect`)
+
+`MarshallingContext` retains all these settings (they're already there), and composes (or delegates to) a `BeanConfigContext` view so the marshalling layer reads them transparently. `MarshallingContext.Builder` produces a `BeanConfigContext` snapshot on `build()`.
+
+### Step 2 — Replace `ClassMeta<T>` with `ClassInfo`
+
+`BeanMeta` and `BeanPropertyMeta` use `ClassMeta` for: `inner()`, `isMemberClass()`, `isAnonymousClass()`, `isAssignableTo(...)`, `isInterface()`, `isRecord()`, `getRecordComponents()`, `getModifiers()`, `getClassLoader()`. **All of these are pure reflection** and already available on `ClassInfo`. Swap them.
+
+Two `ClassMeta`-only methods used by `BeanMeta`:
+- `classMeta.getProxyInvocationHandler()` — used to build the proxy when wrapping an interface. Move this responsibility into `BeanMeta` itself or to a hook in `BeanConfigContext`. `BeanProxyInvocationHandler` already takes a `BeanMeta<T>`; the construction site is the only thing that needs to change.
+- `cm.getMarshallingContext().string()` — used as the raw type for the synthetic `_type` property. After the move, store a plain `Class<String>` or `ClassInfo` and let the marshalling layer wrap that into a `ClassMeta` if it needs to.
+
+### Step 3 — Swap-aware logic in `BeanPropertyMeta`
+
+Recommendation (a): **Remove swap-aware get/set in `BeanPropertyMeta`**. The marshalling layer (already in `MarshallingSession`) applies swaps externally — `BeanPropertyMeta` does raw getter/setter invocation only. This keeps the bean model lean.
+
+If consumers still want a swap-aware extension point, expose two `BiFunction<Object,Object,Object>` callbacks on `BeanPropertyMeta` (or a small `BeanPropertyTransform` interface) that default to identity. The marshalling layer installs swap-aware callbacks at session construction.
+
+### Step 4 — `BeanMap.get/put` decoupling
+
+Same idea: after the move, `BeanMap.get`/`put` do raw property access (calling `BeanPropertyMeta`'s raw getter/setter). `MarshallingSession` wraps a `BeanMap` for serialization and applies swaps externally per property as needed.
+
+### Step 5 — `BeanRegistry` lives in `juneau-marshall` (unchanged)
+
+`BeanRegistry` is a marshalling concern (polymorphic dispatch via `@Marshalled(typeName=...)` / `@Marshalled(dictionary=...)`). After the move, `BeanPropertyMeta` in `commons.bean` does **not** carry a `BeanRegistry` field. Instead:
+- The bean-model `BeanPropertyMeta` exposes the raw `@BeanType` / `@BeanProp` metadata.
+- The marshalling layer reads `@Marshalled` dictionary metadata separately and pairs it with the bean property via a `MarshalledPropertyMeta` (new) or a side-map keyed by `BeanPropertyMeta`.
+
+### Step 6 — `BeanMeta` is constructed by both `ClassMeta` and direct `BeanConfigContext` callers
+
+After the move:
+- A direct `commons.bean` consumer does `BeanMeta.of(MyClass.class, BeanConfigContext.DEFAULT)`.
+- `ClassMeta` does the same internally and stores the resulting `BeanMeta` as a member.
+
+This makes `ClassMeta` a *consumer* of `BeanMeta` rather than its creator.
+
+### Step 7 — `ExtendedBeanMeta` (marshalling-side `BeanMeta` extension) stays
+
+`ExtendedBeanMeta` (and per-format extensions like `XmlBeanMeta`, `RdfBeanMeta`, `HtmlBeanMeta`) currently extend or compose `BeanMeta`. Re-check whether they need to follow `BeanMeta` to `commons.bean` (probably not — they're marshalling-aware and stay).
+
+### Step 8 — Test fallout
+
+- `BeanMap_Test`, `BeanMeta_Test`, `AnnotationInheritance_Test`, plus any test that imports `org.apache.juneau.BeanMap`/`BeanMeta`/`BeanPropertyMeta` needs an import update (rename `org.apache.juneau.BeanMap` to `org.apache.juneau.commons.bean.BeanMap` etc.).
+- Many tests use these types via the unqualified name from inside `org.apache.juneau` — those need explicit imports added.
+
+### Step 9 — Reference sweep across the repo
+
+Estimated reference counts (from a survey before Phase 5a):
+- ~50 files reference `BeanMeta` directly
+- ~50 files reference `BeanMap` directly
+- ~50 files reference `BeanPropertyMeta` directly
+- Lots of overlap, but expect 80–120 unique files to need import updates (most are inside `juneau-marshall` and currently use the in-package short name).
+- Plus `juneau-docs` (release notes, topic pages).
+
+### Step 10 — Module dependency check
+
+`juneau-commons/pom.xml` must NOT add a dependency on `juneau-marshall`. Verify by building `juneau-commons` standalone after the move:
+```bash
+cd juneau-core/juneau-commons && mvn clean compile
+```
+
+---
+
+## Build verification
+
+Build module-by-module as you go. Don't try to move everything then build:
+
+```bash
+# After each set of changes
+python3 scripts/test.py --build-only
+# Periodically
+python3 scripts/test.py --full
+```
+
+---
+
+## Commit message
+
+`refactor: move BeanMap/BeanMeta/BeanPropertyMeta runtime types to commons.bean (Phase 5 of bean-layer split)`
+
+---
+
+## Risks and open questions
+
+1. **`AnnotationProvider`** — currently lives in `juneau-marshall` (`org.apache.juneau.commons.reflect.AnnotationProvider`? need to verify exact location and module). If it's already in `commons`, great. If not, it has to move first.
+2. **`BeanStore`** — `commons.inject` has `BeanInstantiator`. Is that enough for `BeanMeta`'s constructor-resolution path, or does it need the richer `BeanStore` that lives in `juneau-marshall`?
+3. **`ObjectSwap` removal from `BeanPropertyMeta`** — there are likely a handful of test cases that exercise swap-aware `BeanMap.get`/`put` directly. They will need to be rewritten to go through a `MarshallingSession`.
+4. **`@Marshalled(properties=…)` / `@Marshalled(dictionary=…)`** reading inside `BeanMeta` — the bean-modeling layer should only read `@BeanType` / `@BeanProp`. The `@Marshalled`-specific bits (typeName/dictionary/properties-as-include-list) need to be lifted out into the marshalling-side `MarshalledFilter` or an analog.
+5. **`BeanRegistry` removal from `BeanPropertyMeta`** — see Step 5; the side-map design needs to be sketched before any code moves.
+
+---
+
+## Definition of done
+
+- [ ] All 8 files physically located in `juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/`.
+- [ ] None of those 8 files reference `ClassMeta`, `MarshallingContext`, `MarshallingSession`, `ObjectSwap`, or `BeanRegistry`.
+- [ ] `mvn clean compile` of `juneau-commons` succeeds standalone.
+- [ ] `scripts/test.py --build-only` and `--full` both pass.
+- [ ] Reference sweep done: no stale `import org.apache.juneau.BeanMap;` etc. anywhere in the repo.
+- [ ] `juneau-docs` release-notes / migration-guide updated with the package moves.
+- [ ] Remove this TODO from `todo/TODO.md` (final cleanup step).
diff --git a/todo/TODO.md b/todo/TODO.md
index c19c17a061..70b7c51c39 100644
--- a/todo/TODO.md
+++ b/todo/TODO.md
@@ -7,6 +7,8 @@
- [TODO-4] Duration.ofDays(7) serialized in hours?
+- [TODO-5] Finish Phase 5 of the bean-layer split: physically move `BeanMap`, `BeanMeta`, `BeanPropertyMeta`, `BeanMapEntry`, `BeanPropertyValue`, `BeanPropertyConsumer`, `BeanProxyInvocationHandler`, and `BeanMetaFiltered` from `juneau-marshall` into `org.apache.juneau.commons.bean` in `juneau-commons`. Requires untangling `ClassMeta` / `MarshallingContext` / `ObjectSwap` / `BeanRegistry` dependencies (introduce a `BeanConfigContext` runtime POJO, swap `ClassMeta` for `ClassInfo`, hoist [...]
+
- [TODO-6] Add an `ai` / `shortDescription` field to `@Schema` (and related annotations) for concise LLM/AI-consumption descriptions that stay under token budgets. See `todo/TODO-6-ai-short-description.md`.
- [TODO-7] Decouple `juneau-rest-common` from `juneau-marshall` by breaking the compile dependency so REST annotations and beans can be used without pulling in the full serialization stack. See `todo/TODO-7-decouple-rest-common-from-marshall.md`.
(juneau) 04/06: refactor: extract @BeanIgnore from @MarshalledIgnore for bean-detection (Phase 4 of bean-layer split)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit 6dc9a18ab5eca9c40a2951d9f7ec98c9cde98844
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 10:05:47 2026 -0400
refactor: extract @BeanIgnore from @MarshalledIgnore for bean-detection (Phase 4 of bean-layer split)
Split @MarshalledIgnore's mixed semantics into two annotations with cleaner responsibilities:
- @BeanIgnore (new, org.apache.juneau.commons.bean): TYPE/FIELD/METHOD/CONSTRUCTOR.
Bean-modeling concern. On TYPE: "not a bean — marshaller falls through to swaps,
@Marshalled(as=STRING), etc.". On FIELD/METHOD/CONSTRUCTOR: excludes member from
bean property/constructor detection. Lives in juneau-commons so the bean layer
doesn't depend on marshalling.
- @MarshalledIgnore (existing, juneau-marshall): trimmed to @Target({TYPE}) only.
Marshalling-layer concern: "skip this type entirely — serializers output null,
parsers return null". Removed the now-obsolete ignoreAccessors attribute.
Migrated runtime sites in BeanMeta, AutoObjectSwap, AutoMapSwap, AutoListSwap,
AutoNumberSwap, and SurrogateSwap to check @BeanIgnore for member/class-level
bean detection. The TYPE-level "null swap" path in ClassMeta still checks
@MarshalledIgnore.
Migrated callsites: member-level @MarshalledIgnore usages (fields/methods/ctors)
moved to @BeanIgnore; class-level usages on BasicHttpEntity, BasicResource,
MediaType, MediaRanges, StringRange, StringRanges, and various test classes
where the intent was "not a bean (fall through to toString)" moved to
@BeanIgnore. Test class-level usages where the intent was "skip during
marshalling, emit null" remain on @MarshalledIgnore.
Added new tests: BeanIgnore_Test and BeanIgnoreAnnotation_Test. Trimmed
MarshalledIgnore_Test to TYPE-level skip behavior only.
Deleted obsolete shadow annotation org.apache.juneau.commons.annotation.MarshalledIgnore.
Co-authored-by: Cursor <cu...@cursor.com>
---
.../apache/juneau/bean/jsonschema/JsonSchema.java | 22 +-
.../commons/annotation/MarshalledIgnore.java | 58 ------
.../org/apache/juneau/commons/bean/BeanIgnore.java | 87 ++++++++
.../juneau/commons/bean/BeanIgnoreAnnotation.java} | 48 +++--
.../apache/juneau/commons/http/MediaRanges.java | 4 +-
.../org/apache/juneau/commons/http/MediaType.java | 4 +-
.../apache/juneau/commons/http/StringRange.java | 4 +-
.../apache/juneau/commons/http/StringRanges.java | 4 +-
.../juneau/commons/inject/BeanInstantiator.java | 2 +-
.../src/main/java/org/apache/juneau/BeanMeta.java | 44 ++--
.../src/main/java/org/apache/juneau/Context.java | 1 +
.../java/org/apache/juneau/MarshallingContext.java | 20 +-
.../org/apache/juneau/MarshallingContextable.java | 20 +-
.../apache/juneau/annotation/BeanIgnoreApply.java | 101 +++++++++
.../annotation/BeanIgnoreApplyAnnotation.java | 232 +++++++++++++++++++++
.../apache/juneau/annotation/MarshalledIgnore.java | 59 ++----
.../annotation/MarshalledIgnoreAnnotation.java | 21 +-
.../java/org/apache/juneau/swap/AutoListSwap.java | 13 +-
.../java/org/apache/juneau/swap/AutoMapSwap.java | 13 +-
.../org/apache/juneau/swap/AutoNumberSwap.java | 13 +-
.../org/apache/juneau/swap/AutoObjectSwap.java | 13 +-
.../java/org/apache/juneau/swap/SurrogateSwap.java | 3 +-
.../apache/juneau/http/entity/BasicHttpEntity.java | 4 +-
.../apache/juneau/http/resource/BasicResource.java | 4 +-
.../test/java/org/apache/juneau/BeanMap_Test.java | 22 +-
.../src/test/java/org/apache/juneau/TestUtils.java | 8 +-
.../src/test/java/org/apache/juneau/a/A1.java | 12 +-
.../juneau/a/rttests/RoundTripBeanMaps_Test.java | 8 +-
...on_Test.java => BeanIgnoreAnnotation_Test.java} | 27 ++-
...halledIgnore_Test.java => BeanIgnore_Test.java} | 103 ++++-----
.../MarshalledIgnoreAnnotation_Test.java | 2 +-
.../juneau/annotation/MarshalledIgnore_Test.java | 94 +--------
.../apache/juneau/transform/AutoListSwapTest.java | 17 +-
.../apache/juneau/transform/AutoMapSwapTest.java | 17 +-
.../juneau/transform/AutoNumberSwapTest.java | 17 +-
.../juneau/transform/AutoObjectSwapTest.java | 17 +-
36 files changed, 688 insertions(+), 450 deletions(-)
diff --git a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
index 773cfb53bb..851d86cc76 100644
--- a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
+++ b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchema.java
@@ -687,7 +687,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonSchemaArray}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public Boolean getAdditionalItemsAsBoolean() { return additionalItemsBoolean; }
/**
@@ -699,7 +699,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link Boolean}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public List<JsonSchema> getAdditionalItemsAsSchemaArray() { return additionalItemsSchemaArray; }
/**
@@ -726,7 +726,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonSchema}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public Boolean getAdditionalPropertiesAsBoolean() { return additionalPropertiesBoolean; }
/**
@@ -738,7 +738,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link Boolean}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonSchema getAdditionalPropertiesAsSchema() { return additionalPropertiesSchema; }
/**
@@ -966,7 +966,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonSchemaArray}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonSchema getItemsAsSchema() { return itemsSchema; }
/**
@@ -977,7 +977,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonSchema}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonSchemaArray getItemsAsSchemaArray() { return itemsSchemaArray; }
/**
@@ -1053,7 +1053,7 @@ public class JsonSchema {
*
* @return The value of the <property>name</property> property on this bean, or <jk>null</jk> if it is not set.
*/
- @MarshalledIgnore
+ @BeanIgnore
public String getName() { return name; }
/**
@@ -1215,7 +1215,7 @@ public class JsonSchema {
* @return
* The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonTypeArray}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonType getTypeAsJsonType() { return typeJsonType; }
/**
@@ -1226,7 +1226,7 @@ public class JsonSchema {
*
* @return The currently set value, or <jk>null</jk> if the property is not set, or is set as a {@link JsonType}.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonTypeArray getTypeAsJsonTypeArray() { return typeJsonTypeArray; }
/**
@@ -1757,7 +1757,7 @@ public class JsonSchema {
* @param value The new value for the <property>name</property> property on this bean.
* @return This object.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonSchema setName(String value) {
this.name = value;
return this;
@@ -1900,7 +1900,7 @@ public class JsonSchema {
* @param value The schema map to associate with this schema. Can be <jk>null</jk>.
* @return This object.
*/
- @MarshalledIgnore
+ @BeanIgnore
public JsonSchema setSchemaMap(JsonSchemaMap value) {
this.schemaMap = value;
return this;
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/annotation/MarshalledIgnore.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/annotation/MarshalledIgnore.java
deleted file mode 100644
index f0116e9fa9..0000000000
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/annotation/MarshalledIgnore.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.juneau.commons.annotation;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-
-import java.lang.annotation.*;
-
-/**
- * Marks types in <c>juneau-commons</c> that must not be interpreted as beans (for example HTTP header value types
- * serialized as strings).
- *
- * <p>
- * Marshall's {@code org.apache.juneau.annotation.MarshalledIgnore} is the full-featured annotation (repeatable, dynamically
- * applied, and so on). This annotation is recognized alongside it when classes are analyzed in juneau-marshall.
- * </p>
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MarshalledIgnoreAnnotation">@MarshalledIgnore Annotation</a>
- * </ul>
- */
-@Documented
-@Target({ FIELD, METHOD, TYPE, CONSTRUCTOR })
-@Retention(RUNTIME)
-@Inherited
-public @interface MarshalledIgnore {
-
- /**
- * Optional description for the exposed API.
- *
- * @return The annotation value.
- * @since 9.2.0
- */
- String[] description() default {};
-
- /**
- * When <jk>true</jk> and this annotation is on a <jk>field</jk>, JavaBean accessors for the same logical property
- * are also excluded from bean metadata.
- *
- * @return The annotation value.
- */
- boolean ignoreAccessors() default false;
-}
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnore.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnore.java
new file mode 100644
index 0000000000..508581277a
--- /dev/null
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnore.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.commons.bean;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+import java.lang.annotation.*;
+
+/**
+ * Excludes a class, field, method, or constructor from bean introspection.
+ *
+ * <p>
+ * The bean-modeling sibling of {@code @MarshalledIgnore}: where {@code @MarshalledIgnore} (in
+ * <c>juneau-marshall</c>) controls whether the marshaller skips a type entirely at the wire-format
+ * layer, this annotation describes whether something participates in <i>bean detection</i>. It lives
+ * in <c>juneau-commons</c> so the bean-modeling layer can describe non-bean types and excluded bean
+ * members without depending on the marshalling layer.
+ *
+ * <p>
+ * Behavior depends on the target:
+ * <ul>
+ * <li><b>TYPE (class)</b> — marks the class as <i>not a bean</i>. The marshaller falls through to
+ * its other type-detection logic (object swaps, {@link org.apache.juneau.commons.bean.BeanType @BeanType}-style
+ * hints, {@code @Marshalled(as=STRING)}, etc.) instead of treating the class as a bean. This is
+ * the original pre-TODO-21 {@code @BeanIgnore} semantic.
+ * <li><b>FIELD</b> — excludes the field from bean property discovery. Use {@link #ignoreAccessors()}
+ * to also suppress matching JavaBean accessors.
+ * <li><b>METHOD</b> — excludes the getter/setter from bean property discovery.
+ * <li><b>CONSTRUCTOR</b> — excludes the constructor from constructor detection.
+ * </ul>
+ *
+ * <h5 class='section'>Java Records:</h5>
+ * <p>
+ * Ignoring individual record components is not supported during parsing. Because records are
+ * immutable, all components must be provided to the canonical constructor. Applying this
+ * annotation to a record component's accessor method or field will exclude it from serialization
+ * output, but the parser will be unable to instantiate the record if the component value is missing
+ * from the input.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/BeanIgnoreAnnotation">@BeanIgnore Annotation</a>
+ * </ul>
+ */
+@Documented
+@Target({ FIELD, METHOD, TYPE, CONSTRUCTOR })
+@Retention(RUNTIME)
+@Inherited
+public @interface BeanIgnore {
+
+ /**
+ * Optional description for the exposed API.
+ *
+ * @return The annotation value.
+ * @since 9.2.0
+ */
+ String[] description() default {};
+
+ /**
+ * When <jk>true</jk> and this annotation is on a <jk>field</jk>, JavaBean accessors (<c>getX</c>/<c>setX</c>,
+ * <c>isX</c>) for the same logical property are also excluded from bean metadata.
+ *
+ * <p>
+ * Default is <jk>false</jk>: {@code @BeanIgnore} on a field only excludes the field from field-based discovery;
+ * accessors can still expose the property (for example when bean field visibility is set to {@code NONE}).
+ * Set to <jk>true</jk> to omit the property from serialization and parsing while keeping accessors for other
+ * frameworks.
+ *
+ * @return The annotation value.
+ */
+ boolean ignoreAccessors() default false;
+
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnoreAnnotation.java
similarity index 68%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java
copy to juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnoreAnnotation.java
index a78e194bf8..1cb6cb55e2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/bean/BeanIgnoreAnnotation.java
@@ -14,31 +14,33 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.annotation;
+package org.apache.juneau.commons.bean;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
-import java.lang.annotation.*;
-
import org.apache.juneau.commons.annotation.*;
/**
- * Utility classes and methods for the {@link MarshalledIgnore @MarshalledIgnore} annotation.
+ * Utility classes and methods for the {@link BeanIgnore @BeanIgnore} annotation.
+ *
+ * <p>
+ * Provides a {@link Builder} that constructs a synthetic {@link BeanIgnore @BeanIgnore} annotation instance
+ * programmatically without requiring it to be declared on a program element at compile time.
*
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanIgnore}
+ * <li class='jc'>{@link AnnotationObject}
+ * </ul>
*/
-public class MarshalledIgnoreAnnotation {
+public class BeanIgnoreAnnotation {
/**
* Prevents instantiation.
*/
- private MarshalledIgnoreAnnotation() {}
+ private BeanIgnoreAnnotation() {}
/**
* Builder class.
- *
- * <h5 class='section'>See Also:</h5><ul>
- * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
- * </ul>
*/
public static class Builder extends AnnotationObject.Builder {
@@ -49,15 +51,15 @@ public class MarshalledIgnoreAnnotation {
* Constructor.
*/
protected Builder() {
- super(MarshalledIgnore.class);
+ super(BeanIgnore.class);
}
/**
- * Instantiates a new {@link MarshalledIgnore @MarshalledIgnore} object initialized with this builder.
+ * Instantiates a new {@link BeanIgnore @BeanIgnore} object initialized with this builder.
*
- * @return A new {@link MarshalledIgnore @MarshalledIgnore} object.
+ * @return A new {@link BeanIgnore @BeanIgnore} object.
*/
- public MarshalledIgnore build() {
+ public BeanIgnore build() {
return new Object(this);
}
@@ -73,7 +75,7 @@ public class MarshalledIgnoreAnnotation {
}
/**
- * Sets {@link MarshalledIgnore#ignoreAccessors()}.
+ * Sets {@link BeanIgnore#ignoreAccessors()}.
*
* @param value The new value.
* @return This object.
@@ -88,30 +90,30 @@ public class MarshalledIgnoreAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AnnotationObject implements MarshalledIgnore {
+ private static class Object extends AnnotationObject implements BeanIgnore {
private final String[] description;
private final boolean ignoreAccessors;
- Object(MarshalledIgnoreAnnotation.Builder b) {
+ Object(BeanIgnoreAnnotation.Builder b) {
super(b);
- this.description = copyOf(b.description);
- this.ignoreAccessors = b.ignoreAccessors;
+ description = copyOf(b.description);
+ ignoreAccessors = b.ignoreAccessors;
}
- @Override /* Overridden from MarshalledIgnore */
+ @Override /* Overridden from BeanIgnore */
public String[] description() {
return description;
}
- @Override /* Overridden from MarshalledIgnore */
+ @Override /* Overridden from BeanIgnore */
public boolean ignoreAccessors() {
return ignoreAccessors;
}
}
/** Default value */
- public static final MarshalledIgnore DEFAULT = create().build();
+ public static final BeanIgnore DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -121,4 +123,4 @@ public class MarshalledIgnoreAnnotation {
public static Builder create() {
return new Builder();
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaRanges.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaRanges.java
index f6647abdf5..30da447808 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaRanges.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaRanges.java
@@ -23,7 +23,7 @@ import static org.apache.juneau.commons.utils.Utils.*;
import java.util.*;
import java.util.function.*;
-import org.apache.juneau.commons.annotation.MarshalledIgnore;
+import org.apache.juneau.commons.bean.BeanIgnore;
import org.apache.juneau.commons.collections.*;
/**
@@ -53,7 +53,7 @@ import org.apache.juneau.commons.collections.*;
* <li class='extlink'><a class="doclink" href="https://www.w3.org/Protocols/rfc2616/rfc2616.html">Hypertext Transfer Protocol -- HTTP/1.1</a>
* </ul>
*/
-@MarshalledIgnore
+@BeanIgnore
public class MediaRanges {
/** Represents an empty media ranges object. */
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaType.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaType.java
index 9f5c5c5b61..fa681d9bc7 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaType.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/MediaType.java
@@ -23,7 +23,7 @@ import static org.apache.juneau.commons.utils.Utils.*;
import java.util.*;
import java.util.function.*;
-import org.apache.juneau.commons.annotation.MarshalledIgnore;
+import org.apache.juneau.commons.bean.BeanIgnore;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.commons.utils.*;
@@ -36,7 +36,7 @@ import org.apache.juneau.commons.utils.*;
* <li class='extlink'><a class="doclink" href="https://www.w3.org/Protocols/rfc2616/rfc2616.html">Hypertext Transfer Protocol -- HTTP/1.1</a>
* </ul>
*/
-@MarshalledIgnore
+@BeanIgnore
@SuppressWarnings({
"java:S1700", // Field 'mediaType' intentionally shares the class name; it holds the canonical string form of this MediaType instance
"java:S1845" // Field name intentionally matches method name
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRange.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRange.java
index a1cc5d8ba3..4b5fcf607f 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRange.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRange.java
@@ -23,7 +23,7 @@ import static org.apache.juneau.commons.utils.Utils.*;
import java.util.*;
import java.util.function.*;
-import org.apache.juneau.commons.annotation.MarshalledIgnore;
+import org.apache.juneau.commons.bean.BeanIgnore;
/**
* Represents a single value in a comma-delimited header value that optionally contains a quality metric for
@@ -42,7 +42,7 @@ import org.apache.juneau.commons.annotation.MarshalledIgnore;
* </ul>
*/
-@MarshalledIgnore
+@BeanIgnore
public class StringRange {
private static HeaderElement parse(String value) {
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRanges.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRanges.java
index 8e8b0e0d8c..7468440706 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRanges.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/http/StringRanges.java
@@ -23,7 +23,7 @@ import static org.apache.juneau.commons.utils.Utils.*;
import java.util.*;
import java.util.function.*;
-import org.apache.juneau.commons.annotation.MarshalledIgnore;
+import org.apache.juneau.commons.bean.BeanIgnore;
import org.apache.juneau.commons.collections.*;
/**
@@ -59,7 +59,7 @@ import org.apache.juneau.commons.collections.*;
* <li class='extlink'><a class="doclink" href="https://www.w3.org/Protocols/rfc2616/rfc2616.html">Hypertext Transfer Protocol -- HTTP/1.1</a>
* </ul>
*/
-@MarshalledIgnore
+@BeanIgnore
public class StringRanges {
/** Represents an empty string ranges object. */
diff --git a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/inject/BeanInstantiator.java b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/inject/BeanInstantiator.java
index 85d903f269..a95213ca8d 100644
--- a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/inject/BeanInstantiator.java
+++ b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/inject/BeanInstantiator.java
@@ -174,7 +174,7 @@ import org.apache.juneau.commons.reflect.*;
* <li class='note'>All constructors and methods except {@link Optional} and {@link List} parameters
* must have beans available in the store.
* <li class='note'>If multiple constructors/methods are found, the one with the most matching parameters is used.
- * <li class='note'>Deprecated and <a class="doclink" href="https://juneau.apache.org/site/apidocs/org/apache/juneau/annotation/MarshalledIgnore.html">@MarshalledIgnore</a>-annotated methods/constructors are ignored.
+ * <li class='note'>Deprecated and <a class="doclink" href="https://juneau.apache.org/site/apidocs/org/apache/juneau/commons/bean/BeanIgnore.html">@BeanIgnore</a>-annotated methods/constructors are ignored.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
index 5e73b2ae68..fc12d17631 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
@@ -225,8 +225,8 @@ public class BeanMeta<T> {
if (bc.isBeansRequireSerializable() && ! cm.isAssignableTo(Serializable.class) && ! ap.has(Marshalled.class, cm) && ! ap.has(org.apache.juneau.commons.bean.BeanType.class, cm))
return notABean("Class is not serializable");
- if (ap.has(MarshalledIgnore.class, cm) || ap.has(org.apache.juneau.commons.annotation.MarshalledIgnore.class, cm))
- return notABean("Class is annotated with @MarshalledIgnore");
+ if (ap.has(BeanIgnore.class, cm))
+ return notABean("Class is annotated with @BeanIgnore");
if ((! bc.getBeanClassVisibility().isVisible(cm.getModifiers()) || cm.isAnonymousClass()) && ! ap.has(Marshalled.class, cm) && ! ap.has(org.apache.juneau.commons.bean.BeanType.class, cm))
return notABean("Class is not public");
@@ -1099,7 +1099,7 @@ public class BeanMeta<T> {
* <li>Not static
* <li>Not transient (unless transient fields are not ignored)
* <li>Not annotated with {@link Transient @Transient} (unless transient fields are not ignored)
- * <li>Not annotated with {@link MarshalledIgnore @MarshalledIgnore}
+ * <li>Not annotated with {@link BeanIgnore @BeanIgnore}
* <li>Visible according to the specified visibility level, or annotated with {@link BeanProp @BeanProp}
* </ul>
*
@@ -1119,7 +1119,7 @@ public class BeanMeta<T> {
.filter(x -> x.isNotStatic()
&& (x.isNotTransient() || noIgnoreTransients)
&& (! x.hasAnnotation(Transient.class) || noIgnoreTransients)
- && ! ap.has(MarshalledIgnore.class, x)
+ && ! ap.has(BeanIgnore.class, x)
&& (v.isVisible(x.inner()) || ap.has(BeanProp.class, x)
|| (isRecord && recordComponentNames.contains(x.getName()))))
.toList();
@@ -1156,7 +1156,7 @@ public class BeanMeta<T> {
* <ul>
* <li>Not static, not bridge methods
* <li>Parameter count ≤ 2
- * <li>Not annotated with {@link MarshalledIgnore @MarshalledIgnore}
+ * <li>Not annotated with {@link BeanIgnore @BeanIgnore}
* <li>Not annotated with {@link Transient @Transient}
* <li>Visible according to the specified visibility level, or annotated with {@link BeanProp @BeanProp} or {@link Name @Name}
* </ul>
@@ -1179,7 +1179,7 @@ public class BeanMeta<T> {
var ci = classMeta;
var v = marshallingContext.getBeanMethodVisibility();
var pn = opt(beanFilter).map(x -> x.getPropertyNamer()).orElse(marshallingContext.getPropertyNamer());
- var suppressedFromMarshalledIgnoredFields = findSuppressedPropertyNamesFromIgnoredFields(pn);
+ var suppressedFromBeanIgnoredFields = findSuppressedPropertyNamesFromIgnoredFields(pn);
classHierarchy.get().stream().forEach(c2 -> {
for (var m : c2.getDeclaredMethods()) {
@@ -1188,7 +1188,7 @@ public class BeanMeta<T> {
var names = ap.find(Name.class, m).stream().map(AnnotationInfo::inner).toList();
// Skip static, bridge, or methods with >2 params; skip if ignored, transient, or not visible
if (m.isStatic() || m.isBridge() || m.getParameterCount() > 2
- || mm.stream().anyMatch(m2 -> ap.has(MarshalledIgnore.class, m2, SELF))
+ || mm.stream().anyMatch(m2 -> ap.has(BeanIgnore.class, m2, SELF))
|| mm.stream().anyMatch(m2 -> ap.find(Transient.class, m2, SELF).stream().map(x -> x.inner().value()).findFirst().orElse(false))
|| ! (m.isVisible(v) || ne(beanps) || ne(names)))
continue;
@@ -1271,7 +1271,7 @@ public class BeanMeta<T> {
if (methodType != UNKNOWN) {
if (nn(bpName) && ! bpName.isEmpty())
n = bpName;
- if (nn(n) && ! suppressedFromMarshalledIgnoredFields.contains(n))
+ if (nn(n) && ! suppressedFromBeanIgnoredFields.contains(n))
l.add(new BeanMethod(n, methodType, m.inner()));
}
}
@@ -1446,18 +1446,18 @@ public class BeanMeta<T> {
/*
* Merges standard JavaBeans {@link BeanInfo} property descriptors into {@code normalProps}, skipping the class
- * pseudo-property and logical names suppressed when {@link MarshalledIgnore#ignoreAccessors()} is <jk>true</jk> on a field.
+ * pseudo-property and logical names suppressed when {@link BeanIgnore#ignoreAccessors()} is <jk>true</jk> on a field.
*/
@SuppressWarnings({
- "java:S135" // Two continues: skip class pseudo-property and names suppressed via @MarshalledIgnore(ignoreAccessors)
+ "java:S135" // Two continues: skip class pseudo-property and names suppressed via @BeanIgnore(ignoreAccessors)
})
private void mergeJavaBeanPropertyDescriptorsIntoNormalProps(BeanInfo bi, Map<String,BeanPropertyMeta.Builder> normalProps,
PropertyNamer propertyNamer) {
- var suppressedFromMarshalledIgnoredFields = findSuppressedPropertyNamesFromIgnoredFields(propertyNamer);
+ var suppressedFromBeanIgnoredFields = findSuppressedPropertyNamesFromIgnoredFields(propertyNamer);
for (var pd : bi.getPropertyDescriptors()) {
if (PROP_class.equals(pd.getName()))
continue;
- if (suppressedFromMarshalledIgnoredFields.contains(pd.getName()))
+ if (suppressedFromBeanIgnoredFields.contains(pd.getName()))
continue;
var builder = normalProps.computeIfAbsent(pd.getName(), n -> BeanPropertyMeta.builder(this, n));
if (pd.getReadMethod() != null)
@@ -1469,24 +1469,24 @@ public class BeanMeta<T> {
/*
* Property names suppressed from getter/setter discovery because a non-static field with that logical name is
- * annotated with {@link MarshalledIgnore @MarshalledIgnore} and {@link MarshalledIgnore#ignoreAccessors()} is <jk>true</jk>.
+ * annotated with {@link BeanIgnore @BeanIgnore} and {@link BeanIgnore#ignoreAccessors()} is <jk>true</jk>.
*
* <p>
- * When {@link MarshalledIgnore#ignoreAccessors()} is <jk>false</jk> (the default), ignored fields do not suppress
- * JavaBean accessors so patterns such as {@code @MarshalledIgnore} on a private field with a public {@code getX()} still
+ * When {@link BeanIgnore#ignoreAccessors()} is <jk>false</jk> (the default), ignored fields do not suppress
+ * JavaBean accessors so patterns such as {@code @BeanIgnore} on a private field with a public {@code getX()} still
* expose {@code x} when field visibility excludes the field.
*/
@SuppressWarnings({
- "java:S135" // Two continues in inner loop: skip fields without @MarshalledIgnore or without ignoreAccessors
+ "java:S135" // Two continues in inner loop: skip fields without @BeanIgnore or without ignoreAccessors
})
private Set<String> findSuppressedPropertyNamesFromIgnoredFields(PropertyNamer propertyNamer) {
var s = new HashSet<String>();
var ap = marshallingContext.getAnnotationProvider();
for (var c2 : classHierarchy.get()) {
for (var x : c2.getDeclaredFields()) {
- if (! x.isNotStatic() || ! ap.has(MarshalledIgnore.class, x))
+ if (! x.isNotStatic() || ! ap.has(BeanIgnore.class, x))
continue;
- if (! fieldMarshalledIgnoreIgnoresAccessors(x))
+ if (! fieldBeanIgnoreIgnoresAccessors(x))
continue;
var name = ap.find(x).stream()
.filter(x2 -> x2.isType(BeanProp.class) || x2.isType(Name.class))
@@ -1502,8 +1502,8 @@ public class BeanMeta<T> {
return s;
}
- private static boolean fieldMarshalledIgnoreIgnoresAccessors(FieldInfo x) {
- for (var bi : x.inner().getAnnotationsByType(MarshalledIgnore.class))
+ private static boolean fieldBeanIgnoreIgnoresAccessors(FieldInfo x) {
+ for (var bi : x.inner().getAnnotationsByType(BeanIgnore.class))
if (bi.ignoreAccessors())
return true;
return false;
@@ -1524,7 +1524,7 @@ public class BeanMeta<T> {
* <li>Is not static
* <li>Is not transient (unless transient fields are not ignored)
* <li>Is not annotated with {@link Transient @Transient} (unless transient fields are not ignored)
- * <li>Is not annotated with {@link MarshalledIgnore @MarshalledIgnore}
+ * <li>Is not annotated with {@link BeanIgnore @BeanIgnore}
* </ul>
*
* <p>
@@ -1546,7 +1546,7 @@ public class BeanMeta<T> {
x -> x.isNotStatic()
&& (x.isNotTransient() || noIgnoreTransients)
&& (! x.hasAnnotation(Transient.class) || noIgnoreTransients)
- && ! ap.has(MarshalledIgnore.class, x)
+ && ! ap.has(BeanIgnore.class, x)
&& x.hasName(name)
).stream())
.findFirst();
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index 87f4496858..8093a3e2bd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -208,6 +208,7 @@ public abstract class Context {
* <ul class='javatreec'>
* <li class='ja'>{@link MarshalledAnnotation}
* <li class='ja'>{@link org.apache.juneau.commons.bean.BeanCtorAnnotation}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanIgnoreAnnotation}
* <li class='ja'>{@link MarshalledIgnoreAnnotation}
* <li class='ja'>{@link org.apache.juneau.commons.bean.BeanPropAnnotation}
* <li class='ja'>{@link MarshalledPropAnnotation}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
index a30c4f9b84..0573beb4c7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContext.java
@@ -436,7 +436,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a non-public bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -485,7 +485,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean constructor to ignore it.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean constructor to ignore it.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -681,7 +681,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public field.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -831,7 +831,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public method.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1592,7 +1592,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1649,7 +1649,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1704,7 +1704,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can be used on the getter to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters to ignore them as bean properties.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on getters to ignore them as bean properties.
* </ul>
*
* @return This object.
@@ -1913,7 +1913,7 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters and fields to ignore them.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on getters and fields to ignore them.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -2802,11 +2802,11 @@ public class MarshallingContext extends Context implements ConversionFinder {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on classes to prevent them from being recognized as beans.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on classes to prevent them from being recognized as beans.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.annotation.MarshalledIgnore}
+ * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanIgnore}
* <li class='ja'>{@link org.apache.juneau.annotation.MarshalledConfig#notBeanClasses()}
* </ul>
*
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
index f0f0ff8590..3cb72fdd8f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
@@ -167,7 +167,7 @@ public abstract class MarshallingContextable extends Context {
* <h5 class='section'>Notes:</h5>
* <ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a non-public bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5>
@@ -217,7 +217,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean constructor to ignore it.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean constructor to ignore it.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -427,7 +427,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public field.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -567,7 +567,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public method.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1318,7 +1318,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1366,7 +1366,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link Bean @Marshalled} annotation can be used on a bean class to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on a class to ignore it as a bean.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a class to ignore it as a bean.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1412,7 +1412,7 @@ public abstract class MarshallingContextable extends Context {
*
* <h5 class='section'>Notes:</h5><ul>
* <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can be used on the getter to override this setting.
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters to ignore them as bean properties.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on getters to ignore them as bean properties.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1564,7 +1564,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on getters and fields to ignore them.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on getters and fields to ignore them.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -2314,11 +2314,11 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link MarshalledIgnore @MarshalledIgnore} annotation can also be used on classes to prevent them from being recognized as beans.
+ * <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on classes to prevent them from being recognized as beans.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link MarshalledIgnore}
+ * <li class='ja'>{@link BeanIgnore}
* <li class='ja'>{@link MarshalledConfig#notBeanClasses()}
* <li class='jf'>{@link MarshallingContext.Builder#notBeanClasses()}
* </ul>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApply.java
new file mode 100644
index 0000000000..8a4aab6b0b
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApply.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.annotation;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.commons.bean.*;
+
+/**
+ * Dynamically applies a {@link BeanIgnore @BeanIgnore} annotation to specified classes, methods, fields, or constructors.
+ *
+ * <p>
+ * This annotation separates the <b>targeting</b> concern ({@link #on()}/{@link #onClass()}) from the
+ * <b>content</b> concern ({@link #value()}), enabling {@link BeanIgnore @BeanIgnore} to be a pure data annotation
+ * without marshall-specific application machinery.
+ *
+ * <h5 class='section'>Example:</h5>
+ * <p class='bjava'>
+ * <ja>@BeanIgnoreApply</ja>(on=<js>"com.example.Foo.bar"</js>, value=<ja>@BeanIgnore</ja>())
+ * <jk>public class</jk> MyConfig {}
+ * </p>
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ */
+@Documented
+@Target({ TYPE, METHOD })
+@Retention(RUNTIME)
+@Repeatable(BeanIgnoreApply.Array.class)
+@ContextApply(BeanIgnoreApplyAnnotation.Applier.class)
+public @interface BeanIgnoreApply {
+
+ /**
+ * The {@link BeanIgnore @BeanIgnore} annotation to apply.
+ *
+ * @return The annotation value.
+ */
+ BeanIgnore value();
+
+ /**
+ * Dynamically apply this annotation to the specified classes/methods/fields/constructors.
+ *
+ * <p>
+ * Identifies the targets this annotation applies to using fully-qualified names.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ String[] on() default {};
+
+ /**
+ * Dynamically apply this annotation to the specified classes.
+ *
+ * <p>
+ * Identical to {@link #on()} except allows you to specify class objects instead of strings.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/DynamicallyAppliedAnnotations">Dynamically Applied Annotations</a>
+ * </ul>
+ *
+ * @return The annotation value.
+ */
+ Class<?>[] onClass() default {};
+
+ /**
+ * A collection of {@link BeanIgnoreApply @BeanIgnoreApply annotations}.
+ */
+ @Documented
+ @Target({ TYPE, METHOD })
+ @Retention(RUNTIME)
+ public @interface Array {
+
+ /**
+ * The child annotations.
+ *
+ * @return The annotation value.
+ */
+ BeanIgnoreApply[] value();
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApplyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApplyAnnotation.java
new file mode 100644
index 0000000000..772a8db485
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/BeanIgnoreApplyAnnotation.java
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juneau.annotation;
+
+import static org.apache.juneau.commons.utils.CollectionUtils.*;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.bean.*;
+import org.apache.juneau.commons.reflect.*;
+import org.apache.juneau.svl.*;
+
+/**
+ * Utility classes and methods for the {@link BeanIgnoreApply @BeanIgnoreApply} annotation.
+ *
+ */
+public class BeanIgnoreApplyAnnotation {
+
+ /**
+ * Prevents instantiation.
+ */
+ private BeanIgnoreApplyAnnotation() {}
+
+ /**
+ * Applies targeted {@link BeanIgnoreApply} annotations to a {@link org.apache.juneau.Context.Builder}.
+ *
+ * <p>
+ * Passes the {@link BeanIgnoreApply @BeanIgnoreApply} annotation through to the builder's annotation list.
+ * The {@link org.apache.juneau.commons.reflect.AnnotationProvider.Builder#addRuntimeAnnotations(java.util.List)}
+ * method handles unwrapping the nested {@link BeanIgnore @BeanIgnore} from {@link BeanIgnoreApply#value()} and
+ * registering it under the targets specified by {@link BeanIgnoreApply#on()} and {@link BeanIgnoreApply#onClass()}.
+ */
+ public static class Applier extends AnnotationApplier<BeanIgnoreApply,Context.Builder> {
+
+ /**
+ * Constructor.
+ *
+ * @param vr The resolver for resolving values in annotations.
+ */
+ public Applier(VarResolverSession vr) {
+ super(BeanIgnoreApply.class, Context.Builder.class, vr);
+ }
+
+ @Override
+ public void apply(AnnotationInfo<BeanIgnoreApply> ai, Context.Builder b) {
+ BeanIgnoreApply a = ai.inner();
+ if (isEmptyArray(a.on()) && isEmptyArray(a.onClass()))
+ return;
+ b.annotations(a);
+ }
+ }
+
+ /**
+ * Builder class.
+ *
+ * <h5 class='section'>See Also:</h5><ul>
+ * <li class='jm'>{@link org.apache.juneau.MarshallingContext.Builder#annotations(Annotation...)}
+ * </ul>
+ */
+ public static class Builder extends AppliedAnnotationObject.BuilderTMF {
+
+ BeanIgnore value = BeanIgnoreAnnotation.DEFAULT;
+
+ /**
+ * Constructor.
+ */
+ protected Builder() {
+ super(BeanIgnoreApply.class);
+ }
+
+ /**
+ * Sets the {@link BeanIgnoreApply#value()} property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object.
+ */
+ public Builder value(BeanIgnore value) {
+ this.value = value;
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.Builder */
+ public Builder on(String...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder on(Class<?>...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedOnClassAnnotationObject.Builder */
+ public Builder onClass(Class<?>...value) {
+ super.onClass(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderM */
+ public Builder on(Method...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderMF */
+ public Builder on(Field...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder on(ClassInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderT */
+ public Builder onClass(ClassInfo...value) {
+ super.onClass(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderTMF */
+ public Builder on(FieldInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ @Override /* Overridden from AppliedAnnotationObject.BuilderTMF */
+ public Builder on(MethodInfo...value) {
+ super.on(value);
+ return this;
+ }
+
+ /**
+ * Instantiates a new {@link BeanIgnoreApply @BeanIgnoreApply} object initialized with this builder.
+ *
+ * @return A new {@link BeanIgnoreApply} object.
+ */
+ public BeanIgnoreApply build() {
+ return new Object(this);
+ }
+ }
+
+ @SuppressWarnings({
+ "java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
+ })
+ private static class Object extends AppliedOnClassAnnotationObject implements BeanIgnoreApply {
+
+ private final BeanIgnore value;
+
+ Object(BeanIgnoreApplyAnnotation.Builder b) {
+ super(b);
+ value = b.value;
+ }
+
+ @Override /* Overridden from BeanIgnoreApply */
+ public BeanIgnore value() {
+ return value;
+ }
+
+ @Override /* Overridden from BeanIgnoreApply */
+ public String[] on() {
+ return super.on();
+ }
+
+ @Override /* Overridden from BeanIgnoreApply */
+ public Class<?>[] onClass() {
+ return super.onClass();
+ }
+ }
+
+ /** Default value */
+ public static final BeanIgnoreApply DEFAULT = create().build();
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @return A new builder object.
+ */
+ public static Builder create() {
+ return new Builder();
+ }
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @param on The targets this annotation applies to.
+ * @return A new builder object.
+ */
+ public static Builder create(Class<?>...on) {
+ return create().on(on);
+ }
+
+ /**
+ * Instantiates a new builder for this class.
+ *
+ * @param on The targets this annotation applies to.
+ * @return A new builder object.
+ */
+ public static Builder create(String...on) {
+ return create().on(on);
+ }
+
+ /**
+ * Returns <jk>true</jk> if the specified annotation contains all default values.
+ *
+ * @param a The annotation to check.
+ * @return <jk>true</jk> if the specified annotation contains all default values.
+ */
+ public static boolean empty(BeanIgnoreApply a) {
+ return a == null || DEFAULT.equals(a);
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnore.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnore.java
index 0b46d43316..3418773849 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnore.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnore.java
@@ -21,40 +21,40 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
-import org.apache.juneau.commons.reflect.Visibility;
+import org.apache.juneau.commons.bean.*;
/**
- * Ignore classes, fields, methods, and constructors from being interpreted as bean components, or skip a type
- * entirely during serialization and parsing.
+ * Skip a type entirely during marshalling.
*
* <p>
- * Behavior depends on the target:
- * <ul>
- * <li><b>TYPE (class)</b> — Skip this type entirely: serializers output {@code null} and parsers return
- * {@code null}. Previously {@code @BeanIgnore} on a type meant "force non-bean, fall through to
- * {@code toString()}". The "use toString" case is now handled by
- * {@link Marshalled @Marshalled}{@code (as=STRING)}.
- * <li><b>FIELD</b> — Exclude the field from bean property discovery. Use {@link #ignoreAccessors()} to also
- * suppress matching JavaBean accessors.
- * <li><b>METHOD</b> — Force getters/setters to be ignored.
- * <li><b>CONSTRUCTOR</b> — Exclude the constructor from constructor detection.
- * <li><ja>@Rest</ja>-annotated classes and <ja>@RestOp</ja>-annotated methods when used with
- * {@link MarshalledIgnoreApply @MarshalledIgnoreApply}.
- * </ul>
+ * Serializers output {@code null} for instances of the annotated type and parsers return {@code null}
+ * when asked to instantiate it. This is a marshalling-layer concern: the wire format renders the
+ * value as {@code null} regardless of what (if anything) the bean-modeling layer would do with the
+ * type.
+ *
+ * <p>
+ * Bean-modeling decisions are controlled by the sibling annotation
+ * {@link BeanIgnore @BeanIgnore} (in <c>juneau-commons</c>), which is responsible for excluding
+ * classes from bean detection ("this isn't a bean — fall through to swap/{@code @Marshalled(as=STRING)}/etc.")
+ * and for excluding fields, methods, and constructors from bean property/constructor detection.
*
- * <h5 class='section'>Java Records:</h5>
* <p>
- * Ignoring individual record components is not supported during parsing.
- * Because records are immutable, all components must be provided to the canonical constructor.
- * Applying this annotation to a record component's accessor method or field will exclude it from serialization
- * output, but the parser will be unable to instantiate the record if the component value is missing from the input.
+ * The two annotations are independent and may be combined:
+ * <ul>
+ * <li>{@code @MarshalledIgnore} alone — the class still participates in bean detection (it may be
+ * treated as a bean by the modeling layer) but the marshaller emits {@code null}.
+ * <li>{@code @BeanIgnore} alone — the class is not a bean for modeling purposes, but the marshaller
+ * still tries to render it (typically via {@code toString()} or an installed swap).
+ * <li>Both — the class is not a bean and the marshaller emits {@code null}.
+ * </ul>
*
* <h5 class='section'>See Also:</h5><ul>
+ * <li class='ja'>{@link BeanIgnore}
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MarshalledIgnoreAnnotation">@MarshalledIgnore Annotation</a>
* </ul>
*/
@Documented
-@Target({ FIELD, METHOD, TYPE, CONSTRUCTOR })
+@Target({ TYPE })
@Retention(RUNTIME)
@Inherited
public @interface MarshalledIgnore {
@@ -67,17 +67,4 @@ public @interface MarshalledIgnore {
*/
String[] description() default {};
- /**
- * When <jk>true</jk> and this annotation is on a <jk>field</jk>, JavaBean accessors (<c>getX</c>/<c>setX</c>,
- * <c>isX</c>) for the same logical property are also excluded from bean metadata.
- *
- * <p>
- * Default is <jk>false</jk>: {@code @MarshalledIgnore} on a field only excludes the field from field-based discovery;
- * accessors can still expose the property (for example when {@link org.apache.juneau.MarshallingContext.Builder#beanFieldVisibility(Visibility) beanFieldVisibility} is {@link Visibility#NONE NONE}). Set to <jk>true</jk> to
- * omit the property from serialization and parsing while keeping accessors for other frameworks.
- *
- * @return The annotation value.
- */
- boolean ignoreAccessors() default false;
-
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java
index a78e194bf8..51e4252938 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation.java
@@ -43,7 +43,6 @@ public class MarshalledIgnoreAnnotation {
public static class Builder extends AnnotationObject.Builder {
private String[] description = {};
- private boolean ignoreAccessors;
/**
* Constructor.
@@ -72,17 +71,6 @@ public class MarshalledIgnoreAnnotation {
return this;
}
- /**
- * Sets {@link MarshalledIgnore#ignoreAccessors()}.
- *
- * @param value The new value.
- * @return This object.
- */
- public Builder ignoreAccessors(boolean value) {
- ignoreAccessors = value;
- return this;
- }
-
}
@SuppressWarnings({
@@ -91,23 +79,16 @@ public class MarshalledIgnoreAnnotation {
private static class Object extends AnnotationObject implements MarshalledIgnore {
private final String[] description;
- private final boolean ignoreAccessors;
Object(MarshalledIgnoreAnnotation.Builder b) {
super(b);
this.description = copyOf(b.description);
- this.ignoreAccessors = b.ignoreAccessors;
}
@Override /* Overridden from MarshalledIgnore */
public String[] description() {
return description;
}
-
- @Override /* Overridden from MarshalledIgnore */
- public boolean ignoreAccessors() {
- return ignoreAccessors;
- }
}
/** Default value */
@@ -121,4 +102,4 @@ public class MarshalledIgnoreAnnotation {
public static Builder create() {
return new Builder();
}
-}
\ No newline at end of file
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
index 26787fe966..688b34b26d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -65,14 +66,14 @@ import org.apache.juneau.serializer.*;
* <p>
* Classes are ignored if any of the following are true:
* <ul>
- * <li>Classes annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Classes annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Non-static member classes.
* </ul>
*
* <p>
* Members/constructors are ignored if any of the following are true:
* <ul>
- * <li>Members/constructors annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Members/constructors annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Deprecated members/constructors.
* </ul>
*
@@ -133,7 +134,7 @@ public class AutoListSwap<T> extends ObjectSwap<T,List<?>> {
&& mi.hasAnyName(SWAP_METHOD_NAMES)
&& mi.hasReturnTypeParent(List.class)
&& mi.hasParameterTypesLenient(MarshallingSession.class)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
@@ -143,7 +144,7 @@ public class AutoListSwap<T> extends ObjectSwap<T,List<?>> {
cs.isNotDeprecated()
&& cs.isVisible(bc.getBeanConstructorVisibility())
&& cs.hasParameterTypeParents(rt)
- && ! bc.getAnnotationProvider().has(MarshalledIgnore.class, cs);
+ && ! bc.getAnnotationProvider().has(BeanIgnore.class, cs);
// @formatter:on
}
@@ -156,12 +157,12 @@ public class AutoListSwap<T> extends ObjectSwap<T,List<?>> {
&& mi.hasAnyName(UNSWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class, rt.inner())
&& mi.hasReturnTypeParent(ci)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
private static boolean shouldIgnore(MarshallingContext bc, ClassInfo ci) {
- return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(MarshalledIgnore.class, ci);
+ return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(BeanIgnore.class, ci);
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
index 4141845244..79d7656550 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -65,14 +66,14 @@ import org.apache.juneau.serializer.*;
* <p>
* Classes are ignored if any of the following are true:
* <ul>
- * <li>Classes annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Classes annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Non-static member classes.
* </ul>
*
* <p>
* Members/constructors are ignored if any of the following are true:
* <ul>
- * <li>Members/constructors annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Members/constructors annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Deprecated members/constructors.
* </ul>
*
@@ -133,7 +134,7 @@ public class AutoMapSwap<T> extends ObjectSwap<T,Map<?,?>> {
&& mi.hasAnyName(SWAP_METHOD_NAMES)
&& mi.hasReturnTypeParent(Map.class)
&& mi.hasParameterTypesLenient(MarshallingSession.class)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
@@ -143,7 +144,7 @@ public class AutoMapSwap<T> extends ObjectSwap<T,Map<?,?>> {
cs.isNotDeprecated()
&& cs.isVisible(bc.getBeanConstructorVisibility())
&& cs.hasParameterTypeParents(rt)
- && ! bc.getAnnotationProvider().has(MarshalledIgnore.class, cs);
+ && ! bc.getAnnotationProvider().has(BeanIgnore.class, cs);
// @formatter:on
}
@@ -156,12 +157,12 @@ public class AutoMapSwap<T> extends ObjectSwap<T,Map<?,?>> {
&& mi.hasAnyName(UNSWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class, rt.inner())
&& mi.hasReturnTypeParent(ci)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
private static boolean shouldIgnore(MarshallingContext bc, ClassInfo ci) {
- return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(MarshalledIgnore.class, ci);
+ return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(BeanIgnore.class, ci);
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
index 0a67d559d5..f200238e31 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
@@ -88,14 +89,14 @@ import org.apache.juneau.serializer.*;
* <p>
* Classes are ignored if any of the following are true:
* <ul>
- * <li>Classes annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Classes annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Non-static member classes.
* </ul>
*
* <p>
* Members/constructors are ignored if any of the following are true:
* <ul>
- * <li>Members/constructors annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Members/constructors annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Deprecated members/constructors.
* </ul>
*
@@ -159,7 +160,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> {
&& (rt.isAssignableTo(Number.class) || (rt.isPrimitive() && rt.isAny(int.class, short.class, long.class, float.class, double.class, byte.class)))
&& mi.hasAnyName(SWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
@@ -169,7 +170,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> {
cs.isNotDeprecated()
&& cs.isVisible(bc.getBeanConstructorVisibility())
&& cs.hasParameterTypeParents(rt)
- && ! bc.getAnnotationProvider().has(MarshalledIgnore.class, cs);
+ && ! bc.getAnnotationProvider().has(BeanIgnore.class, cs);
// @formatter:on
}
@@ -182,7 +183,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> {
&& mi.hasAnyName(UNSWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class, rt.inner())
&& mi.hasReturnTypeParent(ci)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
@@ -192,7 +193,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> {
ci.isNonStaticMemberClass()
|| ci.isPrimitive()
|| ci.isAssignableTo(Number.class)
- || bc.getAnnotationProvider().has(MarshalledIgnore.class, ci);
+ || bc.getAnnotationProvider().has(BeanIgnore.class, ci);
// @formatter:on
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
index a11d580753..fd5365409f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -67,14 +68,14 @@ import org.apache.juneau.serializer.*;
* <p>
* Classes are ignored if any of the following are true:
* <ul>
- * <li>Classes annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Classes annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Non-static member classes.
* </ul>
*
* <p>
* Members/constructors are ignored if any of the following are true:
* <ul>
- * <li>Members/constructors annotated with {@link MarshalledIgnore @MarshalledIgnore}.
+ * <li>Members/constructors annotated with {@link BeanIgnore @BeanIgnore}.
* <li>Deprecated members/constructors.
* </ul>
*
@@ -134,7 +135,7 @@ public class AutoObjectSwap<T> extends ObjectSwap<T,Object> {
&& mi.isVisible(bc.getBeanMethodVisibility())
&& mi.hasAnyName(SWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
@@ -144,7 +145,7 @@ public class AutoObjectSwap<T> extends ObjectSwap<T,Object> {
cs.isNotDeprecated()
&& cs.isVisible(bc.getBeanConstructorVisibility())
&& cs.hasParameterTypeParents(rt)
- && ! bc.getAnnotationProvider().has(MarshalledIgnore.class, cs);
+ && ! bc.getAnnotationProvider().has(BeanIgnore.class, cs);
// @formatter:on
}
@@ -157,12 +158,12 @@ public class AutoObjectSwap<T> extends ObjectSwap<T,Object> {
&& mi.hasAnyName(UNSWAP_METHOD_NAMES)
&& mi.hasParameterTypesLenient(MarshallingSession.class, rt.inner())
&& mi.hasReturnTypeParent(ci)
- && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(MarshalledIgnore.class, m2));
+ && mi.getMatchingMethods().stream().noneMatch(m2 -> bc.getAnnotationProvider().has(BeanIgnore.class, m2));
// @formatter:on
}
private static boolean shouldIgnore(MarshallingContext bc, ClassInfo ci) {
- return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(MarshalledIgnore.class, ci);
+ return ci.isNonStaticMemberClass() || bc.getAnnotationProvider().has(BeanIgnore.class, ci);
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
index 9ec64de53a..6ec7e13da0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
@@ -24,6 +24,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -59,7 +60,7 @@ public class SurrogateSwap<T,F> extends ObjectSwap<T,F> {
public static List<SurrogateSwap<?,?>> findObjectSwaps(Class<?> c, MarshallingContext bc) {
List<SurrogateSwap<?,?>> l = new LinkedList<>();
var ci = info(c);
- ci.getPublicConstructors().stream().filter(x -> ! bc.getAnnotationProvider().has(MarshalledIgnore.class, x) && x.hasNumParameters(1) && x.isPublic()).forEach(x -> {
+ ci.getPublicConstructors().stream().filter(x -> ! bc.getAnnotationProvider().has(BeanIgnore.class, x) && x.hasNumParameters(1) && x.isPublic()).forEach(x -> {
var pt = x.getParameter(0).getParameterType().inner();
if (! pt.equals(c.getDeclaringClass())) {
// Find the unswap method if there is one.
diff --git a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/entity/BasicHttpEntity.java b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/entity/BasicHttpEntity.java
index 3573f1db59..2e23867ed1 100644
--- a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/entity/BasicHttpEntity.java
+++ b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/entity/BasicHttpEntity.java
@@ -25,8 +25,8 @@ import java.nio.charset.*;
import java.util.function.*;
import org.apache.http.*;
-import org.apache.juneau.annotation.*;
import org.apache.juneau.assertions.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.http.header.*;
/**
@@ -48,7 +48,7 @@ import org.apache.juneau.http.header.*;
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauRestCommonBasics">juneau-rest-common Basics</a>
* </ul>
*/
-@MarshalledIgnore
+@BeanIgnore
@SuppressWarnings({
"resource", // Content may be streams; value equality not practical
diff --git a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/resource/BasicResource.java b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/resource/BasicResource.java
index 3336f35c47..cd3ff59474 100644
--- a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/resource/BasicResource.java
+++ b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/resource/BasicResource.java
@@ -23,8 +23,8 @@ import java.io.*;
import java.util.function.*;
import org.apache.http.*;
-import org.apache.juneau.annotation.*;
import org.apache.juneau.assertions.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.http.entity.*;
import org.apache.juneau.http.header.*;
@@ -47,7 +47,7 @@ import org.apache.juneau.http.header.*;
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauRestCommonBasics">juneau-rest-common Basics</a>
* </ul>
*/
-@MarshalledIgnore /* Use toString() to serialize */
+@BeanIgnore /* Use toString() to serialize */
@SuppressWarnings({
"resource", // Depends on entity (streams); value equality not practical
"java:S1206", // equals/hashCode not overridden; value equality not practical for this class
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
index 6650a346e0..28c8f62b55 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanMap_Test.java
@@ -1598,13 +1598,13 @@ class BeanMap_Test extends TestBase {
public void setA(String v) { a = v; }
public String b;
- @MarshalledIgnore public String getB() { return b; }
+ @BeanIgnore public String getB() { return b; }
public void setB(String v) { this.b = v+"(setter)"; }
- @MarshalledIgnore public String c;
+ @BeanIgnore public String c;
- @MarshalledIgnore public String getD() { return null; }
- @MarshalledIgnore public void setD(String v) {}
+ @BeanIgnore public String getD() { return null; }
+ @BeanIgnore public void setD(String v) {}
}
@Test void a34_hiddenProperties_usingConfig() {
@@ -1626,9 +1626,9 @@ class BeanMap_Test extends TestBase {
assertEquals("b(setter)", t.b);
}
- @MarshalledIgnoreApply(on="Dummy1",value=@MarshalledIgnore())
- @MarshalledIgnoreApply(on="Uc.getB,Uc.c,Uc.getD,Uc.setD",value=@MarshalledIgnore())
- @MarshalledIgnoreApply(on="Dummy2",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="Dummy1",value=@BeanIgnore())
+ @BeanIgnoreApply(on="Uc.getB,Uc.c,Uc.getD,Uc.setD",value=@BeanIgnore())
+ @BeanIgnoreApply(on="Dummy2",value=@BeanIgnore())
private static class UcConfig {}
public static class Uc {
@@ -1637,13 +1637,13 @@ class BeanMap_Test extends TestBase {
public void setA(String v) { a = v; }
public String b;
- @MarshalledIgnore public String getB() { return b; }
+ @BeanIgnore public String getB() { return b; }
public void setB(String b) { this.b = b+"(setter)"; }
- @MarshalledIgnore public String c;
+ @BeanIgnore public String c;
- @MarshalledIgnore public String getD() { return null; }
- @MarshalledIgnore public void setD(String v) {}
+ @BeanIgnore public String getD() { return null; }
+ @BeanIgnore public void setD(String v) {}
}
//====================================================================================================
diff --git a/juneau-utest/src/test/java/org/apache/juneau/TestUtils.java b/juneau-utest/src/test/java/org/apache/juneau/TestUtils.java
index ca7151a681..9497e8ef3d 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/TestUtils.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/TestUtils.java
@@ -28,7 +28,7 @@ import java.util.*;
import java.util.regex.*;
import java.util.stream.*;
-import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.bean.swagger.*;
import org.apache.juneau.commons.utils.*;
import org.apache.juneau.junit.bct.*;
@@ -288,17 +288,17 @@ public class TestUtils extends Utils {
var f = (Field)null;
var c = o.getClass();
var n = Character.toUpperCase(name.charAt(0)) + name.substring(1);
- var m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("is"+n) && x.getParameterCount() == 0 && x.getAnnotation(MarshalledIgnore.class) == null).findFirst().orElse(null);
+ var m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("is"+n) && x.getParameterCount() == 0 && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
if (m != null) {
m.setAccessible(true);
return m.invoke(o);
}
- m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get"+n) && x.getParameterCount() == 0 && x.getAnnotation(MarshalledIgnore.class) == null).findFirst().orElse(null);
+ m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get"+n) && x.getParameterCount() == 0 && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
if (m != null) {
m.setAccessible(true);
return m.invoke(o);
}
- m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get") && x.getParameterCount() == 1 && x.getParameterTypes()[0] == String.class && x.getAnnotation(MarshalledIgnore.class) == null).findFirst().orElse(null);
+ m = Arrays.stream(c.getMethods()).filter(x -> x.getName().equals("get") && x.getParameterCount() == 1 && x.getParameterTypes()[0] == String.class && x.getAnnotation(BeanIgnore.class) == null).findFirst().orElse(null);
if (m != null) {
m.setAccessible(true);
return m.invoke(o, name);
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/A1.java b/juneau-utest/src/test/java/org/apache/juneau/a/A1.java
index 70aa9c32a7..495dd9e951 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/A1.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/A1.java
@@ -16,7 +16,7 @@
*/
package org.apache.juneau.a;
-import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
// Default class
@SuppressWarnings({"unused"})
@@ -26,7 +26,7 @@ public class A1 {
int f3;
private int f4;
- @MarshalledIgnore
+ @BeanIgnore
private int f5, f6, f7, f8;
public int getF5() { return f5; }
@@ -98,7 +98,7 @@ public class A1 {
int f3;
private int f4;
- @MarshalledIgnore
+ @BeanIgnore
private int f5, f6, f7, f8;
public int getF5() { return f5; }
@@ -122,7 +122,7 @@ public class A1 {
int f3;
private int f4;
- @MarshalledIgnore
+ @BeanIgnore
private int f5, f6, f7, f8;
public int getF5() { return f5; }
@@ -146,7 +146,7 @@ public class A1 {
int f3;
private int f4;
- @MarshalledIgnore
+ @BeanIgnore
private int f5, f6, f7, f8;
public int getF5() { return f5; }
@@ -170,7 +170,7 @@ public class A1 {
int f3;
private int f4;
- @MarshalledIgnore
+ @BeanIgnore
private int f5, f6, f7, f8;
public int getF5() { return f5; }
diff --git a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
index 7b280c03b5..fa9d8a01b0 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripBeanMaps_Test.java
@@ -272,7 +272,7 @@ class RoundTripBeanMaps_Test extends TestBase {
@MethodSource("testers")
void a05_implMap2(RoundTrip_Tester t) throws Exception {
if (isMarkdown(t))
- return; // @MarshalledIgnore / getter-only properties
+ return; // @BeanIgnore / getter-only properties
var b = new A(1);
b = t.roundTrip(b);
if (t.returnOriginalObject || t.getParser() == null)
@@ -302,13 +302,13 @@ class RoundTripBeanMaps_Test extends TestBase {
public static class A {
- @MarshalledIgnore
+ @BeanIgnore
public int f1, f2;
public int f3, f4;
private int f5, f6;
- @MarshalledIgnore
+ @BeanIgnore
public int getF5() { return f5; }
public void setF5(int v) { f5 = v; }
@@ -971,7 +971,7 @@ class RoundTripBeanMaps_Test extends TestBase {
return t;
}
- @MarshalledIgnore public KEnum getA() { return KEnum.FOO; }
+ @BeanIgnore public KEnum getA() { return KEnum.FOO; }
@BeanProp(name="a") public String getA2() { return a.toString(); }
public void setA(KEnum v) {
// This method should not be interpreted as the setter for this
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
similarity index 82%
copy from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java
copy to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
index 4c91e08e22..b3d922fa60 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
@@ -21,27 +21,30 @@ import static org.apache.juneau.junit.bct.BctAssertions.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.junit.jupiter.api.*;
@SuppressWarnings({
"java:S1186" // Empty test method intentional for framework testing
})
-class MarshalledIgnoreAnnotation_Test extends TestBase {
+class BeanIgnoreAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
// Basic tests
//------------------------------------------------------------------------------------------------------------------
- MarshalledIgnore a1 = MarshalledIgnoreAnnotation.create()
+ BeanIgnore a1 = BeanIgnoreAnnotation.create()
.description("a")
+ .ignoreAccessors(true)
.build();
- MarshalledIgnore a2 = MarshalledIgnoreAnnotation.create()
+ BeanIgnore a2 = BeanIgnoreAnnotation.create()
.description("a")
+ .ignoreAccessors(true)
.build();
@Test void a01_basic() {
- assertBean(a1, "description,ignoreAccessors", "[a],false");
+ assertBean(a1, "description,ignoreAccessors", "[a],true");
}
@Test void a02_testEquivalency() {
@@ -65,21 +68,23 @@ class MarshalledIgnoreAnnotation_Test extends TestBase {
// Comparison with declared annotations.
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnore(
- description={ "a" }
+ @BeanIgnore(
+ description={ "a" },
+ ignoreAccessors=true
)
public static class D1 {}
- MarshalledIgnore d1 = D1.class.getAnnotationsByType(MarshalledIgnore.class)[0];
+ BeanIgnore d1 = D1.class.getAnnotationsByType(BeanIgnore.class)[0];
- @MarshalledIgnore(
- description={ "a" }
+ @BeanIgnore(
+ description={ "a" },
+ ignoreAccessors=true
)
public static class D2 {}
- MarshalledIgnore d2 = D2.class.getAnnotationsByType(MarshalledIgnore.class)[0];
+ BeanIgnore d2 = D2.class.getAnnotationsByType(BeanIgnore.class)[0];
@Test void d01_comparisonWithDeclarativeAnnotations() {
assertEqualsAll(a1, d1, d2);
assertNotEqualsAny(a1.hashCode(), 0, -1);
assertEqualsAll(a1.hashCode(), d1.hashCode(), d2.hashCode());
}
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnore_Test.java
similarity index 72%
copy from juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java
copy to juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnore_Test.java
index 40e921d981..78867b208a 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnore_Test.java
@@ -20,13 +20,14 @@ import static org.apache.juneau.TestUtils.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.json5.*;
import org.junit.jupiter.api.*;
-class MarshalledIgnore_Test extends TestBase {
+class BeanIgnore_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
- // Test @MarshalledIgnore on properties
+ // Test @BeanIgnore on properties (fields, methods).
//------------------------------------------------------------------------------------------------------------------
public static class A {
@@ -34,22 +35,22 @@ class MarshalledIgnore_Test extends TestBase {
return "a";
}
- @MarshalledIgnore
+ @BeanIgnore
public String getB() {
return "b";
}
public String c = "c";
- @MarshalledIgnore public String d = "d";
+ @BeanIgnore public String d = "d";
}
@Test void a01_beanIgnoreOnProperties() {
assertJson("{a:'a',c:'c'}", new A());
}
- @MarshalledIgnoreApply(on="Ac.getB",value=@MarshalledIgnore())
- @MarshalledIgnoreApply(on="Ac.d",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="Ac.getB",value=@BeanIgnore())
+ @BeanIgnoreApply(on="Ac.d",value=@BeanIgnore())
private static class AcConfig {}
public static class Ac {
@@ -71,65 +72,13 @@ class MarshalledIgnore_Test extends TestBase {
}
//------------------------------------------------------------------------------------------------------------------
- // Test @MarshalledIgnore on classes
- //------------------------------------------------------------------------------------------------------------------
-
- @MarshalledIgnore
- public static class B1 {
- public int f = 1;
-
- @Override
- public String toString() {
- return "xxx";
- }
- }
-
- public static class B {
- public int f2 = 2;
- public B1 f3 = new B1();
-
- public B1 getF4() {
- return new B1();
- }
- }
-
- @Test void a03_beanIgnoreOnBean() {
- assertJson("{f2:2,f3:null,f4:null}", new B());
- }
-
- @MarshalledIgnoreApply(on="B1c",value=@MarshalledIgnore())
- private static class B1cConfig {}
-
- public static class B1c {
- public int f = 1;
-
- @Override
- public String toString() {
- return "xxx";
- }
- }
-
- public static class Bc {
- public int f2 = 2;
- public B1c f3 = new B1c();
-
- public B1c getF4() {
- return new B1c();
- }
- }
-
- @Test void a04_beanIgnoreOnBean_usingConfig() {
- assertSerialized(new Bc(), Json5Serializer.DEFAULT.copy().applyAnnotations(B1cConfig.class).build(), "{f2:2,f3:null,f4:null}");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // @MarshalledIgnore on private field: suppress accessor pair from bean metadata (default + JavaBean introspector)
+ // @BeanIgnore on private field: suppress accessor pair from bean metadata (default + JavaBean introspector).
//------------------------------------------------------------------------------------------------------------------
public static class PrivateFieldIgnoredWithAccessors {
public String visible = "ok";
- @MarshalledIgnore(ignoreAccessors = true)
+ @BeanIgnore(ignoreAccessors = true)
private String foo = "secret";
public String getVisible() {
@@ -149,16 +98,44 @@ class MarshalledIgnore_Test extends TestBase {
}
}
- @Test void a05_beanIgnoreOnPrivateFieldSuppressesGetterProperty() {
+ @Test void a03_beanIgnoreOnPrivateFieldSuppressesGetterProperty() {
var bm = MarshallingContext.DEFAULT.getBeanMeta(PrivateFieldIgnoredWithAccessors.class);
assertFalse(bm.getProperties().containsKey("foo"), () -> "properties: " + bm.getProperties().keySet());
assertJson("{visible:'ok'}", new PrivateFieldIgnoredWithAccessors());
}
- @Test void a06_beanIgnoreOnPrivateField_suppressedWithJavaBeanIntrospector() {
+ @Test void a04_beanIgnoreOnPrivateField_suppressedWithJavaBeanIntrospector() {
var bc = MarshallingContext.create().useJavaBeanIntrospector().build();
var s = Json5Serializer.DEFAULT.copy().marshallingContext(bc).build();
assertFalse(bc.getBeanMeta(PrivateFieldIgnoredWithAccessors.class).getProperties().containsKey("foo"));
assertEquals("{visible:'ok'}", s.serialize(new PrivateFieldIgnoredWithAccessors()));
}
-}
\ No newline at end of file
+
+ //------------------------------------------------------------------------------------------------------------------
+ // @BeanIgnore on TYPE — marks the class as not a bean.
+ // The marshaller falls through to other type detection (e.g. toString() via AutoStringSwap).
+ //------------------------------------------------------------------------------------------------------------------
+
+ @BeanIgnore
+ public static class C1 {
+ public int f = 1;
+
+ @Override
+ public String toString() {
+ return "xxx";
+ }
+ }
+
+ public static class C {
+ public int f2 = 2;
+ public C1 f3 = new C1();
+
+ public C1 getF4() {
+ return new C1();
+ }
+ }
+
+ @Test void a05_beanIgnoreOnType_fallsThroughToToString() {
+ assertJson("{f2:2,f3:'xxx',f4:'xxx'}", new C());
+ }
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java
index 4c91e08e22..e40623a1ca 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnoreAnnotation_Test.java
@@ -41,7 +41,7 @@ class MarshalledIgnoreAnnotation_Test extends TestBase {
.build();
@Test void a01_basic() {
- assertBean(a1, "description,ignoreAccessors", "[a],false");
+ assertBean(a1, "description", "[a]");
}
@Test void a02_testEquivalency() {
diff --git a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java
index 40e921d981..c46b5d745d 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/annotation/MarshalledIgnore_Test.java
@@ -17,7 +17,6 @@
package org.apache.juneau.annotation;
import static org.apache.juneau.TestUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
import org.apache.juneau.json5.*;
@@ -26,52 +25,7 @@ import org.junit.jupiter.api.*;
class MarshalledIgnore_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
- // Test @MarshalledIgnore on properties
- //------------------------------------------------------------------------------------------------------------------
-
- public static class A {
- public String getA() {
- return "a";
- }
-
- @MarshalledIgnore
- public String getB() {
- return "b";
- }
-
- public String c = "c";
-
- @MarshalledIgnore public String d = "d";
- }
-
- @Test void a01_beanIgnoreOnProperties() {
- assertJson("{a:'a',c:'c'}", new A());
- }
-
- @MarshalledIgnoreApply(on="Ac.getB",value=@MarshalledIgnore())
- @MarshalledIgnoreApply(on="Ac.d",value=@MarshalledIgnore())
- private static class AcConfig {}
-
- public static class Ac {
- public String getA() {
- return "a";
- }
-
- public String getB() {
- return "b";
- }
-
- public String c = "c";
-
- public String d = "d";
- }
-
- @Test void a02_beanIgnoreOnProperties_usingConfig() {
- assertSerialized(new Ac(), Json5Serializer.DEFAULT.copy().applyAnnotations(AcConfig.class).build(), "{a:'a',c:'c'}");
- }
-
- //------------------------------------------------------------------------------------------------------------------
- // Test @MarshalledIgnore on classes
+ // @MarshalledIgnore on TYPE — skip entirely during marshalling: serializers output null, parsers return null.
//------------------------------------------------------------------------------------------------------------------
@MarshalledIgnore
@@ -93,7 +47,7 @@ class MarshalledIgnore_Test extends TestBase {
}
}
- @Test void a03_beanIgnoreOnBean() {
+ @Test void a01_marshalledIgnoreOnType() {
assertJson("{f2:2,f3:null,f4:null}", new B());
}
@@ -118,47 +72,7 @@ class MarshalledIgnore_Test extends TestBase {
}
}
- @Test void a04_beanIgnoreOnBean_usingConfig() {
+ @Test void a02_marshalledIgnoreOnType_usingConfig() {
assertSerialized(new Bc(), Json5Serializer.DEFAULT.copy().applyAnnotations(B1cConfig.class).build(), "{f2:2,f3:null,f4:null}");
}
-
- //------------------------------------------------------------------------------------------------------------------
- // @MarshalledIgnore on private field: suppress accessor pair from bean metadata (default + JavaBean introspector)
- //------------------------------------------------------------------------------------------------------------------
-
- public static class PrivateFieldIgnoredWithAccessors {
- public String visible = "ok";
-
- @MarshalledIgnore(ignoreAccessors = true)
- private String foo = "secret";
-
- public String getVisible() {
- return visible;
- }
-
- public void setVisible(String value) {
- visible = value;
- }
-
- public String getFoo() {
- return foo;
- }
-
- public void setFoo(String value) {
- foo = value;
- }
- }
-
- @Test void a05_beanIgnoreOnPrivateFieldSuppressesGetterProperty() {
- var bm = MarshallingContext.DEFAULT.getBeanMeta(PrivateFieldIgnoredWithAccessors.class);
- assertFalse(bm.getProperties().containsKey("foo"), () -> "properties: " + bm.getProperties().keySet());
- assertJson("{visible:'ok'}", new PrivateFieldIgnoredWithAccessors());
- }
-
- @Test void a06_beanIgnoreOnPrivateField_suppressedWithJavaBeanIntrospector() {
- var bc = MarshallingContext.create().useJavaBeanIntrospector().build();
- var s = Json5Serializer.DEFAULT.copy().marshallingContext(bc).build();
- assertFalse(bc.getBeanMeta(PrivateFieldIgnoredWithAccessors.class).getProperties().containsKey("foo"));
- assertEquals("{visible:'ok'}", s.serialize(new PrivateFieldIgnoredWithAccessors()));
- }
-}
\ No newline at end of file
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoListSwapTest.java b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoListSwapTest.java
index 6241b0253c..227adb5bea 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoListSwapTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoListSwapTest.java
@@ -25,6 +25,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -172,7 +173,7 @@ class AutoListSwapTest extends TestBase {
// Ignore class
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnore
+ @BeanIgnore
public static class D01 {
public List<String> toList() {
return STRINGLIST;
@@ -194,7 +195,7 @@ class AutoListSwapTest extends TestBase {
assertNull(find(D02.D02A.class));
}
- @MarshalledIgnoreApply(on="D01c",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="D01c",value=@BeanIgnore())
private static class D01cConfig {}
public static class D01c {
@@ -222,11 +223,11 @@ class AutoListSwapTest extends TestBase {
// Ignore swap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="E01c.toList",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="E01c.toList",value=@BeanIgnore())
private static class E01Config {}
public static class E01 {
- @MarshalledIgnore
+ @BeanIgnore
public List<String> toList() {
return STRINGLIST;
}
@@ -286,14 +287,14 @@ class AutoListSwapTest extends TestBase {
// Ignore unswap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="F01c.create",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="F01c.create",value=@BeanIgnore())
private static class F01Config {}
public static class F01 {
public List<String> toList() {
return STRINGLIST;
}
- @MarshalledIgnore
+ @BeanIgnore
public static F01 create(List<String> o) {
return null;
}
@@ -387,11 +388,11 @@ class AutoListSwapTest extends TestBase {
// Ignore constructor
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="G01c(List)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="G01c(List)",value=@BeanIgnore())
private static class G01Config {}
public static class G01 {
- @MarshalledIgnore
+ @BeanIgnore
public G01(List<String> o) {}
public List<String> toList() {
return STRINGLIST;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoMapSwapTest.java b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoMapSwapTest.java
index e01a210f99..ab340b8e82 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoMapSwapTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoMapSwapTest.java
@@ -26,6 +26,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -179,10 +180,10 @@ class AutoMapSwapTest extends TestBase {
// Ignore class
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="D01c",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="D01c",value=@BeanIgnore())
private static class D01Config {}
- @MarshalledIgnore
+ @BeanIgnore
public static class D01 {
public Map<String,String> toMap() {
return STRINGMAP;
@@ -217,11 +218,11 @@ class AutoMapSwapTest extends TestBase {
// Ignore swap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="E01c.toMap",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="E01c.toMap",value=@BeanIgnore())
private static class E01Config {}
public static class E01 {
- @MarshalledIgnore
+ @BeanIgnore
public Map<String,String> toMap() {
return STRINGMAP;
}
@@ -281,14 +282,14 @@ class AutoMapSwapTest extends TestBase {
// Ignore unswap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="F01c.create(Map)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="F01c.create(Map)",value=@BeanIgnore())
private static class F01Config {}
public static class F01 {
public Map<String,String> toMap() {
return STRINGMAP;
}
- @MarshalledIgnore
+ @BeanIgnore
public static F01 create(Map<String,String> o) {
return null;
}
@@ -382,11 +383,11 @@ class AutoMapSwapTest extends TestBase {
// Ignore constructor
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="G01c(Map)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="G01c(Map)",value=@BeanIgnore())
private static class G01Config {}
public static class G01 {
- @MarshalledIgnore
+ @BeanIgnore
public G01(Map<String,String> o) {}
public Map<String,String> toMap() {
return STRINGMAP;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoNumberSwapTest.java b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoNumberSwapTest.java
index 8c360d05a5..db95377a02 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoNumberSwapTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoNumberSwapTest.java
@@ -23,6 +23,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -564,10 +565,10 @@ class AutoNumberSwapTest extends TestBase {
// Ignore class
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="D01c",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="D01c",value=@BeanIgnore())
private static class D01Config {}
- @MarshalledIgnore
+ @BeanIgnore
public static class D01 {
public Integer toInteger() {
return 1;
@@ -612,11 +613,11 @@ class AutoNumberSwapTest extends TestBase {
// Ignore swap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="E01c.toInteger",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="E01c.toInteger",value=@BeanIgnore())
private static class E01Config {}
public static class E01 {
- @MarshalledIgnore
+ @BeanIgnore
public Integer toInteger() {
return 1;
}
@@ -676,14 +677,14 @@ class AutoNumberSwapTest extends TestBase {
// Ignore unswap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="F01c.create(java.lang.Integer)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="F01c.create(java.lang.Integer)",value=@BeanIgnore())
private static class F01Config {}
public static class F01 {
public Integer toInteger() {
return 1;
}
- @MarshalledIgnore
+ @BeanIgnore
public static F01 create(Integer o) {
return null;
}
@@ -777,11 +778,11 @@ class AutoNumberSwapTest extends TestBase {
// Ignore constructor
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="G01c(java.lang.Integer)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="G01c(java.lang.Integer)",value=@BeanIgnore())
private static class G01Config {}
public static class G01 {
- @MarshalledIgnore
+ @BeanIgnore
public G01(Integer o) {}
public Integer toInteger() {
return 1;
diff --git a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoObjectSwapTest.java b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoObjectSwapTest.java
index 82b7b83fc2..556ab8b070 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/transform/AutoObjectSwapTest.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/transform/AutoObjectSwapTest.java
@@ -26,6 +26,7 @@ import java.util.*;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.collections.*;
+import org.apache.juneau.commons.bean.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.parser.*;
import org.apache.juneau.serializer.*;
@@ -174,10 +175,10 @@ class AutoObjectSwapTest extends TestBase {
// Ignore class
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="D01c",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="D01c",value=@BeanIgnore())
private static class D01Config {}
- @MarshalledIgnore
+ @BeanIgnore
public static class D01 {
public Map<String,String> swap() {
return STRINGMAP;
@@ -212,11 +213,11 @@ class AutoObjectSwapTest extends TestBase {
// Ignore swap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="E01c.swap",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="E01c.swap",value=@BeanIgnore())
private static class E01Config {}
public static class E01 {
- @MarshalledIgnore
+ @BeanIgnore
public Map<String,String> swap() {
return STRINGMAP;
}
@@ -267,14 +268,14 @@ class AutoObjectSwapTest extends TestBase {
// Ignore unswap method
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="F01c.create(java.util.Map)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="F01c.create(java.util.Map)",value=@BeanIgnore())
private static class F01Config {}
public static class F01 {
public Map<String,String> swap() {
return STRINGMAP;
}
- @MarshalledIgnore
+ @BeanIgnore
public static F01 create(Map<String,String> o) {
return null;
}
@@ -368,11 +369,11 @@ class AutoObjectSwapTest extends TestBase {
// Ignore constructor
//------------------------------------------------------------------------------------------------------------------
- @MarshalledIgnoreApply(on="G01c(Map)",value=@MarshalledIgnore())
+ @BeanIgnoreApply(on="G01c(Map)",value=@BeanIgnore())
private static class G01Config {}
public static class G01 {
- @MarshalledIgnore
+ @BeanIgnore
public G01(Map<String,String> o) {}
public Map<String,String> swap() {
return STRINGMAP;
(juneau) 06/06: docs: simplify annotation links in marshall and rest Javadocs
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit bd1889c1134ac1527956bbbd14702ed61726aa3b
Author: James Bognar <ja...@jamesbog-ltmjqf2.internal.salesforce.com>
AuthorDate: Tue May 12 10:56:10 2026 -0400
docs: simplify annotation links in marshall and rest Javadocs
---
.../src/main/java/org/apache/juneau/BeanMap.java | 4 ++--
.../src/main/java/org/apache/juneau/ClassMeta.java | 5 +++--
.../src/main/java/org/apache/juneau/Context.java | 9 +++++---
.../java/org/apache/juneau/MarshalledFilter.java | 24 +++++++++++-----------
.../org/apache/juneau/MarshallingContextable.java | 12 +++++------
.../apache/juneau/annotation/MarshalledProp.java | 5 +++--
.../java/org/apache/juneau/annotation/Name.java | 3 ++-
.../java/org/apache/juneau/rest/RestContext.java | 10 ++++-----
.../org/apache/juneau/rest/annotation/RestGet.java | 5 +++--
.../apache/juneau/rest/annotation/RestInit.java | 6 ++++--
.../org/apache/juneau/rest/annotation/RestOp.java | 7 ++++---
.../apache/juneau/rest/annotation/RestPatch.java | 7 ++++---
12 files changed, 54 insertions(+), 43 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
index 5c3c064363..24519be464 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
@@ -369,7 +369,7 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
*
* <p>
* Triggers bean creation if bean has read-only properties set through a constructor defined by the
- * {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation.
+ * {@link BeanCtor @BeanCtor} annotation.
*
* @return The inner bean object.
*/
@@ -410,7 +410,7 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
*
* <p>
* If <c>create</c> is <jk>false</jk>, then this method may return <jk>null</jk> if the bean has read-only
- * properties set through a constructor defined by the {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation.
+ * properties set through a constructor defined by the {@link BeanCtor @BeanCtor} annotation.
*
* <p>
* This method does NOT always return the bean in it's final state.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index dd8393c7f6..cf99d27494 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -36,6 +36,7 @@ import java.util.function.*;
import java.util.stream.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.BeanType;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.commons.conversion.*;
import org.apache.juneau.commons.function.*;
@@ -66,7 +67,7 @@ import org.apache.juneau.swap.*;
*
* @param <T> The class type of the wrapped class.
*/
-@org.apache.juneau.commons.bean.BeanType(properties = "innerClass,elementType,keyType,valueType,notABeanReason,initException,beanMeta")
+@BeanType(properties = "innerClass,elementType,keyType,valueType,notABeanReason,initException,beanMeta")
@SuppressWarnings({
"java:S1200", // Class has 23 dependencies, acceptable for this core reflection metadata class
"java:S1452", // Wildcard required - ClassMeta<?>, ObjectSwap<T,?>, etc. for element/component types
@@ -1670,7 +1671,7 @@ public class ClassMeta<T> extends ClassInfoTyped<T> {
private MarshalledFilter findMarshalledFilter() {
var ap = marshallingContext.getAnnotationProvider();
var l = ap.find(Marshalled.class, this);
- var bt = ap.find(org.apache.juneau.commons.bean.BeanType.class, this);
+ var bt = ap.find(BeanType.class, this);
if (l.isEmpty() && bt.isEmpty())
return null;
return MarshalledFilter.create(inner())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
index 8093a3e2bd..b1059726c6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/Context.java
@@ -27,9 +27,12 @@ import java.lang.reflect.*;
import java.util.*;
import java.util.function.*;
import org.apache.juneau.annotation.*;
+import org.apache.juneau.commons.bean.BeanCtorAnnotation;
import org.apache.juneau.bson.annotation.BsonConfig;
import org.apache.juneau.cbor.annotation.CborConfig;
import org.apache.juneau.commons.bean.BeanConfig;
+import org.apache.juneau.commons.bean.BeanIgnoreAnnotation;
+import org.apache.juneau.commons.bean.BeanPropAnnotation;
import org.apache.juneau.commons.collections.*;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.commons.utils.*;
@@ -207,10 +210,10 @@ public abstract class Context {
* and passed into the builder class:
* <ul class='javatreec'>
* <li class='ja'>{@link MarshalledAnnotation}
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanCtorAnnotation}
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanIgnoreAnnotation}
+ * <li class='ja'>{@link BeanCtorAnnotation}
+ * <li class='ja'>{@link BeanIgnoreAnnotation}
* <li class='ja'>{@link MarshalledIgnoreAnnotation}
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanPropAnnotation}
+ * <li class='ja'>{@link BeanPropAnnotation}
* <li class='ja'>{@link MarshalledPropAnnotation}
* <li class='ja'>{@link ExampleAnnotation}
* <li class='ja'>{@link NamePropertyAnnotation}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
index 4afd776776..8df0ec7415 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshalledFilter.java
@@ -248,7 +248,7 @@ public class MarshalledFilter {
* Specifies properties to exclude from the bean class.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#excludeProperties()}
+ * <li class='ja'>{@link BeanType#excludeProperties()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesExcludes(Map)}
@@ -273,7 +273,7 @@ public class MarshalledFilter {
* When enabled, fluent setters are detected on beans.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#findFluentSetters()}
+ * <li class='ja'>{@link BeanType#findFluentSetters()}
* <li class='jm'>{@link MarshallingContext.Builder#findFluentSetters()}
* </ul>
*
@@ -353,7 +353,7 @@ public class MarshalledFilter {
* When specified, only the list of properties defined on the interface class will be used during serialization.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#interfaceClass()}
+ * <li class='ja'>{@link BeanType#interfaceClass()}
* </ul>
*
* @param value The new value for this setting.
@@ -385,7 +385,7 @@ public class MarshalledFilter {
* Specifies the set and order of names of properties associated with the bean class.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#properties()}
+ * <li class='ja'>{@link BeanType#properties()}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanProperties(Map)}
@@ -410,7 +410,7 @@ public class MarshalledFilter {
* The class to use for calculating bean property names.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#propertyNamer()}
+ * <li class='ja'>{@link BeanType#propertyNamer()}
* <li class='jm'>{@link MarshallingContext.Builder#propertyNamer(Class)}
* <li class='jc'>{@link PropertyNamer}
* </ul>
@@ -446,8 +446,8 @@ public class MarshalledFilter {
* Specifies one or more properties on a bean that are read-only despite having valid getters.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#readOnlyProperties()}
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp#ro()}
+ * <li class='ja'>{@link BeanType#readOnlyProperties()}
+ * <li class='ja'>{@link BeanProp#ro()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesReadOnly(Map)}
@@ -469,7 +469,7 @@ public class MarshalledFilter {
* Opt out of alphabetical property sorting for this specific bean.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#unsorted()}
+ * <li class='ja'>{@link BeanType#unsorted()}
* <li class='jf'>{@link MarshallingContext.Builder#unsortedProperties()}
* </ul>
*
@@ -484,7 +484,7 @@ public class MarshalledFilter {
* Opt out of alphabetical property sorting for this specific bean.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#unsorted()}
+ * <li class='ja'>{@link BeanType#unsorted()}
* <li class='jf'>{@link MarshallingContext.Builder#unsortedProperties()}
* </ul>
*
@@ -506,7 +506,7 @@ public class MarshalledFilter {
* Identical in purpose to the stop class specified by {@link Introspector#getBeanInfo(Class, Class)}.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#stopClass()}
+ * <li class='ja'>{@link BeanType#stopClass()}
* </ul>
*
* @param value The new value for this setting.
@@ -556,8 +556,8 @@ public class MarshalledFilter {
* Specifies one or more properties on a bean that are write-only despite having valid setters.
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanType#writeOnlyProperties()}
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp#wo()}
+ * <li class='ja'>{@link BeanType#writeOnlyProperties()}
+ * <li class='ja'>{@link BeanProp#wo()}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(Class, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(String, String)}
* <li class='jm'>{@link MarshallingContext.Builder#beanPropertiesWriteOnly(Map)}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
index f40e99b15b..7f345a8138 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/MarshallingContextable.java
@@ -216,7 +216,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
+ * <li class='note'>The {@link BeanCtor @BeanCtor} annotation can also be used to expose a non-public constructor.
* <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean constructor to ignore it.
* </ul>
*
@@ -426,7 +426,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public field.
+ * <li class='note'>The {@link BeanProp @BeanProp} annotation can also be used to expose a non-public field.
* <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean field to ignore it as a bean property.
* </ul>
*
@@ -566,7 +566,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used to expose a non-public method.
+ * <li class='note'>The {@link BeanProp @BeanProp} annotation can also be used to expose a non-public method.
* <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on a public bean getter/setter to ignore it as a bean property.
* </ul>
*
@@ -1411,7 +1411,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can be used on the getter to override this setting.
+ * <li class='note'>The {@link BeanProp @BeanProp} annotation can be used on the getter to override this setting.
* <li class='note'>The {@link BeanIgnore @BeanIgnore} annotation can also be used on getters to ignore them as bean properties.
* </ul>
*
@@ -1603,7 +1603,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on transient fields to keep them from being ignored.
+ * <li class='note'>The {@link BeanProp @BeanProp} annotation can also be used on transient fields to keep them from being ignored.
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -1809,7 +1809,7 @@ public abstract class MarshallingContextable extends Context {
* </p>
*
* <h5 class='section'>Notes:</h5><ul>
- * <li class='note'>The {@link org.apache.juneau.commons.bean.BeanProp @BeanProp} annotation can also be used on methods to individually identify them as fluent setters.
+ * <li class='note'>The {@link BeanProp @BeanProp} annotation can also be used on methods to individually identify them as fluent setters.
* <li class='note'>The {@link Bean#findFluentSetters() @Marshalled.fluentSetters()} annotation can also be used on classes to specify to look for fluent setters.
* </ul>
*
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
index a817d67a00..a4ebfbf1d1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/MarshalledProp.java
@@ -20,12 +20,13 @@ import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.bean.BeanProp;
/**
* Used to tailor how bean properties get marshalled by the framework.
*
* <p>
- * The marshalling-only sibling of {@link org.apache.juneau.commons.bean.BeanProp @BeanProp}.
+ * The marshalling-only sibling of {@link BeanProp @BeanProp}.
* Where {@code @BeanProp} (in <c>juneau-commons</c>) carries the bean-modeling attributes
* (such as {@code name}, {@code ro}, {@code wo}, {@code type}, {@code params}, {@code elementType},
* and {@code factory}), this annotation carries the wire-format-specific attributes used by serializers
@@ -40,7 +41,7 @@ import java.lang.annotation.*;
* </ul>
*
* <h5 class='section'>See Also:</h5><ul>
- * <li class='ja'>{@link org.apache.juneau.commons.bean.BeanProp}
+ * <li class='ja'>{@link BeanProp}
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MarshalledPropAnnotation">@MarshalledProp Annotation</a>
* </ul>
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Name.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Name.java
index 24136e5ad9..e07733b8eb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Name.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/annotation/Name.java
@@ -20,6 +20,7 @@ import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.inject.BeanStore;
/**
* Specifies the parameter name for bean property mapping.
@@ -68,7 +69,7 @@ import java.lang.annotation.*;
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='ja'>{@link Named}
- * <li class='jc'>{@link org.apache.juneau.commons.inject.BeanStore}
+ * <li class='jc'>{@link BeanStore}
* </ul>
*/
@Documented
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 4e0a36e0d2..3d9b8c4efe 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -101,7 +101,7 @@ import jakarta.servlet.http.*;
*
* <p>
* Configuration is supplied declaratively through the {@link Rest @Rest} annotation on the resource class
- * (and inherited from any parent classes), and programmatically through {@link org.apache.juneau.commons.inject.Bean @Bean}-annotated
+ * (and inherited from any parent classes), and programmatically through {@link Bean @Bean}-annotated
* methods/fields that contribute named beans (e.g. <c>encoders</c>, <c>parsers</c>, <c>callLogger</c>) to the REST
* resource's bean store. Where direct construction is needed (test rigs, mock clients, embedded usage),
* the public constructor takes a {@link RestContext.Args} record carrying the bootstrap state.
@@ -374,10 +374,10 @@ public class RestContext extends Context {
*
* <p>
* Default suppliers sit at the bottom of the bean-store resolution order: they fire only when no
- * {@link org.apache.juneau.commons.inject.Bean @Bean} method, no programmatic {@code addBean(...)} call, and no Spring/overriding-parent
+ * {@link Bean @Bean} method, no programmatic {@code addBean(...)} call, and no Spring/overriding-parent
* binding has been registered for the type. This is the mechanism that replaces the old
* {@code DELAYED_INJECTION} list — by registering the framework's own factories as defaults
- * <i>before</i> the {@link org.apache.juneau.commons.inject.Bean @Bean} method walk runs, any {@link org.apache.juneau.commons.inject.Bean @Bean} method whose parameters
+ * <i>before</i> the {@link Bean @Bean} method walk runs, any {@link Bean @Bean} method whose parameters
* include framework types can now resolve those parameters lazily through the bean store without
* requiring a hand-maintained skip list.
*/
@@ -1954,7 +1954,7 @@ public class RestContext extends Context {
* <p>
* The default call logger is {@link BasicCallLogger}. Override via {@link Rest#callLogger() @Rest(callLogger)}
* on the resource class, by registering a {@link CallLogger} bean in the bean store, or by declaring a
- * {@link org.apache.juneau.commons.inject.Bean @Bean}-annotated static method on the resource class:
+ * {@link Bean @Bean}-annotated static method on the resource class:
* <p class='bjava'>
* <ja>@Bean</ja> <jk>public static</jk> CallLogger myCallLogger(<i><args></i>) {...}
* </p>
@@ -2465,7 +2465,7 @@ public class RestContext extends Context {
* The bootstrap resolver has the same {@link Var} catalog as {@link #getVarResolver()} but does not have
* {@link Messages} or {@link Config} beans wired in — it is used to resolve annotation attribute values
* (e.g. <c>@Rest(messages=...)</c>) before those beans are built. Override via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="bootstrapVarResolver")} on a static method of the resource class.
+ * {@link Bean @Bean(name="bootstrapVarResolver")} on a static method of the resource class.
*
* @return The bootstrap var resolver in use by this resource.
*/
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
index 63bb93ae4e..9d904d6d7b 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestGet.java
@@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.inject.Bean;
import org.apache.juneau.bean.swagger.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.rest.*;
@@ -365,7 +366,7 @@ public @interface RestGet {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.encoders.EncoderSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerEncoders">Encoders</a>
@@ -625,7 +626,7 @@ public @interface RestGet {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.serializer.SerializerSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/Marshalling">Marshalling</a>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestInit.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestInit.java
index 51b86aa0fa..dce6698d41 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestInit.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestInit.java
@@ -21,6 +21,8 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
+import org.apache.juneau.commons.inject.Bean;
+import org.apache.juneau.commons.inject.BeanStore;
import org.apache.juneau.rest.*;
import jakarta.servlet.*;
@@ -36,9 +38,9 @@ import jakarta.servlet.*;
*
* <p>
* Method parameters are resolved from the
- * {@link org.apache.juneau.commons.inject.BeanStore bean store} the same way as any other Juneau-injected
+ * {@link BeanStore bean store} the same way as any other Juneau-injected
* method. {@link jakarta.servlet.ServletConfig}, {@link jakarta.servlet.ServletContext}, the resource instance
- * itself, and any bean registered via {@link org.apache.juneau.commons.inject.Bean @Bean} or the
+ * itself, and any bean registered via {@link Bean @Bean} or the
* configured bean-store hooks are all resolvable. Zero-argument variants are also supported.
*
* <p>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
index 9c8a4945de..85808392d5 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestOp.java
@@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.inject.Bean;
import org.apache.juneau.bean.swagger.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.http.remote.*;
@@ -427,7 +428,7 @@ public @interface RestOp {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.encoders.EncoderSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerEncoders">Encoders</a>
@@ -586,7 +587,7 @@ public @interface RestOp {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.parser.ParserSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="parsers")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="parsers")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/Marshalling">Marshalling</a>
@@ -854,7 +855,7 @@ public @interface RestOp {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.serializer.SerializerSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/Marshalling">Marshalling</a>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatch.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatch.java
index 3907934931..9d7a85d406 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatch.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestPatch.java
@@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
import org.apache.juneau.commons.annotation.*;
+import org.apache.juneau.commons.inject.Bean;
import org.apache.juneau.bean.swagger.*;
import org.apache.juneau.encoders.*;
import org.apache.juneau.parser.*;
@@ -427,7 +428,7 @@ public @interface RestPatch {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.encoders.EncoderSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="encoders")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestServerEncoders">Encoders</a>
@@ -535,7 +536,7 @@ public @interface RestPatch {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.parser.ParserSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="parsers")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="parsers")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/Marshalling">Marshalling</a>
@@ -776,7 +777,7 @@ public @interface RestPatch {
*
* <p>
* For programmatic equivalents, contribute a {@link org.apache.juneau.serializer.SerializerSet} bean via
- * {@link org.apache.juneau.commons.inject.Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
+ * {@link Bean @Bean(name="serializers")} (use methodScope to scope to specific operation methods).
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/Marshalling">Marshalling</a>