org.wso2.registry.jdbc.mediatypes.builtin.utils
Class SchemaFileProcessor
java.lang.Object
org.wso2.registry.jdbc.mediatypes.builtin.utils.SchemaFileProcessor
public class SchemaFileProcessor
- extends java.lang.Object
Method Summary |
void |
calculateNewSchemaNames(XmlSchema xmlSchema,
java.util.Map processedSchemaMap,
java.util.Set visitedShemas,
boolean isWsdlInlineSchema)
calculate the new schema file names to save the schema. |
void |
saveSchemaFileToRegistry(java.lang.String location)
saves the file to the reginstry after saving all its inclues and imports to the
reginstry and updating the schema locations accordingly. |
void |
saveSchemaFileToRegistry(java.lang.String location,
java.util.Map processedSchemaMap)
|
void |
saveSchemaFileToRegistry(XmlSchema xmlSchema,
java.util.Map processedSchemaMap,
java.util.Map changeSchemaNames,
java.util.Set visitedShemas,
boolean isWsdlInlineSchema)
save the schemas to the registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SchemaFileProcessor
public SchemaFileProcessor()
saveSchemaFileToRegistry
public void saveSchemaFileToRegistry(java.lang.String location)
throws java.io.FileNotFoundException
- saves the file to the reginstry after saving all its inclues and imports to the
reginstry and updating the schema locations accordingly.
- Parameters:
location
- - original schema location.
- Throws:
java.io.FileNotFoundException
saveSchemaFileToRegistry
public void saveSchemaFileToRegistry(java.lang.String location,
java.util.Map processedSchemaMap)
- Parameters:
location
- - original schema locationprocessedSchemaMap
- - this map contains schema source URI vs new schema locaitons.
calculateNewSchemaNames
public void calculateNewSchemaNames(XmlSchema xmlSchema,
java.util.Map processedSchemaMap,
java.util.Set visitedShemas,
boolean isWsdlInlineSchema)
- calculate the new schema file names to save the schema. Here we can not save the
schema file as it is since there can be recursive imports. So what we have to do
is to first determine the schema names to be saved and then change the schema locations
accordingly.
In this method first we iterate through the imports and includes and find the names.
have used the visitedSchemas variable to keep track of the visited schemas
to avoid the recursion.
- Parameters:
xmlSchema
- - schema to change save into the registryprocessedSchemaMap
- - map to keep the source uri vs new schema locationvisitedShemas
- - already visited schemas source urisisWsdlInlineSchema
- - this variable is used to check whether the given schema is
an inline schema of a wsdl. in that case we do not need to calculate a name for that
saveSchemaFileToRegistry
public void saveSchemaFileToRegistry(XmlSchema xmlSchema,
java.util.Map processedSchemaMap,
java.util.Map changeSchemaNames,
java.util.Set visitedShemas,
boolean isWsdlInlineSchema)
- save the schemas to the registry. used the calcualted names in the processedSchemaMap
to change the schema locations.
- Parameters:
xmlSchema
- - xml scheam to saveprocessedSchemaMap
- - already determined schema nameschangeSchemaNames
- - this contains the map between original schema names and the
change uris. this is used to update the wsdl inline schema imports and inclueds when
saving the wsdl file.visitedShemas
- - keep track of visited schemas to avoid recursionisWsdlInlineSchema
- - if called from a inline wsdl schema.
Copyright © 2007 Apache Web Services Project. All Rights Reserved.