/** * Marker interface to define metadata for a translator */ public interface MetadataProcessor<C> { static final String SOURCE_PREFIX = AbstractMetadataRecord.RELATIONAL_URI+"source_"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable= {Table.class, Procedure.class}, datatype=String.class, display="Fully qualified name of the source object. The format is / separated name value pairs that represent the object path in the metadata tree." + " Each name and value are separated by = and are both URL encoded. Each name will be lower case and is source dependent. e.g. schema=s/table=t") static final String FQN = AbstractMetadataRecord.RELATIONAL_URI+"fqn"; //$NON-NLS-1$ public void process(MetadataFactory metadataFactory, C connection) throws TranslatorException; }
for (int i = 0; i < tp.applicable().length; i++) { sb.append(tp.applicable()[i].getName()); if (tp.applicable().length-1 > i) { sb.append(","); //$NON-NLS-1$ continue; epm.description = tp.description(); epm.displayName = tp.display(); epm.required = tp.required(); epm.dataType = tp.datatype().getName(); if (tp.allowed() != null && !tp.allowed().isEmpty()) { epm.allowed = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(tp.allowed(), ","); //$NON-NLS-1$ while (st.hasMoreTokens()) { epm.allowed.add(st.nextToken().trim());
public class PIMetadataProcessor extends JDBCMetadataProcessor { static Pattern guidPattern = Pattern.compile(Pattern.quote("guid"), Pattern.CASE_INSENSITIVE); @ExtensionMetadataProperty(applicable= {Table.class, Procedure.class}, datatype=String.class, display="Is Table Value Function", description="Marks the table as Table Value Function")
public class JPAMetadataProcessor implements MetadataProcessor<EntityManager> { @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Foreign Table Name", description="Applicable on Foreign Key columns") public static final String KEY_ASSOSIATED_WITH_FOREIGN_TABLE = MetadataFactory.JPA_URI+"assosiated_with_table"; @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Relation Property", description="Applicable on Foreign Key columns") public static final String RELATION_PROPERTY = MetadataFactory.JPA_URI+"relation_property"; @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Relation Key", description="Applicable on Foreign Key columns") public static final String RELATION_KEY = MetadataFactory.JPA_URI+"relation_key"; @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Entity Class", description="Java Entity Class that represents this table", required=true) public static final String ENTITYCLASS= MetadataFactory.JPA_URI+"entity_class";
public class ExcelMetadataProcessor implements MetadataProcessor<VirtualFileConnection> { @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Excel File Name", description="Excel File name, use file name pattern if one than one file in the parent directory", required=true) public static final String FILE = MetadataFactory.EXCEL_URI+"FILE"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Column.class, datatype=Integer.class, display="Cell Number", description="Cell number, where the column information is defined. If column name is ROW_ID, define it as -1", required=true) public static final String CELL_NUMBER = MetadataFactory.EXCEL_URI+"CELL_NUMBER"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Table.class, datatype=Integer.class, display="First Data Number", description="First Row Number, where data rows start") public static final String FIRST_DATA_ROW_NUMBER = MetadataFactory.EXCEL_URI+"FIRST_DATA_ROW_NUMBER"; //$NON-NLS-1$
public class MongoDBMetadataProcessor implements MetadataProcessor<MongoDBConnection> { @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Merge Into Table", description="Declare the name of table that this table needs to be merged into. No separate copy maintained") public static final String MERGE = MetadataFactory.MONGO_URI+"MERGE"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Embedded Into Table", description="Declare the name of table that this table needs to be embedded into. A separate copy is also maintained") public static final String EMBEDDABLE = MetadataFactory.MONGO_URI+"EMBEDDABLE"; //$NON-NLS-1$
public class ODataMetadataProcessor implements MetadataProcessor<WSConnection> { @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Link Tables", description="Used to define navigation relationship in many to many case") public static final String LINK_TABLES = MetadataFactory.ODATA_URI+"LinkTables"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Http Method", description="Http method used for procedure invocation", required=true) public static final String HTTP_METHOD = MetadataFactory.ODATA_URI+"HttpMethod"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Column.class, datatype=Boolean.class, display="Join Column", description="On Link tables this property defines the join column") public static final String JOIN_COLUMN = MetadataFactory.ODATA_URI+"JoinColumn"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable= {Table.class, Procedure.class}, datatype=String.class, display="Entity Type Name", description="Name of the Entity Type in EDM", required=true) public static final String ENTITY_TYPE = MetadataFactory.ODATA_URI+"EntityType"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Complex Type Name", description="Name of the Complex Type in EDM") public static final String COMPLEX_TYPE = MetadataFactory.ODATA_URI+"ComplexType"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Column Group", description="Name of the Column Group") public static final String COLUMN_GROUP = MetadataFactory.ODATA_URI+"ColumnGroup"; //$NON-NLS-1$
@ExtensionMetadataProperty(applicable= {Table.class}, datatype=Boolean.class, display="Supports Create") static final String TABLE_SUPPORTS_CREATE = MetadataFactory.SF_URI+"Supports Create"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Delete") static final String TABLE_SUPPORTS_DELETE = MetadataFactory.SF_URI+"Supports Delete"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class, Column.class}, datatype=Boolean.class, display="Custom") public static final String TABLE_CUSTOM = MetadataFactory.SF_URI+"Custom"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports ID Lookup") static final String TABLE_SUPPORTS_LOOKUP = MetadataFactory.SF_URI+"Supports ID Lookup"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Merge") static final String TABLE_SUPPORTS_MERGE = MetadataFactory.SF_URI+"Supports Merge"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Query") static final String TABLE_SUPPORTS_QUERY = MetadataFactory.SF_URI+"Supports Query"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Replicate") static final String TABLE_SUPPORTS_REPLICATE = MetadataFactory.SF_URI+"Supports Replicate"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Retrieve") static final String TABLE_SUPPORTS_RETRIEVE = MetadataFactory.SF_URI+"Supports Retrieve"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Table.class}, datatype=Boolean.class, display="Supports Search") static final String TABLE_SUPPORTS_SEARCH = MetadataFactory.SF_URI+"Supports Search"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Column.class}, datatype=Boolean.class, display="Defaulted on Create") static final String COLUMN_DEFAULTED = MetadataFactory.SF_URI+"Defaulted on Create"; //$NON-NLS-1$ static final String COLUMN_CUSTOM = TABLE_CUSTOM; @ExtensionMetadataProperty(applicable={Column.class}, datatype=Boolean.class, display="Calculated") static final String COLUMN_CALCULATED = MetadataFactory.SF_URI+"Calculated"; //$NON-NLS-1$ @ExtensionMetadataProperty(applicable={Column.class}, datatype=String.class, display="Picklist Values") static final String COLUMN_PICKLIST_VALUES = MetadataFactory.SF_URI+"Picklist Values"; //$NON-NLS-1$
@ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="URI", description="Used to define endpoint of the procedure", required=true) public final static String URI = RestMetadataExtension.URI; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Http Method", description="Http method used to execute the procedure", required=true, allowed="GET,POST,PUT,DELETE,OPTIONS,HEAD,PATCH") public final static String METHOD = RestMetadataExtension.METHOD; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Scheme", description="Scheme to use http, https etc.", allowed="HTTP,HTTPS") public final static String SCHEME = RestMetadataExtension.SCHEME; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Produces", description="Used to define content type produced by this procedure, default JSON assumed") public final static String PRODUCES = RestMetadataExtension.PRODUCES; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Consumes", description="Used to define content type consumed by this procedure with body type parameters. Default JSON assumed") public final static String CONSUMES = RestMetadataExtension.CONSUMES; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Charset", description="Encoding of the return data") public final static String CHARSET = RestMetadataExtension.CHARSET; @ExtensionMetadataProperty(applicable=ProcedureParameter.class, datatype=String.class, display="Parameter Type", description="Parameter type, as to how the parameter is being provided to the procedure", required=true, allowed="PATH,QUERY,FORM,FORMDATA,BODY,HEADER")