Class IndexerUtils
- Object
-
- IndexerUtils
-
public class IndexerUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
INDEXER_PROPERTIES
static String
INDEXER_XML
-
Constructor Summary
Constructors Constructor Description IndexerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Indexer
createDefaultIndexer()
static String
getAttribute(String coverageName, String domainName, Indexer indexer)
Look for the specified coverageName inside the provided Indexer and return the attributes of the specified domain.static Indexer.Coverages.Coverage
getCoverage(Indexer indexer, String name)
Return an indexerIndexer.Coverages.Coverage
object from the specifiedIndexer
, referring to the requested name.static DomainType
getDomain(DomainType domain, DomainsType refDomains)
static String
getParam(ParametersType params, String parameterName)
Return the parameter string value of the specified parameter name from the provided parameters elementstatic String
getParameter(String parameterName, File indexerFile)
Return the parameter string value of the specified parameter name from the indexer defined in the specified file (if exists).static String
getParameter(String parameterName, Indexer indexer)
Return the parameter string value of the specified parameter name from the provided indexerstatic boolean
getParameterAsBoolean(String parameterName, Indexer indexer)
Return the parameter value (as a boolean) of the specified parameter name from the provider indexerstatic <T extends Enum>
TgetParameterAsEnum(String parameterName, Class<T> enumClass, Indexer indexer)
Return the parameter value (as a boolean) of the specified parameter name from the provider indexerstatic Integer
getParameterAsInteger(String parameterName, Indexer indexer)
Return the parameter value (as an integer) of the specified parameter name from the provider indexer, or null, if the parameter was not foundstatic SchemaType
getSchema(Indexer indexer, Indexer.Coverages.Coverage coverage)
Get aSchemaType
element for the specifiedIndexer.Coverages.Coverage
.static SourceSPIProviderFactory
getSourceSPIProviderFactory(Indexer indexer)
static Indexer
initializeIndexer(ParametersType params, File parent)
static void
parseAdditionalDomains(String attributes, List<DomainType> domainList)
Parse additional domainsstatic String
refineParameterValue(String parameterName, String parameterValue)
Utility method which does special checks on specific parametersstatic void
setAttributes(DomainType domain, String values)
Set the attributes of the specified domain, getting values from the value String In case the value contains a ";" separator, add a different attribute for each element.static void
setParam(List<ParametersType.Parameter> parameters, String parameterName, String parameterValue)
Set the parameter having the specified name with the specified valuestatic void
setParam(List<ParametersType.Parameter> parameters, Properties props, String propName)
Get the value of a property name from a properties object and set that value to a parameter with the same namestatic void
setParam(Indexer indexer, String paramName, String paramValue)
Set the given parameter on the given indexerstatic void
setPropertyCollectors(Indexer indexer, String propertyCollectors)
BuildIndexer.Collectors
element by parsing the specified propertyCollectors, and put them on the specified indexer object.
-
-
-
Field Detail
-
INDEXER_XML
public static final String INDEXER_XML
- See Also:
- Constant Field Values
-
INDEXER_PROPERTIES
public static final String INDEXER_PROPERTIES
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPropertyCollectors
public static void setPropertyCollectors(Indexer indexer, String propertyCollectors)
BuildIndexer.Collectors
element by parsing the specified propertyCollectors, and put them on the specified indexer object.
-
getCoverage
public static Indexer.Coverages.Coverage getCoverage(Indexer indexer, String name)
Return an indexerIndexer.Coverages.Coverage
object from the specifiedIndexer
, referring to the requested name.- Parameters:
indexer
- the mainIndexer
instancename
- the name of theIndexer.Coverages.Coverage
element to be retrieved.- Returns:
- the
Indexer.Coverages.Coverage
element for the specified name (if any).
-
refineParameterValue
public static String refineParameterValue(String parameterName, String parameterValue)
Utility method which does special checks on specific parameters
-
setAttributes
public static void setAttributes(DomainType domain, String values)
Set the attributes of the specified domain, getting values from the value String In case the value contains a ";" separator, add a different attribute for each element.
-
setParam
public static void setParam(List<ParametersType.Parameter> parameters, String parameterName, String parameterValue)
Set the parameter having the specified name with the specified value
-
setParam
public static void setParam(List<ParametersType.Parameter> parameters, Properties props, String propName)
Get the value of a property name from a properties object and set that value to a parameter with the same name
-
getParameterAsBoolean
public static boolean getParameterAsBoolean(String parameterName, Indexer indexer)
Return the parameter value (as a boolean) of the specified parameter name from the provider indexer
-
getParameterAsInteger
public static Integer getParameterAsInteger(String parameterName, Indexer indexer)
Return the parameter value (as an integer) of the specified parameter name from the provider indexer, or null, if the parameter was not found
-
getParameterAsEnum
public static <T extends Enum> T getParameterAsEnum(String parameterName, Class<T> enumClass, Indexer indexer)
Return the parameter value (as a boolean) of the specified parameter name from the provider indexer
-
getParam
public static String getParam(ParametersType params, String parameterName)
Return the parameter string value of the specified parameter name from the provided parameters element
-
getParameter
public static String getParameter(String parameterName, Indexer indexer)
Return the parameter string value of the specified parameter name from the provided indexer
-
getParameter
public static String getParameter(String parameterName, File indexerFile)
Return the parameter string value of the specified parameter name from the indexer defined in the specified file (if exists).
-
parseAdditionalDomains
public static void parseAdditionalDomains(String attributes, List<DomainType> domainList)
Parse additional domains
-
getDomain
public static DomainType getDomain(DomainType domain, DomainsType refDomains)
-
getAttribute
public static String getAttribute(String coverageName, String domainName, Indexer indexer)
Look for the specified coverageName inside the provided Indexer and return the attributes of the specified domain.- Returns:
- TODO: Code is going complex. We should use a visitor
-
getSchema
public static SchemaType getSchema(Indexer indexer, Indexer.Coverages.Coverage coverage)
Get aSchemaType
element for the specifiedIndexer.Coverages.Coverage
. TheIndexer
object will be used in case of an externally referenced schema.- Parameters:
indexer
- the mainIndexer
instancecoverage
- theIndexer.Coverages.Coverage
element with the Schema to be returned.
-
createDefaultIndexer
public static Indexer createDefaultIndexer()
-
initializeIndexer
public static Indexer initializeIndexer(ParametersType params, File parent)
-
getSourceSPIProviderFactory
public static SourceSPIProviderFactory getSourceSPIProviderFactory(Indexer indexer)
-
-