Added isSubType(qname) to ScriptNode API.

- Example:   var isType = node.isSubType("abc:someqname");

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14225 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-05-07 07:47:26 +00:00
parent 70d66c0f8c
commit f122157dce

View File

@@ -667,7 +667,7 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
return isLinkToDocument.booleanValue();
}
/**
* @return true if the Node is a Category
*/
@@ -706,7 +706,7 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
}
/**
* @param aspect The aspect name to test for (full qualified or short-name form)
* @param aspect The aspect name to test for (fully qualified or short-name form)
* @return true if the node has the aspect false otherwise
*/
public boolean hasAspect(String aspect)
@@ -714,6 +714,19 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
return getAspectsSet().contains(createQName(aspect));
}
/**
* @param type The qname type to test this object against (fully qualified or short-name form)
* @return true if this Node is a sub-type of the specified class (or itself of that class)
*/
public boolean isSubType(String type)
{
ParameterCheck.mandatoryString("Type", type);
QName qnameType = createQName(type);
return this.services.getDictionaryService().isSubClass(getQNameType(), qnameType);
}
/**
* @return QName path to this node. This can be used for Lucene PATH: style queries
*/