Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Allowed children of a XSDSimpleTypeDefinition
Allowed children of a XSDSimpleTypeDefinition [message #33003] Wed, 12 November 2003 17:25 Go to next message
Dennis Fuglsang is currently offline Dennis FuglsangFriend
Messages: 77
Registered: July 2009
Member
Ed,

I am a little confused (again :-) about a piece of logic in
XSDSimpleTypeDefinitionItemProvider.collectNewChildDescripto rs(...). The
logic, shown below, adds a new child descriptor to the list regardless of
whether canAccomodateFacet(std,facet) returns true or false. Reading the
javadoc for canAccomodateFacet(...) it seems that if this method returns
false then the simple datatype cannot accomodate the given constraining
facet and should not even be returned as a permissible child. Should it be
creating a CommandParameter instance with a null feature reference?

// facets
for (Iterator i = validFacets.iterator(); i.hasNext(); )
{
XSDConstrainingFacet facet =

(XSDConstrainingFacet)xsdFactory.create((EClass)xsdPackage.g etEClassifier(fo
rmFacetTypeName(i.next())));
facet.setLexicalValue("");
feature = !canAccomodateFacet(std, facet) ? null : <<<<<
xsdPackage.getXSDSimpleTypeDefinition_FacetContents();
newChildDescriptors.add(createChildParameter(feature, facet));
}

Thanks.

Dennis
Re: Allowed children of a XSDSimpleTypeDefinition [message #33039 is a reply to message #33003] Wed, 12 November 2003 17:52 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Dennis,

This way the menu item is disabled rather than disappearing so it keeps the menu
looking consistent for every simple type.


dfuglsang wrote:

> Ed,
>
> I am a little confused (again :-) about a piece of logic in
> XSDSimpleTypeDefinitionItemProvider.collectNewChildDescripto rs(...). The
> logic, shown below, adds a new child descriptor to the list regardless of
> whether canAccomodateFacet(std,facet) returns true or false. Reading the
> javadoc for canAccomodateFacet(...) it seems that if this method returns
> false then the simple datatype cannot accomodate the given constraining
> facet and should not even be returned as a permissible child. Should it be
> creating a CommandParameter instance with a null feature reference?
>
> // facets
> for (Iterator i = validFacets.iterator(); i.hasNext(); )
> {
> XSDConstrainingFacet facet =
>
> (XSDConstrainingFacet)xsdFactory.create((EClass)xsdPackage.g etEClassifier(fo
> rmFacetTypeName(i.next())));
> facet.setLexicalValue("");
> feature = !canAccomodateFacet(std, facet) ? null : <<<<<
> xsdPackage.getXSDSimpleTypeDefinition_FacetContents();
> newChildDescriptors.add(createChildParameter(feature, facet));
> }
>
> Thanks.
>
> Dennis
Re: Allowed children of a XSDSimpleTypeDefinition [message #580758 is a reply to message #33003] Wed, 12 November 2003 17:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Dennis,

This way the menu item is disabled rather than disappearing so it keeps the menu
looking consistent for every simple type.


dfuglsang wrote:

> Ed,
>
> I am a little confused (again :-) about a piece of logic in
> XSDSimpleTypeDefinitionItemProvider.collectNewChildDescripto rs(...). The
> logic, shown below, adds a new child descriptor to the list regardless of
> whether canAccomodateFacet(std,facet) returns true or false. Reading the
> javadoc for canAccomodateFacet(...) it seems that if this method returns
> false then the simple datatype cannot accomodate the given constraining
> facet and should not even be returned as a permissible child. Should it be
> creating a CommandParameter instance with a null feature reference?
>
> // facets
> for (Iterator i = validFacets.iterator(); i.hasNext(); )
> {
> XSDConstrainingFacet facet =
>
> (XSDConstrainingFacet)xsdFactory.create((EClass)xsdPackage.g etEClassifier(fo
> rmFacetTypeName(i.next())));
> facet.setLexicalValue("");
> feature = !canAccomodateFacet(std, facet) ? null : <<<<<
> xsdPackage.getXSDSimpleTypeDefinition_FacetContents();
> newChildDescriptors.add(createChildParameter(feature, facet));
> }
>
> Thanks.
>
> Dennis


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Allowed children of a XSDSimpleTypeDefinition
Next Topic:1999 schema - IndexOutOfBoundsException
Goto Forum:
  


Current Time: Fri Apr 19 09:12:45 GMT 2024

Powered by FUDForum. Page generated in 0.02103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top