The CAS Extension API provides Java annotations that define extensions to the Content Acquisition System and also define configuration properties for an extension. Annotations can describe whether configuration properties are required or optional, whether they have a default value, and their display properties in CAS Console.

You annotate a Java field in a PipelineComponentConfiguration class to expose the field as a configuration property for an extension. The fields that you annotate display in CAS Console and are available to the CAS Server Command-line Utility and the CAS Server API. If you do not annotate a field, CAS Server ignores it.

CAS Console renders all annotated Java fields as configuration properties on the Data Source tab. When a user specifies values for the fields in CAS Console, and saves the data source, then CAS Console sends the value of the field to CAS Server as a configuration property.

Each Java field has a CAS annotation that corresponds to the data type of the Java field. Field annotations include the following:

Annotations contain attributes that specify additional information about a configuration property. This information may control rendering in CAS Console, the order in which fields render, default values for the fields, and so on.

Here is an example annotation of two string fields:

@StringProperty(isRequired=true, name="inputFile", displayName="Input File", 
 description="Path to the input csv file e.g. c:\\incoming\\data.csv")
	private String mInputFile;
	
@StringProperty(isRequired=true, name="keyColumn", displayName="Key Column", 
	description="Name of the column with the record key")
	private String mKeyColumn;

When CAS Console renders the mInputFile property and the mKeyColumn property, they display as the Input File and Key Column configuration properties shown here:

Here is an example annotation for a field which is a list of strings (a multi-valued property):

@StringProperty(isRequired=true, name="sourcePropertyList", displayName="Source Property List")
	private List<String> mSourcePropertyList;

Here is an example annotation for an integer field with four attributes:

@IntegerProperty(isRequired=false, name="startIndex", displayName="Substring Start Index", 
			description="Substring start index (zero based)", defaultValue=0)
	private int mStartIndex;


Copyright © Legal Notices