|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.adobe.idml.Validator
public class Validator
The Validator class can be used to validate IDML packages, extracted IDML packages, and non-package IDML files such as IDMS (snippets) and ICML (InCopy stories). Because non-package IDML files exist in a single file the class and documentation will referred to them as unified IDML file).
This class can be used programaticlly by contructing an Validator instance and calling one of three validate() methods on a given path.
You can construct an Validator with both types of schemas as follows:
Validator validator =
new Validator("/MyFiles/PackageIDMLSchema", "/MyFiles/UnifiedIDMLSchema);
You also can us the more intelligent constructor that determines which type of schema you are loading and initializes the Validator with the appropriate schema type.
Validator validator =
new Validator("/MyFiles/someIDMLSchema");
You could also use the setPackageSchema() and setUnifiedSchema() methods after construction.
Once an Validator is constructed you can validate using one of three methods. The validate method examines the file name and uses the appropriate schema type for validation. It's up to you to make sure that schema type is loaded. For example the following
validator.validate("/MyFiles/Hello.idml");
validator.validate("/MyFiles/Story.icml");
You can manually specify which type of schema to use via the following calls.
validator.validatePackage("/MyFiles/Hello.idml");
validator.validateUnifiedFile("/MyFiles/Hello/icml");
This class also provides a main method that uses the intelligent constructor and validate method. For example, it could be run as follows:
com.adobe.idml.validation.Validator
/MyFiles/PackageIDMLSchema /MyFiles/UnifiedIDMLSchema/MyFiles/Hello.idml
IDML tools comes with several shell script wrappers that show how to set the classpath. See Readme.txt in the IDMLTools directory for more information on these scripts.
| Constructor Summary | |
|---|---|
Validator()
Simple contructor for instantiated an unoaded Validator. |
|
Validator(java.lang.String schemaPath)
This constructor takes a path to one schema folder and examines it to decide which type of schema it is, and calls init(String, String) appropriately. |
|
Validator(java.lang.String packageSchemaPath,
java.lang.String unifiedSchemaPath)
Contructor used to create an instance of an Validator loaded with paths to schemas. |
|
| Method Summary | |
|---|---|
java.lang.String |
getPackateSchema()
|
java.lang.String |
getUnifiedSchema()
|
void |
init(java.lang.String packageSchemaPath,
java.lang.String unifiedSchemaPath)
Initialize the class with both types of schemas. |
static void |
main(java.lang.String[] args)
|
void |
setPackageSchema(java.lang.String packageSchemaPath)
Set the path to the package schema. |
void |
setUnifiedSchema(java.lang.String unifiedSchemaPath)
Sets the unified schema path |
void |
validate(java.lang.String file)
This method validates IDML packages (compressed or decompressed) as well as non-package files (ICML and IDMS). |
void |
validatePackage(java.lang.String idmlFile)
Valildates an IDML package. |
void |
validateUnifiedFile(java.lang.String idmlFilePath)
Validates a non-package file (such as an ICML, IDMS). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Validator(java.lang.String packageSchemaPath,
java.lang.String unifiedSchemaPath)
packageSchemaPath - A path to the folder containing the package schema.
This can be nil if the caller doesn't expect to use a package schema.unifiedSchemaPath - A path to the folder containing the unified schema.
This can be nil if the caller doesn't expect to use a unified schema.public Validator(java.lang.String schemaPath)
schemaPath - The path to the schema folder.public Validator()
| Method Detail |
|---|
public void init(java.lang.String packageSchemaPath,
java.lang.String unifiedSchemaPath)
packageSchemaPath - A path to the folder containing the package schema.unifiedSchemaPath - A path to the folder containing the non-package schema.public void setPackageSchema(java.lang.String packageSchemaPath)
packageSchemaPath - public java.lang.String getPackateSchema()
public void setUnifiedSchema(java.lang.String unifiedSchemaPath)
unifiedSchemaPath - public java.lang.String getUnifiedSchema()
public void validatePackage(java.lang.String idmlFile)
idmlFile - A path to a folder or a compressed IDML file.public void validateUnifiedFile(java.lang.String idmlFilePath)
idmlFilePath - The path to the IDML xml file.public void validate(java.lang.String file)
file - The abosolute or relative path to the IDML file of folder.public static void main(java.lang.String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||