/** * [schema information] * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a> * @return The schema information property if it's the validation root, * null otherwise. */ public synchronized XSModel getSchemaInformation() { if (fSchemaInformation == null && fGrammars != null) { fSchemaInformation = new XSModelImpl(fGrammars); } return fSchemaInformation; }
public int size() { return getLength(); }
public ListIterator listIterator() { return listIterator0(0); }
/** * @see org.apache.xerces.xs.XSModel#getNotationDeclaration(String, String) */ public XSNotationDeclaration getNotationDeclaration(String name, String namespace) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return (XSNotationDeclaration)sg.fGlobalNotationDecls.get(name); }
fGrammarMap.put(null2EmptyString(fNamespaces[i]), fGrammarList[i]); fSubGroupMap = buildSubGroups(s4sVersion);
public Object[] toArray() { Object[] a = new Object[fGrammarCount]; toArray0(a); return a; }
private SymbolHash buildSubGroups_Org(short s4sVersion) { SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null); for (int i = 0 ; i < fGrammarCount; i++) { sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups()); } final XSNamedMap elements = getComponents(XSConstants.ELEMENT_DECLARATION); final int len = elements.getLength(); final SymbolHash subGroupMap = new SymbolHash(len*2); XSElementDecl head; XSElementDeclaration[] subGroup; for (int i = 0; i < len; i++) { head = (XSElementDecl)elements.item(i); subGroup = sgHandler.getSubstitutionGroup(head, s4sVersion); subGroupMap.put(head, subGroup.length > 0 ? new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST); } return subGroupMap; }
private SymbolHash buildSubGroups(short s4sVersion) { SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null); for (int i = 0 ; i < fGrammarCount; i++) { sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups()); } final XSObjectListImpl elements = getGlobalElements(); final int len = elements.getLength(); final SymbolHash subGroupMap = new SymbolHash(len*2); XSElementDecl head; XSElementDeclaration[] subGroup; for (int i = 0; i < len; i++) { head = (XSElementDecl)elements.item(i); subGroup = sgHandler.getSubstitutionGroup(head, s4sVersion); subGroupMap.put(head, subGroup.length > 0 ? new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST); } return subGroupMap; }
public XSNotationDeclaration getNotationDeclaration(String name, String namespace, String loc) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return sg.getGlobalNotationDecl(name, loc); }
public Object[] toArray(Object[] a) { if (a.length < fGrammarCount) { Class arrayClass = a.getClass(); Class componentType = arrayClass.getComponentType(); a = (Object[]) Array.newInstance(componentType, fGrammarCount); } toArray0(a); if (a.length > fGrammarCount) { a[fGrammarCount] = null; } return a; }
/** * Convenience method. Returns a top-level attribute declaration. * @param name The name of the declaration. * @param namespace The namespace of the definition, otherwise null. * @return A top-level attribute declaration or null if such declaration * does not exist. */ public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return (XSAttributeDeclaration)sg.fGlobalAttrDecls.get(name); }
/** * Return an <code>XSModel</code> that represents components in this schema * grammar. * * @return an <code>XSModel</code> representing this schema grammar */ public XSModel toXSModel() { return new XSModelImpl(new SchemaGrammar[]{this}); }
public Iterator iterator() { return listIterator0(0); }
/** * Convenience method. Returns a top-level model group definition. * * @param name The name of the definition. * @param namespace The namespace of the definition, otherwise null. * @return A top-level model group definition definition or null if such * definition does not exist. */ public XSIDCDefinition getIDCDefinition(String name, String namespace) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return (XSIDCDefinition)sg.fGlobalIDConstraintDecls.get(name); }
protected XSModel toXSModel(SchemaGrammar[] grammars, short schemaVersion) { return new XSModelImpl(grammars, schemaVersion); }
public ListIterator listIterator(int index) { if (index >= 0 && index < fGrammarCount) { return listIterator0(index); } throw new IndexOutOfBoundsException("Index: " + index); }
/** * Convenience method. Returns a top-level element declaration. * @param name The name of the declaration. * @param namespace The namespace of the definition, otherwise null. * @return A top-level element declaration or null if such declaration * does not exist. */ public XSElementDeclaration getElementDeclaration(String name, String namespace) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return (XSElementDeclaration)sg.fGlobalElemDecls.get(name); }
public XSModel toXSModel(XSGrammar[] grammars) { if (grammars == null || grammars.length == 0) return toXSModel(); int len = grammars.length; boolean hasSelf = false; for (int i = 0; i < len; i++) { if (grammars[i] == this) { hasSelf = true; break; } } SchemaGrammar[] gs = new SchemaGrammar[hasSelf ? len : len+1]; for (int i = 0; i < len; i++) gs[i] = (SchemaGrammar)grammars[i]; if (!hasSelf) gs[len] = this; return new XSModelImpl(gs); }
/** * Convenience method. Returns a top-level attribute group definition. * @param name The name of the definition. * @param namespace The namespace of the definition, otherwise null. * @return A top-level attribute group definition or null if such * definition does not exist. */ public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace) { SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); if (sg == null) { return null; } return (XSAttributeGroupDefinition)sg.fGlobalAttrGrpDecls.get(name); }
public XSModel loadInputList(LSInputList is) { int length = is.getLength(); SchemaGrammar[] gs = new SchemaGrammar[length]; for (int i = 0; i < length; i++) { try { gs[i] = (SchemaGrammar) loadGrammar(dom2xmlInputSource(is.item(i))); } catch (Exception e) { reportDOMFatalError(e); return null; } } return new XSModelImpl(gs); }