com.oxygenxml.validate.nvdl
Class SchemaReceiverImpl

java.lang.Object
  extended by com.oxygenxml.validate.nvdl.SchemaReceiverImpl
All Implemented Interfaces:
SchemaReceiver

 class SchemaReceiverImpl
extends Object
implements SchemaReceiver

Schema receiver implementation for NVDL schemas.


Field Summary
private  boolean attributesSchema
          Flag indicating if we need to check only attributes, that means the root element is just a placeholder for the attributes.
private  SchemaReader autoSchemaReader
          The schema reader capable of parsing the input schema file.
private static String NVDL_SCHEMA
          Relax NG schema for nvdl schemas.
private  Schema nvdlSchema
          Schema object created by this schema receiver.
private  PropertyMap properties
          Properties.
private static String RNC_MEDIA_TYPE
          The type used for specifying RNC schemas.
private static PropertyId[] subSchemaProperties
          Required properties.
 
Constructor Summary
SchemaReceiverImpl(PropertyMap properties)
          Creates a schema receiver for NVDL schemas.
 
Method Summary
(package private)  Schema createChildSchema(InputSource inputSource, String schemaType, PropertyMap options, boolean isAttributesSchema)
          Creates a child schema.
(package private)  Schema getNvdlSchema()
           
(package private)  Option getOption(String uri)
          Get an option for the given URI.
(package private)  PropertyMap getProperties()
          Get the properties.
private static URL getResource(String resourceName)
          Get a resource using this class class loader.
 SchemaFuture installHandlers(XMLReader xr)
           
private static boolean isRnc(String schemaType)
          Checks is a schema type is RNC.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NVDL_SCHEMA

private static final String NVDL_SCHEMA
Relax NG schema for nvdl schemas.

See Also:
Constant Field Values

RNC_MEDIA_TYPE

private static final String RNC_MEDIA_TYPE
The type used for specifying RNC schemas.

See Also:
Constant Field Values

properties

private final PropertyMap properties
Properties.


attributesSchema

private final boolean attributesSchema
Flag indicating if we need to check only attributes, that means the root element is just a placeholder for the attributes.


autoSchemaReader

private final SchemaReader autoSchemaReader
The schema reader capable of parsing the input schema file. It will be an auto schema reader as NVDL is XML.


nvdlSchema

private Schema nvdlSchema
Schema object created by this schema receiver.


subSchemaProperties

private static final PropertyId[] subSchemaProperties
Required properties.

Constructor Detail

SchemaReceiverImpl

public SchemaReceiverImpl(PropertyMap properties)
Creates a schema receiver for NVDL schemas.

Parameters:
properties - Properties.
Method Detail

installHandlers

public SchemaFuture installHandlers(XMLReader xr)
Specified by:
installHandlers in interface SchemaReceiver

getNvdlSchema

Schema getNvdlSchema()
               throws IOException,
                      IncorrectSchemaException,
                      SAXException
Throws:
IOException
IncorrectSchemaException
SAXException

getResource

private static URL getResource(String resourceName)
Get a resource using this class class loader.

Parameters:
resourceName - the resource.
Returns:
An URL pointing to the resource.

getProperties

PropertyMap getProperties()
Get the properties.

Returns:
a PropertyMap.

createChildSchema

Schema createChildSchema(InputSource inputSource,
                         String schemaType,
                         PropertyMap options,
                         boolean isAttributesSchema)
                   throws IOException,
                          IncorrectSchemaException,
                          SAXException
Creates a child schema. This schema is referred in a validate action.

Parameters:
inputSource - The input source for the schema.
schemaType - The schema type.
options - Options specified for this schema in the NVDL script.
isAttributesSchema - Flag indicating if the schema should be modified to check attributes only.
Returns:
Throws:
IOException - In case of IO problems.
IncorrectSchemaException - In case of invalid schema.
SAXException - In case if XML problems while creating the schema.

getOption

Option getOption(String uri)
Get an option for the given URI.

Parameters:
uri - The URI for an option.
Returns:
Either the option from the auto schema reader or from the compact schema reader.

isRnc

private static boolean isRnc(String schemaType)
Checks is a schema type is RNC.

Parameters:
schemaType - The schema type specification.
Returns:
true if the schema type refers to a RNC schema.