Tabnine Logo
StrictErrorHandler.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
ca.uhn.fhir.parser.StrictErrorHandler
constructor

Best Java code snippets using ca.uhn.fhir.parser.StrictErrorHandler.<init> (Showing top 6 results out of 315)

origin: jamesagnew/hapi-fhir

@SuppressWarnings("unused")
public void enableValidation() {
 // START SNIPPET: clientValidation
 FhirContext ctx = FhirContext.forDstu3();
 
 ctx.setParserErrorHandler(new StrictErrorHandler());
 
 // This client will have strict parser validation enabled
 IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu3");
 // END SNIPPET: clientValidation
 
}
origin: jamesagnew/hapi-fhir

@Override
protected void initialize() throws ServletException {
  // ...Configure resource providers, etc... 
    // Create a context, set the error handler and instruct
  // the server to use it
  FhirContext ctx = FhirContext.forDstu3();
  ctx.setParserErrorHandler(new StrictErrorHandler());
  setFhirContext(ctx);
}

origin: jamesagnew/hapi-fhir

public void parserValidation() {
 // START SNIPPET: parserValidation
 FhirContext ctx = FhirContext.forDstu3();
 
 // Create a parser and configure it to use the strict error handler
 IParser parser = ctx.newXmlParser();
 parser.setParserErrorHandler(new StrictErrorHandler());
 // This example resource is invalid, as Patient.active can not repeat
 String input = "<Patient><active value=\"true\"/><active value=\"false\"/></Patient>";
 // The following will throw a DataFormatException because of the StrictErrorHandler
 parser.parseResource(Patient.class, input);
 // END SNIPPET: parserValidation
}
origin: stackoverflow.com

 String key = "key";
Integer cached = 0;

MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService();
memcacheService.setErrorHandler(new StrictErrorHandler());
cached = (Integer) memcacheService.get(key);
if (cached == null) {
 memcacheService.put(key, 0);
} else {
 memcacheService.put(key, cached + 1);
}
origin: FirelyTeam/fhirstarters

  public static void main(String[] args) {
    String input = "<Encounter xmlns=\"http://hl7.org/fhir\"><AAAA value=\"foo\"/></Encounter>";

    IParser p = FhirContext.forDstu3().newXmlParser();
    
    // Parse with (default) lenient error handler
    p.setParserErrorHandler(new LenientErrorHandler());
    p.parseResource(input);

    // Parse with strict error handler
    p.setParserErrorHandler(new StrictErrorHandler());
    p.parseResource(input);
  }
}
origin: synthetichealth/synthea

jsonParser.setParserErrorHandler(new StrictErrorHandler());
ca.uhn.fhir.parserStrictErrorHandler<init>

Popular methods of StrictErrorHandler

  • invalidValue

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top Sublime Text plugins
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