public void setKey(String v) { if(v !=null) _key = v; else _key = null; if (_useMethod) { _selKey = new NSSelector(_key); } }
public Enumeration getElements(Object target) { try { return (Enumeration) sel.invoke( target ); } catch( Exception e ) { throw new RuntimeException("NSFoundationElementsAccessor being used with a non-foundation class: " + target.getClass().getName()); } }
@Override public WOActionResults performActionNamed(String anActionName) { if(!ERSelenium.testsEnabled()) { return new ERXResponse(ERXHttpStatusCodes.FORBIDDEN); } if("default".equals(anActionName)) { anActionName = null; } else if(new NSSelector(anActionName + "Action").implementedByObject(this)) { return super.performActionNamed(anActionName); } return result(anActionName, false); } }
try { if (conversionClass != null) { convertedValue = conversionMethod.invoke(conversionClass,new Object[]{value}); } else { convertedValue = conversionMethod.invoke(value); EOEntity parentEntity = (EOEntity) parent(); String entityName = parentEntity == null ? "<unspecified>" : parentEntity.name(); throw new IllegalArgumentException(new StringBuilder().append("EOAttribute adaptorValueByConvertingAttributeValue(Object): Unable to convert value of class ").append(convertedValue.getClass().getName()).append(" for attribute '").append(name()).append("' in entity '").append(entityName).append("' to adaptor type EOAttribute.Adaptor").append(valueTypeNames[valueType]).append("Type. Check the signature of the conversion method ").append(className()).append('.').append(conversionMethod == null ? "NotFound" : conversionMethod.name()).append("().").toString());
ERXQ.has(qualifierKey, new NSArray(keyValueQualifier.value()))); } else if (qualifierKey.equals(entity.primaryKeyAttributeNames().get(0)) && keyValueQualifier.selector().name().equals("doesContain") && !(keyValueQualifier.value() instanceof NSArray)) {
private void _setFactoryMethodArgumentType(int argumentType) { _argumentType = argumentType; if (_valueFactoryMethodName != null) _valueFactoryMethod = new NSSelector(_valueFactoryMethodName, _classForArgumentType()); }
private void _setValueFactoryMethodName(String factoryMethodName) { if (factoryMethodName != null && factoryMethodName.length() != 0) { if (factoryMethodName.endsWith(":")) { _valueFactoryMethodName = factoryMethodName.substring(0, factoryMethodName.length() - 1); } else { _valueFactoryMethodName = factoryMethodName; } _valueFactoryMethod = new NSSelector(_valueFactoryMethodName, _classForArgumentType()); } else { _valueFactoryMethodName = null; _valueFactoryMethod = null; } }
/** * Returns the value for the given record. * If {@link #useMethod()} is given, the method is called and no further * action is taken if that fails. * Otherwise we use {@link NSKeyValueCoding} which also considers instance * variables. */ public Object valueForRecord(DRRecord rec) { Object aval = null; if (_useMethod) { try{ aval = _selKey.invoke(rec.rawRecord()); } catch(IllegalAccessException e) { } catch(IllegalArgumentException e) { } catch(java.lang.reflect.InvocationTargetException e) { } catch(NoSuchMethodException e) { } } else { aval = rec.rawRecord().valueForKeyPath(_key); } return aval; }
private void _setAdaptorValueConversionMethodName(String conversionMethodName) { if (conversionMethodName != null && conversionMethodName.length() != 0) { _adaptorValueConversionMethodName = conversionMethodName; if(adaptorValueConversionClass()!=null) { Class valueClass = _NSUtilities.classWithName(className()); _adaptorValueConversionMethod = new NSSelector(_adaptorValueConversionMethodName, new Class[]{valueClass}); } else { _adaptorValueConversionMethod = new NSSelector(_adaptorValueConversionMethodName, null); } } else { _adaptorValueConversionMethodName = null; _adaptorValueConversionMethod = null; } }
public void prepareSelectExpressionWithAttributes(NSArray<EOAttribute> attributes, boolean lock, EOFetchSpecification fetchSpec) { try { _fetchRange = _fetchRangeSelector.invoke(fetchSpec);
public Ajax() { NSNotificationCenter center = NSNotificationCenter.defaultCenter(); // This is needed when ERXAjaxApplication is sub-classed center.addObserver(this, new NSSelector("finishAjaxInitialization", ERXConstant.NotificationClassArray), WOApplication.ApplicationWillFinishLaunchingNotification, null); }
protected void _removeFromEntityArraySelector(NSArray oldArray, NSSelector sel) { if (oldArray.indexOfObject(this) != -1) { NSMutableArray newArray = new NSMutableArray(oldArray); newArray.removeIdenticalObject(this); try { sel.invoke(entity(), newArray); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (IllegalArgumentException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (InvocationTargetException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (NoSuchMethodException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } }
public _UserPreferenceHandler() { NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("handleBatchSizeChange", ERXConstant.NotificationClassArray), ERXBatchNavigationBar.BatchSizeChanged, null); NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("handleSortOrderingChange", ERXConstant.NotificationClassArray), ERXSortOrder.SortOrderingChanged, null); NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("handleDisplayVariantChange", ERXConstant.NotificationClassArray), ERDAttributeRepetition.DisplayVariantChanged, null); }
value1 = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), value); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); value1 = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), new Object[] { bytes, _NSUtilities.IntegerForInt(length) }); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e);
@Override public void awake() { _dataSource = null; NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector<Void>("relatedObjectDidChange", ERXConstant.NotificationClassArray), ERMDActionButton.BUTTON_PERFORMED_DELETE_ACTION, null); super.awake(); }
value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), str); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), _NSStringUtilities.bytesForString(str, CharEncoding.UTF_8)); if (!NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDatabaseAccess)) break; value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), new NSData(str, CharEncoding.UTF_8)); if (!NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDatabaseAccess)) break;
public EREntityStoreFactory(Class<? extends EREntityStore> clazz) { _entityStores = new NSMutableDictionary<>(); _entityStoreClazz = clazz; NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("resetAllEntities", new Class[] { NSNotification.class }), RESET_ALL_ENTITIES, null); }
value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), data); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), bytes); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), _NSStringUtilities.stringForBytes(bytes, CharEncoding.UTF_8)); if (!NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDatabaseAccess)) break;
@SuppressWarnings("rawtypes") @Override public void awake() { NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("relatedObjectDidChange", ERXConstant.NotificationClassArray), ERMDActionButton.BUTTON_PERFORMED_DELETE_ACTION, null); super.awake(); // make sure we don't display a previous search value _searchValue = null; }