protected void registerContextClasses(final Class<?> inputClass) throws NoSuchMethodException, NoSuchFieldException {
  final FastSet<Field> fields=getDeclaredFields(inputClass);
  for (  final Field field : fields) {
    final Class<?> type=field.getType();
    final Class<?> scanClass;
    if (type.isAssignableFrom(List.class)) {
      scanClass=getGenericType(field);
    }
 else {
      scanClass=type;
    }
    if (!_registeredClassesCache.contains(scanClass) && (scanClass.isAnnotationPresent(XmlRootElement.class) || scanClass.isAnnotationPresent(XmlType.class))) {
      _registeredClassesCache.add(scanClass);
      registerContextClasses(scanClass);
    }
  }
  if (_cacheMode == CacheMode.READER) {
    scanClass(inputClass,fields,false);
  }
 else {
    scanClass(inputClass,fields,true);
  }
}

protected void registerContextClasses ( final Class < ? > inputClass ) throws NoSuchMethodException , NoSuchFieldException { final FastSet < Field > fields = getDeclaredFields ( inputClass ) ; for ( final Field field : fields ) { final Class < ? > type = field . getType ( ) ; final Class < ? > scanClass ; if ( type . isAssignableFrom ( List . class ) ) { scanClass = getGenericType ( field ) ; } else { scanClass = type ; } if ( ! _registeredClassesCache . contains ( scanClass ) && ( scanClass . isAnnotationPresent ( XmlRootElement . class ) || scanClass . isAnnotationPresent ( XmlType . class ) ) ) { _registeredClassesCache . add ( scanClass ) ; registerContextClasses ( scanClass ) ; } } if ( _cacheMode == CacheMode . READER ) { scanClass ( inputClass , fields , false ) ; } else { scanClass ( inputClass , fields , true ) ; } }
this method will scan the input class and all subclasses and register any jaxb objects as part of this reader
