apex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhupesh Chawda <bhup...@datatorrent.com>
Subject Re: Set schemaRequired differently on different operator implementations
Date Tue, 03 May 2016 00:02:53 GMT
Thanks Thomas.
I tried that. But in cases where the port is used even in the base class,
different instances are used by both parent and child.

~Bhupesh

On Mon, May 2, 2016 at 5:00 PM, Thomas Weise <thomas.weise@gmail.com> wrote:

> Yes, you can override the port with a new port field with the same name.
>
>
> On Mon, May 2, 2016 at 4:22 PM, Bhupesh Chawda <bhupesh@datatorrent.com>
> wrote:
>
>> Hi All,
>>
>> I have a base operator which is parametrized:
>>
>>
>>
>> *class OperatorBase<T> extends BaseOperator{*
>>
>> *    public final transient DefaultOutputPort output = new
>> DefaultOutputPort();}*
>>
>> I also have two implementations of this operator as follows:
>>
>>    - Instantiating with <Employee> type -
>>    - *class Operator1 extends OperatorBase<Employee>*
>>    - POJO Implementation using <Object> -
>>    - *class Operator1 extends OperatorBase<Object>*
>>
>> The problem is the following:
>>
>> I need to enable the annotation "*schemaRequired*" on the output port "
>> *output*" only if a POJO implementation is used and not otherwise.
>> Please suggest some way to achieve this.
>>
>> Can this be done without moving the port to individual child classes?
>>
>> Thanks.
>>
>> ~Bhupesh
>>
>
>

Mime
View raw message