private void init (String name, PropertyType type, PropertyArity arity, Object value) { /* Some limited type checking. Checking for mismatched types here may help avoid difficult chasing down of the bugs such mismatches cause. */ if (value == null) { throw new NullPointerException (CoreMessageConstants.EXC_PROP_VAL_NULL); } if ((arity == PropertyArity.SCALAR) && !isObjScalarProp(value)) { throw new IncompatibleClassChangeError (CoreMessageConstants.EXC_SCL_PROP_CLSS_INCMPT); } else if ((arity == PropertyArity.MAP) && (!(value instanceof Map))) { throw new IncompatibleClassChangeError (CoreMessageConstants.EXC_MAP_PROP_CLSS_INCMPT); } else if ((arity == PropertyArity.SET) && (!(value instanceof Set))) { throw new IncompatibleClassChangeError (CoreMessageConstants.EXC_SET_PROP_CLSS_INCMPT); } else if ((arity == PropertyArity.LIST) && (!(value instanceof List))) { throw new IncompatibleClassChangeError (CoreMessageConstants.EXC_LIST_PROP_CLSS_INCMPT); } _name = name; _type = type; _arity = arity; _value = value; }