Hi WS Developers: Thanks for a great product.
I have attached a patch to 2.3.0 for your consideration, which simply adds three abstract methods to org.apache.ws.commons.schema.XmlSchemaContent. All subclasses in the source tree already have an implementation for each in place. The purpose is just to avoid looping through the subclasses and checking/casting an XmlSchemaContent instance to each one to get the value. The only one I care about or really wish for is the getBaseTypeName, but, while creating the code, noticed that the other two methods fit the same pattern. It looks like something similar could be done with the setters, and, in fact, all three instance variables could be pushed up to the superclass. I leave that to your judgment, and there may be good reasons not to do that. Thanks very much. Victor Mote
diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentExtension.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentExtension.java index 8983a3a..d697010 100644 --- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentExtension.java +++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentExtension.java @@ -1,87 +1,90 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ws.commons.schema; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Class for complex types with a complex content model derived by extension. Extends the complex type by - * adding attributes or elements. Represents the World Wide Web Consortium (W3C) extension element for complex - * content. - */ - -public class XmlSchemaComplexContentExtension extends XmlSchemaContent { - - /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ - private XmlSchemaAnyAttribute anyAttribute; - /* - * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple - * type. - */ - private List<XmlSchemaAttributeOrGroupRef> attributes; - /* Name of the built-in data type, simple type, or complex type. */ - private QName baseTypeName; - - /* One of the XmlSchemaGroupRef, XmlSchemaChoice, XmlSchemaAll, or XmlSchemaSequence classes. */ - private XmlSchemaParticle particle; - - /** - * Creates new XmlSchemaComplexContentExtension - */ - public XmlSchemaComplexContentExtension() { - attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); - } - - public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { - this.anyAttribute = anyAttribute; - } - - public XmlSchemaAnyAttribute getAnyAttribute() { - return this.anyAttribute; - } - - public List<XmlSchemaAttributeOrGroupRef> getAttributes() { - return this.attributes; - } - - public void setBaseTypeName(QName baseTypeName) { - this.baseTypeName = baseTypeName; - } - - public QName getBaseTypeName() { - return this.baseTypeName; - } - - public XmlSchemaParticle getParticle() { - return this.particle; - } - - public void setParticle(XmlSchemaParticle particle) { - this.particle = particle; - } - - void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { - this.attributes = attributes; - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ws.commons.schema; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Class for complex types with a complex content model derived by extension. Extends the complex type by + * adding attributes or elements. Represents the World Wide Web Consortium (W3C) extension element for complex + * content. + */ + +public class XmlSchemaComplexContentExtension extends XmlSchemaContent { + + /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ + private XmlSchemaAnyAttribute anyAttribute; + /* + * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple + * type. + */ + private List<XmlSchemaAttributeOrGroupRef> attributes; + /* Name of the built-in data type, simple type, or complex type. */ + private QName baseTypeName; + + /* One of the XmlSchemaGroupRef, XmlSchemaChoice, XmlSchemaAll, or XmlSchemaSequence classes. */ + private XmlSchemaParticle particle; + + /** + * Creates new XmlSchemaComplexContentExtension + */ + public XmlSchemaComplexContentExtension() { + attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); + } + + public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { + this.anyAttribute = anyAttribute; + } + + @Override + public XmlSchemaAnyAttribute getAnyAttribute() { + return this.anyAttribute; + } + + @Override + public List<XmlSchemaAttributeOrGroupRef> getAttributes() { + return this.attributes; + } + + public void setBaseTypeName(QName baseTypeName) { + this.baseTypeName = baseTypeName; + } + + @Override + public QName getBaseTypeName() { + return this.baseTypeName; + } + + public XmlSchemaParticle getParticle() { + return this.particle; + } + + public void setParticle(XmlSchemaParticle particle) { + this.particle = particle; + } + + void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { + this.attributes = attributes; + } +} diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentRestriction.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentRestriction.java index c3babbc..b07797d 100644 --- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentRestriction.java +++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexContentRestriction.java @@ -1,88 +1,91 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ws.commons.schema; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Class for complex types with a complex content model that are derived by restriction. Restricts the - * contents of the complex type to a subset of the inherited complex type. Represents the World Wide Web - * Consortium (W3C) restriction element for complex content. - */ - -public class XmlSchemaComplexContentRestriction extends XmlSchemaContent { - /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ - private XmlSchemaAnyAttribute anyAttribute; - /* - * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple - * type. - */ - private List<XmlSchemaAttributeOrGroupRef> attributes; - /* Name of the built-in data type, simple type, or complex type. */ - private QName baseTypeName; - /* - * One of the XmlSchemaGroupRef, XmlSchemaChoice, XmlSchemaAll, or XmlSchemaSequence classes. - */ - private XmlSchemaParticle particle; - - - /** - * Creates new XmlSchemaComplexContentRestriction - */ - public XmlSchemaComplexContentRestriction() { - attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); - } - - public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { - this.anyAttribute = anyAttribute; - } - - public XmlSchemaAnyAttribute getAnyAttribute() { - return this.anyAttribute; - } - - public List<XmlSchemaAttributeOrGroupRef> getAttributes() { - return this.attributes; - } - - public void setBaseTypeName(QName baseTypeName) { - this.baseTypeName = baseTypeName; - } - - public QName getBaseTypeName() { - return this.baseTypeName; - } - - public XmlSchemaParticle getParticle() { - return this.particle; - } - - public void setParticle(XmlSchemaParticle particle) { - this.particle = particle; - } - - void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { - this.attributes = attributes; - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ws.commons.schema; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Class for complex types with a complex content model that are derived by restriction. Restricts the + * contents of the complex type to a subset of the inherited complex type. Represents the World Wide Web + * Consortium (W3C) restriction element for complex content. + */ + +public class XmlSchemaComplexContentRestriction extends XmlSchemaContent { + /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ + private XmlSchemaAnyAttribute anyAttribute; + /* + * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple + * type. + */ + private List<XmlSchemaAttributeOrGroupRef> attributes; + /* Name of the built-in data type, simple type, or complex type. */ + private QName baseTypeName; + /* + * One of the XmlSchemaGroupRef, XmlSchemaChoice, XmlSchemaAll, or XmlSchemaSequence classes. + */ + private XmlSchemaParticle particle; + + + /** + * Creates new XmlSchemaComplexContentRestriction + */ + public XmlSchemaComplexContentRestriction() { + attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); + } + + public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { + this.anyAttribute = anyAttribute; + } + + @Override + public XmlSchemaAnyAttribute getAnyAttribute() { + return this.anyAttribute; + } + + @Override + public List<XmlSchemaAttributeOrGroupRef> getAttributes() { + return this.attributes; + } + + public void setBaseTypeName(QName baseTypeName) { + this.baseTypeName = baseTypeName; + } + + @Override + public QName getBaseTypeName() { + return this.baseTypeName; + } + + public XmlSchemaParticle getParticle() { + return this.particle; + } + + public void setParticle(XmlSchemaParticle particle) { + this.particle = particle; + } + + void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { + this.attributes = attributes; + } +} diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaContent.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaContent.java index d684e1e..a953558 100644 --- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaContent.java +++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaContent.java @@ -1,34 +1,56 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ws.commons.schema; - -/** - * An abstract class for schema content. - */ - -public abstract class XmlSchemaContent extends XmlSchemaAnnotated { - - /** - * Creates new XmlSchemaContent - */ - protected XmlSchemaContent() { - } - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ws.commons.schema; + +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * An abstract class for schema content. + */ + +public abstract class XmlSchemaContent extends XmlSchemaAnnotated { + + /** + * Creates new XmlSchemaContent + */ + protected XmlSchemaContent() { + } + + /** + * Returns the "anyAttribute" value for this schema content. + * @return The "anyAttribute" value. + */ + public abstract XmlSchemaAnyAttribute getAnyAttribute(); + + /** + * Returns the collection of attributes for this schema content. + * @return The collection of attributes. + */ + public abstract List<XmlSchemaAttributeOrGroupRef> getAttributes(); + + /** + * Returns the qname of the base type of this content. + * @return The qname of the base type. + */ + public abstract QName getBaseTypeName(); + +} diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentExtension.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentExtension.java index 3e12766..b07d8d7 100644 --- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentExtension.java +++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentExtension.java @@ -1,79 +1,82 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ws.commons.schema; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Class for simple types that are derived by extension. Extends the simple type content of the element by - * adding attributes. Represents the World Wide Web Consortium (W3C) extension element for simple content. - */ - -public class XmlSchemaSimpleContentExtension extends XmlSchemaContent { - - /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ - private XmlSchemaAnyAttribute anyAttribute; - - /* - * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple - * type. - */ - private List<XmlSchemaAttributeOrGroupRef> attributes; - - /* Name of the built-in data type, simple type, or complex type. */ - private QName baseTypeName; - - /** - * Creates new XmlSchemaSimpleContentExtension - */ - public XmlSchemaSimpleContentExtension() { - attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); - - } - - public XmlSchemaAnyAttribute getAnyAttribute() { - return this.anyAttribute; - } - - public List<XmlSchemaAttributeOrGroupRef> getAttributes() { - return this.attributes; - } - - public QName getBaseTypeName() { - return this.baseTypeName; - } - - public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { - this.anyAttribute = anyAttribute; - } - - public void setBaseTypeName(QName baseTypeName) { - this.baseTypeName = baseTypeName; - } - - public void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { - this.attributes = attributes; - } - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ws.commons.schema; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Class for simple types that are derived by extension. Extends the simple type content of the element by + * adding attributes. Represents the World Wide Web Consortium (W3C) extension element for simple content. + */ + +public class XmlSchemaSimpleContentExtension extends XmlSchemaContent { + + /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ + private XmlSchemaAnyAttribute anyAttribute; + + /* + * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple + * type. + */ + private List<XmlSchemaAttributeOrGroupRef> attributes; + + /* Name of the built-in data type, simple type, or complex type. */ + private QName baseTypeName; + + /** + * Creates new XmlSchemaSimpleContentExtension + */ + public XmlSchemaSimpleContentExtension() { + attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); + + } + + @Override + public XmlSchemaAnyAttribute getAnyAttribute() { + return this.anyAttribute; + } + + @Override + public List<XmlSchemaAttributeOrGroupRef> getAttributes() { + return this.attributes; + } + + @Override + public QName getBaseTypeName() { + return this.baseTypeName; + } + + public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { + this.anyAttribute = anyAttribute; + } + + public void setBaseTypeName(QName baseTypeName) { + this.baseTypeName = baseTypeName; + } + + public void setAttributes(List<XmlSchemaAttributeOrGroupRef> attributes) { + this.attributes = attributes; + } + +} diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java index 5f972e8..70b7661 100644 --- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java +++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java @@ -1,94 +1,97 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ws.commons.schema; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Class for simple types that are derived by restriction. Restricts the range of values for the element to a - * subset of the inherited simple types. Represents the World Wide Web Consortium (W3C) restriction element - * for simple content. - */ - -public class XmlSchemaSimpleContentRestriction extends XmlSchemaContent { - XmlSchemaAnyAttribute anyAttribute; - /* - * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple - * type. - */ - private List<XmlSchemaAttributeOrGroupRef> attributes; - - /* Derived from the type specified by the base value. */ - private XmlSchemaSimpleType baseType; - - /* Name of the built-in data type, simple type, or complex type. */ - private QName baseTypeName; - - - /* One or more of the facet classes: */ - private List<XmlSchemaFacet> facets; - - - /** - * Creates new XmlSchemaSimpleContentRestriction - */ - public XmlSchemaSimpleContentRestriction() { - facets = Collections.synchronizedList(new ArrayList<XmlSchemaFacet>()); - attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); - } - - /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ - - public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { - this.anyAttribute = anyAttribute; - } - - public XmlSchemaAnyAttribute getAnyAttribute() { - return this.anyAttribute; - } - - public List<XmlSchemaAttributeOrGroupRef> getAttributes() { - return this.attributes; - } - - public void setBaseType(XmlSchemaSimpleType baseType) { - this.baseType = baseType; - } - - public XmlSchemaSimpleType getBaseType() { - return this.baseType; - } - public void setBaseTypeName(QName baseTypeName) { - this.baseTypeName = baseTypeName; - } - - public QName getBaseTypeName() { - return this.baseTypeName; - } - - public List<XmlSchemaFacet> getFacets() { - return this.facets; - } - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ws.commons.schema; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Class for simple types that are derived by restriction. Restricts the range of values for the element to a + * subset of the inherited simple types. Represents the World Wide Web Consortium (W3C) restriction element + * for simple content. + */ + +public class XmlSchemaSimpleContentRestriction extends XmlSchemaContent { + XmlSchemaAnyAttribute anyAttribute; + /* + * Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple + * type. + */ + private List<XmlSchemaAttributeOrGroupRef> attributes; + + /* Derived from the type specified by the base value. */ + private XmlSchemaSimpleType baseType; + + /* Name of the built-in data type, simple type, or complex type. */ + private QName baseTypeName; + + + /* One or more of the facet classes: */ + private List<XmlSchemaFacet> facets; + + + /** + * Creates new XmlSchemaSimpleContentRestriction + */ + public XmlSchemaSimpleContentRestriction() { + facets = Collections.synchronizedList(new ArrayList<XmlSchemaFacet>()); + attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>()); + } + + /* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */ + + public void setAnyAttribute(XmlSchemaAnyAttribute anyAttribute) { + this.anyAttribute = anyAttribute; + } + + @Override + public XmlSchemaAnyAttribute getAnyAttribute() { + return this.anyAttribute; + } + + @Override + public List<XmlSchemaAttributeOrGroupRef> getAttributes() { + return this.attributes; + } + + public void setBaseType(XmlSchemaSimpleType baseType) { + this.baseType = baseType; + } + + public XmlSchemaSimpleType getBaseType() { + return this.baseType; + } + public void setBaseTypeName(QName baseTypeName) { + this.baseTypeName = baseTypeName; + } + + @Override + public QName getBaseTypeName() { + return this.baseTypeName; + } + + public List<XmlSchemaFacet> getFacets() { + return this.facets; + } + +} diff --git a/xmlschema-walker/.classpath b/xmlschema-walker/.classpath new file mode 100644 index 0000000..f7e4a1d --- /dev/null +++ b/xmlschema-walker/.classpath @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + <attribute name="test" value="true"/> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath>
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ws.apache.org For additional commands, e-mail: dev-h...@ws.apache.org