Class XSDUtils
java.lang.Object
org.eclipse.lemminx.extensions.xsd.utils.XSDUtils
XSD utilities.
- Author:
- Angelo ZERR
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilesChangedTrackercreateFilesChangedTracker(Set<org.apache.xerces.impl.xs.SchemaGrammar> grammars) static FilesChangedTrackercreateFilesChangedTracker(org.apache.xerces.impl.xs.SchemaGrammar grammar) static DOMAttrfindSchemaLocationAttrByURI(DOMDocument document, String grammarURI) Returns the xsd:import/@schemaLocation or xsd:include/@schemaLocation declared in the givendocumentby the givengrammarURIand null otherwise.static XSDUtils.BindingTypegetBindingType(DOMAttr originAttr) Returns the binding type of the origin attribute which bounds an another target attribute.static DOMAttrgetSchemaLocation(DOMElement element) static booleanisXSAttribute(DOMElement element) static booleanisXSComplexType(Element element) static booleanisXSElement(Element element) static booleanstatic booleanisXSImport(Element element) static booleanisXSInclude(Element element) static booleanisXSSchema(Element element) static booleanisXSSimpleType(Element element) static booleanisXSTargetElement(Element element) static voidsearchXSOriginAttributes(DOMNode targetNode, BiConsumer<DOMAttr, DOMAttr> collector, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) Search origin attributes from the given target node..static voidsearchXSTargetAttributes(DOMAttr originAttr, XSDUtils.BindingType bindingType, boolean matchAttr, boolean searchInExternalSchema, BiConsumer<String, DOMAttr> collector) Collect XSD target attributes declared in the XML Schema according the given attribute and binding type.
-
Field Details
-
SCHEMA_LOCATION_ATTR
- See Also:
-
TARGET_NAMESPACE_ATTR
- See Also:
-
NAMESPACE_ATTR
- See Also:
-
XS_IMPORT_TAG
- See Also:
-
XS_SCHEMA_TAG
- See Also:
-
-
Constructor Details
-
XSDUtils
public XSDUtils()
-
-
Method Details
-
getBindingType
Returns the binding type of the origin attribute which bounds an another target attribute.- Parameters:
originAttr- the origin attribute- Returns:
- the binding type of the origin attribute which bounds an another target attribute.
-
searchXSTargetAttributes
public static void searchXSTargetAttributes(DOMAttr originAttr, XSDUtils.BindingType bindingType, boolean matchAttr, boolean searchInExternalSchema, BiConsumer<String, DOMAttr> collector) Collect XSD target attributes declared in the XML Schema according the given attribute and binding type.- Parameters:
originAttr- the origin attribute.matchAttr- true if the attribute value must match the value of target attribute value and false otherwise.searchInExternalSchema- true if search must be done in included XML Schema (xs:include) and false otherwise.collector- collector to collect XSD target attributes.
-
searchXSOriginAttributes
public static void searchXSOriginAttributes(DOMNode targetNode, BiConsumer<DOMAttr, DOMAttr> collector, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) Search origin attributes from the given target node..- Parameters:
targetNode- the referenced nodecollector- the collector to collect reference between an origin and target attribute.
-
isXSComplexType
-
isXSSimpleType
-
isXSElement
-
isXSGroup
-
isXSInclude
-
isXSImport
-
isXSTargetElement
-
isXSAttribute
-
isXSSchema
-
createFilesChangedTracker
public static FilesChangedTracker createFilesChangedTracker(org.apache.xerces.impl.xs.SchemaGrammar grammar) -
createFilesChangedTracker
public static FilesChangedTracker createFilesChangedTracker(Set<org.apache.xerces.impl.xs.SchemaGrammar> grammars) -
getSchemaLocation
-
findSchemaLocationAttrByURI
Returns the xsd:import/@schemaLocation or xsd:include/@schemaLocation declared in the givendocumentby the givengrammarURIand null otherwise.- Parameters:
document- the XSD documentgrammarURI- the grammar URI to retreive.- Returns:
- the xsd:import/@schemaLocation or xsd:include/@schemaLocation
declared in the given
documentby the givengrammarURIand null otherwise
-