Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.xerces.impl.xs;
  
  import java.io.File;
  import java.io.Reader;
 
 public class XMLSchemaLoader
 {
   protected static final String SCHEMA_FULL_CHECKING = "http://apache.org/xml/features/validation/schema-full-checking";
   protected static final String CONTINUE_AFTER_FATAL_ERROR = "http://apache.org/xml/features/continue-after-fatal-error";
   protected static final String ALLOW_JAVA_ENCODINGS = "http://apache.org/xml/features/allow-java-encodings";
   protected static final String STANDARD_URI_CONFORMANT_FEATURE = "http://apache.org/xml/features/standard-uri-conformant";
   protected static final String VALIDATE_ANNOTATIONS = "http://apache.org/xml/features/validate-annotations";
   protected static final String DISALLOW_DOCTYPE = "http://apache.org/xml/features/disallow-doctype-decl";
   protected static final String GENERATE_SYNTHETIC_ANNOTATIONS = "http://apache.org/xml/features/generate-synthetic-annotations";
   protected static final String HONOUR_ALL_SCHEMALOCATIONS = "http://apache.org/xml/features/honour-all-schemaLocations";
   protected static final String AUGMENT_PSVI = "http://apache.org/xml/features/validation/schema/augment-psvi";
   protected static final String PARSER_SETTINGS = "http://apache.org/xml/features/internal/parser-settings";
   private static final String[] RECOGNIZED_FEATURES = { "http://apache.org/xml/features/validation/schema-full-checking""http://apache.org/xml/features/validation/schema/augment-psvi""http://apache.org/xml/features/continue-after-fatal-error""http://apache.org/xml/features/allow-java-encodings""http://apache.org/xml/features/standard-uri-conformant""http://apache.org/xml/features/disallow-doctype-decl""http://apache.org/xml/features/generate-synthetic-annotations""http://apache.org/xml/features/validate-annotations""http://apache.org/xml/features/honour-all-schemaLocations" };
   public static final String SYMBOL_TABLE = "http://apache.org/xml/properties/internal/symbol-table";
   public static final String ERROR_REPORTER = "http://apache.org/xml/properties/internal/error-reporter";
   protected static final String ERROR_HANDLER = "http://apache.org/xml/properties/internal/error-handler";
   public static final String ENTITY_RESOLVER = "http://apache.org/xml/properties/internal/entity-resolver";
   public static final String XMLGRAMMAR_POOL = "http://apache.org/xml/properties/internal/grammar-pool";
   protected static final String SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-schemaLocation";
   protected static final String SCHEMA_NONS_LOCATION = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
   protected static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
   protected static final String SECURITY_MANAGER = "http://apache.org/xml/properties/security-manager";
   protected static final String ENTITY_MANAGER = "http://apache.org/xml/properties/internal/entity-manager";
   private static final String[] RECOGNIZED_PROPERTIES = { "http://apache.org/xml/properties/internal/entity-manager""http://apache.org/xml/properties/internal/symbol-table""http://apache.org/xml/properties/internal/error-reporter""http://apache.org/xml/properties/internal/error-handler""http://apache.org/xml/properties/internal/entity-resolver""http://apache.org/xml/properties/internal/grammar-pool""http://apache.org/xml/properties/schema/external-schemaLocation""http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation""http://java.sun.com/xml/jaxp/properties/schemaSource""http://apache.org/xml/properties/security-manager" };
   private XMLEntityManager fEntityManager = null;
   private XMLEntityResolver fUserEntityResolver = null;
   private XMLGrammarPool fGrammarPool = null;
   private String fExternalSchemas = null;
   private String fExternalNoNSSchema = null;
   private Object fJAXPSource = null;
   private boolean fIsCheckedFully = false;
   private boolean fJAXPProcessed = false;
   private boolean fSettingsChanged = true;
   private XSDHandler fSchemaHandler;
   private XSDeclarationPool fDeclPool = null;
   private CMBuilder fCMBuilder;
  private WeakHashMap fJAXPCache;
  private Locale fLocale = Locale.getDefault();
  private DOMStringList fRecognizedParameters = null;
  public XMLSchemaLoader()
  {
    this(new SymbolTable(), nullnew XMLEntityManager(), nullnullnull);
  }
  public XMLSchemaLoader(SymbolTable paramSymbolTable)
  {
    this(paramSymbolTablenullnew XMLEntityManager(), nullnullnull);
  }
  XMLSchemaLoader(XMLErrorReporter paramXMLErrorReporterXSGrammarBucket paramXSGrammarBucketSubstitutionGroupHandler paramSubstitutionGroupHandlerCMBuilder paramCMBuilder)
  {
    this(nullparamXMLErrorReporternullparamXSGrammarBucketparamSubstitutionGroupHandlerparamCMBuilder);
  }
  XMLSchemaLoader(SymbolTable paramSymbolTableXMLErrorReporter paramXMLErrorReporterXMLEntityManager paramXMLEntityManagerXSGrammarBucket paramXSGrammarBucketSubstitutionGroupHandler paramSubstitutionGroupHandlerCMBuilder paramCMBuilder)
  {
    if (paramSymbolTable != null)
      this..setProperty("http://apache.org/xml/properties/internal/symbol-table"paramSymbolTable);
    if (paramXMLErrorReporter == null)
    {
      paramXMLErrorReporter = new XMLErrorReporter();
      paramXMLErrorReporter.setLocale(this.);
      paramXMLErrorReporter.setProperty("http://apache.org/xml/properties/internal/error-handler"new DefaultErrorHandler());
    }
    this. = paramXMLErrorReporter;
    if (this..getMessageFormatter("http://www.w3.org/TR/xml-schema-1") == null)
      this..putMessageFormatter("http://www.w3.org/TR/xml-schema-1"new XSMessageFormatter());
    this..setProperty("http://apache.org/xml/properties/internal/error-reporter"this.);
    this. = paramXMLEntityManager;
    if (this. != null)
      this..setProperty("http://apache.org/xml/properties/internal/entity-manager"this.);
    this..setFeature("http://apache.org/xml/features/validation/schema/augment-psvi"true);
    if (paramXSGrammarBucket == null)
      paramXSGrammarBucket = new XSGrammarBucket();
    this. = paramXSGrammarBucket;
    if (paramSubstitutionGroupHandler == null)
      paramSubstitutionGroupHandler = new SubstitutionGroupHandler(this.);
    this. = paramSubstitutionGroupHandler;
    CMNodeFactory localCMNodeFactory = new CMNodeFactory();
    if (paramCMBuilder == null)
      paramCMBuilder = new CMBuilder(localCMNodeFactory);
    this. = paramCMBuilder;
    this. = new XSDHandler(this.);
    this. = new XSDeclarationPool();
    this. = new WeakHashMap();
    this. = true;
  }
  {
    return (String[]).clone();
  }
  public boolean getFeature(String paramString)
  {
    return this..getFeature(paramString);
  }
  public void setFeature(String paramStringboolean paramBoolean)
  {
    this. = true;
    if (paramString.equals("http://apache.org/xml/features/continue-after-fatal-error"))
      this..setFeature("http://apache.org/xml/features/continue-after-fatal-error"paramBoolean);
    else if (paramString.equals("http://apache.org/xml/features/generate-synthetic-annotations"))
      this..setGenerateSyntheticAnnotations(paramBoolean);
    this..setFeature(paramStringparamBoolean);
  }
  {
    return (String[]).clone();
  }
  public Object getProperty(String paramString)
  {
    return this..getProperty(paramString);
  }
  public void setProperty(String paramStringObject paramObject)
  {
    this. = true;
    this..setProperty(paramStringparamObject);
    if (paramString.equals("http://java.sun.com/xml/jaxp/properties/schemaSource"))
    {
      this. = paramObject;
      this. = false;
    }
    else if (paramString.equals("http://apache.org/xml/properties/internal/grammar-pool"))
    {
      this. = ((XMLGrammarPool)paramObject);
    }
    else if (paramString.equals("http://apache.org/xml/properties/schema/external-schemaLocation"))
    {
      this. = ((String)paramObject);
    }
    else if (paramString.equals("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"))
    {
      this. = ((String)paramObject);
    }
    else if (paramString.equals("http://apache.org/xml/properties/internal/entity-resolver"))
    {
      this..setProperty("http://apache.org/xml/properties/internal/entity-resolver"paramObject);
    }
    else if (paramString.equals("http://apache.org/xml/properties/internal/error-reporter"))
    {
      this. = ((XMLErrorReporter)paramObject);
      if (this..getMessageFormatter("http://www.w3.org/TR/xml-schema-1") == null)
        this..putMessageFormatter("http://www.w3.org/TR/xml-schema-1"new XSMessageFormatter());
    }
  }
  public void setLocale(Locale paramLocale)
  {
    this. = paramLocale;
    this..setLocale(paramLocale);
  }
  public Locale getLocale()
  {
    return this.;
  }
  public void setErrorHandler(XMLErrorHandler paramXMLErrorHandler)
  {
    this..setProperty("http://apache.org/xml/properties/internal/error-handler"paramXMLErrorHandler);
  }
  {
    return this..getErrorHandler();
  }
  public void setEntityResolver(XMLEntityResolver paramXMLEntityResolver)
  {
    this. = paramXMLEntityResolver;
    this..setProperty("http://apache.org/xml/properties/internal/entity-resolver"paramXMLEntityResolver);
    this..setProperty("http://apache.org/xml/properties/internal/entity-resolver"paramXMLEntityResolver);
  }
  {
    return this.;
  }
  public void loadGrammar(XMLInputSource[] paramArrayOfXMLInputSource)
    throws IOExceptionXNIException
  {
    int i = paramArrayOfXMLInputSource.length;
    for (int j = 0; j < ij++)
      loadGrammar(paramArrayOfXMLInputSource[j]);
  }
  public Grammar loadGrammar(XMLInputSource paramXMLInputSource)
    throws IOExceptionXNIException
  {
    reset(this.);
    this. = false;
    XSDDescription localXSDDescription = new XSDDescription();
    localXSDDescription.fContextType = 3;
    localXSDDescription.setBaseSystemId(paramXMLInputSource.getBaseSystemId());
    localXSDDescription.setLiteralSystemId(paramXMLInputSource.getSystemId());
    Hashtable localHashtable = new Hashtable();
    processExternalHints(this.this.localHashtablethis.);
    SchemaGrammar localSchemaGrammar = loadSchema(localXSDDescriptionparamXMLInputSourcelocalHashtable);
    if ((localSchemaGrammar != null) && (this. != null))
    {
      this..cacheGrammars("http://www.w3.org/2001/XMLSchema"this..getGrammars());
      if ((this.) && (this..get(localSchemaGrammar) != localSchemaGrammar))
        XSConstraints.fullSchemaChecking(this.this.this.this.);
    }
    return localSchemaGrammar;
  }
  SchemaGrammar loadSchema(XSDDescription paramXSDDescriptionXMLInputSource paramXMLInputSourceHashtable paramHashtable)
    throws IOExceptionXNIException
  {
    if (!this.)
      processJAXPSchemaSource(paramHashtable);
    SchemaGrammar localSchemaGrammar = this..parseSchema(paramXMLInputSourceparamXSDDescriptionparamHashtable);
    return localSchemaGrammar;
  }
  public static XMLInputSource resolveDocument(XSDDescription paramXSDDescriptionHashtable paramHashtableXMLEntityResolver paramXMLEntityResolver)
    throws IOException
  {
    String str = null;
    if ((paramXSDDescription.getContextType() == 2) || (paramXSDDescription.fromInstance()))
    {
      localObject1 = paramXSDDescription.getTargetNamespace();
      Object localObject2 = localObject1 == null ? . : localObject1;
      LocationArray localLocationArray = (LocationArray)paramHashtable.get(localObject2);
      if (localLocationArray != null)
        str = localLocationArray.getFirstLocation();
    }
    if (str == null)
    {
      localObject1 = paramXSDDescription.getLocationHints();
      if ((localObject1 != null) && (localObject1.length > 0))
        str = localObject1[0];
    }
    Object localObject1 = XMLEntityManager.expandSystemId(strparamXSDDescription.getBaseSystemId(), false);
    paramXSDDescription.setLiteralSystemId(str);
    paramXSDDescription.setExpandedSystemId((String)localObject1);
    return (XMLInputSource)paramXMLEntityResolver.resolveEntity(paramXSDDescription);
  }
  public static void processExternalHints(String paramString1String paramString2Hashtable paramHashtableXMLErrorReporter paramXMLErrorReporter)
  {
    if (paramString1 != null)
      try
      {
        localXSAttributeDecl1.fType.validate(paramString1nullnull);
        if (!tokenizeSchemaLocationStr(paramString1paramHashtable))
          paramXMLErrorReporter.reportError("http://www.w3.org/TR/xml-schema-1""SchemaLocation"new Object[] { paramString1 }, 0);
      }
      catch (InvalidDatatypeValueException localInvalidDatatypeValueException1)
      {
        paramXMLErrorReporter.reportError("http://www.w3.org/TR/xml-schema-1"localInvalidDatatypeValueException1.getKey(), localInvalidDatatypeValueException1.getArgs(), 0);
      }
    if (paramString2 != null)
      try
      {
        localXSAttributeDecl2.fType.validate(paramString2nullnull);
        LocationArray localLocationArray = (LocationArray)paramHashtable.get(.);
        if (localLocationArray == null)
        {
          localLocationArray = new LocationArray();
          paramHashtable.put(.localLocationArray);
        }
        localLocationArray.addLocation(paramString2);
      }
      catch (InvalidDatatypeValueException localInvalidDatatypeValueException2)
      {
        paramXMLErrorReporter.reportError("http://www.w3.org/TR/xml-schema-1"localInvalidDatatypeValueException2.getKey(), localInvalidDatatypeValueException2.getArgs(), 0);
      }
  }
  public static boolean tokenizeSchemaLocationStr(String paramStringHashtable paramHashtable)
  {
    if (paramString != null)
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString" \n\t\r");
      while (localStringTokenizer.hasMoreTokens())
      {
        String str1 = localStringTokenizer.nextToken();
        if (!localStringTokenizer.hasMoreTokens())
          return false;
        String str2 = localStringTokenizer.nextToken();
        LocationArray localLocationArray = (LocationArray)paramHashtable.get(str1);
        if (localLocationArray == null)
        {
          localLocationArray = new LocationArray();
          paramHashtable.put(str1localLocationArray);
        }
        localLocationArray.addLocation(str2);
      }
    }
    return true;
  }
  private void processJAXPSchemaSource(Hashtable paramHashtable)
    throws IOException
  {
    this. = true;
    if (this. == null)
      return;
    Class localClass = this..getClass().getComponentType();
    XMLInputSource localXMLInputSource = null;
    String str = null;
    if (localClass == null)
    {
      if (((this. instanceof InputStream)) || ((this. instanceof InputSource)))
      {
        localObject1 = (SchemaGrammar)this..get(this.);
        if (localObject1 != null)
        {
          this..putGrammar((SchemaGrammar)localObject1);
          return;
        }
      }
      this..reset();
      localXMLInputSource = xsdToXMLInputSource(this.);
      str = localXMLInputSource.getSystemId();
      this.. = 3;
      if (str != null)
      {
        this..setBaseSystemId(localXMLInputSource.getBaseSystemId());
        this..setLiteralSystemId(str);
        this..setExpandedSystemId(str);
        this.. = new String[] { str };
      }
      localObject1 = loadSchema(this.localXMLInputSourceparamHashtable);
      if (localObject1 != null)
      {
        if (((this. instanceof InputStream)) || ((this. instanceof InputSource)))
        {
          this..put(this., localObject1);
          if (this.)
            XSConstraints.fullSchemaChecking(this.this.this.this.);
        }
        this..putGrammar((SchemaGrammar)localObject1);
      }
      return;
    }
    if ((localClass != Object.class) && (localClass != String.class) && (localClass != File.class) && (localClass != InputStream.class) && (localClass != InputSource.class) && (!File.class.isAssignableFrom(localClass)) && (!InputStream.class.isAssignableFrom(localClass)) && (!InputSource.class.isAssignableFrom(localClass)) && (!localClass.isInterface()))
    {
      localObject1 = this..getMessageFormatter("http://www.w3.org/TR/xml-schema-1");
      throw new XMLConfigurationException(1, ((MessageFormatter)localObject1).formatMessage(this..getLocale(), "jaxp12-schema-source-type.2"new Object[] { localClass.getName() }));
    }
    Object localObject1 = (Object[])this.;
    ArrayList localArrayList = new ArrayList();
    for (int i = 0; i < localObject1.lengthi++)
    {
      if (((localObject1[iinstanceof InputStream)) || ((localObject1[iinstanceof InputSource)))
      {
        localObject2 = (SchemaGrammar)this..get(localObject1[i]);
        if (localObject2 != null)
        {
          this..putGrammar((SchemaGrammar)localObject2);
          continue;
        }
      }
      this..reset();
      localXMLInputSource = xsdToXMLInputSource(localObject1[i]);
      str = localXMLInputSource.getSystemId();
      this.. = 3;
      if (str != null)
      {
        this..setBaseSystemId(localXMLInputSource.getBaseSystemId());
        this..setLiteralSystemId(str);
        this..setExpandedSystemId(str);
        this.. = new String[] { str };
      }
      Object localObject2 = null;
      SchemaGrammar localSchemaGrammar = this..parseSchema(localXMLInputSourcethis.paramHashtable);
      if (this.)
        XSConstraints.fullSchemaChecking(this.this.this.this.);
      if (localSchemaGrammar == null)
        continue;
      localObject2 = localSchemaGrammar.getTargetNamespace();
      if (localArrayList.contains(localObject2))
      {
        MessageFormatter localMessageFormatter = this..getMessageFormatter("http://www.w3.org/TR/xml-schema-1");
        throw new IllegalArgumentException(localMessageFormatter.formatMessage(this..getLocale(), "jaxp12-schema-source-ns"null));
      }
      localArrayList.add(localObject2);
      if (((localObject1[iinstanceof InputStream)) || ((localObject1[iinstanceof InputSource)))
        this..put(localObject1[i], localSchemaGrammar);
      this..putGrammar(localSchemaGrammar);
    }
  }
  private XMLInputSource xsdToXMLInputSource(Object paramObject)
  {
    Object localObject2;
    if ((paramObject instanceof String))
    {
      localObject1 = (String)paramObject;
      this..reset();
      this..setValues(null, (String)localObject1, nullnull);
      localObject2 = null;
      try
      {
        localObject2 = this..resolveEntity(this.);
      }
      catch (IOException localIOException)
      {
        this..reportError("http://www.w3.org/TR/xml-schema-1""schema_reference.4"new Object[] { localObject1 }, 1);
      }
      if (localObject2 == null)
        return new XMLInputSource(null, (String)localObject1, null);
      return localObject2;
    }
    if ((paramObject instanceof InputSource))
      return saxToXMLInputSource((InputSource)paramObject);
    if ((paramObject instanceof InputStream))
      return new XMLInputSource(nullnullnull, (InputStream)paramObjectnull);
    if ((paramObject instanceof File))
    {
      localObject1 = (File)paramObject;
      localObject2 = null;
      try
      {
        localObject2 = new BufferedInputStream(new FileInputStream((File)localObject1));
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        this..reportError("http://www.w3.org/TR/xml-schema-1""schema_reference.4"new Object[] { ((File)localObject1).toString() }, 1);
      }
      return new XMLInputSource(nullnullnull, (InputStream)localObject2null);
    }
    Object localObject1 = this..getMessageFormatter("http://www.w3.org/TR/xml-schema-1");
    throw new XMLConfigurationException(1, ((MessageFormatter)localObject1).formatMessage(this..getLocale(), "jaxp12-schema-source-type.1"new Object[] { paramObject != null ? paramObject.getClass().getName() : "null" }));
  }
  private static XMLInputSource saxToXMLInputSource(InputSource paramInputSource)
  {
    String str1 = paramInputSource.getPublicId();
    String str2 = paramInputSource.getSystemId();
    Reader localReader = paramInputSource.getCharacterStream();
    if (localReader != null)
      return new XMLInputSource(str1str2nulllocalReadernull);
    InputStream localInputStream = paramInputSource.getByteStream();
    if (localInputStream != null)
      return new XMLInputSource(str1str2nulllocalInputStreamparamInputSource.getEncoding());
    return new XMLInputSource(str1str2null);
  }
  public Boolean getFeatureDefault(String paramString)
  {
    if (paramString.equals("http://apache.org/xml/features/validation/schema/augment-psvi"))
      return .;
    return null;
  }
  public Object getPropertyDefault(String paramString)
  {
    return null;
  }
  public void reset(XMLComponentManager paramXMLComponentManager)
  {
    this..reset();
    this..reset();
    boolean bool1;
    try
    {
      bool1 = paramXMLComponentManager.getFeature("http://apache.org/xml/features/internal/parser-settings");
    }
    catch (XMLConfigurationException localXMLConfigurationException1)
    {
      bool1 = true;
    }
    if ((!bool1) || (!this.))
    {
      this. = false;
      initGrammarBucket();
      return;
    }
    this. = ((XMLEntityManager)paramXMLComponentManager.getProperty("http://apache.org/xml/properties/internal/entity-manager"));
    this. = ((XMLErrorReporter)paramXMLComponentManager.getProperty("http://apache.org/xml/properties/internal/error-reporter"));
    boolean bool2 = true;
    try
    {
      bool2 = paramXMLComponentManager.getFeature("http://apache.org/xml/features/validation/schema/augment-psvi");
    }
    catch (XMLConfigurationException localXMLConfigurationException2)
    {
      bool2 = false;
    }
    if (!bool2)
    {
      this..reset();
      this..setDeclPool(this.);
      this..setDeclPool(this.);
    }
    else
    {
      this..setDeclPool(null);
      this..setDeclPool(null);
    }
    try
    {
      this. = ((String)paramXMLComponentManager.getProperty("http://apache.org/xml/properties/schema/external-schemaLocation"));
      this. = ((String)paramXMLComponentManager.getProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"));
    }
    catch (XMLConfigurationException localXMLConfigurationException3)
    {
      this. = null;
      this. = null;
    }
    try
    {
      this. = paramXMLComponentManager.getProperty("http://java.sun.com/xml/jaxp/properties/schemaSource");
      this. = false;
    }
    catch (XMLConfigurationException localXMLConfigurationException4)
    {
      this. = null;
      this. = false;
    }
    try
    {
      this. = ((XMLGrammarPool)paramXMLComponentManager.getProperty("http://apache.org/xml/properties/internal/grammar-pool"));
    }
    catch (XMLConfigurationException localXMLConfigurationException5)
    {
      this. = null;
    }
    try
    {
      boolean bool3 = paramXMLComponentManager.getFeature("http://apache.org/xml/features/continue-after-fatal-error");
      this..setFeature("http://apache.org/xml/features/continue-after-fatal-error"bool3);
    }
    catch (XMLConfigurationException localXMLConfigurationException6)
    {
    }
    try
    {
      this. = paramXMLComponentManager.getFeature("http://apache.org/xml/features/validation/schema-full-checking");
    }
    catch (XMLConfigurationException localXMLConfigurationException7)
    {
      this. = false;
    }
    try
    {
      this..setGenerateSyntheticAnnotations(paramXMLComponentManager.getFeature("http://apache.org/xml/features/generate-synthetic-annotations"));
    }
    catch (XMLConfigurationException localXMLConfigurationException8)
    {
    }
    this..reset(paramXMLComponentManager);
  }
  private void initGrammarBucket()
  {
    if (this. != null)
    {
      Grammar[] arrayOfGrammar = this..retrieveInitialGrammarSet("http://www.w3.org/2001/XMLSchema");
      for (int i = 0; i < arrayOfGrammar.lengthi++)
      {
        if (this..putGrammar((SchemaGrammar)arrayOfGrammar[i], true))
          continue;
        this..reportError("http://www.w3.org/TR/xml-schema-1""GrammarConflict"null, 0);
      }
    }
  }
  {
    return this;
  }
  public XSModel load(LSInput paramLSInput)
  {
    try
    {
      Grammar localGrammar = loadGrammar(dom2xmlInputSource(paramLSInput));
      return ((XSGrammar)localGrammar).toXSModel();
    }
    catch (Exception localException)
    {
      reportDOMFatalError(localException);
    }
    return null;
  }
  public XSModel loadInputList(LSInputList paramLSInputList)
  {
    int i = paramLSInputList.getLength();
    if (i == 0)
      return null;
    SchemaGrammar[] arrayOfSchemaGrammar = new SchemaGrammar[i];
    for (int j = 0; j < ij++)
      try
      {
        arrayOfSchemaGrammar[j] = ((SchemaGrammar)loadGrammar(dom2xmlInputSource(paramLSInputList.item(j))));
      }
      catch (Exception localException)
      {
        reportDOMFatalError(localException);
        return null;
      }
    return new XSModelImpl(arrayOfSchemaGrammar);
  }
  public XSModel loadURI(String paramString)
  {
    try
    {
      Grammar localGrammar = loadGrammar(new XMLInputSource(nullparamStringnull));
      return ((XSGrammar)localGrammar).toXSModel();
    }
    catch (Exception localException)
    {
      reportDOMFatalError(localException);
    }
    return null;
  }
  public XSModel loadURIList(StringList paramStringList)
  {
    int i = paramStringList.getLength();
    if (i == 0)
      return null;
    SchemaGrammar[] arrayOfSchemaGrammar = new SchemaGrammar[i];
    for (int j = 0; j < ij++)
      try
      {
        arrayOfSchemaGrammar[j] = ((SchemaGrammar)loadGrammar(new XMLInputSource(nullparamStringList.item(j), null)));
      }
      catch (Exception localException)
      {
        reportDOMFatalError(localException);
        return null;
      }
    return new XSModelImpl(arrayOfSchemaGrammar);
  }
  void reportDOMFatalError(Exception paramException)
  {
    if (this. != null)
    {
      DOMErrorImpl localDOMErrorImpl = new DOMErrorImpl();
      localDOMErrorImpl.fException = paramException;
      localDOMErrorImpl.fMessage = paramException.getMessage();
      localDOMErrorImpl.fSeverity = 3;
      this..getErrorHandler().handleError(localDOMErrorImpl);
    }
  }
  public boolean canSetParameter(String paramStringObject paramObject)
  {
    if ((paramObject instanceof Boolean))
      return (paramString.equals("validate")) || (paramString.equals("http://apache.org/xml/features/validation/schema-full-checking")) || (paramString.equals("http://apache.org/xml/features/validate-annotations")) || (paramString.equals("http://apache.org/xml/features/continue-after-fatal-error")) || (paramString.equals("http://apache.org/xml/features/allow-java-encodings")) || (paramString.equals("http://apache.org/xml/features/standard-uri-conformant")) || (paramString.equals("http://apache.org/xml/features/generate-synthetic-annotations")) || (paramString.equals("http://apache.org/xml/features/honour-all-schemaLocations"));
    return (paramString.equals("error-handler")) || (paramString.equals("resource-resolver")) || (paramString.equals("http://apache.org/xml/properties/internal/symbol-table")) || (paramString.equals("http://apache.org/xml/properties/internal/error-reporter")) || (paramString.equals("http://apache.org/xml/properties/internal/error-handler")) || (paramString.equals("http://apache.org/xml/properties/internal/entity-resolver")) || (paramString.equals("http://apache.org/xml/properties/internal/grammar-pool")) || (paramString.equals("http://apache.org/xml/properties/schema/external-schemaLocation")) || (paramString.equals("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation")) || (paramString.equals("http://java.sun.com/xml/jaxp/properties/schemaSource"));
  }
  public Object getParameter(String paramString)
    throws DOMException
  {
    if (paramString.equals("error-handler"))
      return this. != null ? this..getErrorHandler() : null;
    if (paramString.equals("resource-resolver"))
      return this. != null ? this..getEntityResolver() : null;
    String str;
    try
    {
      boolean bool = getFeature(paramString);
      return bool ? . : .;
    }
    catch (Exception localException1)
    {
      try
      {
        Object localObject = getProperty(paramString);
        return localObject;
      }
      catch (Exception localException2)
      {
        str = DOMMessageFormatter.formatMessage("http://www.w3.org/dom/DOMTR""FEATURE_NOT_SUPPORTED"new Object[] { paramString });
      }
    }
    throw new DOMException(9, str);
  }
  {
    if (this. == null)
    {
      Vector localVector = new Vector();
      localVector.add("validate");
      localVector.add("error-handler");
      localVector.add("resource-resolver");
      localVector.add("http://apache.org/xml/properties/internal/symbol-table");
      localVector.add("http://apache.org/xml/properties/internal/error-reporter");
      localVector.add("http://apache.org/xml/properties/internal/error-handler");
      localVector.add("http://apache.org/xml/properties/internal/entity-resolver");
      localVector.add("http://apache.org/xml/properties/internal/grammar-pool");
      localVector.add("http://apache.org/xml/properties/schema/external-schemaLocation");
      localVector.add("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation");
      localVector.add("http://java.sun.com/xml/jaxp/properties/schemaSource");
      localVector.add("http://apache.org/xml/features/validation/schema-full-checking");
      localVector.add("http://apache.org/xml/features/continue-after-fatal-error");
      localVector.add("http://apache.org/xml/features/allow-java-encodings");
      localVector.add("http://apache.org/xml/features/standard-uri-conformant");
      localVector.add("http://apache.org/xml/features/validate-annotations");
      localVector.add("http://apache.org/xml/features/generate-synthetic-annotations");
      localVector.add("http://apache.org/xml/features/honour-all-schemaLocations");
      this. = new DOMStringListImpl(localVector);
    }
    return this.;
  }
  public void setParameter(String paramStringObject paramObject)
    throws DOMException
  {
    if ((paramObject instanceof Boolean))
    {
      boolean bool = ((Boolean)paramObject).booleanValue();
      if ((paramString.equals("validate")) && (bool))
        return;
      try
      {
        setFeature(paramStringbool);
      }
      catch (Exception localException2)
      {
        String str4 = DOMMessageFormatter.formatMessage("http://www.w3.org/dom/DOMTR""FEATURE_NOT_SUPPORTED"new Object[] { paramString });
        throw new DOMException(9, str4);
      }
      return;
    }
    if (paramString.equals("error-handler"))
    {
      if ((paramObject instanceof DOMErrorHandler))
      {
        try
        {
          this. = new DOMErrorHandlerWrapper((DOMErrorHandler)paramObject);
          setErrorHandler(this.);
        }
        catch (XMLConfigurationException localXMLConfigurationException1)
        {
        }
      }
      else
      {
        String str1 = DOMMessageFormatter.formatMessage("http://www.w3.org/dom/DOMTR""FEATURE_NOT_SUPPORTED"new Object[] { paramString });
        throw new DOMException(9, str1);
      }
      return;
    }
    if (paramString.equals("resource-resolver"))
    {
      if ((paramObject instanceof LSResourceResolver))
      {
        try
        {
          this. = new DOMEntityResolverWrapper((LSResourceResolver)paramObject);
          setEntityResolver(this.);
        }
        catch (XMLConfigurationException localXMLConfigurationException2)
        {
        }
      }
      else
      {
        String str2 = DOMMessageFormatter.formatMessage("http://www.w3.org/dom/DOMTR""FEATURE_NOT_SUPPORTED"new Object[] { paramString });
        throw new DOMException(9, str2);
      }
      return;
    }
    try
    {
      setProperty(paramStringparamObject);
    }
    catch (Exception localException1)
    {
      String str3 = DOMMessageFormatter.formatMessage("http://www.w3.org/dom/DOMTR""FEATURE_NOT_SUPPORTED"new Object[] { paramString });
      throw new DOMException(9, str3);
    }
  }
  {
    XMLInputSource localXMLInputSource = null;
    if (paramLSInput.getCharacterStream() != null)
      localXMLInputSource = new XMLInputSource(paramLSInput.getPublicId(), paramLSInput.getSystemId(), paramLSInput.getBaseURI(), paramLSInput.getCharacterStream(), "UTF-16");
    else if (paramLSInput.getByteStream() != null)
      localXMLInputSource = new XMLInputSource(paramLSInput.getPublicId(), paramLSInput.getSystemId(), paramLSInput.getBaseURI(), paramLSInput.getByteStream(), paramLSInput.getEncoding());
    else if ((paramLSInput.getStringData() != null) && (paramLSInput.getStringData().length() != 0))
      localXMLInputSource = new XMLInputSource(paramLSInput.getPublicId(), paramLSInput.getSystemId(), paramLSInput.getBaseURI(), new StringReader(paramLSInput.getStringData()), "UTF-16");
    else
      localXMLInputSource = new XMLInputSource(paramLSInput.getPublicId(), paramLSInput.getSystemId(), paramLSInput.getBaseURI());
    return localXMLInputSource;
  }
  static class LocationArray
  {
    int length;
    String[] locations = new String[2];
    public void resize(int paramInt1int paramInt2)
    {
      String[] arrayOfString = new String[paramInt2];
      System.arraycopy(this., 0, arrayOfString, 0, Math.min(paramInt1paramInt2));
      this. = arrayOfString;
      this. = Math.min(paramInt1paramInt2);
    }
    public void addLocation(String paramString)
    {
      if (this. >= this..length)
        resize(this., Math.max(1, this. * 2));
      this.[(this.++)] = paramString;
    }
    public String[] getLocationArray()
    {
      if (this. < this..length)
        resize(this..lengththis.);
      return this.;
    }
    public String getFirstLocation()
    {
      return this. > 0 ? this.[0] : null;
    }
    public int getLength()
    {
      return this.;
    }
  }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     org.apache.xerces.impl.xs.XMLSchemaLoader
 * JD-Core Version:    0.6.0
 */