return (Codec<T>) new NumericCodec(sizeExpr, endian,
numericType, null);
}
if (overrides != null
&& overrides.isAnnotationPresent(BoundNumber.class)) {
BoundNumber numericMetadata = overrides
.getAnnotation(BoundNumber.class);
ByteOrder endian = numericMetadata.byteOrder();
String size = numericMetadata.size();
// if(NUMERIC_TYPES.containsKey(numericMetadata.type())) {
// numericType = NUMERIC_TYPES.get(numericMetadata.type());
// }
if (size.length() == 0) {
size = Integer.toString(numericType.getDefaultSize());
}
Expression<Integer, Resolver> sizeExpr = Expressions
.createInteger(context, size);
Expression<Integer, Resolver> matchExpr = null;
if (numericMetadata.match().trim().length() != 0) {
matchExpr = Expressions.createInteger(context,
numericMetadata.match());
}
return (Codec<T>) new NumericCodec(sizeExpr, endian,
numericType, matchExpr);
}
}