public void registerAttribute ( String namespacePrefix , String attributeName , Class < ? > clazz , String fieldName , Class < ? > fieldClass ) { if ( ! _namespaces . containsKey ( namespacePrefix ) ) throw new RuntimeException ( "Namespace prefix '" + namespacePrefix + "' has not been registered yet" ) ; _xstream . aliasAttribute ( clazz , fieldName , namespacePrefix + ":" + attributeName ) ; _xstream . useAttributeFor ( fieldName , fieldClass ) ; }
Registers an attribute corresponding to a specific field of a specific class in a given namespace .