out.writeObject( annotations );
}
public static InternalReadAccessor getReadAcessor(ObjectType objectType) {
if ( !(objectType instanceof ClassObjectType) ) {
return new PatternExtractor(objectType);
}
Class returnType = ((ClassObjectType) objectType).getClassType();
if (Number.class.isAssignableFrom( returnType ) ||
( returnType == byte.class ||
returnType == short.class ||
returnType == int.class ||
returnType == long.class ||
returnType == float.class ||
returnType == double.class ) ) {
return new SelfNumberExtractor(objectType);
} else if ( Date.class.isAssignableFrom( returnType ) ) {
return new SelfDateExtractor(objectType);
} else {
return new PatternExtractor(objectType);
}
}