Data Request Broker
2-3-release

fr.gael.drb.xsd
Class XmlSchema

java.lang.Object
  extended by fr.gael.drb.xsd.XmlSchema

public class XmlSchema
extends Object

Declaration of an XML-Schema.


Field Summary
protected  Namespace namespaces
          Namespace definition.
protected  String targetNamespace
          The target namespace of this type.
 
Constructor Summary
XmlSchema(XsdElement[] root_elements, XsdType[] global_types, Namespace namespaces)
          Build an XML-Schema
 
Method Summary
 XsdAnnotation getAnnotation()
          Returns annotation of this component.
 XsdElement getDefaultRootElement()
          Returns the default root element of this schema
static XmlSchema getDefaultSchema()
          Returns the default schema including the standard types.
protected  Set<XsdType> getDerivation(XsdType global_type)
          Returns the local derivation of a global type.
 DrbAttributeList getExternalAttributes()
          Returns the external attributes of this component.
 DrbNodeList getExternalNodes()
          Returns the external nodes of this component.
 XsdType[] getGlobalTypes()
          Returns the global type of this schema.
 XsdElement getRootElement(String qname)
          Returns an element from its qualified name.
 XsdElement[] getRootElements()
          Returns the root elements of this schema
 String getTargetNamespace()
          Returns the target namespace of this type.
 XsdType getType(String qname)
          Returns a type from its qualified name.
static void main(String[] args)
          Makes this class runnable for testing.
 void setAnnotation(XsdAnnotation annotation)
          Set annotation of this component.
 void setExternalAttributes(DrbAttributeList external_attributes)
          Set the external attributes of this component.
 void setExternalNodes(DrbNodeList external_nodes)
          Set the external nodes of this component.
 void setTargetNamespace(String target_namespace)
          Set the target namespace of this type.
 DrbNode toNode()
          Format this component into a string.
static XsdInvalid validate(String xml_filename, String xsd_filename, boolean deep)
          Allow to validate an xml file using an xml schema file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaces

protected Namespace namespaces
Namespace definition.


targetNamespace

protected String targetNamespace
The target namespace of this type.

Constructor Detail

XmlSchema

public XmlSchema(XsdElement[] root_elements,
                 XsdType[] global_types,
                 Namespace namespaces)
Build an XML-Schema

Parameters:
root_elements - All the elements of the root
global_types - The globals types
namespaces - The name space
Method Detail

getDefaultRootElement

public final XsdElement getDefaultRootElement()
Returns the default root element of this schema

Returns:
Return the default root element

getRootElements

public final XsdElement[] getRootElements()
Returns the root elements of this schema

Returns:
Return all the root elements

getRootElement

public final XsdElement getRootElement(String qname)
Returns an element from its qualified name.

Parameters:
qname - the name root
Returns:
Return the element root with the specified name

getGlobalTypes

public final XsdType[] getGlobalTypes()
Returns the global type of this schema.

Returns:
Return the global types

getType

public XsdType getType(String qname)
Returns a type from its qualified name.

Parameters:
qname - The qualified name
Returns:
Return the type of the qualified name

getDerivation

protected final Set<XsdType> getDerivation(XsdType global_type)
Returns the local derivation of a global type.

Parameters:
global-type - a global type definition
Returns:
the set of derived

getDefaultSchema

public static XmlSchema getDefaultSchema()
Returns the default schema including the standard types.

Returns:
The Xml schema

toNode

public DrbNode toNode()
Format this component into a string.

Returns:
the node

validate

public static XsdInvalid validate(String xml_filename,
                                  String xsd_filename,
                                  boolean deep)
Allow to validate an xml file using an xml schema file.

Parameters:
xml_filename - the xml filename to be validate
xsd_filename - the xml schema file used for validation
deep - true for deep validation and false otherwise
Returns:
true if the xml file is valid regarding the schema, false otherwise.

main

public static void main(String[] args)
Makes this class runnable for testing.

Parameters:
args - String[]

getAnnotation

public final XsdAnnotation getAnnotation()
Returns annotation of this component.

Returns:
The annotation of this component

setAnnotation

public final void setAnnotation(XsdAnnotation annotation)
Set annotation of this component.

Parameters:
annotation - The annotation of this component

getExternalNodes

public final DrbNodeList getExternalNodes()
Returns the external nodes of this component.

Returns:
The list of the node

setExternalNodes

public final void setExternalNodes(DrbNodeList external_nodes)
Set the external nodes of this component.

Parameters:
external_nodes - The list of the node

getExternalAttributes

public final DrbAttributeList getExternalAttributes()
Returns the external attributes of this component.

Returns:
The list of attributes

setExternalAttributes

public final void setExternalAttributes(DrbAttributeList external_attributes)
Set the external attributes of this component.

Parameters:
external_attributes - The list of the attributes

getTargetNamespace

public final String getTargetNamespace()
Returns the target namespace of this type.

Returns:
the target namespace of this type.

setTargetNamespace

public final void setTargetNamespace(String target_namespace)
Set the target namespace of this type.

Parameters:
target_namespace - the target namespace of this type.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .