Package org.xmlet.xsdparser.xsdelements
Class XsdComplexType
- java.lang.Object
-
public class XsdComplexType extends XsdNamedElements
A class representing the xsd:complexType element. ExtendsXsdNamedElementsbecause it's one of theXsdAbstractElementconcrete classes that can have a name attribute.
-
-
Field Summary
Fields Modifier and Type Field Description private ComplexTypeBlockEnumblockPrevents a complex type that has a specified type of derivation from being used in place of this complex type.private ReferenceBasechildElementThe child element ofXsdComplexType.private XsdComplexContentcomplexContentAXsdComplexContentchild.private booleanelementAbstractSpecifies whether the complex type can be used in an instance document.private FinalEnumelementFinalPrevents a specified type of derivation of this complex type element.private booleanmixedSpecifies whether character data is allowed to appear between the child elements of this complexType element.private XsdSimpleContentsimpleContentAXsdSimpleContentchild.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 Constructor Description XsdComplexType(XsdParserCore parser, java.util.Map<java.lang.String,java.lang.String> attributesMap, java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)XsdComplexType(XsdAbstractElement parent, XsdParserCore parser, java.util.Map<java.lang.String,java.lang.String> elementFieldsMapParam, 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.private booleanchildrenIsMultipleElement()XsdComplexTypeclone(java.util.Map<java.lang.String,java.lang.String> placeHolderAttributes)Performs a copy of the current object for replacing purposes.java.util.stream.Stream<XsdAttributeGroup>getAllXsdAttributeGroups()java.util.stream.Stream<XsdAttribute>getAllXsdAttributes()(package private) java.util.List<ReferenceBase>getAttributes()java.lang.StringgetBlock()XsdAllgetChildAsAll()XsdChoicegetChildAsChoice()XsdGroupgetChildAsGroup()XsdSequencegetChildAsSequence()XsdComplexContentgetComplexContent()java.util.List<ReferenceBase>getElements()java.lang.StringgetFinal()XsdSimpleContentgetSimpleContent()java.util.stream.Stream<XsdAttributeGroup>getXsdAttributeGroup()java.util.stream.Stream<XsdAttribute>getXsdAttributes()XsdAbstractElementgetXsdChildElement()booleanisElementAbstract()booleanisMixed()static ReferenceBaseparse(ParseData parseData)voidreplaceUnsolvedElements(NamedConcreteElement element)This method iterates on the current element children and replaces anyUnsolvedReferenceobject that has a ref attribute that matches the receivingNamedConcreteElementname attribute.private voidrule2()Asserts if the current object has a simpleContent as children and contains a value for the mixed attribute, which isn't allowed throwing an exception in that case.voidsetChildElement(ReferenceBase childElement)voidsetComplexContent(XsdComplexContent complexContent)voidsetSimpleContent(XsdSimpleContent simpleContent)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, 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 ReferenceBase childElement
The child element ofXsdComplexType. Can be either aXsdGroupor aXsdMultipleElementsinstance wrapped in aReferenceBaseobject.
-
elementAbstract
private boolean elementAbstract
Specifies whether the complex type can be used in an instance document. True indicates that an element cannot use this complex type directly but must use a complex type derived from this complex type.
-
mixed
private boolean mixed
Specifies whether character data is allowed to appear between the child elements of this complexType element. This attribute is exclusive withsimpleContent, only one can be present at any given time.
-
block
private ComplexTypeBlockEnum block
Prevents a complex type that has a specified type of derivation from being used in place of this complex type. Possible values are extension, restriction or #all.
-
elementFinal
private FinalEnum elementFinal
Prevents a specified type of derivation of this complex type element. Possible values are extension, restriction or #all.
-
complexContent
private XsdComplexContent complexContent
AXsdComplexContentchild.
-
simpleContent
private XsdSimpleContent simpleContent
AXsdSimpleContentchild. This element is exclusive with themixedfield, only one of them should be present in anyXsdComplexTypeelement.
-
-
Constructor Detail
-
XsdComplexType
XsdComplexType(@NotNull XsdParserCore parser, @NotNull java.util.Map<java.lang.String,java.lang.String> attributesMap, @NotNull java.util.function.Function<XsdAbstractElement,XsdAbstractElementVisitor> visitorFunction)
-
XsdComplexType
XsdComplexType(XsdAbstractElement parent, @NotNull XsdParserCore parser, @NotNull java.util.Map<java.lang.String,java.lang.String> elementFieldsMapParam, @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 a simpleContent as children and contains a value for the mixed attribute, which isn't allowed throwing an exception in that case.
-
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:
- The elements of his child as if they belong to the
XsdComplexTypeinstance.
-
clone
public XsdComplexType 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.
-
replaceUnsolvedElements
public void replaceUnsolvedElements(NamedConcreteElement element)
Description copied from class:XsdAbstractElementThis method iterates on the current element children and replaces anyUnsolvedReferenceobject that has a ref attribute that matches the receivingNamedConcreteElementname attribute.- Overrides:
replaceUnsolvedElementsin classXsdAbstractElement- Parameters:
element- A fully parsed element with a name that will replace anUnsolvedReferenceobject, if a match between theNamedConcreteElementname attribute and theUnsolvedReferenceref attribute.
-
getXsdChildElement
public XsdAbstractElement getXsdChildElement()
-
getFinal
public java.lang.String getFinal()
-
getAttributes
java.util.List<ReferenceBase> getAttributes()
-
getXsdAttributes
public java.util.stream.Stream<XsdAttribute> getXsdAttributes()
-
getXsdAttributeGroup
public java.util.stream.Stream<XsdAttributeGroup> getXsdAttributeGroup()
-
getAllXsdAttributeGroups
public java.util.stream.Stream<XsdAttributeGroup> getAllXsdAttributeGroups()
-
getAllXsdAttributes
public java.util.stream.Stream<XsdAttribute> getAllXsdAttributes()
-
getSimpleContent
public XsdSimpleContent getSimpleContent()
-
getComplexContent
public XsdComplexContent getComplexContent()
-
isMixed
public boolean isMixed()
-
isElementAbstract
public boolean isElementAbstract()
-
parse
public static ReferenceBase parse(@NotNull ParseData parseData)
-
setChildElement
public void setChildElement(ReferenceBase childElement)
-
setComplexContent
public void setComplexContent(XsdComplexContent complexContent)
-
setSimpleContent
public void setSimpleContent(XsdSimpleContent simpleContent)
-
getBlock
public java.lang.String getBlock()
-
getChildAsGroup
public XsdGroup getChildAsGroup()
-
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.
-
childrenIsMultipleElement
private boolean childrenIsMultipleElement()
-
-