congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AdministrationService.validate
Code IndexAdd Tabnine to your IDE (free)

How to use
validate
method
in
org.openmrs.api.AdministrationService

Best Java code snippets using org.openmrs.api.AdministrationService.validate (Showing top 4 results out of 315)

origin: openmrs/openmrs-core

/**
 * Test the given object against all validators that are registered as compatible with the
 * object class
 *
 * @param obj the object to validate
 * @param errors the validation errors found
 * @since 1.9
 * @should populate errors if object invalid
 * @should return immediately if validation is disabled and have no errors
 */
public static void validate(Object obj, Errors errors) {
  if (disableValidation) {
    return;
  }
  Context.getAdministrationService().validate(obj, errors);
}

origin: openmrs/openmrs-core

@Test(expected = APIException.class)
public void validate_shouldThrowThrowAPIExceptionIfTheInputIsNull() {
  BindException errors = new BindException(new Object(), "");
  adminService.validate(null, errors);
}

origin: openmrs/openmrs-core

Context.getAdministrationService().validate(obj, errors);
origin: openmrs/openmrs-core

/**
 * @see DrugOrderValidator#validate(Object, org.springframework.validation.Errors)
 */
@Test
public void validate_shouldFailIfConceptIsNullAndCannotInferItFromDrug() {
  DrugOrder order = new DrugOrder();
  Drug drug = Context.getConceptService().getDrug(3);
  drug.setConcept(null);
  order.setDrug(drug);
  
  Errors errors = new BindException(order, "order");
  adminService.validate(order, errors);
  Assert.assertTrue(errors.hasFieldErrors("concept"));
}

org.openmrs.apiAdministrationServicevalidate

Javadoc

Performs validation in the manual flush mode to prevent any premature flushes.

Used by ValidateUtil#validate(Object).

Popular methods of AdministrationService

  • saveGlobalProperty
    Save the given global property to the database
  • getGlobalProperty
    Gets the global property that has the given propertyName If propertyName is not found in the list of
  • getGlobalPropertyObject
    Gets the global property that has the given propertyName
  • getAllGlobalProperties
    Get a list of all global properties in the system
  • getAllowedLocales
    Gets the list of locales which the administrator has allowed for use on the system. This is specifie
  • executeSQL
    Runs the sql on the database. If selectOnly is flagged then any non-select sql statements will be re
  • getGlobalPropertiesByPrefix
    Gets all global properties that begin with prefix.
  • getGlobalPropertyByUuid
    Get a global property by its uuid. There should be only one of these in the database (well, in the w
  • getGlobalPropertyValue
    Returns a global property according to the type specified
  • purgeGlobalProperty
    Completely remove the given global property from the database
  • addGlobalPropertyListener
    Allows code to be notified when a global property is created/edited/deleted.
  • getSearchLocales
    Returns a list of locales used by the user when searching.
  • addGlobalPropertyListener,
  • getSearchLocales,
  • getSystemVariables,
  • setGlobalProperty,
  • setImplementationId,
  • getGlobalPropertiesBySuffix,
  • getImplementationId,
  • getMaximumPropertyLength,
  • getPresentationLocales

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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