Skip to content

Commit

Permalink
Add support for annotation validators and induced user interfaces #10
Browse files Browse the repository at this point in the history
  • Loading branch information
estepper committed Aug 28, 2023
1 parent 1300b66 commit e417d40
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,32 @@ public static boolean isSystemPackageURI(String nsURI)
return CORE_PACKAGE_URI.equals(nsURI) || RESOURCE_PACKAGE_URI.equals(nsURI) || TYPES_PACKAGE_URI.equals(nsURI);
}

/**
* @since 4.21
*/
public static boolean isBasedInPackage(EClass eClass, String nsURI)
{
if (nsURI == null)
{
return false;
}

if (nsURI.equals(eClass.getEPackage().getNsURI()))
{
return true;
}

for (EClass superType : eClass.getESuperTypes())
{
if (isBasedInPackage(superType, nsURI))
{
return true;
}
}

return false;
}

/**
* @since 4.0
*/
Expand Down

0 comments on commit e417d40

Please sign in to comment.