/** * Returns the number of sub-components in the specified component, i.e. the number of standard * sub-components (e.g. 6 for CE) plus any extra components that that have been added at * runtime. * * @param type composite type * @param component numbered from 1 * @return number of sub-components in the specified component */ public static int numSubComponents(Type type, int component) { if (component == 1 && Primitive.class.isAssignableFrom(type.getClass())) { // note that getComponent(primitive, 1) below returns the primitive // itself -- if we do numComponents on it, we'll end up with the // number of components in the field, not the number of subcomponents return 1; } Type comp = getComponent(type, component); return numComponents(comp); }
/** * Returns the number of sub-components in the specified component, i.e. the number of standard * sub-components (e.g. 6 for CE) plus any extra components that that have been added at * runtime. * * @param type composite type * @param component numbered from 1 * @return number of sub-components in the specified component */ public static int numSubComponents(Type type, int component) { if (component == 1 && Primitive.class.isAssignableFrom(type.getClass())) { // note that getComponent(primitive, 1) below returns the primitive // itself -- if we do numComponents on it, we'll end up with the // number of components in the field, not the number of subcomponents return 1; } Type comp = getComponent(type, component); return numComponents(comp); }
Type comp = getComponent(type, component); if (type instanceof Varies && comp instanceof GenericPrimitive && subcomponent > 1) { try { final GenericComposite comp2 = new GenericComposite(type.getMessage()); varies.setData(comp2); comp = getComponent(type, component); } catch (final DataTypeException de) { final String message = "Unexpected exception copying data to generic composite. This is probably a bug within HAPI. " final Type sub = getComponent(comp, subcomponent); return getPrimitive(sub);
Type comp = getComponent(type, component); if (type instanceof Varies && comp instanceof GenericPrimitive && subcomponent > 1) { try { final GenericComposite comp2 = new GenericComposite(type.getMessage()); varies.setData(comp2); comp = getComponent(type, component); } catch (final DataTypeException de) { final String message = "Unexpected exception copying data to generic composite. This is probably a bug within HAPI. " final Type sub = getComponent(comp, subcomponent); return getPrimitive(sub);
return getComponent(v.getData(), comp);
return getComponent(v.getData(), comp);