#750: AliasMap.java

projectforge-business/src/main/java/org/projectforge/framework/xmlstream/AliasMap.java Lines: 54 · Type: Java — bidirectional Class ↔ alias mapping 54 lines · 24 code · 22 comments · 8 blank

Purpose

Bidirectional map between Java classes and XML alias names for ProjectForge's custom XmlStream framework (a lightweight alternative to XStream). 54 lines. Maintains two HashMaps: Class → alias (for serialization — knowing what XML tag to use for a given class) and alias → Class (for deserialization — knowing what class to instantiate from an XML tag).

This is the same concept as XStream's alias() method but implemented manually. It's used to translate between Java class names like org.projectforge.business.user.PFUserDO and XML tag names like <user>. The put() method ensures both directions stay in sync — you can't have one direction without the other.