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