/** * Returns an instance of the desired class. There is no provision for: a) same instances each * call b) different instances each call c) this factory being thread safe * * @param targetNamespace * @param desiredSchema URI the uri of which you want a schema instance. * @return Schema an instance of the desired schema. * @throws SAXException */ public static Schema getInstance(URI targetNamespace, URI desiredSchema) throws SAXException { return getInstance(targetNamespace, desiredSchema, Level.WARNING); }
public static Schema getInstance(URI targetNamespace, InputStream is1) throws SAXException { return getInstance(targetNamespace, is1, Level.WARNING); }
public static synchronized Schema getInstance(String targetNamespace) { try { URI uri = new URI(targetNamespace); return getInstance(uri); } catch (URISyntaxException e) { return null; } } /**
public static synchronized Schema[] getSchemas(String prefix) { if (prefix == null) return null; SchemaFactory sf = getInstance(); Iterator i = sf.schemas.values().iterator(); List l = new LinkedList(); while (i.hasNext()) { Schema s = (Schema) i.next(); if (prefix.equals(s.getPrefix())) l.add(s); } return (Schema[]) l.toArray(new Schema[l.size()]); }
/** * Returns an instance of the targetNamespace if it can be found ... null otherwise. * targetNamespaces which can be found are either hard-coded namespaces * (SchemaFactory.properties), have already been parsed or were registered. * * @param targetNamespace * @see #registerSchema(Strin,Schema) */ public static synchronized Schema getInstance(URI targetNamespace) { return getInstance().getRealInstance(targetNamespace); }
public static synchronized Schema getInstance(URI targetNamespace, InputStream is1, Level level) throws SAXException { return getInstance().getRealInstance(targetNamespace, is1, level); }
/** * Registers a Schema instance with the factory. A clone is NOT created within this method. The * Schema passed in is associated with the specified targetNamespace. The Schema is not tested * to ensure the intended targetNamespace (schema.getTargetNamespace()) is equal to * targetNamespace. The ramifications is that you may hack wildly within the repository, but we * aware you may have some 'undocumented features' as a result (odd Schemas being returned). * * @param targetNamespace * @param schema */ public static void registerSchema(URI targetNamespace, Schema schema) { getInstance().registerRealSchema(targetNamespace, schema); }
/** * Returns an instance of the desired class. There is no provision for: a) same instances each * call b) different instances each call c) this factory being thread safe * * @param targetNamespace The targetNamespace to search for. * @param desiredSchema URI the uri of which you want a schema instance. * @param level Level * @return Schema an instance of the desired schema. * @throws SAXException When something goes wrong */ public static synchronized Schema getInstance( URI targetNamespace, URI desiredSchema, Level level) throws SAXException { return getInstance().getRealInstance(targetNamespace, desiredSchema, level); }
/** @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String) */ public void startPrefixMapping(String prefix, String targ) throws SAXException { logger.finest("Target == '" + targ + "'"); try { URI tns = new URI(targ); Schema s = SchemaFactory.getInstance(tns); if (s == null) { prefixURIs.put(prefix, tns); return; } if ((prefix == null) || "".equalsIgnoreCase(prefix)) { defaultNS = s.getTargetNamespace(); } targSchemas.put(s.getTargetNamespace(), s); prefixURIs.put(prefix, tns); } catch (URISyntaxException e) { logger.warning(e.toString()); throw new SAXException(e); } }
Schema s = SchemaFactory.getInstance(tns, uri, logger.getLevel());
} else { XSISAXHandler.setLogLevel(logger.getLevel()); prefix = SchemaFactory.getInstance(namespaceURI).getPrefix();
} else { XSISAXHandler.setLogLevel(logger.getLevel()); prefix = SchemaFactory.getInstance(namespaceURI).getPrefix();
} else { XSISAXHandler.setLogLevel(logger.getLevel()); prefix = SchemaFactory.getInstance(namespaceURI).getPrefix();
incURI = thisURI.normalize().resolve(inc.getSchemaLocation()); cs = SchemaFactory.getInstance(targetNamespace, incURI, logger.getLevel()); SchemaFactory.getInstance( imp.getNamespace(), incURI, logger.getLevel());
so.add(SchemaFactory.getInstance(uri)); targNS.remove(nsIndex); } else { URI uri = new URI(stringOrder[i]); so.add(SchemaFactory.getInstance(uri));
Schema s = SchemaFactory.getInstance(attributeGroup.getNamespace()); ai.addAttribute("", "ref", "", "QName", s.getPrefix() + ":" + attributeGroup.getName());
Schema s = SchemaFactory.getInstance(group.getNamespace()); ai.addAttribute("", "ref", "", "QName", s.getPrefix() + ":" + group.getName());
ai = new AttributesImpl(); XSISAXHandler.setLogLevel(logger.getLevel()); Schema s = SchemaFactory.getInstance(st.getNamespace()); ai.addAttribute("", "base", "", "QName", s.getPrefix() + ":" + st.getName()); ai = new AttributesImpl(); Schema s = SchemaFactory.getInstance(st.getNamespace()); ai.addAttribute( "", "itemType", "", "QName", s.getPrefix() + ":" + st.getName()); ai = new AttributesImpl(); Schema s = SchemaFactory.getInstance(st.getNamespace());
found = true; XSISAXHandler.setLogLevel(logger.getLevel()); Schema s = SchemaFactory.getInstance(attribute.getNamespace()); Schema s = SchemaFactory.getInstance(attribute.getNamespace()); ai.addAttribute("", "ref", "", "QName", s.getPrefix() + ":" + attribute.getName());
found = true; XSISAXHandler.setLogLevel(logger.getLevel()); Schema s = SchemaFactory.getInstance(element.getNamespace()); Schema s = SchemaFactory.getInstance(element.getNamespace()); ai.addAttribute("", "ref", "", "QName", s.getPrefix() + ":" + element.getName()); .equals(schema.getTargetNamespace())) { Schema sss = SchemaFactory.getInstance(element.getSubstitutionGroup().getNamespace()); s = sss.getPrefix() + ":";