Annox is an open source project which allows you to read arbitrary Java annotations from string or XML resources. JAXB users may be interested in Annox annotation reader for JAXB RI which allows you to define JAXB Java/XML mappings in text or XML resources (instead of annotations).