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

How to use
validate
method
in
org.apache.activemq.artemis.utils.XMLUtil

Best Java code snippets using org.apache.activemq.artemis.utils.XMLUtil.validate (Showing top 3 results out of 315)

origin: apache/activemq-artemis

public void readConfiguration() throws Exception {
 URL url;
 url = Thread.currentThread().getContextClassLoader().getResource(configurationUrl);
 if (url == null) {
   // trying a different classloader now
   url = getClass().getClassLoader().getResource(configurationUrl);
 }
 if (url == null) {
   // The URL is outside of the classloader. Trying a pure url now
   url = new URL(configurationUrl);
 }
 // create a reader
 try (Reader reader = new InputStreamReader(url.openStream())) {
   String xml = XMLUtil.readerToString(reader);
   //replace any system props
   xml = XMLUtil.replaceSystemProps(xml);
   Element e = XMLUtil.stringToElement(xml);
   //iterate around all the deployables
   for (Deployable deployable : deployables.values()) {
    String root = deployable.getRootElement();
    NodeList children = e.getElementsByTagName(root);
    //if the root element exists then parse it
    if (root != null && children.getLength() > 0) {
      Node item = children.item(0);
      XMLUtil.validate(item, deployable.getSchema());
      deployable.parse((Element) item, url);
    }
   }
 }
}
origin: apache/activemq-artemis

if (root != null && children.getLength() > 0) {
  Node item = children.item(0);
  XMLUtil.validate(item, ((FileConfiguration) configuration).getSchema());
  ((FileConfiguration) configuration).parse((Element) item, url);
origin: apache/activemq-artemis

/**
* test does not pass in eclipse (because it can not find artemis-configuration.xsd).
* It runs fine on the CLI with the proper env setting.
*/
@Test
public void testMinimalConfiguration() throws Exception {
 String xml = "<core xmlns='urn:activemq:core'>" + "</core>";
 Element element = XMLUtil.stringToElement(xml);
 Assert.assertNotNull(element);
 XMLUtil.validate(element, "schema/artemis-configuration.xsd");
}
org.apache.activemq.artemis.utilsXMLUtilvalidate

Popular methods of XMLUtil

  • assertEquivalent
  • elementToString
  • findResource
  • getTextContent
    Note: if the content is another element or set of elements, it returns a string representation of th
  • filter
  • readerToElement
  • replaceSystemProps
  • stringToElement
  • readerToString
  • parseBoolean
  • parseDouble
  • parseInt
  • parseDouble,
  • parseInt,
  • parseLong,
  • stripCDATA

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ImageIO (javax.imageio)
  • JLabel (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top 17 Free Sublime Text Plugins
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