StscState (xmlbeans API)

org.apache.xmlbeans.impl.schema

## Class StscState

- java.lang.Object
- - org.apache.xmlbeans.impl.schema.StscState

-     public class StscState
      extends Object

  This class represents the state of the SchemaTypeSystemCompiler as it's going.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addError(Collection<XmlError> errorListener, String message, int code, XmlObject location)`
    `static void` | `addError(Collection<XmlError> errorListener, String code, Object[] args, File location)`
    `static void` | `addError(Collection<XmlError> errorListener, String code, Object[] args, URL location)`
    `static void` | `addError(Collection<XmlError> errorListener, String code, Object[] args, XmlObject location)`
    `static void` | `addInfo(Collection<XmlError> errorListener, String message)`
    `static void` | `addInfo(Collection<XmlError> errorListener, String code, Object[] args)`
    `void` | `addSchemaDigest(byte[] digest)` Accumulates a schema digest...
    `void` | `addSourceUri(String uri, String nameToUse)` Notes another URI that has been consumed during compilation (this is the URI that is in the document .NAME property)
    `static void` | `addWarning(Collection<XmlError> errorListener, String message, int code, XmlObject location)`
    `static void` | `addWarning(Collection<XmlError> errorListener, String code, Object[] args, XmlObject location)`
    `boolean` | `allowPartial()` True if a partial SchemaTypeSystem should be produced
    `static void` | `clearThreadLocals()`
    `String` | `computeSavedFilename(String uri)`
    `static void` | `end()`
    `void` | `error(String message, int code, XmlObject loc)` Passes an error on to the current error listener.
    `void` | `error(String code, Object[] args, XmlObject loc)` Passes an error on to the current error listener.
    `static StscState` | `get()`
    `BindingConfig` | `getBindingConfig()`
    `EntityResolver` | `getEntityResolver()` May return null if there is no custom entity resolver.
    `Collection<XmlError>` | `getErrorListener()` Returns the error listener being filled in during this compilation
    `String` | `getJavaname(QName qname, int kind)` Looks up configured java name for the given qname.
    `String` | `getJavaPrefix(String namespace)` Looks up package override for a namespace URI
    `String` | `getJavaSuffix(String namespace)` Looks up package override for a namespace URI
    `String` | `getPackageOverride(String namespace)` Looks up package override for a namespace URI
    `int` | `getRecovered()` Get count of recovered errors.
    `SchemaTypeLoader` | `getS4SLoader()` Returns the schema type loader to use for processing s4s
    `File` | `getSchemasDir()`
    `void` | `info(String message)` Passes a warning on to the current error listener.
    `void` | `info(String code, Object[] args)` Passes a warning on to the current error listener.
    `void` | `initFromTypeSystem(SchemaTypeSystemImpl system, Set<String> newNamespaces)` Initializer for incremental compilation
    `boolean` | `noAnn()` True if annotations should be skipped
    `boolean` | `noPvr()` True if no particle valid (restriction) option is set
    `void` | `notFoundError(QName itemName, int code, XmlObject loc, boolean recovered)`
    `boolean` | `noUpa()` True if no unique particle attribution option is set
    `void` | `recover(String code, Object[] args, XmlObject loc)` Passes a recovered error on to the current error listener.
    `String` | `relativize(String uri)`
    `void` | `setBaseUri(URI uri)` The base URI to use for nice filenames when saving sources.
    `void` | `setBindingConfig(BindingConfig config)` Initializer for the schema config object.
    `void` | `setErrorListener(Collection<XmlError> errorListener)` Initializer for error handling.
    `void` | `setGivenTypeSystemName(String name)`
    `void` | `setImportingTypeLoader(SchemaTypeLoader loader)` Initializer for schematypepath
    `void` | `setOptions(XmlOptions options)` Initializer for compatMap.
    `void` | `setSchemasDir(File _schemasDir)`
    `void` | `setTargetSchemaTypeSystem(SchemaTypeSystemImpl target)` Initializer for references to the SchemaTypeLoader
    `boolean` | `shouldDownloadURI(String uriString)` True if the given URI is a local file
    `String` | `sourceCodeEncoding()` An optional encoding to use when compiling generated java source file (can be `null`)
    `Map<String,String>` | `sourceCopyMap()` Returns the whole sourceCopyMap, mapping URI's that have been read to "sourceName" local names that have been used to tag the types.
    `String` | `sourceNameForUri(String uri)` Produces the "sourceName" (to be used within the schema project source file copies) from the URI of the original source.
    `static StscState` | `start()`
    `SchemaTypeSystemImpl` | `sts()` The SchemaTypeSystem which we're building types on behalf of.
    `void` | `warning(String message, int code, XmlObject loc)` Passes an error on to the current error listener.
    `void` | `warning(String code, Object[] args, XmlObject loc)` Passes an error on to the current error listener.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### initFromTypeSystem

          public void initFromTypeSystem(SchemaTypeSystemImpl system,
                                         Set<String> newNamespaces)

      Initializer for incremental compilation

    - #### setImportingTypeLoader

          public void setImportingTypeLoader(SchemaTypeLoader loader)

      Initializer for schematypepath

    - #### setErrorListener

          public void setErrorListener(Collection<XmlError> errorListener)

      Initializer for error handling.

    - #### error

          public void error(String message,
                            int code,
                            XmlObject loc)

      Passes an error on to the current error listener. KHK: remove this

    - #### error

          public void error(String code,
                            Object[] args,
                            XmlObject loc)

      Passes an error on to the current error listener.

    - #### recover

          public void recover(String code,
                              Object[] args,
                              XmlObject loc)

      Passes a recovered error on to the current error listener.

    - #### warning

          public void warning(String message,
                              int code,
                              XmlObject loc)

      Passes an error on to the current error listener.

    - #### warning

          public void warning(String code,
                              Object[] args,
                              XmlObject loc)

      Passes an error on to the current error listener.

    - #### info

          public void info(String message)

      Passes a warning on to the current error listener.

    - #### info

          public void info(String code,
                           Object[] args)

      Passes a warning on to the current error listener.

    - #### addError

          public static void addError(Collection<XmlError> errorListener,
                                      String message,
                                      int code,
                                      XmlObject location)

    - #### addError

          public static void addError(Collection<XmlError> errorListener,
                                      String code,
                                      Object[] args,
                                      XmlObject location)

    - #### addError

          public static void addError(Collection<XmlError> errorListener,
                                      String code,
                                      Object[] args,
                                      File location)

    - #### addError

          public static void addError(Collection<XmlError> errorListener,
                                      String code,
                                      Object[] args,
                                      URL location)

    - #### addWarning

          public static void addWarning(Collection<XmlError> errorListener,
                                        String message,
                                        int code,
                                        XmlObject location)

    - #### addWarning

          public static void addWarning(Collection<XmlError> errorListener,
                                        String code,
                                        Object[] args,
                                        XmlObject location)

    - #### addInfo

          public static void addInfo(Collection<XmlError> errorListener,
                                     String message)

    - #### addInfo

          public static void addInfo(Collection<XmlError> errorListener,
                                     String code,
                                     Object[] args)

    - #### setGivenTypeSystemName

          public void setGivenTypeSystemName(String name)

    - #### setTargetSchemaTypeSystem

          public void setTargetSchemaTypeSystem(SchemaTypeSystemImpl target)

      Initializer for references to the SchemaTypeLoader

    - #### addSchemaDigest

          public void addSchemaDigest(byte[] digest)

      Accumulates a schema digest...

    - #### sts

          public SchemaTypeSystemImpl sts()

      The SchemaTypeSystem which we're building types on behalf of.

    - #### shouldDownloadURI

          public boolean shouldDownloadURI(String uriString)

      True if the given URI is a local file

    - #### setOptions

          public void setOptions(XmlOptions options)

      Initializer for compatMap.

    - #### getEntityResolver

          public EntityResolver getEntityResolver()

      May return null if there is no custom entity resolver.

    - #### noUpa

          public boolean noUpa()

      True if no unique particle attribution option is set

    - #### noPvr

          public boolean noPvr()

      True if no particle valid (restriction) option is set

    - #### noAnn

          public boolean noAnn()

      True if annotations should be skipped

    - #### allowPartial

          public boolean allowPartial()

      True if a partial SchemaTypeSystem should be produced

    - #### sourceCodeEncoding

          public String sourceCodeEncoding()

      An optional encoding to use when compiling generated java source file (can be `null`)

    - #### getRecovered

          public int getRecovered()

      Get count of recovered errors. Not for public.

    - #### setBindingConfig

          public void setBindingConfig(BindingConfig config)
                                throws IllegalArgumentException

      Initializer for the schema config object.
      Throws:
        `IllegalArgumentException`

    - #### getBindingConfig

          public BindingConfig getBindingConfig()
                                         throws IllegalArgumentException

      Throws:
        `IllegalArgumentException`

    - #### getPackageOverride

          public String getPackageOverride(String namespace)

      Looks up package override for a namespace URI

    - #### getJavaPrefix

          public String getJavaPrefix(String namespace)

      Looks up package override for a namespace URI

    - #### getJavaSuffix

          public String getJavaSuffix(String namespace)

      Looks up package override for a namespace URI

    - #### getJavaname

          public String getJavaname(QName qname,
                                    int kind)

      Looks up configured java name for the given qname.

    - #### clearThreadLocals

          public static void clearThreadLocals()

    - #### start

          public static StscState start()

    - #### get

          public static StscState get()

    - #### end

          public static void end()

    - #### notFoundError

          public void notFoundError(QName itemName,
                                    int code,
                                    XmlObject loc,
                                    boolean recovered)

    - #### sourceNameForUri

          public String sourceNameForUri(String uri)

      Produces the "sourceName" (to be used within the schema project source file copies) from the URI of the original source.

      Returns null if none.

    - #### sourceCopyMap

          public Map<String,String> sourceCopyMap()

      Returns the whole sourceCopyMap, mapping URI's that have been read to "sourceName" local names that have been used to tag the types.

    - #### setBaseUri

          public void setBaseUri(URI uri)

      The base URI to use for nice filenames when saving sources.

    - #### relativize

          public String relativize(String uri)

    - #### computeSavedFilename

          public String computeSavedFilename(String uri)

    - #### addSourceUri

          public void addSourceUri(String uri,
                                   String nameToUse)

      Notes another URI that has been consumed during compilation (this is the URI that is in the document .NAME property)

    - #### getErrorListener

          public Collection<XmlError> getErrorListener()

      Returns the error listener being filled in during this compilation

    - #### getS4SLoader

          public SchemaTypeLoader getS4SLoader()

      Returns the schema type loader to use for processing s4s

    - #### getSchemasDir

          public File getSchemasDir()

    - #### setSchemasDir

          public void setSchemasDir(File _schemasDir)