org.eclipse.xsd
Interface XSDNamedComponent

All Superinterfaces:
org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier, XSDComponent, XSDConcreteComponent
All Known Subinterfaces:
XSDAttributeDeclaration, XSDAttributeGroupDefinition, XSDComplexTypeDefinition, XSDElementDeclaration, XSDFeature, XSDIdentityConstraintDefinition, XSDModelGroupDefinition, XSDNotationDeclaration, XSDRedefinableComponent, XSDSimpleTypeDefinition, XSDTypeDefinition
All Known Implementing Classes:
XSDAttributeDeclarationImpl, XSDAttributeGroupDefinitionImpl, XSDComplexTypeDefinitionImpl, XSDElementDeclarationImpl, XSDFeatureImpl, XSDIdentityConstraintDefinitionImpl, XSDModelGroupDefinitionImpl, XSDNamedComponentImpl, XSDNotationDeclarationImpl, XSDRedefinableComponentImpl, XSDSimpleTypeDefinitionImpl, XSDTypeDefinitionImpl

public interface XSDNamedComponent
extends XSDComponent

A representation of the model object 'Named Component'. It is used to represent aspects common to attribute declarations, attribute group definitions, complex type definitions, element declarations, identity constraint definitions, model groups definitions, notation declarations, and simple type definitions.

The following features are supported:

See Also:
XSDPackage.getXSDNamedComponent()

Method Summary
 java.lang.String getAliasName()
          Returns the value of the 'Alias Name' attribute
 java.lang.String getAliasURI()
          Returns the value of the 'Alias URI' attribute
 java.lang.String getName()
          Returns the value of the 'Name' attribute
 java.lang.String getQName()
          Returns the value of the 'QName' attribute
 java.lang.String getQName(XSDConcreteComponent relativeToComponent)
          Returns this named component's 'QName' in the context of the given component
 java.lang.String getTargetNamespace()
          Returns the value of the 'Target Namespace' attribute
 java.lang.String getURI()
          Returns the value of the 'URI' attribute
 boolean hasNameAndTargetNamespace(java.lang.String name, java.lang.String targetNamespace)
          Returns whether this named component has the given name and target namespace
 boolean hasSameNameAndTargetNamespace(XSDNamedComponent xsdNamedComponent)
          Returns whether this named component and the given named component are named the same
 boolean hasURI(java.lang.String uri)
          Returns whether this named component has the given URI
 void setName(java.lang.String value)
          Sets the value of the 'Name' attribute
 void setTargetNamespace(java.lang.String value)
          Sets the value of the 'Target Namespace' attribute
 
Methods inherited from interface org.eclipse.xsd.XSDConcreteComponent
clearDiagnostics, cloneConcreteComponent, contains, elementAttributesChanged, elementChanged, elementContentsChanged, getComponentsWithApplicationInformation, getComponentsWithUserInformation, getContainer, getDiagnostics, getElement, getRootContainer, getSchema, resolveAttributeDeclaration, resolveAttributeDeclaration, resolveAttributeDeclarationURI, resolveAttributeGroupDefinition, resolveAttributeGroupDefinition, resolveAttributeGroupDefinitionURI, resolveComplexTypeDefinition, resolveComplexTypeDefinition, resolveComplexTypeDefinitionURI, resolveElementDeclaration, resolveElementDeclaration, resolveElementDeclarationURI, resolveIdentityConstraintDefinition, resolveIdentityConstraintDefinition, resolveIdentityConstraintDefinitionURI, resolveModelGroupDefinition, resolveModelGroupDefinition, resolveModelGroupDefinitionURI, resolveNotationDeclaration, resolveNotationDeclaration, resolveNotationDeclarationURI, resolveSimpleTypeDefinition, resolveSimpleTypeDefinition, resolveSimpleTypeDefinitionURI, resolveTypeDefinition, resolveTypeDefinition, resolveTypeDefinitionURI, setElement, updateElement, updateElement, validate
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getName

java.lang.String getName()
Returns the value of the 'Name' attribute.

This represents the value of the attribute declaration name, attribute group definition name, complex type definition name, element declaration name, identity constraint definition name, model group definition name, notation declaration name, or simple type definition name (*) infoset property.

Returns:
the value of the 'Name' attribute.
See Also:
setName(String), XSDPackage.getXSDNamedComponent_Name()

setName

void setName(java.lang.String value)
Sets the value of the 'Name' attribute.

Parameters:
value - the new value of the 'Name' attribute.
See Also:
getName()

getTargetNamespace

java.lang.String getTargetNamespace()
Returns the value of the 'Target Namespace' attribute.

This represents the value of the attribute declaration target namespace, attribute group definition target namespace, complex type definition target namespace, element declaration target namespace, identity constraint definition target namespace, model group definition target namespace, notation declaration target namespace, or simple type definition target namespace (*) infoset property. It is computed from the target namespace of the schema and should typically not be set directly; in the case of locally scoped features, the value is also affected by the form.

Returns:
the value of the 'Target Namespace' attribute.
See Also:
setTargetNamespace(String), XSDPackage.getXSDNamedComponent_TargetNamespace()

setTargetNamespace

void setTargetNamespace(java.lang.String value)
Sets the value of the 'Target Namespace' attribute.

Parameters:
value - the new value of the 'Target Namespace' attribute.
See Also:
getTargetNamespace()

getAliasName

java.lang.String getAliasName()
Returns the value of the 'Alias Name' attribute.

This attempts to construct a relatively meaningful name for an anonymous component by using the name of the containing component and an indication of the relation to that component, For example, "E_._type" would be the alias name of the anonymous type definition of the element "E" and "LT_._item" would be the alias name of the anonymous item type definition of the list type defintion "LT".

Returns:
the value of the 'Alias Name' attribute.
See Also:
XSDPackage.getXSDNamedComponent_AliasName()

getURI

java.lang.String getURI()
Returns the value of the 'URI' attribute.

This is equivalent to the string

  <target namespace>#<name>
where a null target namespace is taken to mean an empty string.

Returns:
the value of the 'URI' attribute.
See Also:
XSDConcreteComponent.resolveAttributeDeclarationURI(java.lang.String), XSDConcreteComponent.resolveAttributeGroupDefinitionURI(java.lang.String), XSDConcreteComponent.resolveComplexTypeDefinitionURI(java.lang.String), XSDConcreteComponent.resolveElementDeclarationURI(java.lang.String), XSDConcreteComponent.resolveIdentityConstraintDefinitionURI(java.lang.String), XSDConcreteComponent.resolveModelGroupDefinitionURI(java.lang.String), XSDConcreteComponent.resolveNotationDeclarationURI(java.lang.String), XSDConcreteComponent.resolveSimpleTypeDefinitionURI(java.lang.String), XSDPackage.getXSDNamedComponent_URI()

getAliasURI

java.lang.String getAliasURI()
Returns the value of the 'Alias URI' attribute.

This is equivalent to the string

  <target namespace>#<alias name>
where a null target namespace is taken to mean an empty string. There is no support yet for resolving this URI; only globally scoped names can be resolved.

Returns:
the value of the 'Alias URI' attribute.
See Also:
XSDPackage.getXSDNamedComponent_AliasURI()

getQName

java.lang.String getQName()
Returns the value of the 'QName' attribute.

This concrete attribute is equivalent to

  xsdNamedComponent.getQName(xsdNamedComponent)

Returns:
the value of the 'QName' attribute.
See Also:
getQName(org.eclipse.xsd.XSDConcreteComponent), XSDPackage.getXSDNamedComponent_QName()

getQName

java.lang.String getQName(XSDConcreteComponent relativeToComponent)
Returns this named component's 'QName' in the context of the given component.

Parameters:
relativeToComponent - the context at which to express the QName.
Returns:
the 'QName'.
See Also:
getQName()

hasSameNameAndTargetNamespace

boolean hasSameNameAndTargetNamespace(XSDNamedComponent xsdNamedComponent)
Returns whether this named component and the given named component are named the same.

This is equivalent to

  xsdNamedComponent.hasNameAndTargetNamespace
    (xsdOtherNamedComponent.getName(), 
     xsdOtherNamedComponent.getTargetNamespace())

Parameters:
xsdNamedComponent - another named component.
Returns:
whether this named component and the given named component are named the same.
See Also:
hasNameAndTargetNamespace(java.lang.String, java.lang.String), getName(), getTargetNamespace()

hasNameAndTargetNamespace

boolean hasNameAndTargetNamespace(java.lang.String name,
                                  java.lang.String targetNamespace)
Returns whether this named component has the given name and target namespace.

This is equivalent to

  (targetNamespace == null ?
     getTargetNamespace() == null :
     targetNamespace.equals(getTargetNamespace())) &&
  (name == null ?
     getName() == null :
     name.equals(getName()))

Parameters:
name - the name.
targetNamespace - namespace the target namespace.
Returns:
whether this named component has the given name and target namespace.
See Also:
hasSameNameAndTargetNamespace(org.eclipse.xsd.XSDNamedComponent), hasURI(java.lang.String), getName(), getTargetNamespace()

hasURI

boolean hasURI(java.lang.String uri)
Returns whether this named component has the given URI.

This is equivalent to

  String theTargetNamespace = getTargetNamespace();
  if (theTargetNamespace == null)
  {
    theTargetNamespace = "";
  }
  String theName = getName();
  if (theName == null)
  {
    theName = "";
  }
  return
    qName.startsWith(theTargetNamespace) &&
      qName.endsWith(theName) &&
      qName.length() == theName.length() + theTargetNamespace.length() + 1;

Parameters:
uri - the URI.
Returns:
whether this named component has the given URI.
See Also:
hasNameAndTargetNamespace(java.lang.String, java.lang.String), hasSameNameAndTargetNamespace(org.eclipse.xsd.XSDNamedComponent), getURI()

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.