@Override public void setDocumentLocator(Locator locator) { pLocator = locator; super.setDocumentLocator(locator); }
/** * Create the root-level Namespace context. */ Context () { copyTables(); }
/** * Copy an existing Attributes object. * * <p>This constructor is especially useful inside a * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p> * * @param atts The existing Attributes object. */ public AttributesImpl (Attributes atts) { setAttributes(atts); }
/** * Create an {@code XMLReader} that this marshaller will when passed an empty {@code SAXSource}. * @return the XMLReader * @throws SAXException if thrown by JAXP methods */ @SuppressWarnings("deprecation") // on JDK 9 protected XMLReader createXmlReader() throws SAXException { XMLReader xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", !isSupportDtd()); xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", isProcessExternalEntities()); if (!isProcessExternalEntities()) { xmlReader.setEntityResolver(NO_OP_ENTITY_RESOLVER); } return xmlReader; }
@Override public Object answer(InvocationOnMock invocation) throws Throwable { invocation.getArguments()[3] = new AttributesImpl((Attributes) invocation.getArguments()[3]); return null; } }).given(contentHandler).startElement(anyString(), anyString(), anyString(), any(Attributes.class));
/** * Create a new adapter. * * <p>Use the "org.xml.sax.driver" property to locate the SAX2 * driver to embed.</p> * * @exception org.xml.sax.SAXException If the embedded driver * cannot be instantiated or if the * org.xml.sax.driver property is not specified. */ public XMLReaderAdapter () throws SAXException { setup(XMLReaderFactory.createXMLReader()); }
public ClassWhichUsesSomeClassesInOrgXMLSaxPackage() { Attributes locator = null; DefaultHandler handler = new DefaultHandler(); handler.getClass(); }
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { super.startElement(uri, localName, qName, attributes); } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { elements.pop(); tagNames.pop(); super.endElement(uri, localName, qName); }
@Override public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); }
@Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); }
/** * Create a new Namespace support object. */ public NamespaceSupport () { reset(); }
@Override public void endPrefixMapping(String prefix) throws SAXException { super.endPrefixMapping(prefix); }
@Override public Parser getParser() { if (parser == null) { parser = new XMLReaderAdapter(reader); } return parser; }
/** * Construct an XML filter with the specified parent. * * @param parent the XML reader from which this filter receives its events. * * @see #setParent * @see #getParent */ public XMLFilterImpl (XMLReader parent) { setParent(parent); }
@Override public void unparsedEntityDecl(String name, String publicID, String systemID, String notationName) throws SAXException { super.unparsedEntityDecl(name, publicID, systemID, notationName); }
@Override public void notationDecl(String name, String publicID, String systemID) throws SAXException { super.notationDecl(name, publicID, systemID); }
@Before @SuppressWarnings("deprecation") // on JDK 9 public void createXMLReader() throws Exception { xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); }
@Before @SuppressWarnings("deprecation") // on JDK 9 public void setUp() throws Exception { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilder = documentBuilderFactory.newDocumentBuilder(); result = documentBuilder.newDocument(); xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); }
@Before @SuppressWarnings("deprecation") // on JDK 9 public void setUp() throws Exception { inputFactory = XMLInputFactory.newInstance(); standardReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); standardContentHandler = mockContentHandler(); standardReader.setContentHandler(standardContentHandler); }