Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
4ff5f207
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4ff5f207
编写于
3月 11, 2017
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XML utils code cleanup. SAX parser fix (custom handlers).
上级
ceb541d9
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
278 addition
and
308 deletion
+278
-308
modules/org.jkiss.utils/src/org/jkiss/utils/xml/SAXListener.java
.../org.jkiss.utils/src/org/jkiss/utils/xml/SAXListener.java
+5
-5
modules/org.jkiss.utils/src/org/jkiss/utils/xml/SAXReader.java
...es/org.jkiss.utils/src/org/jkiss/utils/xml/SAXReader.java
+53
-47
modules/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
...les/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
+218
-241
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/formatter/DataFormatterRegistry.java
...iss/dbeaver/registry/formatter/DataFormatterRegistry.java
+1
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/ViewerColumnRegistry.java
...c/org/jkiss/dbeaver/ui/controls/ViewerColumnRegistry.java
+1
-8
未找到文件。
modules/org.jkiss.utils/src/org/jkiss/utils/xml/SAXListener.java
浏览文件 @
4ff5f207
...
...
@@ -24,19 +24,19 @@ import org.xml.sax.Attributes;
*/
public
interface
SAXListener
{
public
void
saxStartElement
(
void
saxStartElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
,
org
.
xml
.
sax
.
Attributes
atts
)
throws
XMLException
;
public
void
saxText
(
void
saxText
(
SAXReader
reader
,
String
data
)
throws
XMLException
;
public
void
saxEndElement
(
void
saxEndElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
)
...
...
@@ -46,7 +46,7 @@ public interface SAXListener {
/**
* Empty listener supposed to skip element subtrees
*/
public
static
class
Empty
Listener
implements
SAXListener
{
class
Base
Listener
implements
SAXListener
{
@Override
public
void
saxStartElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
,
Attributes
atts
)
throws
XMLException
{
...
...
@@ -60,6 +60,6 @@ public interface SAXListener {
public
void
saxEndElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
)
throws
XMLException
{
}
}
public
static
final
SAXListener
EMPTY_LISTENER
=
new
Empty
Listener
();
SAXListener
EMPTY_LISTENER
=
new
Base
Listener
();
}
modules/org.jkiss.utils/src/org/jkiss/utils/xml/SAXReader.java
浏览文件 @
4ff5f207
...
...
@@ -16,6 +16,11 @@
*/
package
org.jkiss.utils.xml
;
import
org.xml.sax.*
;
import
javax.xml.parsers.FactoryConfigurationError
;
import
javax.xml.parsers.ParserConfigurationException
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -24,7 +29,7 @@ import java.util.Map;
/**
* SAX document reader
*/
public
final
class
SAXReader
implements
org
.
xml
.
sax
.
Content
Handler
{
public
final
class
SAXReader
implements
ContentHandler
,
EntityResolver
,
DTD
Handler
{
public
static
final
int
DEFAULT_POOL_SIZE
=
10
;
...
...
@@ -32,7 +37,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
private
static
List
<
Parser
>
parsersPool
=
new
ArrayList
<>();
private
org
.
xml
.
sax
.
InputSource
inputSource
;
private
org
.
xml
.
sax
.
Locator
locator
;
private
Locator
locator
;
private
Map
<
String
,
Object
>
attributes
=
new
HashMap
<>();
private
List
<
SAXListener
>
elementLayers
=
new
ArrayList
<>();
...
...
@@ -52,8 +57,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
* Standard constructor.
* Initialize parser and prepare input stream for reading.
*/
public
SAXReader
(
java
.
io
.
InputStream
stream
)
{
public
SAXReader
(
InputStream
stream
)
{
this
();
inputSource
=
new
org
.
xml
.
sax
.
InputSource
(
stream
);
}
...
...
@@ -62,8 +66,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
* Standard constructor.
* Initialize parser and prepare input stream for reading.
*/
public
SAXReader
(
java
.
io
.
Reader
reader
)
{
public
SAXReader
(
Reader
reader
)
{
this
();
inputSource
=
new
org
.
xml
.
sax
.
InputSource
(
reader
);
}
...
...
@@ -77,35 +80,36 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
handleWhiteSpaces
=
flag
;
}
public
org
.
xml
.
sax
.
Locator
getLocator
()
{
public
Locator
getLocator
()
{
return
locator
;
}
/**
* Parse input stream and handle XML tags.
*/
public
void
parse
(
SAXListener
listener
)
throws
java
.
io
.
IOException
,
XMLException
{
public
void
parse
(
SAXListener
listener
)
throws
IOException
,
XMLException
{
// Initialize SAX parser
Parser
parser
=
acquireParser
();
// Get reader and parse using SAX2 API
try
{
org
.
xml
.
sax
.
XMLReader
saxReader
=
parser
.
getSAXParser
().
getXMLReader
();
XMLReader
saxReader
=
parser
.
getSAXParser
().
getXMLReader
();
saxReader
.
setErrorHandler
(
new
ParseErrorHandler
());
saxReader
.
setContentHandler
(
this
);
saxReader
.
setEntityResolver
(
this
);
saxReader
.
setDTDHandler
(
this
);
curListener
=
listener
;
elementLayers
.
add
(
listener
);
saxReader
.
parse
(
inputSource
);
}
catch
(
org
.
xml
.
sax
.
SAXParseException
toCatch
)
{
}
catch
(
SAXParseException
toCatch
)
{
throw
new
XMLException
(
"Document parse error (line "
+
toCatch
.
getLineNumber
()
+
", pos "
+
toCatch
.
getColumnNumber
(),
toCatch
);
}
catch
(
org
.
xml
.
sax
.
SAXException
toCatch
)
{
}
catch
(
SAXException
toCatch
)
{
throw
new
XMLException
(
"Document reading SAX exception"
,
XMLUtils
.
adaptSAXException
(
toCatch
));
...
...
@@ -114,15 +118,14 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
}
}
public
synchronized
static
Parser
acquireParser
()
throws
XMLException
{
public
synchronized
static
Parser
acquireParser
()
throws
XMLException
{
try
{
if
(
saxParserFactory
==
null
)
{
try
{
saxParserFactory
=
javax
.
xml
.
parsers
.
SAXParserFactory
.
newInstance
();
saxParserFactory
.
setNamespaceAware
(
true
);
saxParserFactory
.
setValidating
(
false
);
}
catch
(
javax
.
xml
.
parsers
.
FactoryConfigurationError
toCatch
)
{
}
catch
(
FactoryConfigurationError
toCatch
)
{
throw
new
XMLException
(
"SAX factory configuration error"
,
toCatch
);
...
...
@@ -150,11 +153,11 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
Parser
parser
=
new
Parser
(
saxParserFactory
.
newSAXParser
(),
true
);
parsersPool
.
add
(
parser
);
return
parser
;
}
catch
(
javax
.
xml
.
parsers
.
ParserConfigurationException
toCatch
)
{
}
catch
(
ParserConfigurationException
toCatch
)
{
throw
new
XMLException
(
"SAX Parser Configuration error"
,
toCatch
);
}
catch
(
org
.
xml
.
sax
.
SAXException
toCatch
)
{
}
catch
(
SAXException
toCatch
)
{
throw
new
XMLException
(
"SAX Parser error"
,
toCatch
);
...
...
@@ -203,14 +206,14 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
}
private
void
handleText
()
throws
org
.
xml
.
sax
.
SAXException
{
throws
SAXException
{
curListener
=
elementLayers
.
get
(
elementLayers
.
size
()
-
1
);
try
{
String
value
=
textValue
.
toString
();
curListener
.
saxText
(
this
,
value
);
}
catch
(
Exception
toCatch
)
{
throw
new
org
.
xml
.
sax
.
SAXException
(
toCatch
);
throw
new
SAXException
(
toCatch
);
}
finally
{
textValue
.
setLength
(
0
);
}
...
...
@@ -236,7 +239,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
String
localName
,
String
qName
,
org
.
xml
.
sax
.
Attributes
attributes
)
throws
org
.
xml
.
sax
.
SAXException
{
throws
SAXException
{
if
(
depth
++
>
0
)
{
this
.
handleText
();
}
...
...
@@ -246,7 +249,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
try
{
curListener
.
saxStartElement
(
this
,
namespaceURI
,
localName
,
attributes
);
}
catch
(
XMLException
toCatch
)
{
throw
new
org
.
xml
.
sax
.
SAXException
(
toCatch
);
throw
new
SAXException
(
toCatch
);
}
elementLayers
.
add
(
curListener
);
...
...
@@ -257,7 +260,7 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
String
namespaceURI
,
String
localName
,
String
qName
)
throws
org
.
xml
.
sax
.
SAXException
{
throws
SAXException
{
this
.
handleText
();
elementLayers
.
remove
(
elementLayers
.
size
()
-
1
);
...
...
@@ -266,61 +269,64 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
try
{
curListener
.
saxEndElement
(
this
,
namespaceURI
,
localName
);
}
catch
(
XMLException
toCatch
)
{
throw
new
org
.
xml
.
sax
.
SAXException
(
toCatch
);
throw
new
SAXException
(
toCatch
);
}
depth
--;
}
@Override
public
void
startPrefixMapping
(
String
prefix
,
String
uri
)
{
public
void
startPrefixMapping
(
String
prefix
,
String
uri
)
{
// just do-nothing
}
@Override
public
void
endPrefixMapping
(
String
prefix
)
{
public
void
endPrefixMapping
(
String
prefix
)
{
// just do-nothing
}
@Override
public
void
characters
(
char
[]
ch
,
int
start
,
int
length
)
{
public
void
characters
(
char
[]
ch
,
int
start
,
int
length
)
{
textValue
.
append
(
ch
,
start
,
length
);
}
@Override
public
void
ignorableWhitespace
(
char
[]
ch
,
int
start
,
int
length
)
{
public
void
ignorableWhitespace
(
char
[]
ch
,
int
start
,
int
length
)
{
if
(
handleWhiteSpaces
)
{
textValue
.
append
(
ch
,
start
,
length
);
}
}
@Override
public
void
processingInstruction
(
String
target
,
String
data
)
{
public
void
processingInstruction
(
String
target
,
String
data
)
{
// just do-nothing
}
@Override
public
void
setDocumentLocator
(
org
.
xml
.
sax
.
Locator
locator
)
{
public
void
setDocumentLocator
(
Locator
locator
)
{
this
.
locator
=
locator
;
}
@Override
public
void
skippedEntity
(
String
name
)
{
public
void
skippedEntity
(
String
name
)
{
// just do-nothing
}
@Override
public
InputSource
resolveEntity
(
String
publicId
,
String
systemId
)
throws
SAXException
,
IOException
{
// Return empty stream - we don't need entities by default
return
new
InputSource
(
new
StringReader
(
""
));
}
@Override
public
void
notationDecl
(
String
name
,
String
publicId
,
String
systemId
)
throws
SAXException
{
// do nothing
}
@Override
public
void
unparsedEntityDecl
(
String
name
,
String
publicId
,
String
systemId
,
String
notationName
)
throws
SAXException
{
// do nothing
}
static
public
class
Parser
{
private
javax
.
xml
.
parsers
.
SAXParser
saxParser
;
private
boolean
isAcquired
;
...
...
@@ -354,17 +360,17 @@ public final class SAXReader implements org.xml.sax.ContentHandler {
static
class
ParseErrorHandler
implements
org
.
xml
.
sax
.
ErrorHandler
{
@Override
public
void
error
(
org
.
xml
.
sax
.
SAXParseException
exception
)
{
public
void
error
(
SAXParseException
exception
)
{
}
@Override
public
void
fatalError
(
org
.
xml
.
sax
.
SAXParseException
exception
)
{
public
void
fatalError
(
SAXParseException
exception
)
{
}
@Override
public
void
warning
(
org
.
xml
.
sax
.
SAXParseException
exception
)
{
public
void
warning
(
SAXParseException
exception
)
{
}
...
...
modules/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
浏览文件 @
4ff5f207
...
...
@@ -19,11 +19,15 @@ package org.jkiss.utils.xml;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.w3c.dom.Document
;
import
org.w3c.dom.Element
;
import
org.xml.sax.InputSource
;
import
javax.xml.parsers.DocumentBuilder
;
import
javax.xml.parsers.DocumentBuilderFactory
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
...
...
@@ -31,54 +35,41 @@ import java.util.List;
/**
* Common XML utils
*/
public
class
XMLUtils
{
public
class
XMLUtils
{
public
static
org
.
w3c
.
dom
.
Document
parseDocument
(
String
fileName
)
throws
XMLException
{
public
static
Document
parseDocument
(
String
fileName
)
throws
XMLException
{
return
parseDocument
(
new
java
.
io
.
File
(
fileName
));
}
public
static
org
.
w3c
.
dom
.
Document
parseDocument
(
java
.
io
.
File
file
)
throws
XMLException
{
try
{
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
xmlBuilder
=
dbf
.
newDocumentBuilder
();
return
xmlBuilder
.
parse
(
file
);
}
catch
(
Exception
er
)
{
throw
new
XMLException
(
"Error parsing XML document"
,
er
);
public
static
Document
parseDocument
(
java
.
io
.
File
file
)
throws
XMLException
{
try
(
InputStream
is
=
new
FileInputStream
(
file
))
{
return
parseDocument
(
new
InputSource
(
is
));
}
catch
(
IOException
e
)
{
throw
new
XMLException
(
"Error opening file '"
+
file
+
"'"
,
e
);
}
}
public
static
org
.
w3c
.
dom
.
Document
parseDocument
(
java
.
io
.
InputStream
is
)
throws
XMLException
{
try
{
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
xmlBuilder
=
dbf
.
newDocumentBuilder
();
return
xmlBuilder
.
parse
(
is
);
}
catch
(
Exception
er
)
{
throw
new
XMLException
(
"Error parsing XML document"
,
er
);
public
static
Document
parseDocument
(
java
.
io
.
InputStream
is
)
throws
XMLException
{
return
parseDocument
(
new
InputSource
(
is
));
}
public
static
Document
parseDocument
(
java
.
io
.
Reader
is
)
throws
XMLException
{
return
parseDocument
(
new
InputSource
(
is
));
}
public
static
org
.
w3c
.
dom
.
Document
parseDocument
(
java
.
io
.
Reader
is
)
throws
XMLException
{
public
static
Document
parseDocument
(
InputSource
source
)
throws
XMLException
{
try
{
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
xmlBuilder
=
dbf
.
newDocumentBuilder
();
return
xmlBuilder
.
parse
(
new
InputSource
(
is
)
);
return
xmlBuilder
.
parse
(
source
);
}
catch
(
Exception
er
)
{
throw
new
XMLException
(
"Error parsing XML document"
,
er
);
}
}
public
static
org
.
w3c
.
dom
.
Document
createDocument
()
throws
XMLException
{
public
static
Document
createDocument
()
throws
XMLException
{
try
{
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
xmlBuilder
=
dbf
.
newDocumentBuilder
();
...
...
@@ -89,8 +80,7 @@ public class XMLUtils
}
public
static
Element
getChildElement
(
Element
element
,
String
childName
)
{
String
childName
)
{
for
(
org
.
w3c
.
dom
.
Node
node
=
element
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
&&
((
Element
)
node
).
getTagName
().
equals
(
childName
))
{
...
...
@@ -102,8 +92,7 @@ public class XMLUtils
@Nullable
public
static
String
getChildElementBody
(
Element
element
,
String
childName
)
{
String
childName
)
{
for
(
org
.
w3c
.
dom
.
Node
node
=
element
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
&&
((
Element
)
node
).
getTagName
().
equals
(
childName
))
{
...
...
@@ -114,8 +103,7 @@ public class XMLUtils
}
@Nullable
public
static
String
getElementBody
(
Element
element
)
{
public
static
String
getElementBody
(
Element
element
)
{
org
.
w3c
.
dom
.
Node
valueNode
=
element
.
getFirstChild
();
if
(
valueNode
==
null
)
{
return
null
;
...
...
@@ -131,13 +119,11 @@ public class XMLUtils
@NotNull
public
static
List
<
Element
>
getChildElementList
(
Element
parent
,
String
nodeName
)
{
String
nodeName
)
{
List
<
Element
>
list
=
new
ArrayList
<>();
for
(
org
.
w3c
.
dom
.
Node
node
=
parent
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
&&
nodeName
.
equals
(
node
.
getNodeName
()))
{
nodeName
.
equals
(
node
.
getNodeName
()))
{
list
.
add
((
Element
)
node
);
}
}
...
...
@@ -148,13 +134,11 @@ public class XMLUtils
@NotNull
public
static
Collection
<
Element
>
getChildElementListNS
(
Element
parent
,
String
nsURI
)
{
String
nsURI
)
{
List
<
Element
>
list
=
new
ArrayList
<>();
for
(
org
.
w3c
.
dom
.
Node
node
=
parent
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
&&
node
.
getNamespaceURI
().
equals
(
nsURI
))
{
node
.
getNamespaceURI
().
equals
(
nsURI
))
{
list
.
add
((
Element
)
node
);
}
}
...
...
@@ -165,14 +149,12 @@ public class XMLUtils
public
static
Collection
<
Element
>
getChildElementListNS
(
Element
parent
,
String
nodeName
,
String
nsURI
)
{
String
nsURI
)
{
List
<
Element
>
list
=
new
ArrayList
<>();
for
(
org
.
w3c
.
dom
.
Node
node
=
parent
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
&&
node
.
getLocalName
().
equals
(
nodeName
)
&&
node
.
getNamespaceURI
().
equals
(
nsURI
))
{
node
.
getLocalName
().
equals
(
nodeName
)
&&
node
.
getNamespaceURI
().
equals
(
nsURI
))
{
list
.
add
((
Element
)
node
);
}
}
...
...
@@ -183,13 +165,12 @@ public class XMLUtils
@NotNull
public
static
Collection
<
Element
>
getChildElementList
(
Element
parent
,
String
[]
nodeNameList
)
{
String
[]
nodeNameList
)
{
List
<
Element
>
list
=
new
ArrayList
<>();
for
(
org
.
w3c
.
dom
.
Node
node
=
parent
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
)
{
for
(
int
i
=
0
;
i
<
nodeNameList
.
length
;
i
++)
{
if
(
node
.
getNodeName
().
equals
(
nodeNameList
[
i
]
))
{
if
(
node
.
getNodeName
().
equals
(
nodeNameList
[
i
]
))
{
list
.
add
((
Element
)
node
);
}
}
...
...
@@ -201,12 +182,10 @@ public class XMLUtils
// Find one child element with specified name
@Nullable
public
static
Element
findChildElement
(
Element
parent
)
{
Element
parent
)
{
for
(
org
.
w3c
.
dom
.
Node
node
=
parent
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
)
{
return
(
Element
)
node
;
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
)
{
return
(
Element
)
node
;
}
}
return
null
;
...
...
@@ -216,7 +195,7 @@ public class XMLUtils
if
(
obj
==
null
)
{
return
null
;
}
else
if
(
obj
instanceof
CharSequence
)
{
return
escapeXml
((
CharSequence
)
obj
);
return
escapeXml
((
CharSequence
)
obj
);
}
else
{
return
obj
;
}
...
...
@@ -248,8 +227,7 @@ public class XMLUtils
return
res
==
null
?
str
.
toString
()
:
res
.
toString
();
}
public
static
boolean
isValidXMLChar
(
char
c
)
{
public
static
boolean
isValidXMLChar
(
char
c
)
{
return
(
c
>=
32
||
c
==
'\n'
||
c
==
'\r'
||
c
==
'\t'
);
}
...
...
@@ -276,13 +254,12 @@ public class XMLUtils
}
}
public
static
XMLException
adaptSAXException
(
Exception
toCatch
)
{
public
static
XMLException
adaptSAXException
(
Exception
toCatch
)
{
if
(
toCatch
instanceof
XMLException
)
{
return
(
XMLException
)
toCatch
;
return
(
XMLException
)
toCatch
;
}
else
if
(
toCatch
instanceof
org
.
xml
.
sax
.
SAXException
)
{
String
message
=
toCatch
.
getMessage
();
Exception
embedded
=
((
org
.
xml
.
sax
.
SAXException
)
toCatch
).
getException
();
Exception
embedded
=
((
org
.
xml
.
sax
.
SAXException
)
toCatch
).
getException
();
if
(
embedded
!=
null
&&
embedded
.
getMessage
()
!=
null
&&
embedded
.
getMessage
().
equals
(
message
))
{
// Just SAX wrapper - skip it
return
adaptSAXException
(
embedded
);
...
...
@@ -300,7 +277,7 @@ public class XMLUtils
List
<
Element
>
children
=
new
ArrayList
<>();
for
(
org
.
w3c
.
dom
.
Node
node
=
element
.
getFirstChild
();
node
!=
null
;
node
=
node
.
getNextSibling
())
{
if
(
node
.
getNodeType
()
==
org
.
w3c
.
dom
.
Node
.
ELEMENT_NODE
)
{
children
.
add
((
Element
)
node
);
children
.
add
((
Element
)
node
);
}
}
return
children
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/formatter/DataFormatterRegistry.java
浏览文件 @
4ff5f207
...
...
@@ -213,7 +213,7 @@ public class DataFormatterRegistry
}
}
private
class
FormattersParser
implements
SAX
Listener
private
class
FormattersParser
extends
SAXListener
.
Base
Listener
{
private
String
profileName
;
private
SimplePreferenceStore
curStore
;
...
...
@@ -234,12 +234,6 @@ public class DataFormatterRegistry
}
}
@Override
public
void
saxText
(
SAXReader
reader
,
String
data
)
throws
XMLException
{
}
@Override
public
void
saxEndElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
)
throws
XMLException
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/ViewerColumnRegistry.java
浏览文件 @
4ff5f207
...
...
@@ -159,7 +159,7 @@ class ViewerColumnRegistry {
}
private
class
ColumnsParser
implements
SAX
Listener
{
private
class
ColumnsParser
extends
SAXListener
.
Base
Listener
{
private
List
<
ColumnState
>
curColumnState
=
null
;
...
...
@@ -188,12 +188,5 @@ class ViewerColumnRegistry {
}
}
@Override
public
void
saxText
(
SAXReader
reader
,
String
data
)
throws
XMLException
{
}
@Override
public
void
saxEndElement
(
SAXReader
reader
,
String
namespaceURI
,
String
localName
)
throws
XMLException
{
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录