Tabnine Logo
SType.getValidators
Code IndexAdd Tabnine to your IDE (free)

How to use
getValidators
method
in
org.opensingular.form.SType

Best Java code snippets using org.opensingular.form.SType.getValidators (Showing top 7 results out of 315)

origin: org.opensingular/singular-requirement-commons

private Boolean initValidationRule(SType<?> type) {
  return !type.getValidators().isEmpty();
}
origin: org.opensingular/singular-server-commons

private Boolean initValidationRule(SType<?> type) {
  return !type.getValidators().isEmpty();
}
origin: org.opensingular/singular-requirement-module

private Boolean initValidationRule(SType<?> type) {
  return !type.getValidators().isEmpty();
}
origin: org.opensingular/singular-form-core

public final List<ValidationEntry<I>> getValidators() {
  List<ValidationEntry<I>> list = superType == null ? Collections.emptyList() : superType.getValidators();
  if (validators != null && !validators.isEmpty()) {
    if (list.isEmpty()) {
      list = new ArrayList<>(validators);
    } else {
      list.addAll(validators);
    }
  }
  return list;
}
origin: org.opensingular/form-core

public Collection<IInstanceValidator<I>> getValidators() {
  Collection<IInstanceValidator<I>> list =
      superType == null ? Collections.emptyList() : superType.getValidators();
  if (instanceValidators != null && !instanceValidators.isEmpty()) {
    if (list.isEmpty()) {
      list = instanceValidators.keySet();
    } else {
      if (!(list instanceof ArrayList)) {
        ArrayList<IInstanceValidator<I>> list2 = new ArrayList<>(list.size() + instanceValidators.size());
        list2.addAll(list);
        list = list2;
      }
      list.addAll(instanceValidators.keySet());
    }
  }
  return list;
}
origin: org.opensingular/form-core

@SuppressWarnings({"unchecked", "rawtypes"})
protected <I extends SInstance> void validateInstance(IInstanceValidatable<I> validatable, boolean containsInvalidChild) {
  final I instance = validatable.getInstance();
  if (isEnabledInHierarchy(instance) && isVisibleInHierarchy(instance)) {
    if (!isFilledIfRequired(instance)) {
      validatable.error(new ValidationError(instance.getId(), ValidationErrorLevel.ERROR, "Campo obrigatório"));
      return;
    }
    final SType<I> tipo = (SType<I>) instance.getType();
    for (IInstanceValidator<I> validator : tipo.getValidators()) {
      if (containsInvalidChild && validator.executeOnlyIfChildrenValid())
        continue;
      validatable.setDefaultLevel(tipo.getValidatorErrorLevel(validator));
      validator.validate((IInstanceValidatable) validatable);
    }
  }
}
origin: org.opensingular/singular-form-core

@SuppressWarnings({"unchecked"})
protected <I extends SInstance> void validateInstance(InstanceValidatable<I> validatable, boolean containsInvalidChild) {
  final I instance = validatable.getInstance();
  if (isEnabledInHierarchy(instance) && isVisibleInHierarchy(instance)) {
    if (!isFilledIfRequired(instance)) {
      validatable.error(new ValidationErrorImpl(instance.getId(), ValidationErrorLevel.ERROR, "Campo obrigatório"));
      return;
    }
    final SType<I> type = (SType<I>) instance.getType();
    for (ValidationEntry<I> entry : type.getValidators()) {
      if (containsInvalidChild && entry.getValidator().executeOnlyIfChildrenValid())
        continue;
      validatable.setDefaultLevel(entry.getErrorLevel());
      entry.getValidator().validate(validatable);
    }
  }
}
org.opensingular.formSTypegetValidators

Popular methods of SType

  • asAtr
  • getNameSimple
  • getName
  • asAtrProvider
  • getAttributeValue
  • isList
    Verificar se o tipo é um tipo lista ( STypeList).
  • withView
  • asAtrBootstrap
  • getInstanceClass
  • isComposite
    Verificar se o tipo é um tipo composto ( STypeComposite).
  • getDependentTypes
  • getDictionary
  • getDependentTypes,
  • getDictionary,
  • hasAttributeDefinedInHierarchy,
  • isDependentType,
  • isTypeOf,
  • newInstance,
  • addAttribute,
  • addDependentType,
  • addInstanceValidator

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Join (org.hibernate.mapping)
  • Github Copilot alternatives
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