Tabnine Logo
FieldType.isUpdatable
Code IndexAdd Tabnine to your IDE (free)

How to use
isUpdatable
method
in
org.activityinfo.model.type.FieldType

Best Java code snippets using org.activityinfo.model.type.FieldType.isUpdatable (Showing top 3 results out of 315)

origin: bedatadriven/activityinfo

/**
 * Verify that all required fields are provided for new resources
 */
private static void validateRequiredFields(FormClass formClass, Optional<FormRecord> existingResource, TypedRecordUpdate update) {
  if(!existingResource.isPresent()) {
    for (FormField formField : formClass.getFields()) {
      if (formField.isRequired() &&
        formField.isVisible() &&
        formField.getType().isUpdatable() && !isProvided(formField, existingResource, update)) {
        throw new InvalidUpdateException("Required field '%s' [%s] is missing from record with schema %s",
          formField.getCode(), formField.getId(), formClass.getId().asString());
      }
    }
  }
}
origin: bedatadriven/activityinfo

private static FieldValue validateType(FormField field, FieldValue updatedValue) {
  Preconditions.checkNotNull(field);
  if(updatedValue != null) {
    if ( !field.getType().isUpdatable()) {
      throw new InvalidUpdateException(
        format("Field %s ('%s') is a field of type '%s' and its value cannot be set. Found %s",
          field.getId(),
          field.getLabel(),
          field.getType().getTypeClass().getId(),
          updatedValue));
    }
    if (!field.getType().getTypeClass().equals(updatedValue.getTypeClass())) {
      throw new InvalidUpdateException(
        format("Updated value for field %s ('%s') has invalid type. Expected %s, found %s.",
          field.getId(),
          field.getLabel(),
          field.getType().getTypeClass().getId(),
          updatedValue.getTypeClass().getId()));
    }
  }
  return updatedValue;
}
origin: bedatadriven/activityinfo

JsonValue fieldValues = jsonObject.get("fieldValues");
for (FormField formField : formClass.getFields()) {
  if(formField.getType().isUpdatable()) {
    if (fieldValues.hasKey(formField.getName())) {
      JsonValue updatedValueElement = fieldValues.get(formField.getName());
org.activityinfo.model.typeFieldTypeisUpdatable

Popular methods of FieldType

  • getTypeClass
  • parseJsonValue
  • accept

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Kernel (java.awt.image)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
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