Tabnine Logo
ValidationContext
Code IndexAdd Tabnine to your IDE (free)

How to use
ValidationContext
in
org.jibx.binding.model

Best Java code snippets using org.jibx.binding.model.ValidationContext (Showing top 17 results out of 315)

origin: org.jibx/jibx-tools

  new org.jibx.binding.model.ValidationContext(new DummyClassLocator());
BindingElement binding = BindingElement.readBinding(url.openStream(), name, null, true,
  vctx);
binding.setBaseUrl(url);
vctx.setBindingRoot(binding);
if (vctx.getProblems().size() > 0) {
  reportBindingProblems(vctx, handler);
  if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
    throw new JiBXException("Errors in binding");
origin: org.jibx/jibx-tools

/**
 * Populate the mapping directory from a supplied list of root bindings. This uses a visitor to analyze the
 * bindings, building the detail information to be used during the actual generation process.
 * 
 * @param bindings
 */
public void populate(List bindings) {
  
  // analyze all the bindings
  AnalysisVisitor visitor = new AnalysisVisitor(m_context);
  for (Iterator iter = bindings.iterator(); iter.hasNext();) {
    m_context.tourTree((BindingElement)iter.next(), visitor);
  }
  
  // flag all mappings referenced as base types to be defined as types
  for (Iterator iter = m_forceTypeMappings.iterator(); iter.hasNext();) {
    MappingElement mapping = (MappingElement)iter.next();
    MappingDetail detail = (MappingDetail)m_mappingMap.get(mapping);
    detail.setType(true);
  }
}

origin: org.apache.axis2/axis2-jibx

  public boolean visit(IncludeElement node) {
    try {
      // force creation of defintions context for containing binding
      m_context.getFormatDefinitions();
      node.prevalidate(m_context);
    } catch (Throwable t) {
      m_context.addFatal("Error during validation: " +
          t.getMessage());
      t.printStackTrace();
      return false;
    }
    return true;
  }
}
origin: org.jibx/jibx-tools

ValidationContext vctx = new ValidationContext(loc);
FileInputStream is = new FileInputStream(file);
BindingElement binding = BindingElement.validateBinding(root.getFileName(), file.toURI().toURL(), is, vctx);
if (binding == null || vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
  return null;
} else {
origin: org.apache.axis2/axis2-jibx

binding = BindingElement.readBinding(new FileInputStream(file), path, vctx);
binding.setBaseUrl(file.toURI().toURL());
vctx.setBindingRoot(binding);
IncludePrevalidationVisitor ipv = new IncludePrevalidationVisitor(vctx);
vctx.tourTree(binding, ipv);
if (vctx.getErrorCount() != 0 || vctx.getFatalCount() != 0) {
  ArrayList probs = vctx.getProblems();
  System.err.println("Errors in generated binding:");
  for (int j = 0; j < probs.size(); j++) {
origin: org.jibx/jibx-tools

ArrayList probs = m_context.getProblems();
boolean error = m_context.getErrorCount() > 0 || m_context.getFatalCount() > 0;
if (probs.size() > 0) {
  System.out.print(error ? "Errors" : "Warnings");
origin: org.jibx/jibx-tools

/**
 * Report problems found in binding.
 * 
 * @param vctx Validation Context
 * @param handler Problem Handler
 */
private static void reportBindingProblems(org.jibx.binding.model.ValidationContext vctx, ProblemHandler handler) {
  StringBuffer buff = new StringBuffer();
  ArrayList problems = vctx.getProblems();
  for (int i = 0; i < problems.size(); i++) {
    org.jibx.binding.model.ValidationProblem prob =
      (org.jibx.binding.model.ValidationProblem)problems.get(i);
    buff.setLength(0);
    buff.append(prob.getSeverity() >= org.jibx.binding.model.ValidationProblem.ERROR_LEVEL ?
      "Error: " : "Warning: ");
    buff.append(prob.getDescription());
    handler.report(buff.toString());
  }
}
origin: org.jibx/jibx-tools

    m_context.addWarning("Handling not implemented for unspecified mapping", coll);
    m_context.addWarning("Handling not implemented for unspecified mapping", struct);
  m_context.addError("Unsupported binding construct", comp);
m_context.addError("Unsupported component", comp);
origin: org.jibx/jibx-tools

    m_context.addError("No schema equivalent for optional abstract mapping with attributes", comp);
  } else {
    MappingElementBase ref = (MappingElementBase)struct.getEffectiveMapping();
  m_context.addError("Unsupported binding construct", comp);
m_context.addError("Unsupported component", comp);
origin: org.jibx/jibx-tools

/**
 * Constructor.
 * 
 * @param loc locator for class information (<code>null</code> if none)
 * @param custom binding customization information (used for creating names as needed)
 * @param urinames map from namespace URI to schema file name
 */
public SchemaGen(IClassLocator loc, GlobalCustom custom, Map urinames) {
  m_locator = loc;
  m_custom = custom;
  m_classSimpletypes = new HashMap();
  m_uriNames = urinames;
  m_uriSchemas = new HashMap();
  m_formatCache = new FormatterCache(loc);
  m_context = new ValidationContext(loc);
  m_detailDirectory = new DetailDirectory(custom, m_context);
}

origin: apache/axis2-java

binding = BindingElement.readBinding(new FileInputStream(file), path, vctx);
binding.setBaseUrl(file.toURI().toURL());
vctx.setBindingRoot(binding);
IncludePrevalidationVisitor ipv = new IncludePrevalidationVisitor(vctx);
vctx.tourTree(binding, ipv);
if (vctx.getErrorCount() != 0 || vctx.getFatalCount() != 0) {
  ArrayList probs = vctx.getProblems();
  System.err.println("Errors in generated binding:");
  for (int j = 0; j < probs.size(); j++) {
origin: org.jibx/jibx-tools

FileInputStream is = new FileInputStream(file);
try {
  ValidationContext vctx = new ValidationContext(parms.getLocator());
  BindingElement binding = BindingElement.validateBinding(name, url, is, vctx);
  if (vctx.getErrorCount() == 0 && vctx.getFatalCount() == 0) {
    bindings.add(binding);
  } else {
origin: org.jibx/jibx-tools

m_context.addError("'extends' mapping not usable as schema extension base", map);
origin: org.jibx/jibx-tools

/**
 * Write the binding definitions file(s). This method can only be used after
 * {@link #buildDataModel(boolean, boolean, Map, Map)} is called.
 *
 * @param name root binding definition file name (use customization, or default, if <code>null</code>)
 * @param pack target package for binding (<code>null</code> if unspecified)
 * @param pregens pregenerated bindings to be included in root binding
 * @param handler validation error and code generation problem handler
 * @throws JiBXException error
 * @throws IOException error
 */
public void writeBindings(String name, String pack, List pregens, ProblemHandler handler)
throws JiBXException, IOException {
  if (name == null) {
    name = m_global.getBindingFileName();
    if (name == null) {
      name = "binding.xml";
    }
  }
  m_rootHolder = m_bindingDirectory.configureFiles(name, pack, pregens);
  IClassLocator iloc = new DummyClassLocator();
  org.jibx.binding.model.ValidationContext vctx = new org.jibx.binding.model.ValidationContext(iloc);
  if (m_bindingDirectory.validateBindings(m_rootHolder, m_targetDir, vctx)) {
    m_bindingDirectory.writeBindings(m_targetDir);
  } else {
    reportBindingProblems(vctx, handler);
    throw new JiBXException("Terminating due to errors in bindings");
  }
}

origin: org.jibx/jibx-tools

  new org.jibx.binding.model.ValidationContext(new DummyClassLocator());
BindingElement binding = BindingElement.readBinding(url.openStream(), name, null, true,
  vctx);
binding.setBaseUrl(url);
vctx.setBindingRoot(binding);
ArrayList probs = vctx.getProblems();
if (probs.size() > 0) {
  for (int i = 0; i < probs.size(); i++) {
    System.out.println(prob.getDescription());
  if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
    throw new JiBXException("Errors in binding");
origin: apache/axis2-java

  public boolean visit(IncludeElement node) {
    try {
      // force creation of defintions context for containing binding
      m_context.getFormatDefinitions();
      node.prevalidate(m_context);
    } catch (Throwable t) {
      m_context.addFatal("Error during validation: " +
          t.getMessage());
      t.printStackTrace();
      return false;
    }
    return true;
  }
}
origin: org.jibx/jibx-tools

  m_context.addError("No handling defined for empty structure with no mapping reference", struct);
} else {
      m_context.addError("No handling defined for name on concrete mapping reference", struct);
org.jibx.binding.modelValidationContext

Most used methods

  • getErrorCount
  • getFatalCount
  • getProblems
  • setBindingRoot
  • tourTree
  • addFatal
  • getFormatDefinitions
  • <init>
  • addError
  • addWarning
  • getParentElement
  • getParentElement

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JOptionPane (javax.swing)
  • 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