org.eclipse.wst.xsd.core_1.1.600.v201104070312

16:49:35.345 INFO  jd.cli.Main - Decompiling org.eclipse.wst.xsd.core_1.1.600.v201104070312.jar
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
import org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactory;
import org.eclipse.xsd.XSDPackage;

public class CMDocumentFactoryXSD
  implements CMDocumentFactory
{
  public static final String XSD_FILE_TYPE = "XSD";
  
  public CMDocumentFactoryXSD()
  {
    XSDPackage.eINSTANCE.eClass();
    XSDPackage.eINSTANCE.getXSDFactory();
  }
  
  public CMDocument createCMDocument(String uri)
  {
    CMDocument result = null;
    try
    {
      result = XSDImpl.buildCMDocument(uri);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.CMDocumentFactoryXSD
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;

public abstract class CMNodeImpl
  extends AdapterImpl
  implements CMNode
{
  protected static final String PROPERTY_DOCUMENTATION = "documentation";
  protected static final String PROPERTY_DOCUMENTATION_SOURCE = "documentationSource";
  protected static final String PROPERTY_DOCUMENTATION_LANGUAGE = "documentationLanguage";
  protected static final String PROPERTY_MOF_NOTIFIER = "key";
  protected static final String PROPERTY_DEFINITION_INFO = "http://org.eclipse.wst/cm/properties/definitionInfo";
  protected static final String PROPERTY_DEFINITION = "http://org.eclipse.wst/cm/properties/definition";
  
  public abstract Object getKey();
  
  public boolean supports(String propertyName)
  {
    return propertyName.equals("key");
  }
  
  public Object getProperty(String propertyName)
  {
    return null;
  }
  
  public void setProperty(String propertyName, Object object) {}
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.CMNodeImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Plugin;

public class XSDCMManager
  extends Plugin
{
  private static XSDCMManager instance;
  
  public static XSDCMManager getInstance()
  {
    if (instance == null) {
      instance = new XSDCMManager();
    }
    return instance;
  }
  
  public void startup()
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDCMManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDModelGroup;
import org.eclipse.xsd.XSDModelGroupDefinition;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDWildcard;
import org.eclipse.xsd.util.XSDSwitch;

class XSDImpl$1
  extends XSDSwitch
{
  final XSDImpl.XSDAdapterFactoryImpl this$1;
  
  XSDImpl$1(XSDImpl.XSDAdapterFactoryImpl paramXSDAdapterFactoryImpl)
  {
    this$1 = paramXSDAdapterFactoryImpl;
  }
  
  public Object caseXSDWildcard(XSDWildcard object)
  {
    return new XSDImpl.XSDWildcardAdapter(object);
  }
  
  public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
  {
    return new XSDImpl.XSDModelGroupDefinitionAdapter(object);
  }
  
  public Object caseXSDAttributeUse(XSDAttributeUse object)
  {
    return new XSDImpl.XSDAttributeUseAdapter(object);
  }
  
  public Object caseXSDElementDeclaration(XSDElementDeclaration object)
  {
    return new XSDImpl.XSDElementDeclarationAdapter(object);
  }
  
  public Object caseXSDModelGroup(XSDModelGroup object)
  {
    return new XSDImpl.XSDModelGroupAdapter(object);
  }
  
  public Object caseXSDSchema(XSDSchema object)
  {
    return new XSDImpl.XSDSchemaAdapter(object);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.List;
import java.util.Vector;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDModelGroup;
import org.eclipse.xsd.XSDModelGroupDefinition;
import org.eclipse.xsd.XSDWildcard;

public class XSDImpl$DerivedChildVisitor
  extends XSDImpl.XSDCMVisitor
{
  protected CMNodeListImpl childNodeList = new CMNodeListImpl();
  protected List baseTypeList = new Vector();
  Object root;
  
  XSDImpl$DerivedChildVisitor(Object root)
  {
    this.root = root;
  }
  
  public CMNodeListImpl getChildNodeList()
  {
    return childNodeList;
  }
  
  public void visitWildcard(XSDWildcard wildcard)
  {
    childNodeList.getList().add(XSDImpl.getAdapter(wildcard));
  }
  
  public void visitElementDeclaration(XSDElementDeclaration element)
  {
    childNodeList.getList().add(XSDImpl.getAdapter(element));
  }
  
  public void visitModelGroup(XSDModelGroup modelGroup)
  {
    childNodeList.getList().add(XSDImpl.getAdapter(modelGroup));
  }
  
  public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDefinition)
  {
    childNodeList.getList().add(XSDImpl.getAdapter(modelGroupDefinition));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.DerivedChildVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.List;
import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDTypeDefinition;

public class XSDImpl$DerivedElementDeclarationImpl
  extends XSDImpl.ElementDeclarationBaseImpl
{
  protected XSDImpl.XSDElementDeclarationAdapter owner;
  protected XSDTypeDefinition xsdType;
  public String uriQualifiedTypeName;
  
  public XSDImpl$DerivedElementDeclarationImpl(XSDImpl.XSDElementDeclarationAdapter owner, XSDTypeDefinition xsdType, String uriQualifiedTypeName)
  {
    this.owner = owner;
    this.xsdType = xsdType;
    this.uriQualifiedTypeName = uriQualifiedTypeName;
  }
  
  protected XSDElementDeclaration getXSDElementDeclaration()
  {
    return (XSDElementDeclaration)owner.getKey();
  }
  
  protected XSDElementDeclaration getResolvedXSDElementDeclaration()
  {
    return ((XSDElementDeclaration)owner.getKey()).getResolvedElementDeclaration();
  }
  
  public Object getKey()
  {
    return owner.getKey();
  }
  
  protected XSDTypeDefinition getXSDType()
  {
    return xsdType;
  }
  
  protected List getXSITypes()
  {
    return owner.getXSITypes();
  }
  
  protected CMElementDeclaration getDerivedElementDeclaration(String uriQualifiedTypeName)
  {
    return owner.getDerivedElementDeclaration(uriQualifiedTypeName);
  }
  
  protected CMNode getDefinition()
  {
    return this;
  }
  
  protected String getDefinitionInfo()
  {
    return owner.getDefinitionInfo();
  }
  
  public Object getNSPrefixQualification()
  {
    return owner.getNSPrefixQualification();
  }
  
  protected CMNodeListImpl getSubstitutionGroup()
  {
    return owner.getSubstitutionGroup();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.DerivedElementDeclarationImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.wst.xml.core.internal.contentmodel.CMDocumentation;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;

public class XSDImpl$DocumentationImpl
  implements CMDocumentation
{
  protected Element documentation;
  
  public XSDImpl$DocumentationImpl(Element documentation)
  {
    this.documentation = documentation;
  }
  
  public int getNodeType()
  {
    return 9;
  }
  
  public String getNodeName()
  {
    return "";
  }
  
  public boolean supports(String propertyName)
  {
    return false;
  }
  
  public Object getProperty(String propertyName)
  {
    return null;
  }
  
  public String getValue()
  {
    String content = "";
    boolean contentFound = false;
    NodeList nodes = documentation.getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Node node = nodes.item(i);
      if ((node instanceof Text))
      {
        contentFound = true;
        content = content + node.getNodeValue();
      }
    }
    return contentFound ? content : null;
  }
  
  public String getLanguage()
  {
    return documentation.hasAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:lang") ? documentation.getAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:lang") : null;
  }
  
  public String getSource()
  {
    return documentation.hasAttributeNS(null, "source") ? documentation.getAttributeNS(null, "source") : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.DocumentationImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
import org.eclipse.xsd.XSDConstraint;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.XSDWhiteSpaceFacet;

public class XSDImpl$ElementDeclarationBaseImpl$DataTypeImpl
  implements CMDataType
{
  final XSDImpl.ElementDeclarationBaseImpl this$1;
  
  public XSDImpl$ElementDeclarationBaseImpl$DataTypeImpl(XSDImpl.ElementDeclarationBaseImpl paramElementDeclarationBaseImpl)
  {
    this$1 = paramElementDeclarationBaseImpl;
  }
  
  public int getNodeType()
  {
    return 3;
  }
  
  public String getNodeName()
  {
    return getDataTypeName();
  }
  
  public boolean supports(String propertyName)
  {
    return "org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName);
  }
  
  public Object getProperty(String propertyName)
  {
    if ("org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName)) {
      return getWhiteSpaceFacetValue();
    }
    return null;
  }
  
  public String getDataTypeName()
  {
    String typeName = null;
    XSDSimpleTypeDefinition std = this$1.getXSDType().getSimpleType();
    if (std != null) {
      typeName = std.getName();
    }
    return typeName != null ? typeName : "string";
  }
  
  public int getImpliedValueKind()
  {
    int result = 1;
    if (this$1.getXSDElementDeclaration().isSetConstraint()) {
      if (this$1.getXSDElementDeclaration().getConstraint().getValue() == 0) {
        result = 3;
      } else if (this$1.getXSDElementDeclaration().getConstraint().getValue() == 1) {
        result = 2;
      }
    }
    return result;
  }
  
  public String getImpliedValue()
  {
    String result = null;
    if (this$1.getXSDElementDeclaration().isSetConstraint()) {
      result = this$1.getXSDElementDeclaration().getLexicalValue();
    }
    return result;
  }
  
  public String[] getEnumeratedValues()
  {
    return XSDImpl.getEnumeratedValuesForType(this$1.getXSDType());
  }
  
  public String generateInstanceValue()
  {
    return XSDTypeUtil.getInstanceValue(this$1.getXSDType());
  }
  
  public CMDocument getCMDocument()
  {
    return (CMDocument)XSDImpl.getAdapter(this$1.getXSDElementDeclaration().getSchema());
  }
  
  private String getWhiteSpaceFacetValue()
  {
    XSDSimpleTypeDefinition def = this$1.getXSDType().getSimpleType();
    return (def != null) && (def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.ElementDeclarationBaseImpl.DataTypeImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMAttributeDeclarationImpl;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMDataTypeImpl;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMGroupImpl;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;
import org.eclipse.xsd.XSDAnnotation;
import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDComplexTypeDefinition;
import org.eclipse.xsd.XSDConstraint;
import org.eclipse.xsd.XSDContentTypeCategory;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.XSDWhiteSpaceFacet;
import org.w3c.dom.Element;

public abstract class XSDImpl$ElementDeclarationBaseImpl
  extends XSDImpl.XSDBaseAdapter
  implements CMElementDeclaration
{
  protected CMDataType dataType = new DataTypeImpl();
  protected CMNamedNodeMap namedNodeMap;
  
  protected abstract XSDElementDeclaration getXSDElementDeclaration();
  
  protected abstract XSDElementDeclaration getResolvedXSDElementDeclaration();
  
  public int getNodeType()
  {
    return 5;
  }
  
  public String getNodeName()
  {
    return getElementName();
  }
  
  public String getElementName()
  {
    String result = getResolvedXSDElementDeclaration().getName();
    return result != null ? result : "";
  }
  
  public boolean supports(String propertyName)
  {
    return (propertyName.equals("XSITypes")) || (propertyName.equals("DerivedElementDeclaration")) || (propertyName.equals("SubstitutionGroup")) || (propertyName.equals("Abstract")) || (super.supports(propertyName));
  }
  
  public abstract Object getKey();
  
  public CMNamedNodeMap getAttributes()
  {
    CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
    XSDTypeDefinition td = getXSDType();
    getAttributes(map, td);
    addXSITypeAttribute(map);
    return map;
  }
  
  public void getAttributes(CMNamedNodeMapImpl map, XSDTypeDefinition xsdTypeDefinition)
  {
    if ((xsdTypeDefinition instanceof XSDComplexTypeDefinition))
    {
      XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition)xsdTypeDefinition;
      for (Iterator i = ctd.getAttributeUses().iterator(); i.hasNext();)
      {
        XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)i.next();
        XSDImpl.XSDAttributeUseAdapter adapter = (XSDImpl.XSDAttributeUseAdapter)XSDImpl.getAdapter(xsdAttributeUse);
        if ((adapter != null) && (adapter.getNodeName() != null)) {
          map.getHashtable().put(adapter.getNodeName(), adapter);
        }
      }
    }
  }
  
  public CMContent getContent()
  {
    CMContent result = null;
    XSDTypeDefinition td = getXSDType();
    if ((td instanceof XSDComplexTypeDefinition))
    {
      XSDImpl.DerivedChildVisitor dcv = new XSDImpl.DerivedChildVisitor(td);
      dcv.visitTypeDefinition(td);
      CMNodeList nodeList = dcv.getChildNodeList();
      if (nodeList.getLength() > 1) {
        result = new CMGroupImpl(nodeList, 1);
      } else if (nodeList.getLength() > 0) {
        result = (CMContent)nodeList.item(0);
      }
    }
    return result;
  }
  
  public int getContentType()
  {
    int contentType = 1;
    XSDTypeDefinition td = getXSDType();
    if ((td instanceof XSDSimpleTypeDefinition))
    {
      String typeName = td.getName();
      if ((typeName != null) && (typeName.equals("anyType"))) {
        contentType = 0;
      } else {
        contentType = 4;
      }
    }
    else if ((td instanceof XSDComplexTypeDefinition))
    {
      XSDContentTypeCategory category = ((XSDComplexTypeDefinition)td).getContentTypeCategory();
      if (category != null) {
        switch (category.getValue())
        {
        case 3: 
          contentType = 2;
          break;
        case 0: 
          contentType = 1;
          break;
        case 2: 
          contentType = 3;
          break;
        case 1: 
          contentType = 4;
        }
      }
    }
    return contentType;
  }
  
  public CMDataType getDataType()
  {
    CMDataType result = null;
    int contentType = getContentType();
    boolean hasDataType = (contentType == 4) || (contentType == 3);
    if (hasDataType) {
      result = dataType;
    }
    return result;
  }
  
  public int getMinOccur()
  {
    return XSDImpl.getMinOccurs(getXSDElementDeclaration());
  }
  
  public int getMaxOccur()
  {
    return XSDImpl.getMaxOccurs(getXSDElementDeclaration());
  }
  
  protected abstract CMNode getDefinition();
  
  protected abstract String getDefinitionInfo();
  
  public CMNamedNodeMap getLocalElements()
  {
    if (namedNodeMap == null)
    {
      XSDImpl.LocalElementVisitor localElementVisitor = new XSDImpl.LocalElementVisitor();
      localElementVisitor.visitTypeDefinition(getXSDType());
      namedNodeMap = localElementVisitor.getCMNamedNodeMap();
    }
    return namedNodeMap;
  }
  
  public Object getProperty(String propertyName)
  {
    Object result = null;
    if (propertyName.equals("http://org.eclipse.wst/cm/properties/definitionInfo"))
    {
      result = getDefinitionInfo();
    }
    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/definition"))
    {
      result = getDefinition();
    }
    else if (propertyName.equals("XSITypes"))
    {
      result = getXSITypes();
    }
    else if (propertyName.startsWith("DerivedElementDeclaration"))
    {
      int index = propertyName.indexOf("=");
      if (index != -1)
      {
        String uriQualifiedTypeName = propertyName.substring(index + 1);
        result = getDerivedElementDeclaration(uriQualifiedTypeName);
      }
    }
    else
    {
      if (propertyName.equals("SubstitutionGroup")) {
        return getSubstitutionGroup();
      }
      if (propertyName.equals("SubstitutionGroupValue")) {
        return getSubstitutionGroupValue();
      }
      if (propertyName.equals("Abstract")) {
        return getAbstract();
      }
      result = super.getProperty(propertyName);
    }
    return result;
  }
  
  public boolean isNillable()
  {
    if (getXSDElementDeclaration().isSetNillable()) {
      return getXSDElementDeclaration().isNillable();
    }
    return false;
  }
  
  public String getSubstitutionGroupValue()
  {
    XSDElementDeclaration xsdElementDeclaration = getResolvedXSDElementDeclaration();
    if (xsdElementDeclaration != null)
    {
      Element element = xsdElementDeclaration.getElement();
      if (element != null)
      {
        if (element.hasAttribute("substitutionGroup")) {
          return element.getAttribute("substitutionGroup");
        }
        return null;
      }
    }
    return "";
  }
  
  public Boolean getAbstract()
  {
    boolean result = getResolvedXSDElementDeclaration().isAbstract();
    
    return result ? Boolean.TRUE : Boolean.FALSE;
  }
  
  protected CMNodeList getDocumentation()
  {
    XSDElementDeclaration xsdElementDeclaration = getXSDElementDeclaration();
    XSDAnnotation annotation = xsdElementDeclaration.getAnnotation();
    
    boolean hasDocumentation = false;
    if ((annotation != null) && 
      (!annotation.getUserInformation().isEmpty())) {
      hasDocumentation = true;
    }
    if ((!hasDocumentation) && 
      (xsdElementDeclaration.isElementDeclarationReference())) {
      annotation = xsdElementDeclaration.getResolvedElementDeclaration().getAnnotation();
    }
    return XSDImpl.getDocumentations(annotation);
  }
  
  protected abstract XSDTypeDefinition getXSDType();
  
  protected abstract List getXSITypes();
  
  protected abstract CMElementDeclaration getDerivedElementDeclaration(String paramString);
  
  protected void addXSITypeAttribute(CMNamedNodeMapImpl map)
  {
    List list = getXSITypes();
    int listSize = list.size();
    if (listSize > 1)
    {
      CMDataType dataType = new CMDataTypeImpl("typeNames", null);
      CMAttributeDeclarationImpl attribute = new CMAttributeDeclarationImpl("type", 1, dataType);
      attribute.setCMDocument(XSDImpl.xsiDocument);
      attribute.setPrefixQualification(true);
      attribute.setXSITypes(list);
      
      Hashtable hashTable = map.getHashtable();
      String name = attribute.getNodeName();
      if (!hashTable.containsKey(name)) {
        hashTable.put(name, attribute);
      }
    }
  }
  
  public CMDocument getCMDocument()
  {
    XSDSchema schema = getResolvedXSDElementDeclaration().getSchema();
    if (schema == null) {
      return null;
    }
    return (CMDocument)XSDImpl.getAdapter(schema);
  }
  
  protected abstract CMNodeListImpl getSubstitutionGroup();
  
  public class DataTypeImpl
    implements CMDataType
  {
    public DataTypeImpl() {}
    
    public int getNodeType()
    {
      return 3;
    }
    
    public String getNodeName()
    {
      return getDataTypeName();
    }
    
    public boolean supports(String propertyName)
    {
      return "org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName);
    }
    
    public Object getProperty(String propertyName)
    {
      if ("org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName)) {
        return getWhiteSpaceFacetValue();
      }
      return null;
    }
    
    public String getDataTypeName()
    {
      String typeName = null;
      XSDSimpleTypeDefinition std = getXSDType().getSimpleType();
      if (std != null) {
        typeName = std.getName();
      }
      return typeName != null ? typeName : "string";
    }
    
    public int getImpliedValueKind()
    {
      int result = 1;
      if (getXSDElementDeclaration().isSetConstraint()) {
        if (getXSDElementDeclaration().getConstraint().getValue() == 0) {
          result = 3;
        } else if (getXSDElementDeclaration().getConstraint().getValue() == 1) {
          result = 2;
        }
      }
      return result;
    }
    
    public String getImpliedValue()
    {
      String result = null;
      if (getXSDElementDeclaration().isSetConstraint()) {
        result = getXSDElementDeclaration().getLexicalValue();
      }
      return result;
    }
    
    public String[] getEnumeratedValues()
    {
      return XSDImpl.getEnumeratedValuesForType(getXSDType());
    }
    
    public String generateInstanceValue()
    {
      return XSDTypeUtil.getInstanceValue(getXSDType());
    }
    
    public CMDocument getCMDocument()
    {
      return (CMDocument)XSDImpl.getAdapter(getXSDElementDeclaration().getSchema());
    }
    
    private String getWhiteSpaceFacetValue()
    {
      XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
      return (def != null) && (def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.ElementDeclarationBaseImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.io.IOException;
import java.io.InputStream;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;

class XSDImpl$InternalURIConverter
  extends URIConverterImpl
{
  protected InputStream createURLInputStream(URI uri)
    throws IOException
  {
    if ("http".equals(uri.scheme()))
    {
      String theURI = uri.toString();
      String mapped = URIResolverPlugin.createResolver().resolve(theURI, theURI, theURI);
      if (mapped != null) {
        uri = XSDImpl.createURI(mapped);
      }
    }
    return super.createURLInputStream(uri);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.InternalURIConverter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl;
import org.eclipse.xsd.XSDElementDeclaration;

public class XSDImpl$LocalElementVisitor
  extends XSDImpl.XSDCMVisitor
{
  protected CMNamedNodeMapImpl namedNodeMap = new CMNamedNodeMapImpl();
  protected List baseTypeList = new Vector();
  
  public void visitElementDeclaration(XSDElementDeclaration element)
  {
    XSDImpl.XSDElementDeclarationAdapter adapter = (XSDImpl.XSDElementDeclarationAdapter)XSDImpl.getAdapter(element);
    namedNodeMap.getHashtable().put(adapter.getNodeName(), adapter);
  }
  
  public CMNamedNodeMap getCMNamedNodeMap()
  {
    return namedNodeMap;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.LocalElementVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xsd.util.XSDSwitch;

public class XSDImpl$XSDAdapterFactoryImpl
  extends AdapterFactoryImpl
{
  public Adapter createAdapter(Notifier target)
  {
    XSDSwitch xsdSwitch = new XSDImpl.1(this);
    
    Object o = xsdSwitch.doSwitch((EObject)target);
    Adapter result = null;
    if ((o instanceof Adapter)) {
      result = (Adapter)o;
    } else {
      Thread.dumpStack();
    }
    return result;
  }
  
  public Adapter adapt(Notifier target)
  {
    return adapt(target, this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.XSDAdapterFactoryImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDConstraint;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.XSDWhiteSpaceFacet;

public class XSDImpl$XSDAttributeUseAdapter$DataTypeImpl
  implements CMDataType
{
  final XSDImpl.XSDAttributeUseAdapter this$1;
  
  public XSDImpl$XSDAttributeUseAdapter$DataTypeImpl(XSDImpl.XSDAttributeUseAdapter paramXSDAttributeUseAdapter)
  {
    this$1 = paramXSDAttributeUseAdapter;
  }
  
  public int getNodeType()
  {
    return 3;
  }
  
  public String getNodeName()
  {
    return getDataTypeName();
  }
  
  public boolean supports(String propertyName)
  {
    return "org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName);
  }
  
  public Object getProperty(String propertyName)
  {
    if ("org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName)) {
      return getWhiteSpaceFacetValue();
    }
    return null;
  }
  
  public String getDataTypeName()
  {
    XSDSimpleTypeDefinition sc = this$1.xsdAttributeUse.getAttributeDeclaration().getTypeDefinition();
    String typeName = sc.getName();
    return typeName != null ? typeName : "string";
  }
  
  public int getImpliedValueKind()
  {
    int result = 1;
    if (this$1.xsdAttributeUse.isSetConstraint()) {
      if (this$1.xsdAttributeUse.getConstraint().getValue() == 0) {
        result = 3;
      } else if (this$1.xsdAttributeUse.getConstraint().getValue() == 1) {
        result = 2;
      }
    }
    return result;
  }
  
  public String getImpliedValue()
  {
    String result = null;
    if (this$1.xsdAttributeUse.isSetConstraint()) {
      result = this$1.xsdAttributeUse.getLexicalValue();
    }
    return result;
  }
  
  public String[] getEnumeratedValues()
  {
    return XSDImpl.getEnumeratedValuesForType(getXSDType());
  }
  
  public String generateInstanceValue()
  {
    XSDAttributeDeclaration attr = this$1.xsdAttributeUse.getAttributeDeclaration();
    return XSDTypeUtil.getInstanceValue(attr.getResolvedAttributeDeclaration().getTypeDefinition());
  }
  
  protected XSDTypeDefinition getXSDType()
  {
    XSDAttributeDeclaration attr = this$1.xsdAttributeUse.getAttributeDeclaration();
    return attr.getResolvedAttributeDeclaration().getTypeDefinition();
  }
  
  private String getWhiteSpaceFacetValue()
  {
    XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
    return (def != null) && (def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.XSDAttributeUseAdapter.DataTypeImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.Collections;
import java.util.Enumeration;
import org.eclipse.emf.common.util.EList;
import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
import org.eclipse.xsd.XSDAnnotation;
import org.eclipse.xsd.XSDAttributeDeclaration;
import org.eclipse.xsd.XSDAttributeUse;
import org.eclipse.xsd.XSDAttributeUseCategory;
import org.eclipse.xsd.XSDConstraint;
import org.eclipse.xsd.XSDForm;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.XSDWhiteSpaceFacet;

public class XSDImpl$XSDAttributeUseAdapter
  extends XSDImpl.XSDBaseAdapter
  implements CMAttributeDeclaration
{
  protected XSDAttributeUse xsdAttributeUse;
  protected CMDataType dataType = new DataTypeImpl();
  
  public XSDImpl$XSDAttributeUseAdapter(XSDAttributeUse xsdAttributeUse)
  {
    this.xsdAttributeUse = xsdAttributeUse;
  }
  
  public Object getKey()
  {
    return xsdAttributeUse;
  }
  
  public String getSpec()
  {
    return "//@" + getAttrName();
  }
  
  public int getNodeType()
  {
    return 2;
  }
  
  public String getNodeName()
  {
    return getAttrName();
  }
  
  /**
   * @deprecated
   */
  public Enumeration getEnumAttr()
  {
    return Collections.enumeration(Collections.EMPTY_LIST);
  }
  
  public String getAttrName()
  {
    return xsdAttributeUse.getAttributeDeclaration().getName();
  }
  
  public CMDataType getAttrType()
  {
    return dataType;
  }
  
  public String getDefaultValue()
  {
    return dataType.getImpliedValue();
  }
  
  public int getUsage()
  {
    int useKind = 1;
    switch (xsdAttributeUse.getUse().getValue())
    {
    case 0: 
      useKind = 1;
      break;
    case 1: 
      useKind = 4;
      break;
    case 2: 
      useKind = 2;
    }
    return useKind;
  }
  
  public Object getNSPrefixQualification()
  {
    String form = null;
    if (xsdAttributeUse.getContent() != xsdAttributeUse.getAttributeDeclaration())
    {
      form = "qualified";
    }
    else if (xsdAttributeUse.getContent().isSetForm())
    {
      form = xsdAttributeUse.getContent().getForm().getName();
    }
    else
    {
      XSDSchema schema = xsdAttributeUse.getSchema();
      if (schema != null) {
        form = schema.getAttributeFormDefault().getName();
      }
    }
    return form;
  }
  
  protected CMNodeList getDocumentation()
  {
    XSDAttributeDeclaration xsdAttributeRef = xsdAttributeUse.getContent();
    if ((xsdAttributeRef != null) && (xsdAttributeRef.isAttributeDeclarationReference()))
    {
      boolean refHasDocumentation = false;
      XSDAnnotation refAnnotation = xsdAttributeRef.getAnnotation();
      if (refAnnotation != null) {
        if (!refAnnotation.getUserInformation().isEmpty()) {
          refHasDocumentation = true;
        }
      }
      if (refHasDocumentation) {
        return XSDImpl.getDocumentations(refAnnotation);
      }
    }
    XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
    XSDAnnotation annotation = xsdAttributeDeclaration.getAnnotation();
    
    return XSDImpl.getDocumentations(annotation);
  }
  
  public CMDocument getCMDocument()
  {
    return (CMDocument)XSDImpl.getAdapter(xsdAttributeUse.getSchema());
  }
  
  public class DataTypeImpl
    implements CMDataType
  {
    public DataTypeImpl() {}
    
    public int getNodeType()
    {
      return 3;
    }
    
    public String getNodeName()
    {
      return getDataTypeName();
    }
    
    public boolean supports(String propertyName)
    {
      return "org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName);
    }
    
    public Object getProperty(String propertyName)
    {
      if ("org.eclipse.wst.xsd.cm.properties/whitespace".equals(propertyName)) {
        return getWhiteSpaceFacetValue();
      }
      return null;
    }
    
    public String getDataTypeName()
    {
      XSDSimpleTypeDefinition sc = xsdAttributeUse.getAttributeDeclaration().getTypeDefinition();
      String typeName = sc.getName();
      return typeName != null ? typeName : "string";
    }
    
    public int getImpliedValueKind()
    {
      int result = 1;
      if (xsdAttributeUse.isSetConstraint()) {
        if (xsdAttributeUse.getConstraint().getValue() == 0) {
          result = 3;
        } else if (xsdAttributeUse.getConstraint().getValue() == 1) {
          result = 2;
        }
      }
      return result;
    }
    
    public String getImpliedValue()
    {
      String result = null;
      if (xsdAttributeUse.isSetConstraint()) {
        result = xsdAttributeUse.getLexicalValue();
      }
      return result;
    }
    
    public String[] getEnumeratedValues()
    {
      return XSDImpl.getEnumeratedValuesForType(getXSDType());
    }
    
    public String generateInstanceValue()
    {
      XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
      return XSDTypeUtil.getInstanceValue(attr.getResolvedAttributeDeclaration().getTypeDefinition());
    }
    
    protected XSDTypeDefinition getXSDType()
    {
      XSDAttributeDeclaration attr = xsdAttributeUse.getAttributeDeclaration();
      return attr.getResolvedAttributeDeclaration().getTypeDefinition();
    }
    
    private String getWhiteSpaceFacetValue()
    {
      XSDSimpleTypeDefinition def = getXSDType().getSimpleType();
      return (def != null) && (def.getEffectiveWhiteSpaceFacet() != null) ? def.getEffectiveWhiteSpaceFacet().getLexicalValue() : null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.XSDAttributeUseAdapter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNodeListImpl;

public abstract class XSDImpl$XSDBaseAdapter
  extends CMNodeImpl
{
  protected CMNodeListImpl documentation = new CMNodeListImpl();
  
  public String getNodeName()
  {
    return "";
  }
  
  public boolean isAdapterForType(Object type)
  {
    return type == XSDImpl.xsdAdapterFactoryImpl;
  }
  
  public boolean supports(String propertyName)
  {
    return (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification")) || (propertyName.equals("http://org.eclipse.wst/cm/properties/nillable")) || (propertyName.equals("http://org.eclipse.wst/cm/properties/usesLocalElementDeclarations")) || (propertyName.equals("documentation")) || (propertyName.equals("documentationSource")) || (propertyName.equals("documentationLanguage")) || (propertyName.equals("key")) || (propertyName.equals("http://org.eclipse.wst/cm/properties/definitionInfo")) || (propertyName.equals("http://org.eclipse.wst/cm/properties/definition")) || (propertyName.equals("CMDocument")) || (propertyName.equals("http://org.eclipse.wst/cm/properties/isNameSpaceAware")) || (propertyName.equals("spec")) || (super.supports(propertyName));
  }
  
  public boolean isNillable()
  {
    return false;
  }
  
  public CMDocument getCMDocument()
  {
    return null;
  }
  
  protected CMNodeList getDocumentation()
  {
    return documentation;
  }
  
  public Object getProperty(String propertyName)
  {
    Object result = null;
    if (propertyName.equals("CMDocument"))
    {
      result = getCMDocument();
    }
    else if (propertyName.equals("documentation"))
    {
      result = getDocumentation();
    }
    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/usesLocalElementDeclarations"))
    {
      result = Boolean.TRUE;
    }
    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/isNameSpaceAware"))
    {
      result = Boolean.TRUE;
    }
    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/nsPrefixQualification"))
    {
      result = getNSPrefixQualification();
    }
    else if (propertyName.equals("http://org.eclipse.wst/cm/properties/nillable"))
    {
      result = isNillable() ? xsiDocumentnilAttribute : null;
    }
    else if (propertyName.equals("key"))
    {
      result = getKey();
    }
    else if (propertyName.equals("spec"))
    {
      result = getSpec();
    }
    else
    {
      result = super.getProperty(propertyName);
      
      CMDocument cmDocument = getCMDocument();
      if ((cmDocument instanceof XSDImpl.XSDSchemaAdapter))
      {
        AnnotationMap map = annotationMap;
        if (map != null)
        {
          String spec = getSpec();
          if (spec != null) {
            result = map.getProperty(getSpec(), propertyName);
          }
        }
      }
    }
    return result;
  }
  
  public Object getNSPrefixQualification()
  {
    return null;
  }
  
  public String getSpec()
  {
    return "//" + getNodeName();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.XSDBaseAdapter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xsd.contentmodel.internal;

import java.util.Iterator;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xsd.XSDModelGroup;
import org.eclipse.xsd.XSDModelGroupDefinition;
import org.eclipse.xsd.XSDParticle;
import org.eclipse.xsd.XSDSimpleTypeDefinition;

public class XSDImpl$XSDCMVisitor
  extends XSDVisitor
{
  public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
  {
    XSDParticle ctd = type.getComplexType();
    if (ctd != null) {
      visitParticle(ctd);
    }
  }
  
  public void visitModelGroup(XSDModelGroup modelGroup)
  {
    if (modelGroup.getParticles() != null) {
      for (Iterator iterator = modelGroup.getParticles().iterator(); iterator.hasNext();)
      {
        XSDParticle particle = (XSDParticle)iterator.next();
        v
1 2 3 4

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd