/** * Checks whether the current property is declared as to be observed via the * propertyDependencies key. * * @return true if the current property key is to be observed */ public Object shouldObserve(D2WContext context) { boolean shouldObserve = false; NSDictionary<String, NSArray<String>> propertyDependencies = ERMDAjaxNotificationCenter.PROPERTY_DEPENDENCIES .valueInObject(context); if (propertyDependencies != null && propertyDependencies.containsKey(context.propertyKey())) { shouldObserve = true; } return shouldObserve; }
/** * @param context * The d2wContext of the changed property level component * @return a list of property keys to be updated */ @SuppressWarnings("unchecked") public NSArray<String> propertyChanged(D2WContext context) { String prop = context.propertyKey(); NSArray<String> dependants = NSArray.EmptyArray; NSDictionary<String, NSArray<String>> propertyDependencies = PROPERTY_DEPENDENCIES .valueInObject(context); if (propertyDependencies.containsKey(prop)) { dependants = (NSArray<String>) propertyDependencies.valueForKey(prop); } return dependants; }
protected NSArray _ignoredPackages() { NSBundle bundle; String path, content; NSDictionary dic = null; NSMutableArray<NSBundle> allBundles = new NSMutableArray<>(NSBundle.frameworkBundles()); NSMutableArray<String> ignored = new NSMutableArray<>(); for (Enumeration enumerator = allBundles.objectEnumerator(); enumerator.hasMoreElements(); ) { bundle = (NSBundle) enumerator.nextElement(); path = WOApplication.application().resourceManager().pathForResourceNamed("WOIgnoredPackage.plist",bundle.name(),null); if (path != null) { content = _stringFromFileSafely(path); if (content != null) { dic = (NSDictionary) NSPropertyListSerialization.propertyListFromString(content); if (dic != null && dic.containsKey("ignoredPackages")) { @SuppressWarnings("unchecked") NSArray<String> tmpArray = (NSArray<String>) dic.objectForKey("ignoredPackages"); if (tmpArray != null && tmpArray.count() > 0) { ignored.addObjectsFromArray(tmpArray); } } } } } System.out.println("_ignoredPackages:: "+ignored); return ignored; }