Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Willms
hfc
Commits
6b92d82f
Commit
6b92d82f
authored
Jul 03, 2018
by
Christian Willms
Browse files
Merge branch 'developer' of mlt-gitlab.sb.dfki.de:kiefer/hfc into developer
parents
b950b7e1
215a3f40
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
6b92d82f
...
...
@@ -7,7 +7,7 @@
<groupId>
de.dfki.lt.hfc
</groupId>
<artifactId>
hfc
</artifactId>
<version>
1.2.
0
-SNAPSHOT
</version>
<version>
1.2.
2
-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<inceptionYear>
2015
</inceptionYear>
...
...
src/main/java/de/dfki/lt/hfc/types/XsdString.java
View file @
6b92d82f
...
...
@@ -80,19 +80,11 @@ public final class XsdString extends XsdAnySimpleType {
this
.
languageTag
=
languageTag
;
}
/**
* depending on shortIsDefault, either the suffix
* de.dfki.lt.hfc.Namespace.SHORT_NAME
* or
* de.dfki.lt.hfc.Namespace.LONG_NAME
* is used;
* shortIsDefault is ignored in case a language tag is available
*/
public
String
toString
(
boolean
shortIsDefault
)
{
private
static
String
toString
(
String
val
,
String
languageTag
,
boolean
shortIsDefault
)
{
StringBuilder
sb
=
new
StringBuilder
(
"\""
);
sb
.
append
(
Utils
.
stringToExternal
(
this
.
val
ue
));
sb
.
append
(
Utils
.
stringToExternal
(
val
));
sb
.
append
(
"\""
);
if
(
this
.
languageTag
!=
null
)
{
if
(
languageTag
!=
null
)
{
sb
.
append
(
"@"
);
sb
.
append
(
languageTag
);
}
...
...
@@ -106,18 +98,23 @@ public final class XsdString extends XsdAnySimpleType {
return
sb
.
toString
();
}
/**
* depending on shortIsDefault, either the suffix
* de.dfki.lt.hfc.Namespace.SHORT_NAME
* or
* de.dfki.lt.hfc.Namespace.LONG_NAME
* is used;
* shortIsDefault is ignored in case a language tag is available
*/
public
String
toString
(
boolean
shortIsDefault
)
{
return
toString
(
this
.
value
,
this
.
languageTag
,
shortIsDefault
);
}
/**
* binary version is given the value directly;
*/
public
static
String
toString
(
String
val
,
boolean
shortIsDefault
)
{
StringBuilder
sb
=
new
StringBuilder
(
"\""
);
sb
.
append
(
val
);
sb
.
append
(
"\"^^"
);
if
(
shortIsDefault
)
sb
.
append
(
SHORT_NAME
);
else
sb
.
append
(
LONG_NAME
);
return
sb
.
toString
();
return
toString
(
val
,
null
,
shortIsDefault
);
}
/**
...
...
@@ -129,13 +126,27 @@ public final class XsdString extends XsdAnySimpleType {
}
/**
* we return the pure string
_without_
the language tag
* we return the pure string
if there is no
the language tag
*/
public
Object
toJava
()
{
return
this
.
languageTag
==
null
?
this
.
value
:
this
;
}
/**
* return only the string, ignoring the language tag
*/
public
String
toCharSequence
()
{
return
this
.
value
;
}
/** Two XsdString objects are equal if value and language tag are equal
/**
* return the language tag of this XsdString
*/
public
String
getLanguageTag
()
{
return
this
.
getLanguageTag
();
}
/** two XsdString objects are equal if value and language tag are equal
*/
public
boolean
equals
(
Object
o
)
{
if
(
o
instanceof
String
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment