Package org.openrefine.wikibase.schema
Class WbLanguageVariable
- java.lang.Object
-
- org.openrefine.wikibase.schema.WbVariableExpr<String>
-
- org.openrefine.wikibase.schema.WbLanguageVariable
-
- All Implemented Interfaces:
WbExpression<String>
public class WbLanguageVariable extends WbVariableExpr<String>
A language variable generates a language code from a cell. It checks its values against a known list of valid language codes and fixes on the fly the deprecated ones (seeWbLanguageConstant
).
-
-
Field Summary
-
Fields inherited from class org.openrefine.wikibase.schema.WbVariableExpr
NO_VALUE_KEYWORD, SOME_VALUE_KEYWORD
-
-
Constructor Summary
Constructors Constructor Description WbLanguageVariable()
WbLanguageVariable(String columnName)
Constructs a variable and sets the column it is bound to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
String
fromCell(Cell cell, ExpressionContext ctxt)
Method that should be implemented by subclasses, converting an OpenRefine cell to a Wikibase value.-
Methods inherited from class org.openrefine.wikibase.schema.WbVariableExpr
equalAsVariables, evaluate, getColumnName, hashCode, setColumnName, validate
-
-
-
-
Constructor Detail
-
WbLanguageVariable
public WbLanguageVariable()
-
WbLanguageVariable
public WbLanguageVariable(String columnName)
Constructs a variable and sets the column it is bound to. Mostly used as a convenience method for testing.- Parameters:
columnName
- the name of the column the expression should draw its value from
-
-
Method Detail
-
fromCell
public String fromCell(Cell cell, ExpressionContext ctxt) throws SkipSchemaExpressionException
Description copied from class:WbVariableExpr
Method that should be implemented by subclasses, converting an OpenRefine cell to a Wikibase value. Access to other values and emitting warnings is possible via the supplied EvaluationContext object.- Specified by:
fromCell
in classWbVariableExpr<String>
- Parameters:
cell
- the cell to convertctxt
- the evaluation context- Returns:
- the corresponding Wikibase value
- Throws:
SkipSchemaExpressionException
-
-