congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConditionReference
Code IndexAdd Tabnine to your IDE (free)

How to use
ConditionReference
in
io.yawp.repository.query.condition

Best Java code snippets using io.yawp.repository.query.condition.ConditionReference (Showing top 5 results out of 315)

origin: feroult/yawp

@Override
public boolean evaluate(Object object) {
  try {
    Object objectValue = new ConditionReference(field, clazz, object).getValue();
    return whereOperator.evaluate(objectValue, whereValue);
  } catch (ConditionForChildException e) {
    return true;
  }
}
origin: feroult/yawp

public Object getValue() throws ConditionForChildException {
  verifyIfConditionIsForChild();
  Object currentObject = advanceAncestorSequenceIfNecessary();
  while (hasMoreRefs()) {
    IdRef<?> objectId = (IdRef<?>) ReflectionUtils.getFieldValue(currentObject, nextRef());
    if (objectId == null) {
      return null;
    }
    currentObject = objectId.fetch();
  }
  return ReflectionUtils.getFieldValue(currentObject, fieldName());
}
origin: feroult/yawp

private Object advanceAncestorSequenceIfNecessary() {
  if (isObjectAcenstor()) {
    advanceToTheRightAncestor();
  }
  if (!isParentRef()) {
    return object;
  }
  IdRef<?> parentId = objectHolder.getParentId();
  nextRef();
  while (isParentRef()) {
    parentId = parentId.getParentId();
    nextRef();
  }
  return parentId.fetch();
}
origin: feroult/yawp

private void verifyIfConditionIsForChild() throws ConditionForChildException {
  if (clazz != null && isObjectAcenstor() && isReferenceForChild()) {
    throw new ConditionForChildException();
  }
}
origin: feroult/yawp

private void advanceToTheRightAncestor() {
  if (clazz == null || object.getClass().equals(clazz)) {
    return;
  }
  Class<?> ancestorClazz = clazz;
  for (int i = 0; !object.getClass().equals(ancestorClazz); i++) {
    ancestorClazz = model.getAncestorClazz(i);
    if (ancestorClazz == null) {
      throw new RuntimeException("Invalid condition ref " + refString + " for object class: " + object.getClass().getName());
    }
    nextRef();
  }
}
io.yawp.repository.query.conditionConditionReference

Most used methods

  • <init>
  • advanceAncestorSequenceIfNecessary
  • advanceToTheRightAncestor
  • fieldName
  • getValue
  • hasMoreRefs
  • isObjectAcenstor
  • isParentRef
  • isReferenceForChild
  • nextRef
  • verifyIfConditionIsForChild
  • verifyIfConditionIsForChild

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now