com.ibm.commons.xsdutil.xsd
Class XSDConcreteComponentWrapper

java.lang.Object
  extended by com.ibm.commons.xsdutil.xsd.XSDConcreteComponentWrapper

public class XSDConcreteComponentWrapper
extends java.lang.Object

This class wraps XSDConcreteComponent. It provides a way for users to reliably retrieve the unique tag name (prefix + local name) for any given XSDConcreteComponent when the XSDSchemaSet is not available, or not required.


Constructor Summary
XSDConcreteComponentWrapper(org.eclipse.xsd.XSDConcreteComponent component, java.lang.String prefix)
          Creates a new instance of this class.
 
Method Summary
 void appendToParentList(XSDConcreteComponentWrapper c)
           
 org.eclipse.xsd.XSDComponent getComponent()
          Returns the component that has been wrapped
static java.lang.String getDisplayTypeFromType(java.lang.String type)
          Converts the XSD Type to a user readable name (e.g.
 java.lang.String getKey()
           
 java.lang.String getName()
           
 java.util.List<XSDConcreteComponentWrapper> getParentList()
           
 java.lang.String getType()
          Returns the schema type of the wrapped component
 boolean hasRestrictionOrExtension()
          Returns true if the given component has an extension or restriction defined
 void setType(java.lang.String type)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSDConcreteComponentWrapper

public XSDConcreteComponentWrapper(org.eclipse.xsd.XSDConcreteComponent component,
                                   java.lang.String prefix)
Creates a new instance of this class.

Parameters:
component - XSDConcreteComponent The component that we wish to wrap.
prefix - the prefix for the component that we are going to wrap
Method Detail

getName

public java.lang.String getName()
Returns:
returns a qualified component name (e.g. ns:tagName)

getComponent

public org.eclipse.xsd.XSDComponent getComponent()
Returns the component that has been wrapped

Returns:

getType

public java.lang.String getType()
Returns the schema type of the wrapped component

Returns:
the type of the component

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDisplayTypeFromType

public static java.lang.String getDisplayTypeFromType(java.lang.String type)
Converts the XSD Type to a user readable name (e.g. "Number" instead of 'decimal' etc).

Parameters:
type - the name of the type we wish to see in user friendly format
Returns:
a user readable name for the given type

setType

public void setType(java.lang.String type)

getKey

public java.lang.String getKey()

appendToParentList

public void appendToParentList(XSDConcreteComponentWrapper c)

getParentList

public java.util.List<XSDConcreteComponentWrapper> getParentList()

hasRestrictionOrExtension

public boolean hasRestrictionOrExtension()
Returns true if the given component has an extension or restriction defined

Returns: