time | Calls | line |
---|
| | 42 | function tf = hasProp( obj, propName )
|
< 0.001 | 2 | 43 | try
|
< 0.001 | 2 | 44 | if ( isa(obj, 'handle') || ~isobject(obj) ) % COM is an example that returns FALSE from ISOBJECT but should go into this branch
|
< 0.001 | 2 | 45 | if isa(obj, 'double') % In case the object is casted to double
|
| | 46 | obj = handle(obj);
|
| | 47 | if ishghandle(obj) % graphics handle
|
| | 48 | tf = isprop(obj, propName); % delegate to HG ISPROP overload
|
| | 49 | return
|
| | 50 | end
|
| | 51 | end
|
< 0.001 | 2 | 52 | p = findprop(obj, propName); % match case sensitivity determined by the object's FINDPROP
|
< 0.001 | 2 | 53 | tf= ~isempty(p) && strcmpi(p.Name,propName); % make sure property match to the complete query text
|
| | 54 | else % assume FINDPROP is not defined for OBJ and query METACLASS
|
| | 55 | mc = metaclass(obj);
|
| | 56 | if isempty(mc) % no property
|
| | 57 | tf = false;
|
| | 58 | else
|
| | 59 | tf = ~isempty( findobj(mc.PropertyList, '-depth',0,'Name', propName) );
|
| | 60 | end
|
< 0.001 | 2 | 61 | end
|
| | 62 | catch
|
| | 63 | tf = false;
|
| | 64 | end
|
< 0.001 | 2 | 65 | end
|
Other subfunctions in this file are not included in this listing.