public class XsdAttribute extends XsdNamedElements
XsdNamedElements, which serves as a base to every element type that can have a ref attribute.
For more information check XsdNamedElements.| Modifier and Type | Field | Description |
|---|---|---|
private String |
defaultElement |
A default value for the current
XsdAttribute instance. |
private String |
fixed |
Specifies a fixed value for the current
XsdAttribute instance. |
private FormEnum |
form |
Specifies if the current
XsdAttribute attribute is "qualified" or "unqualified". |
private ReferenceBase |
simpleType |
A
XsdSimpleType instance wrapped in a ReferenceBase object which indicate any restrictions
that may be present in the current XsdAttribute instance. |
private String |
type |
Specifies either a built-in data type for the current
XsdAttribute instance or serves as a reference to a
XsdSimpleType instance. |
private UsageEnum |
use |
Specifies how this
XsdAttribute should be used. |
private XsdAttributeVisitor |
visitor |
XsdAttributeVisitor instance which restricts the its children to XsdSimpleType. |
static String |
XS_TAG |
|
static String |
XSD_TAG |
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| Modifier | Constructor | Description |
|---|---|---|
private |
XsdAttribute(XsdParser parser,
Map<String,String> elementFieldsMapParam) |
|
private |
XsdAttribute(XsdAbstractElement parent,
XsdParser parser,
Map<String,String> elementFieldsMapParam) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
accept(XsdAbstractElementVisitor visitorParam) |
Base method for all accept methods.
|
XsdAttribute |
clone(Map<String,String> placeHolderAttributes) |
Performs a copy of the current object for replacing purposes.
|
List<XsdRestriction> |
getAllRestrictions() |
|
String |
getFixed() |
|
String |
getForm() |
|
private static String |
getFormDefaultValue(XsdAbstractElement parent) |
|
String |
getType() |
|
String |
getUse() |
|
XsdAttributeVisitor |
getVisitor() |
Obtains the visitor of a concrete
XsdAbstractElement instance. |
XsdSimpleType |
getXsdSimpleType() |
|
static ReferenceBase |
parse(XsdParser parser,
Node node) |
|
void |
replaceUnsolvedElements(NamedConcreteElement elementWrapper) |
Receives a
NamedConcreteElement that should be the one requested earlier |
private void |
rule2() |
Asserts if the current object has the fixed and default attributes at the same time, which isn't allowed, throwing
an exception in that case.
|
private void |
rule3() |
Asserts if the current object has a ref attribute at the same time as either a simpleType as children, a form attribute or a type attribute.
|
void |
setFields(Map<String,String> elementFieldsMapParam) |
Sets all the fields of the
XsdAttribute 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 XsdAttributeVisitor visitor
XsdAttributeVisitor instance which restricts the its children to XsdSimpleType.
Can also have xsd:annotation as children as per inheritance of XsdAnnotatedElementsVisitor.private ReferenceBase simpleType
XsdSimpleType instance wrapped in a ReferenceBase object which indicate any restrictions
that may be present in the current XsdAttribute instance.private String defaultElement
XsdAttribute instance. This value and fixed
shouldn't be present at the same time.private String fixed
XsdAttribute instance. This value and
defaultElement shouldn't be present at the same time.private String type
XsdAttribute instance or serves as a reference to a
XsdSimpleType instance. In the case of being used as a reference to a XsdSimpleType instance
its value is used to create an UnsolvedReference using its value as ref to be resolved later in the
parsing process.private FormEnum form
XsdAttribute attribute is "qualified" or "unqualified".private UsageEnum use
XsdAttribute should be used. The possible values are: required, prohibited, optional.private XsdAttribute(@NotNull
XsdParser parser,
@NotNull
Map<String,String> elementFieldsMapParam)
private XsdAttribute(XsdAbstractElement parent, @NotNull XsdParser parser, @NotNull Map<String,String> elementFieldsMapParam)
public void setFields(@NotNull
Map<String,String> elementFieldsMapParam)
XsdAttribute instance. Most values don't have default values except the
use field. Regarding the type field we check if the value present is a
built-in type, if not we create an UnsolvedReference object to be resolved at a later time in the
parsing process.setFields in class XsdNamedElementselementFieldsMapParam - The Map object containing all the information previously contained in the parsed Node.private static String getFormDefaultValue(XsdAbstractElement parent)
public void validateSchemaRules()
validateSchemaRules in class XsdNamedElementsprivate void rule3()
private void rule2()
public void accept(XsdAbstractElementVisitor visitorParam)
XsdAbstractElementaccept in class XsdAbstractElementvisitorParam - The visitor that is visiting the current instance.public XsdAttributeVisitor getVisitor()
XsdAbstractElementXsdAbstractElement instance.getVisitor in class XsdAbstractElementpublic XsdAttribute 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 elementWrapper)
NamedConcreteElement that should be the one requested earlier.
* In the setFields(java.util.Map<java.lang.String, java.lang.String>) method:
this.simpleType = new UnsolvedReference(type, placeHolder);
XsdParser.getInstance().addUnsolvedReference((UnsolvedReference) this.simpleType);
This implies that the object being received is the object that is being referred with the type
String.replaceUnsolvedElements in class XsdAbstractElementelementWrapper - The object that should be wrapping the requested XsdSimpleType object.public void setSimpleType(ReferenceBase simpleType)
public XsdSimpleType getXsdSimpleType()
public String getType()
public String getUse()
public String getForm()
public String getFixed()
public List<XsdRestriction> getAllRestrictions()
public static ReferenceBase parse(@NotNull XsdParser parser, Node node)
Copyright © 2018. All rights reserved.