mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8130078: Document better processing
Reviewed-by: dfuchs, lancea, ahgross
This commit is contained in:
parent
1e46af2eae
commit
7ed29c81ee
3 changed files with 37 additions and 5 deletions
|
@ -379,6 +379,26 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
|
|||
|
||||
} // scanDTDInternalSubset(boolean,boolean,boolean):boolean
|
||||
|
||||
/**
|
||||
* Skip the DTD if javax.xml.stream.supportDTD is false.
|
||||
*
|
||||
* @param supportDTD The value of the property javax.xml.stream.supportDTD.
|
||||
* @return true if DTD is skipped, false otherwise.
|
||||
* @throws java.io.IOException if i/o error occurs
|
||||
*/
|
||||
@Override
|
||||
public boolean skipDTD(boolean supportDTD) throws IOException {
|
||||
if (!supportDTD) {
|
||||
fStringBuffer.clear();
|
||||
if (!fEntityScanner.scanData("]", fStringBuffer)) {
|
||||
fEntityScanner.fCurrentEntity.position--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// XMLComponent methods
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -1095,11 +1095,14 @@ public class XMLDocumentScannerImpl
|
|||
again = false;
|
||||
switch (fScannerState) {
|
||||
case SCANNER_STATE_DTD_INTERNAL_DECLS: {
|
||||
// REVISIT: Should there be a feature for
|
||||
// the "complete" parameter?
|
||||
boolean completeDTD = true;
|
||||
boolean moreToScan = false;
|
||||
if (!fDTDScanner.skipDTD(fSupportDTD)) {
|
||||
// REVISIT: Should there be a feature for
|
||||
// the "complete" parameter?
|
||||
boolean completeDTD = true;
|
||||
|
||||
boolean moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD);
|
||||
moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD);
|
||||
}
|
||||
Entity entity = fEntityScanner.getCurrentEntity();
|
||||
if(entity instanceof Entity.ScannedEntity){
|
||||
fEndPos=((Entity.ScannedEntity)entity).position;
|
||||
|
|
|
@ -96,5 +96,14 @@ public interface XMLDTDScanner
|
|||
public boolean scanDTDExternalSubset(boolean complete)
|
||||
throws IOException, XNIException;
|
||||
|
||||
/**
|
||||
* Skip the DTD if javax.xml.stream.supportDTD is false.
|
||||
* @param supportDTD The value of the property javax.xml.stream.supportDTD.
|
||||
* @return true if DTD is skipped, false otherwise.
|
||||
* @throws java.io.IOException if i/o error occurs
|
||||
*/
|
||||
public boolean skipDTD(boolean supportDTD)
|
||||
throws IOException;
|
||||
|
||||
public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer);
|
||||
} // interface XMLDTDScanner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue