org.alfresco.web.forms.xforms
Class SchemaUtil

java.lang.Object
  extended by org.alfresco.web.forms.xforms.SchemaUtil

public class SchemaUtil
extends java.lang.Object

Provides utility functions for xml schema parsing.


Nested Class Summary
static class SchemaUtil.Occurrence
           
 
Constructor Summary
SchemaUtil()
           
 
Method Summary
static java.util.TreeMap buildTypeTree(org.apache.xerces.xs.XSModel schema)
           
static boolean doesAttributeComeFromExtension(org.apache.xerces.xs.XSAttributeUse attr, org.apache.xerces.xs.XSComplexTypeDefinition controlType)
           
static boolean doesElementComeFromExtension(org.apache.xerces.xs.XSElementDeclaration element, org.apache.xerces.xs.XSComplexTypeDefinition controlType)
           
static org.apache.xerces.xs.XSParticle findCorrespondingParticleInComplexType(org.apache.xerces.xs.XSElementDeclaration elDecl)
           
static short getBuiltInType(org.apache.xerces.xs.XSTypeDefinition type)
          Returns the most-specific built-in base type for the provided type.
static java.lang.String getBuiltInTypeName(short type)
           
static java.lang.String getBuiltInTypeName(org.apache.xerces.xs.XSTypeDefinition type)
           
static SchemaUtil.Occurrence getOccurrence(org.apache.xerces.xs.XSElementDeclaration elDecl)
          finds the minOccurs and maxOccurs of an element declaration
static boolean isAttributeDeclaredIn(java.lang.String attrName, java.lang.String namespace, org.apache.xerces.xs.XSComplexTypeDefinition type, boolean recursive)
          check that the element defined by this name is declared directly in the type -> idem with string
static boolean isAttributeDeclaredIn(org.apache.xerces.xs.XSAttributeUse attr, org.apache.xerces.xs.XSComplexTypeDefinition type, boolean recursive)
          check that the element defined by this name is declared directly in the type
static boolean isElementDeclaredIn(java.lang.String name, java.lang.String namespace, org.apache.xerces.xs.XSComplexTypeDefinition type, boolean recursive)
          check that the element defined by this name is declared directly in the type
static boolean isElementDeclaredIn(java.lang.String name, java.lang.String namespace, org.apache.xerces.xs.XSModelGroup group)
          private recursive method called by isElementDeclaredIn(String name, XSComplexTypeDefinition type)
static org.apache.xerces.xs.XSModel parseSchema(org.w3c.dom.Document schemaDocument, boolean failOnError)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaUtil

public SchemaUtil()
Method Detail

getBuiltInType

public static short getBuiltInType(org.apache.xerces.xs.XSTypeDefinition type)
Returns the most-specific built-in base type for the provided type.


getBuiltInTypeName

public static java.lang.String getBuiltInTypeName(org.apache.xerces.xs.XSTypeDefinition type)

getBuiltInTypeName

public static java.lang.String getBuiltInTypeName(short type)

parseSchema

public static org.apache.xerces.xs.XSModel parseSchema(org.w3c.dom.Document schemaDocument,
                                                       boolean failOnError)
                                                throws FormBuilderException
Throws:
FormBuilderException

buildTypeTree

public static java.util.TreeMap buildTypeTree(org.apache.xerces.xs.XSModel schema)

findCorrespondingParticleInComplexType

public static org.apache.xerces.xs.XSParticle findCorrespondingParticleInComplexType(org.apache.xerces.xs.XSElementDeclaration elDecl)

isElementDeclaredIn

public static boolean isElementDeclaredIn(java.lang.String name,
                                          java.lang.String namespace,
                                          org.apache.xerces.xs.XSComplexTypeDefinition type,
                                          boolean recursive)
check that the element defined by this name is declared directly in the type


isElementDeclaredIn

public static boolean isElementDeclaredIn(java.lang.String name,
                                          java.lang.String namespace,
                                          org.apache.xerces.xs.XSModelGroup group)
private recursive method called by isElementDeclaredIn(String name, XSComplexTypeDefinition type)


doesElementComeFromExtension

public static boolean doesElementComeFromExtension(org.apache.xerces.xs.XSElementDeclaration element,
                                                   org.apache.xerces.xs.XSComplexTypeDefinition controlType)

isAttributeDeclaredIn

public static boolean isAttributeDeclaredIn(org.apache.xerces.xs.XSAttributeUse attr,
                                            org.apache.xerces.xs.XSComplexTypeDefinition type,
                                            boolean recursive)
check that the element defined by this name is declared directly in the type


isAttributeDeclaredIn

public static boolean isAttributeDeclaredIn(java.lang.String attrName,
                                            java.lang.String namespace,
                                            org.apache.xerces.xs.XSComplexTypeDefinition type,
                                            boolean recursive)
check that the element defined by this name is declared directly in the type -> idem with string


doesAttributeComeFromExtension

public static boolean doesAttributeComeFromExtension(org.apache.xerces.xs.XSAttributeUse attr,
                                                     org.apache.xerces.xs.XSComplexTypeDefinition controlType)

getOccurrence

public static SchemaUtil.Occurrence getOccurrence(org.apache.xerces.xs.XSElementDeclaration elDecl)
finds the minOccurs and maxOccurs of an element declaration

Returns:
a table containing minOccurs and MaxOccurs


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.