public class DatamodelConverter extends Object implements SnakVisitor<Snak>, ValueVisitor<Value>
| Constructor and Description |
|---|
DatamodelConverter(DataObjectFactory dataObjectFactory)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Claim |
copy(Claim object)
Copies a
Claim. |
DatatypeIdValue |
copy(DatatypeIdValue object)
Copies a
DatatypeIdValue. |
GlobeCoordinatesValue |
copy(GlobeCoordinatesValue object)
Copies a
GlobeCoordinatesValue. |
ItemDocument |
copy(ItemDocument object)
Copies an
ItemDocument. |
ItemIdValue |
copy(ItemIdValue object)
Copies an
ItemIdValue. |
MonolingualTextValue |
copy(MonolingualTextValue object)
Copies a
MonolingualTextValue. |
NoValueSnak |
copy(NoValueSnak object)
Copies a
NoValueSnak. |
PropertyDocument |
copy(PropertyDocument object)
Copies a
PropertyDocument. |
PropertyIdValue |
copy(PropertyIdValue object)
Copies a
PropertyIdValue. |
QuantityValue |
copy(QuantityValue object)
Copies a
QuantityValue. |
Reference |
copy(Reference object)
Copies a
Reference. |
SiteLink |
copy(SiteLink object)
Copies a
SiteLink. |
SnakGroup |
copy(SnakGroup object)
Copies a
SnakGroup. |
SomeValueSnak |
copy(SomeValueSnak object)
Copies a
SomeValueSnak. |
Statement |
copy(Statement object)
Copies a
Statement. |
StatementGroup |
copy(StatementGroup object)
Copies a
StatementGroup. |
StringValue |
copy(StringValue object)
Copies a
StringValue. |
TimeValue |
copy(TimeValue object)
Copies a
TimeValue. |
ValueSnak |
copy(ValueSnak object)
Copies a
ValueSnak. |
Snak |
copySnak(Snak snak)
Copies a
Snak. |
Value |
copyValue(Value value)
Copies a
Value. |
Set<String> |
getOptionLanguageFilter()
Returns the (possibly empty) set of language codes that are used to
filter data while copying it, or null if no such filter is configured
(default).
|
Set<PropertyIdValue> |
getOptionPropertyFilter()
Returns the (possibly empty) set of
PropertyIdValue objects that
are used to filter statements while copying data, or null if no such
filter is configured (default). |
Set<String> |
getOptionSiteLinkFilter()
Returns the (possibly empty) set of site keys that are used to filter
SiteLink objects while copying data, or null if no such filter is
configured (default). |
boolean |
hasOptionDeepCopy()
Returns true if objects will be copied by deep copy, replacing all
subobjects recursively.
|
boolean |
hasOptionDeepCopyReferences()
Returns true if references will be copied when creating a deep copy of
statements.
|
void |
setOptionDeepCopy(boolean value)
Sets the value of the deep copy option.
|
void |
setOptionDeepCopyReferences(boolean value)
Sets the value of the deep copy references option.
|
void |
setOptionLanguageFilter(Set<String> languageFilter)
Sets the (possibly empty) set of language codes that are used to filter
data while copying it.
|
void |
setOptionPropertyFilter(Set<PropertyIdValue> propertyFilter)
Sets the (possibly empty) set of
PropertyIdValue objects that are
used to filter statements while copying data. |
void |
setOptionSiteLinkFilter(Set<String> siteLinkFilter)
Sets the (possibly empty) set of site keys that are used to filter
SiteLink objects while copying data. |
Value |
visit(DatatypeIdValue value)
Visits a DatatypeIdValue and returns a result.
|
Value |
visit(EntityIdValue value)
Visits a EntityIdValue and returns a result.
|
Value |
visit(GlobeCoordinatesValue value)
Visits a GlobeCoordinatesValue and returns a result.
|
Value |
visit(MonolingualTextValue value)
Visits a MonolingualTextValue and returns a result.
|
Snak |
visit(NoValueSnak snak)
Visits a NoValueSnak and returns a result.
|
Value |
visit(QuantityValue value)
Visits a QuantityValue and returns a result.
|
Snak |
visit(SomeValueSnak snak)
Visits a SomeValueSnak and returns a result.
|
Value |
visit(StringValue value)
Visits a StringValue and returns a result.
|
Value |
visit(TimeValue value)
Visits a TimeValue and returns a result.
|
Snak |
visit(ValueSnak snak)
Visits a ValueSnak and returns a result.
|
public DatamodelConverter(DataObjectFactory dataObjectFactory)
dataObjectFactory - the factory to use for creating new objectspublic boolean hasOptionDeepCopy()
public void setOptionDeepCopy(boolean value)
value - the value of the deep copy optionpublic boolean hasOptionDeepCopyReferences()
public void setOptionDeepCopyReferences(boolean value)
value - the value of the deep copy references optionpublic Set<String> getOptionLanguageFilter()
public void setOptionLanguageFilter(Set<String> languageFilter)
The language filter is not applied to monolingual text values in statements. Only labels, descriptions, and aliases are filtered.
languageFilter - set of language codes to restrict copying topublic Set<PropertyIdValue> getOptionPropertyFilter()
PropertyIdValue objects that
are used to filter statements while copying data, or null if no such
filter is configured (default). If not equal to null, only statements
using the given properties will be copied.public void setOptionPropertyFilter(Set<PropertyIdValue> propertyFilter)
PropertyIdValue objects that are
used to filter statements while copying data. Setting this to null
disables this filter (this is the default). If not equal to null, only
statements using the given properties will be copied.
The property filter is not applied to qualifiers and references in statements. Only the main property of statements is filtered.
propertyFilter - set of properties to use for filteringpublic Set<String> getOptionSiteLinkFilter()
SiteLink objects while copying data, or null if no such filter is
configured (default). If not equal to null, only site links for the given
sites will be copied.public void setOptionSiteLinkFilter(Set<String> siteLinkFilter)
SiteLink objects while copying data. Setting this to null
disables this filter (this is the default). If not equal to null, only
site links for the given sites will be copied.siteLinkFilter - set of site keys to use for filteringpublic ItemIdValue copy(ItemIdValue object)
ItemIdValue.object - object to copypublic PropertyIdValue copy(PropertyIdValue object)
PropertyIdValue.object - object to copypublic DatatypeIdValue copy(DatatypeIdValue object)
DatatypeIdValue.object - object to copypublic TimeValue copy(TimeValue object)
TimeValue.object - object to copypublic GlobeCoordinatesValue copy(GlobeCoordinatesValue object)
GlobeCoordinatesValue.object - object to copypublic StringValue copy(StringValue object)
StringValue.object - object to copypublic MonolingualTextValue copy(MonolingualTextValue object)
MonolingualTextValue. This method is not affected by the
language filter option (see
setOptionLanguageFilter(Set)).object - object to copypublic QuantityValue copy(QuantityValue object)
QuantityValue.object - object to copypublic ValueSnak copy(ValueSnak object)
ValueSnak.object - object to copypublic SomeValueSnak copy(SomeValueSnak object)
SomeValueSnak.object - object to copypublic NoValueSnak copy(NoValueSnak object)
NoValueSnak.object - object to copypublic SnakGroup copy(SnakGroup object)
SnakGroup.object - object to copypublic Claim copy(Claim object)
Claim.object - object to copypublic Reference copy(Reference object)
Reference.object - object to copypublic Statement copy(Statement object)
Statement.object - object to copypublic StatementGroup copy(StatementGroup object)
StatementGroup.
This method ignores filters set via setOptionPropertyFilter(Set).
object - object to copypublic SiteLink copy(SiteLink object)
SiteLink.
This method is not affected by the setting made via
setOptionSiteLinkFilter(Set).
object - object to copypublic PropertyDocument copy(PropertyDocument object)
PropertyDocument.object - object to copypublic ItemDocument copy(ItemDocument object)
ItemDocument.object - object to copypublic Snak copySnak(Snak snak)
Snak.snak - object to copypublic Snak visit(ValueSnak snak)
SnakVisitorvisit in interface SnakVisitor<Snak>snak - the snak to visitpublic Snak visit(SomeValueSnak snak)
SnakVisitorvisit in interface SnakVisitor<Snak>snak - the snak to visitpublic Snak visit(NoValueSnak snak)
SnakVisitorvisit in interface SnakVisitor<Snak>snak - the snak to visitpublic Value copyValue(Value value)
Value.value - object to copypublic Value visit(DatatypeIdValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(EntityIdValue value)
ValueVisitorItemIdValue and
PropertyIdValue. Since the set of possible subtypes can be
extended by extensions of Wikibase, the visitor only visits the general
(abstract) supertype. Implementations will have to decide if the given
specific type is supported and what to do with it.visit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(GlobeCoordinatesValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(MonolingualTextValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(QuantityValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(StringValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitpublic Value visit(TimeValue value)
ValueVisitorvisit in interface ValueVisitor<Value>value - the value to visitCopyright © 2014–2015 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage