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

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

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

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

private String resolveNamespaceOfDeclaration( String formValue, String defaultValue ) {
  if( "qualified".equals(formValue) )
    return currentSchema.targetNamespace;
  
  if( "unqualified".equals(formValue) )
    return "";
  
  if( formValue!=null ) {
    reportError( ERR_BAD_ATTRIBUTE_VALUE, "form", formValue );
    return "$$recover$$";    // recovery by returning whatever
  }
  
  return defaultValue;
}

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

private String resolveNamespaceOfDeclaration( String formValue, String defaultValue ) {
  if( "qualified".equals(formValue) )
    return currentSchema.targetNamespace;
  
  if( "unqualified".equals(formValue) )
    return "";
  
  if( formValue!=null ) {
    reportError( ERR_BAD_ATTRIBUTE_VALUE, "form", formValue );
    return "$$recover$$";    // recovery by returning whatever
  }
  
  return defaultValue;
}

origin: msv/msv

private String resolveNamespaceOfDeclaration( String formValue, String defaultValue ) {
  if( "qualified".equals(formValue) )
    return currentSchema.targetNamespace;
  
  if( "unqualified".equals(formValue) )
    return "";
  
  if( formValue!=null ) {
    reportError( ERR_BAD_ATTRIBUTE_VALUE, "form", formValue );
    return "$$recover$$";    // recovery by returning whatever
  }
  
  return defaultValue;
}

origin: kohsuke/msv

private String resolveNamespaceOfDeclaration( String formValue, String defaultValue ) {
  if( "qualified".equals(formValue) )
    return currentSchema.targetNamespace;
  
  if( "unqualified".equals(formValue) )
    return "";
  
  if( formValue!=null ) {
    reportError( ERR_BAD_ATTRIBUTE_VALUE, "form", formValue );
    return "$$recover$$";    // recovery by returning whatever
  }
  
  return defaultValue;
}

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

protected void startSelf() {
  super.startSelf();
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  base = startTag.getAttribute("base");
  if(base==null) {
    // in extension, base attribute is mandatory.
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
    return;
  }
  
  baseTypeName = reader.splitQName(base);
  if( baseTypeName==null ) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
    return;
  }
  
  baseSchema = reader.grammar.getByNamespace(baseTypeName[0]);
}

origin: msv/msv

protected void startSelf() {
  super.startSelf();
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  base = startTag.getAttribute("base");
  if(base==null) {
    // in extension, base attribute is mandatory.
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
    return;
  }
  
  baseTypeName = reader.splitQName(base);
  if( baseTypeName==null ) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
    return;
  }
  
  baseSchema = reader.grammar.getByNamespace(baseTypeName[0]);
}

origin: kohsuke/msv

protected void startSelf() {
  super.startSelf();
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  base = startTag.getAttribute("base");
  if(base==null) {
    // in extension, base attribute is mandatory.
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
    return;
  }
  
  baseTypeName = reader.splitQName(base);
  if( baseTypeName==null ) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
    return;
  }
  
  baseSchema = reader.grammar.getByNamespace(baseTypeName[0]);
}

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

protected void startSelf() {
  super.startSelf();
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  base = startTag.getAttribute("base");
  if(base==null) {
    // in extension, base attribute is mandatory.
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "base");
    return;
  }
  
  baseTypeName = reader.splitQName(base);
  if( baseTypeName==null ) {
    reader.reportError( XMLSchemaReader.ERR_UNDECLARED_PREFIX, base );
    return;
  }
  
  baseSchema = reader.grammar.getByNamespace(baseTypeName[0]);
}

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

public void onEndChild( XSDatatypeExp type ) {
  // handle redefinition of simpleType.
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  final String typeName = type.name;
  
  if( typeName==null ) {
    // top-level simpleType must define a named type
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, "simpleType", "name" );
    return;    // recover by ignoring this declaration
  }
  
  oldSimpleTypeExp.set(type);
  reader.setDeclaredLocationOf(oldSimpleTypeExp);
  
  // restore the association
  reader.currentSchema.simpleTypes.redefine( oldSimpleTypeExp.name, oldSimpleTypeExp );
  
  oldSimpleTypeExp = null;
}
origin: com.sun.xml.bind/jaxb-extra-osgi

public void onEndChild( XSDatatypeExp type ) {
  // handle redefinition of simpleType.
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  final String typeName = type.name;
  
  if( typeName==null ) {
    // top-level simpleType must define a named type
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, "simpleType", "name" );
    return;    // recover by ignoring this declaration
  }
  
  oldSimpleTypeExp.set(type);
  reader.setDeclaredLocationOf(oldSimpleTypeExp);
  
  // restore the association
  reader.currentSchema.simpleTypes.redefine( oldSimpleTypeExp.name, oldSimpleTypeExp );
  
  oldSimpleTypeExp = null;
}
origin: msv/msv

public void onEndChild( XSDatatypeExp type ) {
  // handle redefinition of simpleType.
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  final String typeName = type.name;
  
  if( typeName==null ) {
    // top-level simpleType must define a named type
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, "simpleType", "name" );
    return;    // recover by ignoring this declaration
  }
  
  oldSimpleTypeExp.set(type);
  reader.setDeclaredLocationOf(oldSimpleTypeExp);
  
  // restore the association
  reader.currentSchema.simpleTypes.redefine( oldSimpleTypeExp.name, oldSimpleTypeExp );
  
  oldSimpleTypeExp = null;
}
origin: msv/msv

public Expression resolveQNameRef( StartTagInfo tag, String attName, RefResolver resolver ) {
  
  String refQName = tag.getAttribute(attName);
  if( refQName==null ) {
    reportError( ERR_MISSING_ATTRIBUTE, tag.qName, attName );
    return null;    // failed.
  }
  
  String[] r = splitQName(refQName);
  if(r==null) {
    reportError( ERR_UNDECLARED_PREFIX, refQName );
    return null;
  }
  
  Expression e =  resolver.get( getOrCreateSchema(r[0]/*uri*/) )._getOrCreate(r[1]/*local name*/);
  backwardReference.memorizeLink(e);
  
  return e;
}
origin: com.sun.xml.bind/jaxb1-impl

public Expression resolveQNameRef( StartTagInfo tag, String attName, RefResolver resolver ) {
  
  String refQName = tag.getAttribute(attName);
  if( refQName==null ) {
    reportError( ERR_MISSING_ATTRIBUTE, tag.qName, attName );
    return null;    // failed.
  }
  
  String[] r = splitQName(refQName);
  if(r==null) {
    reportError( ERR_UNDECLARED_PREFIX, refQName );
    return null;
  }
  
  Expression e =  resolver.get( getOrCreateSchema(r[0]/*uri*/) )._getOrCreate(r[1]/*local name*/);
  backwardReference.memorizeLink(e);
  
  return e;
}
origin: com.sun.xml.bind/jaxb-extra-osgi

public Expression resolveQNameRef( StartTagInfo tag, String attName, RefResolver resolver ) {
  
  String refQName = tag.getAttribute(attName);
  if( refQName==null ) {
    reportError( ERR_MISSING_ATTRIBUTE, tag.qName, attName );
    return null;    // failed.
  }
  
  String[] r = splitQName(refQName);
  if(r==null) {
    reportError( ERR_UNDECLARED_PREFIX, refQName );
    return null;
  }
  
  Expression e =  resolver.get( getOrCreateSchema(r[0]/*uri*/) )._getOrCreate(r[1]/*local name*/);
  backwardReference.memorizeLink(e);
  
  return e;
}
origin: kohsuke/msv

public Expression resolveQNameRef( StartTagInfo tag, String attName, RefResolver resolver ) {
  
  String refQName = tag.getAttribute(attName);
  if( refQName==null ) {
    reportError( ERR_MISSING_ATTRIBUTE, tag.qName, attName );
    return null;    // failed.
  }
  
  String[] r = splitQName(refQName);
  if(r==null) {
    reportError( ERR_UNDECLARED_PREFIX, refQName );
    return null;
  }
  
  Expression e =  resolver.get( getOrCreateSchema(r[0]/*uri*/) )._getOrCreate(r[1]/*local name*/);
  backwardReference.memorizeLink(e);
  
  return e;
}
origin: kohsuke/msv

public void onEndChild( XSDatatypeExp type ) {
  // handle redefinition of simpleType.
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  final String typeName = type.name;
  
  if( typeName==null ) {
    // top-level simpleType must define a named type
    reader.reportError( XMLSchemaReader.ERR_MISSING_ATTRIBUTE, "simpleType", "name" );
    return;    // recover by ignoring this declaration
  }
  
  oldSimpleTypeExp.set(type);
  reader.setDeclaredLocationOf(oldSimpleTypeExp);
  
  // restore the association
  reader.currentSchema.simpleTypes.redefine( oldSimpleTypeExp.name, oldSimpleTypeExp );
  
  oldSimpleTypeExp = null;
}
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 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: msv/msv

protected void onTargetNamespaceResolved( String targetNs ) {
  super.onTargetNamespaceResolved(targetNs);
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  // sets new XMLSchemaGrammar object.
  old = reader.currentSchema;
  reader.currentSchema = reader.getOrCreateSchema(targetNs);
  
  if( reader.isSchemaDefined(reader.currentSchema) )  {
    reader.reportError( XMLSchemaReader.ERR_DUPLICATE_SCHEMA_DEFINITION, targetNs );
    // recover by providing dummy grammar object.
    // this object is not registered to the map,
    // so it cannot be referenced.
    reader.currentSchema = new XMLSchemaSchema(targetNs,reader.grammar);
  }
  
  reader.markSchemaAsDefined(reader.currentSchema);
}

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

protected void onTargetNamespaceResolved( String targetNs ) {
  super.onTargetNamespaceResolved(targetNs);
  
  final XMLSchemaReader reader = (XMLSchemaReader)this.reader;
  
  // sets new XMLSchemaGrammar object.
  old = reader.currentSchema;
  reader.currentSchema = reader.getOrCreateSchema(targetNs);
  
  if( reader.isSchemaDefined(reader.currentSchema) )  {
    reader.reportError( XMLSchemaReader.ERR_DUPLICATE_SCHEMA_DEFINITION, targetNs );
    // recover by providing dummy grammar object.
    // this object is not registered to the map,
    // so it cannot be referenced.
    reader.currentSchema = new XMLSchemaSchema(targetNs,reader.grammar);
  }
  
  reader.markSchemaAsDefined(reader.currentSchema);
}

com.sun.msv.reader.xmlschemaXMLSchemaReaderreportError

Popular methods of XMLSchemaReader

  • 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

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top Vim 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