de.mindcrimeilab.xsanalyzer.util
Class XSModelHelper

java.lang.Object
  extended by de.mindcrimeilab.xsanalyzer.util.XSModelHelper

public abstract class XSModelHelper
extends Object

Version:
$Revision:62 $
Author:
Michael Engelhardt, $Author:me $

Constructor Summary
XSModelHelper()
           
 
Method Summary
static
<T> void
addComponents(org.apache.xerces.xs.XSNamedMap map, List<T> list)
           
static String compositorToString(short compositor)
           
static Collection<org.apache.xerces.xs.XSObject> flat(org.apache.xerces.xs.XSObjectList list)
           
static org.apache.xerces.xs.XSTypeDefinition getBaseType(org.apache.xerces.xs.XSObject object)
           
static org.apache.xerces.xs.XSTypeDefinition getBaseType(org.apache.xerces.xs.XSSimpleTypeDefinition stypedef)
           
static Set<? extends org.apache.xerces.xs.XSTypeDefinition> getComponents(org.apache.xerces.xs.XSModel model, List<org.apache.xerces.xs.XSNamespaceItem> namespaces)
           
static Set<? extends org.apache.xerces.xs.XSTypeDefinition> getComponents(org.apache.xerces.xs.XSModel model, List<org.apache.xerces.xs.XSNamespaceItem> namespaces, short[] selectedTypes)
          Returns all public and global types for a given set of namespaces
static List<org.apache.xerces.xs.XSElementDeclaration> getElements(org.apache.xerces.xs.XSModel model, List<org.apache.xerces.xs.XSNamespaceItem> namespaces)
          Returns all public and global elements for given set of namespaces
static List<org.apache.xerces.impl.xs.XSGroupDecl> getGroups(org.apache.xerces.xs.XSModel model, List<org.apache.xerces.xs.XSNamespaceItem> namespaces)
           
static List<org.apache.xerces.xs.XSNamespaceItem> getNamespaceItemsAsList(org.apache.xerces.xs.XSModel model)
           
static org.apache.xerces.xs.XSNamespaceItem getTargetNamespace(org.apache.xerces.xs.XSModel model, File schema)
          Get target namespace from model.
static boolean isSameTypeDefinition(org.apache.xerces.xs.XSObject lhs, org.apache.xerces.xs.XSObject rhs)
          Check if both values have the same name and namespace definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSModelHelper

public XSModelHelper()
Method Detail

getComponents

public static Set<? extends org.apache.xerces.xs.XSTypeDefinition> getComponents(org.apache.xerces.xs.XSModel model,
                                                                                 List<org.apache.xerces.xs.XSNamespaceItem> namespaces)

getComponents

public static Set<? extends org.apache.xerces.xs.XSTypeDefinition> getComponents(org.apache.xerces.xs.XSModel model,
                                                                                 List<org.apache.xerces.xs.XSNamespaceItem> namespaces,
                                                                                 short[] selectedTypes)
Returns all public and global types for a given set of namespaces

Parameters:
model - schema
namespaces - List of namespaces
Returns:

getElements

public static List<org.apache.xerces.xs.XSElementDeclaration> getElements(org.apache.xerces.xs.XSModel model,
                                                                          List<org.apache.xerces.xs.XSNamespaceItem> namespaces)
Returns all public and global elements for given set of namespaces

Parameters:
model - schema
namespaces - List of namespaces
Returns:

getGroups

public static List<org.apache.xerces.impl.xs.XSGroupDecl> getGroups(org.apache.xerces.xs.XSModel model,
                                                                    List<org.apache.xerces.xs.XSNamespaceItem> namespaces)

getNamespaceItemsAsList

public static List<org.apache.xerces.xs.XSNamespaceItem> getNamespaceItemsAsList(org.apache.xerces.xs.XSModel model)

isSameTypeDefinition

public static boolean isSameTypeDefinition(org.apache.xerces.xs.XSObject lhs,
                                           org.apache.xerces.xs.XSObject rhs)
Check if both values have the same name and namespace definition.

Parameters:
lhs -
rhs -
Returns:
true if both have same name and namespace value

flat

public static Collection<org.apache.xerces.xs.XSObject> flat(org.apache.xerces.xs.XSObjectList list)

addComponents

public static <T> void addComponents(org.apache.xerces.xs.XSNamedMap map,
                                     List<T> list)

getBaseType

public static org.apache.xerces.xs.XSTypeDefinition getBaseType(org.apache.xerces.xs.XSObject object)
Parameters:
object -
Returns:

getBaseType

public static org.apache.xerces.xs.XSTypeDefinition getBaseType(org.apache.xerces.xs.XSSimpleTypeDefinition stypedef)

getTargetNamespace

public static org.apache.xerces.xs.XSNamespaceItem getTargetNamespace(org.apache.xerces.xs.XSModel model,
                                                                      File schema)
Get target namespace from model.

Parameters:
model -
schema -
Returns:

compositorToString

public static String compositorToString(short compositor)


Copyright © 2010. All Rights Reserved.