Package org.openrefine.browsing.facets
Class ListFacet.ListFacetConfig
- java.lang.Object
-
- org.openrefine.browsing.facets.ListFacet.ListFacetConfig
-
- All Implemented Interfaces:
FacetConfig
- Enclosing class:
- ListFacet
public static class ListFacet.ListFacetConfig extends Object implements FacetConfig
-
-
Field Summary
Fields Modifier and Type Field Description StringcolumnNamebooleaninvertStringnamebooleanomitBlankbooleanomitErrorbooleanselectBlankbooleanselectErrorList<DecoratedValue>selection
-
Constructor Summary
Constructors Constructor Description ListFacetConfig(String name, String expression, String columnName)Convenience constructor for a text facet in neutral configuration.ListFacetConfig(String name, String expression, String columnName, boolean invert, boolean omitBlank, boolean omitError, boolean selectBlank, boolean selectError, List<DecoratedValue> selection)ListFacetConfig(String name, String expression, String columnName, boolean invert, boolean omitBlank, boolean omitError, List<ListFacet.DecoratedValueWrapper> selection, boolean selectBlank, boolean selectError)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListFacetapply(ColumnModel columnModel, Map<String,OverlayModel> overlayModels, long projectId)Instantiates the given facet on a particular column model.Set<String>getColumnDependencies()Computes the set of columns the facet depends on.StringgetErrorMessage()EvaluablegetEvaluable()StringgetExpression()StringgetJsonType()The facet type as stored in json.List<ListFacet.DecoratedValueWrapper>getWrappedSelection()booleanisNeutral()A neutral facet is a facet that does not filter out any row, i.e. it is in its initial, reset state.ListFacet.ListFacetConfigrenameColumnDependencies(Map<String,String> substitutions)Updates the facet config after a renaming of columns.voidsetExpression(String expression)voidsetSelection(List<ListFacet.DecoratedValueWrapper> wrapped)
-
-
-
Field Detail
-
name
public String name
-
columnName
public String columnName
-
invert
public boolean invert
-
omitBlank
public boolean omitBlank
-
omitError
public boolean omitError
-
selection
public List<DecoratedValue> selection
-
selectBlank
public boolean selectBlank
-
selectError
public boolean selectError
-
-
Constructor Detail
-
ListFacetConfig
public ListFacetConfig(String name, String expression, String columnName, boolean invert, boolean omitBlank, boolean omitError, List<ListFacet.DecoratedValueWrapper> selection, boolean selectBlank, boolean selectError)
-
ListFacetConfig
public ListFacetConfig(String name, String expression, String columnName, boolean invert, boolean omitBlank, boolean omitError, boolean selectBlank, boolean selectError, List<DecoratedValue> selection)
-
-
Method Detail
-
getWrappedSelection
public List<ListFacet.DecoratedValueWrapper> getWrappedSelection()
-
setSelection
public void setSelection(List<ListFacet.DecoratedValueWrapper> wrapped)
-
apply
public ListFacet apply(ColumnModel columnModel, Map<String,OverlayModel> overlayModels, long projectId)
Description copied from interface:FacetConfigInstantiates the given facet on a particular column model. This allows to check the validity of the configuration against a particular table schema (checking that the dependent columns exist, for instance).- Specified by:
applyin interfaceFacetConfig- Parameters:
columnModel- the header of the table the facet is applied to.overlayModels- the overlay models of the table the facet is applied to (can be accessed by expressions evaluated by the facet)projectId- the id of the project this facet is evaluated on- Returns:
- a computed facet on the given project.
-
getJsonType
public String getJsonType()
Description copied from interface:FacetConfigThe facet type as stored in json.- Specified by:
getJsonTypein interfaceFacetConfig
-
getColumnDependencies
public Set<String> getColumnDependencies()
Description copied from interface:FacetConfigComputes the set of columns the facet depends on. If the facet relies on an unknown set of columns, or if it is not row-wise, this returns null.- Specified by:
getColumnDependenciesin interfaceFacetConfig- Returns:
- the set of column names the facet depends on.
-
renameColumnDependencies
public ListFacet.ListFacetConfig renameColumnDependencies(Map<String,String> substitutions)
Description copied from interface:FacetConfigUpdates the facet config after a renaming of columns.- Specified by:
renameColumnDependenciesin interfaceFacetConfig- Returns:
- null if the update could not be performed, or the new facet config if the update could be performed.
-
isNeutral
public boolean isNeutral()
Description copied from interface:FacetConfigA neutral facet is a facet that does not filter out any row, i.e. it is in its initial, reset state. Neutral facets are still useful to visualize the distribution of values in a column.- Specified by:
isNeutralin interfaceFacetConfig
-
getExpression
public String getExpression()
-
setExpression
public void setExpression(String expression)
-
getEvaluable
public Evaluable getEvaluable()
-
getErrorMessage
public String getErrorMessage()
-
-