Package org.xmlet.xsdparser.xsdelements
Class XsdGroup
- java.lang.Object
-
public class XsdGroup extends XsdNamedElements
A class representing the xsd:complexType element. ExtendsXsdNamedElementsbecause it's one of theXsdAbstractElementconcrete classes that can have aXsdNamedElements.nameattribute.- See Also:
- xsd:group description and usage at w3c
-
-
Field Summary
Fields Modifier and Type Field Description private XsdMultipleElementschildElementThe child element of theXsdGroupinstance.private java.lang.StringmaxOccursSpecifies the maximum number of times this element can occur in the parent element.private java.lang.IntegerminOccursSpecifies the minimum number of times this element can occur in the parent element.static java.lang.StringTAGstatic java.lang.StringXS_TAGstatic java.lang.StringXSD_TAG-
Fields inherited from class org.xmlet.xsdparser.xsdelements.XsdNamedElements
name
-
Fields inherited from class org.xmlet.xsdparser.xsdelements.XsdAbstractElement
ABSTRACT_TAG, ATTRIBUTE_FORM_DEFAULT, attributesMap, BASE_TAG, BLOCK_DEFAULT, BLOCK_TAG, cloneOf, DEFAULT_ELEMENT_TAG, DEFAULT_TAG, ELEMENT_FORM_DEFAULT, FINAL_DEFAULT, FINAL_TAG, FIXED_TAG, FORM_TAG, ID_TAG, ITEM_TYPE_TAG, MAX_OCCURS_TAG, MEMBER_TYPES_TAG, MIN_OCCURS_TAG, MIXED_TAG, NAME_TAG, NAMESPACE, NILLABLE_TAG, parent, parentAvailable, parser, REF_TAG, SCHEMA_LOCATION, SOURCE_TAG, SUBSTITUTION_GROUP_TAG, TARGET_NAMESPACE, TYPE_TAG, USE_TAG, VALUE_TAG, VERSION, visitor, visitorFunction, XML_LANG_TAG, XMLNS
-
-
Constructor Summary
Constructors Modifier Constructor Description privateXsdGroup(XsdParserCore parser, java.util.Map<java.lang.String,java.lang.String> attributesMap, java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)privateXsdGroup(XsdAbstractElement parent, XsdParserCore parser, java.util.Map<java.lang.String,java.lang.String> attributesMap, java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(XsdAbstractElementVisitor visitorParam)Base method for all accept methods.XsdNamedElementsclone(java.util.Map<java.lang.String,java.lang.String> placeHolderAttributes)Performs a copy of the current object for replacing purposes.XsdAllgetChildAsAll()XsdChoicegetChildAsChoice()XsdSequencegetChildAsSequence()XsdMultipleElementsgetChildElement()java.util.List<ReferenceBase>getElements()java.lang.StringgetMaxOccurs()java.lang.IntegergetMinOccurs()static ReferenceBaseparse(ParseData parseData)private voidrule2()Asserts if the current object has the name attribute when not being a direct child of the XsdSchema element, which is not allowed, throwing an exception in that case.private voidrule3()Asserts if the current has no value for its name attribute while being a direct child of the top level XsdSchema element, which is required.voidsetChildElement(XsdMultipleElements childElement)voidvalidateSchemaRules()Runs verifications on each concrete element to ensure that the XSD schema rules are verified.-
Methods inherited from class org.xmlet.xsdparser.xsdelements.XsdNamedElements
getName, getRawName, setName
-
Methods inherited from class org.xmlet.xsdparser.xsdelements.XsdAnnotatedElements
getAnnotation, setAnnotation
-
Methods inherited from class org.xmlet.xsdparser.xsdelements.XsdIdentifierElements
getId
-
Methods inherited from class org.xmlet.xsdparser.xsdelements.XsdAbstractElement
clone, compareReference, compareReference, convertNodeMap, getAttributesMap, getCloneOf, getParent, getParent, getParser, getVisitor, getXsdElements, getXsdSchema, getXsdSchema, replaceUnsolvedElements, setCloneOf, setParent, setParentAvailable, xsdParseSkeleton, xsdRawContentParse
-
-
-
-
Field Detail
-
XSD_TAG
public static final java.lang.String XSD_TAG
- See Also:
- Constant Field Values
-
XS_TAG
public static final java.lang.String XS_TAG
- See Also:
- Constant Field Values
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
childElement
private XsdMultipleElements childElement
The child element of theXsdGroupinstance. It can be aXsdAll,XsdChoiceor aXsdSequenceinstance.
-
minOccurs
private java.lang.Integer minOccurs
Specifies the minimum number of times this element can occur in the parent element. The value can be any number bigger or equal to 0. Default value is 1. This attribute cannot be used if the parent element is the XsdSchema element.
-
maxOccurs
private java.lang.String maxOccurs
Specifies the maximum number of times this element can occur in the parent element. The value can be any number bigger or equal to 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. This attribute cannot be used if the parent element is the XsdSchema element.
-
-
Constructor Detail
-
XsdGroup
private XsdGroup(@NotNull XsdParserCore parser, @NotNull java.util.Map<java.lang.String,java.lang.String> attributesMap, @NotNull java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)
-
XsdGroup
private XsdGroup(XsdAbstractElement parent, @NotNull XsdParserCore parser, @NotNull java.util.Map<java.lang.String,java.lang.String> attributesMap, @NotNull java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)
-
-
Method Detail
-
validateSchemaRules
public void validateSchemaRules()
Runs verifications on each concrete element to ensure that the XSD schema rules are verified.- Overrides:
validateSchemaRulesin classXsdNamedElements
-
rule2
private void rule2()
Asserts if the current object has the name attribute when not being a direct child of the XsdSchema element, which is not allowed, throwing an exception in that case.
-
rule3
private void rule3()
Asserts if the current has no value for its name attribute while being a direct child of the top level XsdSchema element, which is required. Throws an exception if no name is present.
-
accept
public void accept(XsdAbstractElementVisitor visitorParam)
Description copied from class:XsdAbstractElementBase method for all accept methods. It serves as a way to guarantee that every accept call assigns the parent field.- Overrides:
acceptin classXsdAbstractElement- Parameters:
visitorParam- The visitor that is visiting the current instance.
-
getElements
public java.util.List<ReferenceBase> getElements()
- Overrides:
getElementsin classXsdAbstractElement- Returns:
- A list with the child element of the
XsdGroupinstance.
-
clone
public XsdNamedElements clone(@NotNull java.util.Map<java.lang.String,java.lang.String> placeHolderAttributes)
Performs a copy of the current object for replacing purposes. The cloned objects are used to replaceUnsolvedReferenceobjects in the reference solving process.- Overrides:
clonein classXsdAbstractElement- Parameters:
placeHolderAttributes- The additional attributes to add to the clone.- Returns:
- A copy of the object from which is called upon.
-
setChildElement
public void setChildElement(XsdMultipleElements childElement)
-
getChildElement
public XsdMultipleElements getChildElement()
-
getChildAsAll
public XsdAll getChildAsAll()
-
getChildAsChoice
public XsdChoice getChildAsChoice()
-
getChildAsSequence
public XsdSequence getChildAsSequence()
- Returns:
- The childElement as a
XsdSequenceobject or null if childElement isn't aXsdSequenceinstance.
-
parse
public static ReferenceBase parse(@NotNull ParseData parseData)
-
getMinOccurs
public java.lang.Integer getMinOccurs()
-
getMaxOccurs
public java.lang.String getMaxOccurs()
-
-