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

How to use
SchemaBaseValidator$MyResourceResolver
in
ca.uhn.fhir.validation

Best Java code snippets using ca.uhn.fhir.validation.SchemaBaseValidator$MyResourceResolver (Showing top 2 results out of 315)

origin: jamesagnew/hapi-fhir

private Schema loadSchema(String theVersion, String theSchemaName) {
  String key = theVersion + "-" + theSchemaName;
  synchronized (myKeyToSchema) {
    Schema schema = myKeyToSchema.get(key);
    if (schema != null) {
      return schema;
    }
    Source baseSource = loadXml(null, theSchemaName);
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    schemaFactory.setResourceResolver(new MyResourceResolver());
    try {
      try {
      /*
       * See https://github.com/jamesagnew/hapi-fhir/issues/339
       * https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
       */
        schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
      }catch (SAXNotRecognizedException snex){
        ourLog.warn("Jaxp 1.5 Support not found.",snex);
      }
      schema = schemaFactory.newSchema(new Source[] { baseSource });
    } catch (SAXException e) {
      throw new ConfigurationException("Could not load/parse schema file: " + theSchemaName, e);
    }
    myKeyToSchema.put(key, schema);
    return schema;
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

private Schema loadSchema(String theVersion, String theSchemaName) {
  String key = theVersion + "-" + theSchemaName;
  synchronized (myKeyToSchema) {
    Schema schema = myKeyToSchema.get(key);
    if (schema != null) {
      return schema;
    }
    Source baseSource = loadXml(null, theSchemaName);
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    schemaFactory.setResourceResolver(new MyResourceResolver());
    try {
      try {
      /*
       * See https://github.com/jamesagnew/hapi-fhir/issues/339
       * https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
       */
        schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
      }catch (SAXNotRecognizedException snex){
        ourLog.warn("Jaxp 1.5 Support not found.",snex);
      }
      schema = schemaFactory.newSchema(new Source[] { baseSource });
    } catch (SAXException e) {
      throw new ConfigurationException("Could not load/parse schema file: " + theSchemaName, e);
    }
    myKeyToSchema.put(key, schema);
    return schema;
  }
}
ca.uhn.fhir.validationSchemaBaseValidator$MyResourceResolver

Most used methods

  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JFrame (javax.swing)
  • JTextField (javax.swing)
  • 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