Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsSchema Class Reference

#include <nsSchemaPrivate.h>

Inheritance diagram for nsSchema:
Inheritance graph
[legend]
Collaboration diagram for nsSchema:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsSchema (nsISchemaCollection *aCollection, nsIDOMElement *aElement)
virtual ~nsSchema ()
NS_DECL_ISUPPORTS
NS_DECL_NSISCHEMACOMPONENT
NS_DECL_NSISCHEMA nsresult 
Init ()
NS_IMETHOD AddType (nsISchemaType *aType)
NS_IMETHOD AddAttribute (nsISchemaAttribute *aAttribute)
NS_IMETHOD AddElement (nsISchemaElement *aElement)
NS_IMETHOD AddAttributeGroup (nsISchemaAttributeGroup *aAttributeGroup)
NS_IMETHOD AddModelGroup (nsISchemaModelGroup *aModelGroup)
void DropCollectionReference ()
nsresult ResolveTypePlaceholder (nsIWebServiceErrorHandler *aErrorHandler, nsISchemaType *aPlaceholder, nsISchemaType **aType)
PRBool IsElementFormQualified ()
nsISchemaType getTypeByIndex (in PRUint32 index)
nsISchemaType getTypeByName (in AString name)
nsISchemaAttribute getAttributeByIndex (in PRUint32 index)
nsISchemaAttribute getAttributeByName (in AString name)
nsISchemaElement getElementByIndex (in PRUint32 index)
nsISchemaElement getElementByName (in AString name)
nsISchemaAttributeGroup getAttributeGroupByIndex (in PRUint32 index)
nsISchemaAttributeGroup getAttributeGroupByName (in AString name)
nsISchemaModelGroup getModelGroupByIndex (in PRUint32 index)
nsISchemaModelGroup getModelGroupByName (in AString name)
void resolve (in nsIWebServiceErrorHandler aErrorHandler)
void clear ()

Public Attributes

readonly attribute AString schemaNamespace
readonly attribute PRUint32 typeCount
readonly attribute PRUint32 attributeCount
readonly attribute PRUint32 elementCount
readonly attribute PRUint32 attributeGroupCount
readonly attribute PRUint32 modelGroupCount
readonly attribute
nsISchemaCollection 
collection
readonly attribute AString targetNamespace

Protected Attributes

nsString mTargetNamespace
nsString mSchemaNamespace
nsCOMArray< nsISchemaTypemTypes
nsInterfaceHashtable
< nsStringHashKey,
nsISchemaType
mTypesHash
nsCOMArray< nsISchemaAttributemAttributes
nsInterfaceHashtable
< nsStringHashKey,
nsISchemaAttribute
mAttributesHash
nsCOMArray< nsISchemaElementmElements
nsInterfaceHashtable
< nsStringHashKey,
nsISchemaElement
mElementsHash
nsCOMArray
< nsISchemaAttributeGroup
mAttributeGroups
nsInterfaceHashtable
< nsStringHashKey,
nsISchemaAttributeGroup
mAttributeGroupsHash
nsCOMArray< nsISchemaModelGroupmModelGroups
nsInterfaceHashtable
< nsStringHashKey,
nsISchemaModelGroup
mModelGroupsHash
nsISchemaCollectionmCollection
PRPackedBool mElementFormQualified

Detailed Description

Definition at line 72 of file nsSchemaPrivate.h.


Constructor & Destructor Documentation

nsSchema::nsSchema ( nsISchemaCollection aCollection,
nsIDOMElement aElement 
)

Definition at line 47 of file nsSchema.cpp.

{
  mCollection = aCollection;  // Weak reference
  
  if (aSchemaElement) {
    const nsAFlatString& empty = EmptyString();

    aSchemaElement->GetAttributeNS(empty, 
                                   NS_LITERAL_STRING("targetNamespace"), 
                                   mTargetNamespace);
    mTargetNamespace.Trim(" \r\n\t");
    aSchemaElement->GetNamespaceURI(mSchemaNamespace);

    nsAutoString elementFormDefault;
    aSchemaElement->GetAttributeNS(empty, 
                                   NS_LITERAL_STRING("elementFormDefault"), 
                                   elementFormDefault);
    elementFormDefault.Trim(" \r\n\t");
    mElementFormQualified = 
      elementFormDefault.EqualsLiteral("qualified");
  }
}
nsSchema::~nsSchema ( ) [virtual]

Definition at line 71 of file nsSchema.cpp.

{
  Clear();
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 440 of file nsSchema.cpp.

{
  NS_ENSURE_ARG_POINTER(aAttribute);

  nsAutoString name;
  aAttribute->GetName(name);

  mAttributes.AppendObject(aAttribute);
  mAttributesHash.Put(name, aAttribute);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 468 of file nsSchema.cpp.

{
  NS_ENSURE_ARG_POINTER(aAttributeGroup);

  nsAutoString name;
  aAttributeGroup->GetName(name);

  mAttributeGroups.AppendObject(aAttributeGroup);
  mAttributeGroupsHash.Put(name, aAttributeGroup);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 454 of file nsSchema.cpp.

{
  NS_ENSURE_ARG_POINTER(aElement);

  nsAutoString name;
  aElement->GetName(name);

  mElements.AppendObject(aElement);
  mElementsHash.Put(name, aElement);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 482 of file nsSchema.cpp.

{
  NS_ENSURE_ARG_POINTER(aModelGroup);

  nsAutoString name;
  aModelGroup->GetName(name);

  mModelGroups.AppendObject(aModelGroup);
  mModelGroupsHash.Put(name, aModelGroup);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 426 of file nsSchema.cpp.

{
  NS_ENSURE_ARG_POINTER(aType);

  nsAutoString name;
  aType->GetName(name);

  mTypes.AppendObject(aType);
  mTypesHash.Put(name, aType);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 496 of file nsSchema.cpp.

nsISchemaAttribute nsISchema::getAttributeByName ( in AString  name) [inherited]
nsISchemaElement nsISchema::getElementByName ( in AString  name) [inherited]
nsISchemaModelGroup nsISchema::getModelGroupByName ( in AString  name) [inherited]
nsISchemaType nsISchema::getTypeByName ( in AString  name) [inherited]

Definition at line 93 of file nsSchemaPrivate.h.

Here is the caller graph for this function:

Definition at line 502 of file nsSchema.cpp.

{
  PRUint16 schemaType;

  aPlaceholder->GetSchemaType(&schemaType);
  if (schemaType == nsISchemaType::SCHEMA_TYPE_PLACEHOLDER) {
    nsAutoString name;
    aPlaceholder->GetName(name);
    
    nsresult rv = GetTypeByName(name, aType);
    if (NS_FAILED(rv) || !*aType) {
      *aType = nsnull;
      nsAutoString errorMsg;
      errorMsg.AppendLiteral("Failure resolving schema type, ");
      errorMsg.AppendLiteral("cannot resolve schema type place holder for \"");
      errorMsg.Append(name);
      errorMsg.AppendLiteral("\"");

      NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);

      return NS_ERROR_FAILURE;
    }
  }
  else {
    NS_ADDREF(*aType = aPlaceholder);
  }

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 89 of file nsISchema.idl.

Definition at line 97 of file nsISchema.idl.

Definition at line 105 of file nsISchema.idl.

Definition at line 93 of file nsISchema.idl.

Definition at line 104 of file nsSchemaPrivate.h.

Definition at line 105 of file nsSchemaPrivate.h.

Definition at line 100 of file nsSchemaPrivate.h.

Definition at line 101 of file nsSchemaPrivate.h.

Definition at line 108 of file nsSchemaPrivate.h.

Definition at line 109 of file nsSchemaPrivate.h.

Definition at line 102 of file nsSchemaPrivate.h.

Definition at line 103 of file nsSchemaPrivate.h.

Definition at line 106 of file nsSchemaPrivate.h.

Definition at line 107 of file nsSchemaPrivate.h.

Definition at line 101 of file nsISchema.idl.

Definition at line 97 of file nsSchemaPrivate.h.

Definition at line 96 of file nsSchemaPrivate.h.

Definition at line 98 of file nsSchemaPrivate.h.

Definition at line 99 of file nsSchemaPrivate.h.

readonly attribute AString nsISchema::schemaNamespace [inherited]

Definition at line 83 of file nsISchema.idl.

readonly attribute AString nsISchemaComponent::targetNamespace [inherited]

Definition at line 75 of file nsISchema.idl.

readonly attribute PRUint32 nsISchema::typeCount [inherited]

Definition at line 85 of file nsISchema.idl.


The documentation for this class was generated from the following files: