/** * Converts the given arbitrary object to an implementation having JAXB annotations. * If the given object is not recognized or is already an instance of the expected class, * then it is returned unchanged. */ private Object toImplementation(final Object value) { specificBitMasks = value.getClass().isAnnotationPresent(UseLegacyMetadata.class) ? Context.LEGACY_METADATA : 0; final UnaryOperator<Object>[] converters = getRootAdapters(); if (converters != null) { for (final UnaryOperator<Object> t : converters) { final Object c = t.apply(value); if (c != null) return c; } } return value; }
/** * Converts the given arbitrary object to an implementation having JAXB annotations. * If the given object is not recognized or is already an instance of the expected class, * then it is returned unchanged. */ private Object toImplementation(final Object value) throws JAXBException { final TypeRegistration[] converters = getRootAdapters(); if (converters != null) { for (final TypeRegistration t : converters) { final Object c = t.toImplementation(value); if (c != null) return c; } } return value; }