Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cines Vitamui
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dad
Cines Vitamui
Commits
6c5c2fc5
Commit
6c5c2fc5
authored
2 years ago
by
descamps
Browse files
Options
Downloads
Patches
Plain Diff
Correction checkmarks
parent
472599ba
Branches
correction_faille_securite
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java
+5
-6
5 additions, 6 deletions
...fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java
with
5 additions
and
6 deletions
api/api-pastis/pastis-commons/src/main/java/fr/gouv/vitamui/pastis/common/util/PastisSAX2Handler.java
+
5
−
6
View file @
6c5c2fc5
...
...
@@ -43,15 +43,14 @@ import org.xml.sax.Attributes;
import
org.xml.sax.SAXException
;
import
org.xml.sax.helpers.DefaultHandler
;
import
java.util.ArrayDeque
;
import
java.util.Deque
;
import
java.util.Stack
;
public
class
PastisSAX2Handler
extends
DefaultHandler
{
@Getter
private
ElementRNG
elementRNGRoot
;
boolean
isValue
;
private
Deque
<
ElementRNG
>
stackRNG
=
new
ArrayDeque
<>();
private
Stack
<
ElementRNG
>
stackRNG
=
new
Stack
<>();
private
boolean
isInDocumentationTag
;
private
StringBuilder
documentationContent
;
...
...
@@ -81,7 +80,7 @@ public class PastisSAX2Handler extends DefaultHandler {
elementRNG
.
setType
(
localName
);
elementRNG
.
setDataType
(
attr
.
getValue
(
"type"
));
if
(!
stackRNG
.
isEmpty
())
{
ElementRNG
e
=
stackRNG
.
getLas
t
();
ElementRNG
e
=
stackRNG
.
lastElemen
t
();
elementRNG
.
setParent
(
e
);
e
.
getChildren
().
add
(
elementRNG
);
}
...
...
@@ -129,11 +128,11 @@ public class PastisSAX2Handler extends DefaultHandler {
public
void
characters
(
char
[]
caracteres
,
int
start
,
int
length
)
throws
SAXException
{
if
(
isInDocumentationTag
)
{
documentationContent
.
append
(
new
String
(
caracteres
,
start
,
length
));
stackRNG
.
getLas
t
().
setValue
(
documentationContent
.
toString
());
stackRNG
.
lastElemen
t
().
setValue
(
documentationContent
.
toString
());
}
if
(
isValue
)
{
String
valueContent
=
new
String
(
caracteres
,
start
,
length
);
stackRNG
.
getLas
t
().
setValue
(
valueContent
);
stackRNG
.
lastElemen
t
().
setValue
(
valueContent
);
this
.
isValue
=
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment