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

How to use
XMLSchemaReader
in
com.sun.msv.reader.xmlschema

Best Java code snippets using com.sun.msv.reader.xmlschema.XMLSchemaReader (Showing top 20 results out of 315)

origin: com.sun.xml.bind/jaxb-extra-osgi

/** loads XML Schema */
public static XMLSchemaGrammar parse( InputSource grammar,
  SAXParserFactory factory, GrammarReaderController controller ) {
  
  XMLSchemaReader reader = new XMLSchemaReader(controller,factory);
  reader.parse(grammar);
  
  return reader.getResult();
}

origin: com.sun.xml.bind/jaxb-extra-osgi

protected State createChildState( StartTagInfo tag ) {
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  State s;
  if( super.exp==Expression.epsilon ) {
    // model group must be the first expression child.
    s = reader.createModelGroupState(this,tag);
    if(s!=null )    return s;
  }
  
  // attribute, attributeGroup, and anyAttribtue can be specified
  // after content model is given.
  return reader.createAttributeState(this,tag);
}
origin: com.sun.xml.bind/jaxb1-impl

protected State createChildState( StartTagInfo tag ) {
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  if( incubator==null && tag.localName.equals("simpleType") )
    return reader.sfactory.simpleType(this,tag);
  
  State s = reader.createAttributeState(this,tag);
  if(s!=null )    return s;
  
  return reader.createFacetState(this,tag);    // facets
}

origin: com.sun.xml.bind/jaxb1-impl

if(base==null) {
  reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
  return Expression.nullSet;
final String[] baseTypeName = reader.splitQName(base);
if( baseTypeName==null ) {
  reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
  return Expression.nullSet;
if(reader.isSchemaNamespace(baseTypeName[0])) {
  XSDatatype dt = reader.resolveBuiltinDataType(baseTypeName[1]);
  if(dt!=null) {
    XSDatatypeExp dtexp = new XSDatatypeExp(dt,reader.pool);
reader.addBackPatchJob( new GrammarReader.BackPatch(){
  public State getOwnerState() {
    return SimpleContentExtensionState.this;
origin: com.sun.xml.bind/jaxb-extra-osgi

  reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE,
    startTag.localName, "name" );
  return;    // recover by ignoring this constraint.
  final String refer = startTag.getAttribute("refer");
  if(refer==null) {
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE,
      startTag.localName, "refer" );
    return;    // recover by ignoring this constraint.
  final String[] qn = reader.splitQName(refer);
  if(qn==null) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, qn );
    return;
  reader.addBackPatchJob( new GrammarReader.BackPatch(){
    public State getOwnerState() { return IdentityConstraintState.this; }
    public void patch() {
  reader.reportError(
    new Locator[]{ this.location, reader.getDeclaredLocationOf(id) },
    XMLSchemaReader.ERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITION,
    new Object[]{name} );
  reader.currentSchema.identityConstraints.add(name,id);
reader.setDeclaredLocationOf(id);
((ElementDeclState)parentState).onIdentityConstraint(id);
origin: apache/cxf

public void switchSource(Source source, State newState) {
  String url = source.getSystemId();
  if (url != null && sysIds.contains(url)) {
    return;
  }
  super.switchSource(source, newState);
}
origin: msv/msv

final String[] s = reader.splitQName(typeQName);
if(s==null) {
  reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, typeQName );
reader.addBackPatchJob( new GrammarReader.BackPatch(){
  public State getOwnerState() { return ElementDeclState.this; }
  public void patch() {
origin: org.codehaus.woodstox/woodstox-core-asl

  protected XMLValidationSchema loadSchema(InputSource src, Object sysRef)
    throws XMLStreamException
  {
    /* 26-Oct-2007, TSa: Are SAX parser factories safe to share?
     *   If not, should just create new instances for each
     *   parsed schema.
     */
    SAXParserFactory saxFactory = getSaxFactory();

    MyGrammarController ctrl = new MyGrammarController();
    XMLSchemaGrammar grammar = XMLSchemaReader.parse(src, saxFactory, ctrl);
    if (grammar == null) {
      String msg = "Failed to load W3C Schema from '"+sysRef+"'";
      String emsg = ctrl.mErrorMsg;
      if (emsg != null) {
        msg = msg + ": "+emsg;
      }
      throw new XMLStreamException(msg);
    }
    return new W3CSchema(grammar);
  }
}
origin: com.sun.xml.bind/jaxb1-impl

  Schema s = XMLSchemaReader.getXmlSchemaForXmlSchema();
  reader[0] = new XMLSchemaReader(
    getController(),
    new SAXParserFactoryImpl(getSAXParserFactory(),s),
  winner = setupPipeline(s);
} else {
  winner = reader[0] = new XMLSchemaReader(
    getController(),getSAXParserFactory(),getPool());
origin: msv/msv

protected void switchSource( State sourceState, State newRootState ) throws AbortException {
  final String schemaLocation = sourceState.getStartTag().getAttribute("schemaLocation");
  if(schemaLocation==null) {
    // schemaLocation attribute is required.
    reportError( ERR_MISSING_ATTRIBUTE, sourceState.getStartTag().qName, "schemaLocation" );
    // recover by ignoring this element
  }
  else
    // parse specified file
    switchSource( sourceState, schemaLocation, newRootState );
}
origin: com.sun.xml.bind/jaxb1-impl

protected State createChildState( StartTagInfo tag ) {
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  // TODO: group reference is prohibited under group element.
  return reader.createModelGroupState(this,tag);
}
origin: msv/msv

protected State createChildState( StartTagInfo tag ) {
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  return reader.createAttributeState(this,tag);
}
origin: com.sun.xml.bind/jaxb-extra-osgi

                                       wsdlSystemId, schemas);
XMLSchemaReader reader = new XMLSchemaReader(wsdlController);
reader.setAdditionalNamespaceMap(wsdlNamespaceMappings);
MultiSchemaReader multiSchemaReader = new MultiSchemaReader(reader);
for (EmbeddedSchema schema : schemas.values()) {
origin: msv/msv

/**
 * Adds maxOccurs/minOccurs semantics to a given expression.
 * 
 * @param   maxOccurs
 *      -1 to represent "unbounded".
 */
public Expression processOccurs( Expression item, int minOccurs, int maxOccurs ) {
  Expression precise = _processOccurs(item,minOccurs,maxOccurs);
  if(maxOccurs==1)                    return precise;
  if(maxOccurs==-1 && minOccurs<=1 )  return precise;
  return new OccurrenceExp(precise,maxOccurs,minOccurs,item);
}

origin: msv/msv

/** easy-to-use constructor. */
public XMLSchemaReader( GrammarReaderController controller ) {
  this(controller,createParserFactory());
}

origin: kohsuke/msv

reader.addBackPatchJob( new GrammarReader.BackPatch(){
  public State getOwnerState() { return AnyElementState.this; }
  public void patch() {
origin: kohsuke/msv

  /** tests the existence of all messages */
  public void testMessages() throws Exception {
    final XMLSchemaReader reader = new XMLSchemaReader(null);
    
    Checker checker = new Checker(){
      public void check( String propertyName ) {
        // if the specified property doesn't exist, this will throw an error
        System.out.println(
          reader.localizeMessage(propertyName,new Object[]{"@@@","@@@","@@@","@@@","@@@"}));
      }
    };
    
    String prefixes[] = new String[]{"ERR_","WRN_"};
    
    for( int i=0; i<prefixes.length; i++ ) {
      ResourceChecker.check( XMLSchemaReader.class, prefixes[i], checker );
      ResourceChecker.check( GrammarReader.class, prefixes[i], checker );
    }
  }
}
origin: kohsuke/msv

protected Schema getSchemaForSchema() {
  return XMLSchemaReader.getXmlSchemaForXmlSchema();
}
origin: msv/msv

if(base==null) {
  reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
  return Expression.nullSet;
final String[] baseTypeName = reader.splitQName(base);
if( baseTypeName==null ) {
  reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
  return Expression.nullSet;
if(reader.isSchemaNamespace(baseTypeName[0])) {
  XSDatatype dt = reader.resolveBuiltinDataType(baseTypeName[1]);
  if(dt!=null) {
    XSDatatypeExp dtexp = new XSDatatypeExp(dt,reader.pool);
reader.addBackPatchJob( new GrammarReader.BackPatch(){
  public State getOwnerState() {
    return SimpleContentExtensionState.this;
origin: msv/msv

  reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE,
    startTag.localName, "name" );
  return;    // recover by ignoring this constraint.
  final String refer = startTag.getAttribute("refer");
  if(refer==null) {
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE,
      startTag.localName, "refer" );
    return;    // recover by ignoring this constraint.
  final String[] qn = reader.splitQName(refer);
  if(qn==null) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, qn );
    return;
  reader.addBackPatchJob( new GrammarReader.BackPatch(){
    public State getOwnerState() { return IdentityConstraintState.this; }
    public void patch() {
  reader.reportError(
    new Locator[]{ this.location, reader.getDeclaredLocationOf(id) },
    XMLSchemaReader.ERR_DUPLICATE_IDENTITY_CONSTRAINT_DEFINITION,
    new Object[]{name} );
  reader.currentSchema.identityConstraints.add(name,id);
reader.setDeclaredLocationOf(id);
((ElementDeclState)parentState).onIdentityConstraint(id);
com.sun.msv.reader.xmlschemaXMLSchemaReader

Javadoc

parses XML representation of XML Schema and constructs AGM.

Most used methods

  • parse
    loads XML Schema
  • switchSource
  • <init>
  • getXmlSchemaForXmlSchema
  • _processOccurs
  • addBackPatchJob
  • createAttributeState
    creates a state object that parses "attribute","attributeGroup ref", and "anyAttribute".
  • createFacetState
  • createModelGroupState
    creates a state object that parses "all"/"group ref"/"choice" and "sequence".
  • createParserFactory
  • detectUndefinedOnes
  • getCurrentState
  • detectUndefinedOnes,
  • getCurrentState,
  • getDeclaredLocationOf,
  • getOrCreateSchema,
  • getResult,
  • getType,
  • isSchemaDefined,
  • isSchemaNamespace,
  • isSubstitutable,
  • markSchemaAsDefined

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Best plugins for Eclipse
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