mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
occurence constraints for xml
This commit is contained in:
+16
@@ -73,6 +73,22 @@ public class CompositeDescriptor extends RngElementDescriptor {
|
||||
return computeAttributeDescriptor(AttributeFinder.find(qname, myPatterns));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected XmlAttributeDescriptor[] collectAttributeDescriptors(@Nullable XmlTag context) {
|
||||
|
||||
final QName qName = context == null ?
|
||||
|
||||
@@ -63,6 +63,22 @@ public abstract class AbstractDomChildrenDescriptor implements XmlElementDescrip
|
||||
return name.getXmlName().getLocalName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public PsiElement getDeclaration() {
|
||||
@@ -115,6 +131,22 @@ public abstract class AbstractDomChildrenDescriptor implements XmlElementDescrip
|
||||
return finalDomElement.getXmlElementName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public PsiElement getDeclaration() {
|
||||
|
||||
@@ -53,6 +53,22 @@ public class DomElementXmlDescriptor extends AbstractDomChildrenDescriptor {
|
||||
return myChildrenDescription.getXmlElementName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PsiElement getDeclaration() {
|
||||
final DomElement declaration = myChildrenDescription.getUserData(DomExtension.KEY_DECLARATION);
|
||||
|
||||
@@ -88,6 +88,22 @@ public class RelaxedHtmlFromSchemaElementDescriptor extends XmlElementDescriptor
|
||||
return getAttributeDescriptor(attribute.getName(), attribute.getParent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) {
|
||||
final XmlAttributeDescriptor descriptor = super.getAttributeDescriptor(attributeName.toLowerCase(), context);
|
||||
if (descriptor != null) return descriptor;
|
||||
|
||||
@@ -131,6 +131,22 @@ public class HtmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl {
|
||||
return myDelegate.getNSDescriptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getContentType() {
|
||||
return myDelegate.getContentType();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,22 @@ public class XmlElementDescriptorImpl extends BaseXmlElementDescriptorImpl imple
|
||||
return getNsDescriptorFrom(myElementDecl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static XmlNSDescriptor getNsDescriptorFrom(final PsiElement elementDecl) {
|
||||
final XmlFile file = XmlUtil.getContainingFile(elementDecl);
|
||||
|
||||
@@ -60,6 +60,22 @@ public class XmlElementDescriptorByType extends XmlElementDescriptorImpl {
|
||||
return nsDescriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ComplexTypeDescriptor getType(XmlElement context) {
|
||||
return myType;
|
||||
}
|
||||
|
||||
@@ -270,6 +270,22 @@ public class HtmlUtil {
|
||||
return tagName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return minimal occurrence constraint value (e.g. 0 or 1), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMinOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximal occurrence constraint value (e.g. 1 or {@link Integer.MAX_VALUE}), on null if not applied
|
||||
*/
|
||||
@Override
|
||||
public Integer getMaxOccurs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean allowElementsFromNamespace(final String namespace, final XmlTag context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user