XmlObject.java@XmlRootElement and XStream's implicit convention (any class can be serialized). Unlike them, XmlStream requires explicit annotation — classes without @XmlObject will not be processed by either XmlObjectReader or XmlObjectWriter. This is a security measure: only explicitly permitted classes participate in serialization.
alias()Overrides the root XML element name. By default (empty string), the fully-qualified class name is used: org.projectforge.business.user.PFUserDO → <org.projectforge.business.user.PFUserDO>. With alias: @XmlObject(alias="user") → <user>. Aliases are registered in AliasMap (#758) during XmlRegistry initialization.
Difference from @XmlField(alias): @XmlObject.alias sets the root element name (the tag wrapping the entire object), while @XmlField.alias sets a child element or attribute name (a specific field).
XmlRegistry at startup scans the classpath (or config) and finds all @XmlObject-annotated classesAliasMap: Class → alias and alias → ClassXmlObjectReader.newInstance() upon encountering an XML element looks up the corresponding class via AliasMap.getClassForAlias(tagName)BeanHelper.newInstance() and recursively populates fields (using @XmlField)Status.IGNORE (#760)@XmlObject is not just an alias — it's an explicit permission for serialization. A class without @XmlObject is entirely excluded from the process. XStream by default serializes any class — creating a risk of accidental data leakage (e.g., serializing a Hibernate proxy with passwords). XmlStream is safer but requires more manual annotation work.
| Annotation | File | Role |
|---|---|---|
@XmlField | #752 | Configure field serialization (name, type, defaults, format) |
@XmlObject | #754 | Enable class for serialization with alias |
@XmlOmitField | #757 | Exclude a field from serialization entirely |
868d6abb7 2025 → 2026 (copyright year update) 63081666f Source file headers: 2024→2025 b6092df09 Copyright 2023 → 2024 ab45d51fa Copyright 2001-2022 → 2001-2023 5f7ef41b8 Copyright 2021 → 2022 cd27dd997 package xstream → xmlstream ceb63e8a1 Source code header: (C) 2001-2021 7c79f1922 Copyright of source header → 2020 32f634b88 Optimize imports dd5ca38ac CopyRight of all java file-header updated or created 9ebb88522 Initial commit
alias) and has not changed since the initial commit beyond copyright updates and the xstream → xmlstream package rename. The simplicity is intentional — this is a permission gate, not a configuration surface.