com.abra.j2xb.beans.xmlModel
Class MoXmlDefaultSchemaLocationGenerator

java.lang.Object
  extended by com.abra.j2xb.beans.xmlModel.MoXmlDefaultSchemaLocationGenerator
All Implemented Interfaces:
MoXmlSchemaLocationGenerator

public class MoXmlDefaultSchemaLocationGenerator
extends java.lang.Object
implements MoXmlSchemaLocationGenerator

Since:
JDK1.5
Version:
1.0, May 1, 2008
Author:
Yoav Abrahami

Constructor Summary
MoXmlDefaultSchemaLocationGenerator(java.io.File schemasOutputDirectory)
          constructs the default filename generator for schemas
 
Method Summary
 java.io.File getSchemaFilename(MoXmlSchema schema)
          callback method to generate a filename for a certain XML Schema, where the schema is saved as part of the schema generation process.
 java.net.URL getSchemaLocation(MoXmlSchema schema)
          callback method to generate a schemaLocation attribute for an included schema.
 boolean includeSchemaLocation(MoXmlSchema schema)
          Defines if to include the schemaLocation attribute for an included XML Schema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoXmlDefaultSchemaLocationGenerator

public MoXmlDefaultSchemaLocationGenerator(java.io.File schemasOutputDirectory)
constructs the default filename generator for schemas

Parameters:
schemasOutputDirectory - - the output location of the generated schemas.
Method Detail

getSchemaFilename

public java.io.File getSchemaFilename(MoXmlSchema schema)
                               throws MoXmlSchemaGenerationException
Description copied from interface: MoXmlSchemaLocationGenerator
callback method to generate a filename for a certain XML Schema, where the schema is saved as part of the schema generation process. The method can return null in cases when generating the schema does not require saving the schema to file.

Specified by:
getSchemaFilename in interface MoXmlSchemaLocationGenerator
Parameters:
schema - - the schema
Returns:
File object naming the schema file
Throws:
MoXmlSchemaGenerationException - exception to throw in case of error in the callback itself.

getSchemaLocation

public java.net.URL getSchemaLocation(MoXmlSchema schema)
                               throws MoXmlSchemaGenerationException
Description copied from interface: MoXmlSchemaLocationGenerator
callback method to generate a schemaLocation attribute for an included schema.

Specified by:
getSchemaLocation in interface MoXmlSchemaLocationGenerator
Parameters:
schema - - the schema
Returns:
URL of the included schema
Throws:
MoXmlSchemaGenerationException - exception to throw in case of error in the callback itself.

includeSchemaLocation

public boolean includeSchemaLocation(MoXmlSchema schema)
                              throws MoXmlSchemaGenerationException
Description copied from interface: MoXmlSchemaLocationGenerator
Defines if to include the schemaLocation attribute for an included XML Schema

Specified by:
includeSchemaLocation in interface MoXmlSchemaLocationGenerator
Parameters:
schema - - the schema
Returns:
true to include the schemaLocation attribute
Throws:
MoXmlSchemaGenerationException - exception to throw in case of error in the callback itself.


Copyright © 2008. All Rights Reserved.