public class XsdElement extends XsdNamedElements
XsdNamedElements because it's one of the
XsdAbstractElement concrete classes that can have a XsdNamedElements.name attribute.| Modifier and Type | Field | Description |
|---|---|---|
private boolean |
abstractObj |
Specifies whether the element can be used in an instance document.
|
private BlockEnum |
block |
Prevents an element with a specified type of derivation from being used in place of this
XsdElement element. |
private ReferenceBase |
complexType |
The
XsdComplexType instance wrapped in a ReferenceBase object. |
private String |
defaultObj |
Specifies a default value for the element.
|
private FinalEnum |
finalObj |
Prevents other elements to derive depending on its value.
|
private String |
fixed |
Specifies a fixed value for the element.
|
private FormEnum |
form |
Specifies if the current
XsdElement attribute is "qualified" or "unqualified". |
private String |
maxOccurs |
Specifies the maximum number of times this element can occur in the parent element.
|
private Integer |
minOccurs |
Specifies the minimum number of times this element can occur in the parent element.
|
private boolean |
nillable |
Specifies if the this
XsdElement support a null value. |
private ReferenceBase |
simpleType |
The
XsdSimpleType instance wrapped in a ReferenceBase object. |
private String |
substitutionGroup |
Specifies the name of an element that can be substituted with this element.
|
private ReferenceBase |
type |
The type of the current element.
|
private XsdElementVisitor |
visitor |
|
static String |
XS_TAG |
|
static String |
XSD_TAG |
|
private static String |
xsdElementIsXsdSchema |
ABSTRACT_TAG, ATTRIBUTE_FORM_DEFAULT, BASE_TAG, BLOCK_DEFAULT, BLOCK_TAG, DEFAULT_ELEMENT_TAG, DEFAULT_TAG, ELEMENT_FORM_DEFAULT, elementFieldsMap, 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, parser, REF_TAG, SCHEMA_LOCATION, SOURCE_TAG, SUBSTITUTION_GROUP_TAG, TARGET_NAMESPACE, TYPE_TAG, USE_TAG, VALUE_TAG, VERSION, XML_LANG_TAG, XMLNSname| Constructor | Description |
|---|---|
XsdElement(XsdParser parser,
Map<String,String> elementFieldsMapParam) |
|
XsdElement(XsdAbstractElement parent,
XsdParser parser,
Map<String,String> elementFieldsMapParam) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
accept(XsdAbstractElementVisitor visitorParam) |
Base method for all accept methods.
|
XsdElement |
clone(Map<String,String> placeHolderAttributes) |
Performs a copy of the current object for replacing purposes.
|
String |
getBlock() |
|
String |
getFinal() |
|
String |
getForm() |
|
String |
getMaxOccurs() |
|
Integer |
getMinOccurs() |
|
String |
getType() |
|
XsdElementVisitor |
getVisitor() |
Obtains the visitor of a concrete
XsdAbstractElement instance. |
XsdComplexType |
getXsdComplexType() |
|
XsdSimpleType |
getXsdSimpleType() |
|
private XsdComplexType |
getXsdType() |
|
boolean |
isAbstractObj() |
|
boolean |
isNillable() |
|
static ReferenceBase |
parse(XsdParser parser,
Node node) |
|
void |
replaceUnsolvedElements(NamedConcreteElement element) |
This method aims to replace the previously created
UnsolvedReference in case that the type of the
current XsdElement instance is not a built-in type. |
private void |
rule2() |
Asserts if the current object is a direct child of the top level XsdSchema element and doesn't have a name, which isn't allowed,
throwing an exception in that case.
|
private void |
rule3() |
Asserts if the current object has a ref attribute while being a direct child of the top level XsdSchema element, which isn't allowed,
throwing an exception in that case.
|
private void |
rule4() |
Asserts if the current object isn't a direct child of the top level XsdSchema and has a value for the substitutionGroup,
which isn't allowed, throwing an exception in that case.
|
private void |
rule5() |
|
private void |
rule6() |
|
private void |
rule7() |
Asserts if the current object has a form attribute while being a direct child of the top level XsdSchema element,
which isn't allowed, throwing an exception in that case.
|
void |
setComplexType(ReferenceBase complexType) |
|
void |
setFields(Map<String,String> elementFieldsMapParam) |
Sets all the fields of the
XsdElement instance. |
void |
setSimpleType(ReferenceBase simpleType) |
|
void |
validateSchemaRules() |
Runs verifications on each concrete element to ensure that the XSD schema rules are verified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertNodeMap, getElementFieldsMap, getElements, getParent, getParser, getXsdElements, setParent, xsdParseSkeleton, xsdRawContentParsegetAnnotation, setAnnotationgetIdgetName, getRawName, setNamepublic static final String XSD_TAG
public static final String XS_TAG
private XsdElementVisitor visitor
XsdElementVisitor which restricts its children to XsdComplexType and XsdSimpleType
instances.
Can also have XsdAnnotation as children as per inheritance of XsdAnnotatedElementsVisitor.private ReferenceBase complexType
XsdComplexType instance wrapped in a ReferenceBase object.private ReferenceBase simpleType
XsdSimpleType instance wrapped in a ReferenceBase object.private ReferenceBase type
XsdComplexType or a
XsdSimpleType instances.private String substitutionGroup
XsdElement is a top level element, i.e. his parent is a XsdSchema element.private String defaultObj
private String fixed
private FormEnum form
XsdElement attribute is "qualified" or "unqualified".private boolean nillable
XsdElement support a null value.private boolean abstractObj
private BlockEnum block
XsdElement element.
Possible values are:
extension - prevents elements derived by extension;
restriction - prevents elements derived by restriction;
substitution - prevents elements derived by substitution;
#all - all of the above.private FinalEnum finalObj
XsdElement is a top level element, i.e. his parent is a XsdSchema element.
extension - prevents elements derived by extension;
restriction - prevents elements derived by restriction;
#all - all of the above.private Integer minOccurs
private String maxOccurs
private static String xsdElementIsXsdSchema
public XsdElement(@NotNull
XsdParser parser,
@NotNull
Map<String,String> elementFieldsMapParam)
public XsdElement(XsdAbstractElement parent, @NotNull XsdParser parser, @NotNull Map<String,String> elementFieldsMapParam)
public void setFields(@NotNull
Map<String,String> elementFieldsMapParam)
XsdElement instance. Applies default values whenever they exist.
The type is treated in a special way. His value is received as a String, which is inspected
and if the value is a built-in type we create a XsdComplexType to reflect that built-in type. If the
value is a declared XsdSimpleType or XsdComplexType we add it as a UnsolvedReference to
be resolved later in the parsing process.setFields in class XsdNamedElementselementFieldsMapParam - The Map object that contains the information previously present in the Node element.public void validateSchemaRules()
validateSchemaRules in class XsdNamedElementsprivate void rule7()
private void rule6()
private void rule5()
private void rule4()
private void rule3()
private void rule2()
public void accept(XsdAbstractElementVisitor visitorParam)
XsdAbstractElementaccept in class XsdAbstractElementvisitorParam - The visitor that is visiting the current instance.public XsdElementVisitor getVisitor()
XsdAbstractElementXsdAbstractElement instance.getVisitor in class XsdAbstractElementpublic XsdElement clone(@NotNull Map<String,String> placeHolderAttributes)
UnsolvedReference objects in the reference solving process.clone in class XsdNamedElementsplaceHolderAttributes - The additional attributes to add to the clone.public void replaceUnsolvedElements(NamedConcreteElement element)
UnsolvedReference in case that the type of the
current XsdElement instance is not a built-in type.replaceUnsolvedElements in class XsdAbstractElementelement - A concrete element with a name that will replace the UnsolvedReference object created in the
setFields(Map) method. The UnsolvedReference is only replaced if there
is a match between the UnsolvedReference.ref and the NamedConcreteElement.name.public XsdComplexType getXsdComplexType()
public XsdSimpleType getXsdSimpleType()
private XsdComplexType getXsdType()
public static ReferenceBase parse(@NotNull XsdParser parser, Node node)
public String getFinal()
public boolean isNillable()
public Integer getMinOccurs()
public String getMaxOccurs()
public boolean isAbstractObj()
public void setComplexType(ReferenceBase complexType)
public void setSimpleType(ReferenceBase simpleType)
public String getBlock()
public String getForm()
public String getType()
Copyright © 2018. All rights reserved.