Javax.Xml.Validation.SchemaFactory.NewInstance Method
  1. If the system property "javax.xml.validation.SchemaFactory:schemaLanguage" is present (where schemaLanguage is the parameter to this method), then its value is read as a class name. The method will try to create a new instance of this class by using the class loader, and returns it if it is successfully created.
  2. $java.home/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for. If present, the value is processed just like above.
  3. java Example

    isSchemaLanguageSupported(String)
    The first service provider found in class loader order that supports the specified schema language is returned.
  4. Platform default SchemaFactory is located in a implementation specific way. There must be a platform default SchemaFactory for W3C XML Schema.

java Example

 http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
 

Syntax

[Android.Runtime.Register("newInstance", "(Ljava/lang/String;)Ljavax/xml/validation/SchemaFactory;", "")]
public static SchemaFactory NewInstance (string schemaLanguage)

Parameters

schemaLanguage
Specifies the schema language which the returned SchemaFactory will understand. See for the possible values.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionIf no implementation of the schema language is available.
Java.Lang.NullPointerExceptionIf the schemaLanguage parameter is null.

Remarks

  1. If the system property "javax.xml.validation.SchemaFactory:schemaLanguage" is present (where schemaLanguage is the parameter to this method), then its value is read as a class name. The method will try to create a new instance of this class by using the class loader, and returns it if it is successfully created.
  2. $java.home/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for. If present, the value is processed just like above.
  3. java Example

    isSchemaLanguageSupported(String)
    The first service provider found in class loader order that supports the specified schema language is returned.
  4. Platform default SchemaFactory is located in a implementation specific way. There must be a platform default SchemaFactory for W3C XML Schema.

java Example

 http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
 

Lookup an implementation of the SchemaFactory that supports the specified schema language and return it.

To find a SchemaFactory object for a given schema language, this method looks the following places in the following order where "the class loader" refers to the context class loader:

The class loader is asked for service provider provider-configuration files matching javax.xml.validation.SchemaFactory in the resource directory META-INF/services. See the JAR File Specification for file format and parsing rules. Each potential service provider is required to implement the method:

If everything fails, Java.Lang.IllegalArgumentException will be thrown.

Tip for Trouble-shooting:

See Java.Util.Properties.Load(System.IO.Stream) for exactly how a property file is parsed. In particular, colons ':' need to be escaped in a property file, so make sure schema language URIs are properly escaped in it. For example:

[Android Documentation]

Requirements

Namespace: Javax.Xml.Validation
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8