});
return ret;
} catch (Exception e) {
- LOG.error("Could not find augmentable for {}", augmentation, e);
+ LOG.debug("Could not find augmentable for {} using {}", augmentation, augmentation.getClassLoader(), e);
return null;
}
}
if (typeToClass.containsKey(typeRef)) {
return;
}
- LOG.info("Binding Class {} encountered.", cls);
+ LOG.trace("Binding Class {} encountered.", cls);
WeakReference<Class> weakRef = new WeakReference<>(cls);
typeToClass.put(typeRef, weakRef);
if (Augmentation.class.isAssignableFrom(cls)) {
if (typeToClass.containsKey(typeRef)) {
return;
}
- LOG.info("Binding Class {} encountered.", cls);
+ LOG.trace("Binding Class {} encountered.", cls);
WeakReference<Class> weakRef = new WeakReference<>((Class) cls);
typeToClass.put(typeRef, weakRef);
}
public void onModuleContextAdded(SchemaContext schemaContext, Module module, ModuleContext context) {
pathToType.putAll(context.getChildNodes());
qnamesToIdentityMap.putAll(context.getIdentities());
- for(Entry<QName, GeneratedTOBuilder> identity : context.getIdentities().entrySet()) {
- typeToQname.put(new ReferencedTypeImpl(identity.getValue().getPackageName(), identity.getValue().getName()),identity.getKey());
+ for (Entry<QName, GeneratedTOBuilder> identity : context.getIdentities().entrySet()) {
+ typeToQname.put(
+ new ReferencedTypeImpl(identity.getValue().getPackageName(), identity.getValue().getName()),
+ identity.getKey());
}
captureCases(context.getCases(), schemaContext);
}
@Override
public Class<?> deserialize(QName input) {
Type type = qnamesToIdentityMap.get(input);
- if(type == null) {
+ if (type == null) {
return null;
}
ReferencedTypeImpl typeref = new ReferencedTypeImpl(type.getPackageName(), type.getName());
WeakReference<Class> softref = typeToClass.get(typeref);
- if(softref == null) {
+ if (softref == null) {
return null;
}
return softref.get();
checkArgument(BaseIdentity.class.isAssignableFrom(input));
bindingClassEncountered(input);
QName qname = identityQNames.get(input);
- if(qname != null) {
+ if (qname != null) {
return qname;
}
ConcreteType typeref = Types.typeForClass(input);
qname = typeToQname.get(typeref);
- if(qname != null) {
+ if (qname != null) {
identityQNames.put(input, qname);
}
return qname;
return serialize((Class) input);
}
}
+
+ public boolean isCodecAvailable(Class<? extends DataContainer> cls) {
+ if (containerCodecs.containsKey(cls)) {
+ return true;
+ }
+ if (identifierCodecs.containsKey(cls)) {
+ return true;
+ }
+ if (choiceCodecs.containsKey(cls)) {
+ return true;
+ }
+ if (caseCodecs.containsKey(cls)) {
+ return true;
+ }
+ if (augmentableCodecs.containsKey(cls)) {
+ return true;
+ }
+ if (augmentationCodecs.containsKey(cls)) {
+ return true;
+ }
+ return false;
+ }
}
\ No newline at end of file