public static List<String> getSettableProperties(InternalRuleBase ruleBase, Class<?> nodeClass) {
   if (nodeClass == null) {
     return null;
   }
   TypeDeclaration typeDeclaration = ruleBase.getTypeDeclaration(nodeClass);
   if (typeDeclaration == null) {
     return ClassUtils.getSettableProperties(nodeClass);
   }
   typeDeclaration.setTypeClass(nodeClass);
   return typeDeclaration.getSettableProperties();
 }
Esempio n. 2
0
 private static long getExpiratioOffsetForType(BuildContext context, ObjectType objectType) {
   long expirationOffset = -1;
   for (TypeDeclaration type : context.getRuleBase().getTypeDeclarations()) {
     if (type.getObjectType().isAssignableFrom(objectType)) {
       expirationOffset = Math.max(type.getExpirationOffset(), expirationOffset);
     }
   }
   // if none of the type declarations have an @expires annotation
   // we return -1 (no-expiration) value, otherwise we return the
   // set expiration value+1 to enable the fact to match events with
   // the same timestamp
   return expirationOffset == -1 ? -1 : expirationOffset + 1;
 }
 public static boolean isPropertyReactive(BuildContext context, Class<?> objectClass) {
   TypeDeclaration typeDeclaration = context.getRuleBase().getTypeDeclaration(objectClass);
   return typeDeclaration != null && typeDeclaration.isPropertyReactive();
 }