Extending/Modifying VOImpl Class Methods

Hi All
In iExpense Module, there is one CreditCardsVO, which is already extended by a developer as BTCreditCardsVO
The standard CreditCardsVOImpl class has its contructor method, executeQuery, encodeCardNumber, etc methods.
My requirement is to modify the encodeCardNumber method ( This method masks the CreditCard Number with '****' , leaving just last 4 digits to display using substring function)
I need to modify this 4 digits to 9 digits.
This encodeCardNumber is called in executeQuery method. Also, this method is private type.
Extending standard VO is possible and usually SQLs are modified to add new columns.
Is it possible to modify/extend the methods of the standard VOImpl classes.
Rgds
Vaddi Rakesh

Hi Kumar,
Thanks for the reply.
Correct me if I have got it wrong.
To extend the private method EncodeCardNumber, I need to copy the standard ExecuteQuery method in the extended VOImpl class and also the EncodeCardNUmber method with modifications.
I have Copy/Pasted whats in the standard VOImpl and Also what I intend to change in extended VOImpl.
Standard VOImpl Class:
public class CreditCardsVOImpl extends OAViewObjectImpl
public CreditCardsVOImpl()
public void executeQuery()
super.executeQuery();
while(hasNext())
CreditCardsVORowImpl creditcardsvorowimpl = (CreditCardsVORowImpl)next();
String s = creditcardsvorowimpl.getCardProgramName() + encodeCardNumber(creditcardsvorowimpl.getCardNumber());
creditcardsvorowimpl.setDisplayedValue(s);
if(Boolean.TRUE.equals(isMultPaymentsForCard(creditcardsvorowimpl)))
creditcardsvorowimpl.setDisplayedValue(creditcardsvorowimpl.getDisplayedValue() + " - " + creditcardsvorowimpl.getPaymentDueFrom());
private String encodeCardNumber(String s)
if(s.length() > 4)
return " ****" + s.substring(s.length() - 4);
else
return " ****";
/// Other Public methods ...........
Extended Code :
public class BTCreditCardsVOImpl extends CreditCardsVOImpl
* This is the default constructor (do not remove)
public BTCreditCardsVOImpl()
// COPIED FROM STANDARD VOImpl CLASS
public void executeQuery()
super.executeQuery();
while(hasNext())
CreditCardsVORowImpl creditcardsvorowimpl = (CreditCardsVORowImpl)next();
String s = creditcardsvorowimpl.getCardProgramName() + encodeCardNumber(creditcardsvorowimpl.getCardNumber());
creditcardsvorowimpl.setDisplayedValue(s);
if(Boolean.TRUE.equals(isMultPaymentsForCard(creditcardsvorowimpl)))
creditcardsvorowimpl.setDisplayedValue(creditcardsvorowimpl.getDisplayedValue() + " - " + creditcardsvorowimpl.getPaymentDueFrom());
// MY VERSION OF ENCODE METHOD
private String encodeCardNumber(String s)
if(s.length() > 4)
return " ****" + s.substring(s.length() - 9); // changed from 4 to 9
else
return " ****";
My Query would be, the ExecuteQuery would be calling super.executeQuery.
Does this refer back to Standard ExecuteQuery and then subsequent EncodeCardNumber.
Or is it, my concepts are not clear. And extending the Standard methods, would simply replace any call to the methods of the Standard class, with the ones extended in the Extended VOImpl
Please advise
Rgds
Vaddi Rakesh

Similar Messages

  • Error Extending the OAEntityImpl class when creating a BC4J  Entity Object

    I have created an EO based on an Oracle Apps table and extended the OAEntityDefImpl, OAEntityCache and OAEntityImpl classes as specified in the OA Framework Developers Guide when creating EO's via the BC4J wizard.
    When I build my Business Components package I recive an error stating that the Impl class should be declared abstract.
    Error(14,8): class oracle.apps.xxtpc.arinvoices.schema.TpcApInvoicesEO2Impl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    When I modify this class to declare it abstract and then try to test (via the AM test function) the VO that I created based on this EO - I receive an oracle.jbo.RowCreateException: JBO-25017.
    Do you think that this has anything to do with modifying the Impl class to make it abstract? I can create another VO against the same table by creating a SQL statement against it and not basing it off of the EO and this VO will run correctly via the AM tester.
    Thanks,
    Chris
    oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for TpcApInvoicesEO.
         at oracle.jbo.server.EntityDefImpl.createBlankInstance(EntityDefImpl.java:1054)
         at oracle.jbo.server.ViewRowImpl.createMissingEntities(ViewRowImpl.java:1532)
         at oracle.jbo.server.ViewRowImpl.init(ViewRowImpl.java:236)
         at oracle.jbo.server.ViewDefImpl.createBlankInstance(ViewDefImpl.java:1050)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1007)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2643)

    The problem was that there were no audit columns in the table that I was querying.

  • Confused about extending the Sprite class

    Howdy --
    I'm learning object oriented programming with ActionScript and am confused about the Sprite class and OO in general.
    My understanding is that the Sprite class allows you to group a set of objects together so that you can manipulate all of the objects simultaneously.
    I've been exploring the Open Flash Chart code and notice that the main class extends the Sprite class:
    public class Base extends Sprite {
    What does this enable you to do?
    Also, on a related note, how do I draw, say, a line once I've extended it?
    Without extending Sprite I could write:
    var graphContainer:Sprite = new Sprite();
    var newLine:Graphics = graphContainer.graphics;
    And it would work fine. Once I extend the Sprite class, I'm lost. How do I modify that code so that it still draws a line? I tried:
    var newLine:Graphics = this.graphics;
    My understanding is that since I'm extending the Sprite class, I should still be able to call its graphics method (or property? I have no idea). But, it yells at me, saying "1046: Type was not found or was not a compile-time constant: Graphics.

    Thanks -- that helped get rid of the error, I really appreciate it.
    Alas, I am still confused about the extended Sprite class.
    Here's my code so far. I want to draw an x-axis:
    package charts {
        import flash.display.Sprite;
        import flash.display.Graphics;
        public class Chart extends Sprite {
            // Attributes
            public var chartName:String;
            // Constructor
            public function Chart(width:Number, height:Number) {
                this.width = width;
                this.height = height;
            // Methods
            public function render() {
                drawAxis();
            public function drawAxis() {
                var newLine:Graphics = this.graphics;
                newLine.lineStyle(1, 0x000000);
                newLine.moveTo(0, 100);
                newLine.lineTo(100, 100);
    I instantiate Chart by saying var myChart:Chart = new Chart(); then I say myChart.render(); hoping that it will draw the axis, but nothing happens.
    I know I need the addChild method somewhere in here but I can't figure out where or what the parameter is, which goes back to my confusion regarding the extended Sprite class.
    I'll get this eventually =)

  • What are abstract classes/methods and what are they for?

    Hi,
    I've just heard about abstract classes and methods and I'm just wondering what exactly they're used for, and why are they there for the Graphics class for example?
    Cheers.

    raggy wrote:
    bastones_ wrote:
    Hi,
    I've just heard about abstract classes and methods and I'm just wondering what exactly they're used for, and why are they there for the Graphics class for example?
    Cheers.Hey bro, I'll try to solve your problemYou have to know two important concepts for this part. 1 is Abstract classes and the other is Interface classes. Depends on the nature of the project, you need to set certain level of standards and rules that the other developers must follow. This is where Abstract classes and Interface classes come into picture.
    Abstract classes are usually used on small time projects, where it can have code implementation like general classes and also declare Abstract methods (empty methods that require implementation from the sub-classes).Wrong, they are used equally among big and small projects alike.
    Here are the rules of an Abstract class and method:
    1. Abstract classes cannot be instantiatedRight.
    2. Abstract class can extend an abstract class and implement several interface classesRight, but the same is true for non-abstract classes, so nothing special here.
    3. Abstract class cannot extend a general class or an interfaceWrong. Abstract classes can extend non-abstract ones. Best example: Object is non-abstract. How would you write an abstract class that doesn't extend Object (directly or indirectly)?
    4. If a class contains Abstract method, the class has to be declared Abstract classRight.
    5. An Abstract class may or may not contain an Abstract methodRight, and an important point to realize. A class need not have abstract methods to be an abstract class, although usually it will.
    6. Abstract method should not have any code implementations, the sub-classes must override it (sub-class must give the code implementations). An abstract method must not have any implementation code code. It's more than a suggestion.
    7. If a sub-class of an Abstract class does not override the Abstract methods of its super-class, than the sub-class should be declared Abstract also.This follows from point 4.
    9. Abstract classes can only be declared with public and default access modifiers.That's the same for abstract and non-abstract classes.

  • Customization of existing bean of VOImpl class

    Hi Team,
    We have a number of requirements, where we are facing a difficulty that we are not able to customize the bean classes or the VORowImpl or VOImpl Classes in fusion apps.
    Requirement is something like, there is a existing logic written in bean, on button click,
    Now we want to extend that logic, but I am not able to find any way to customize the existing bean or any java class, this is giving me less flexibility in fusion which we use to have in OAF.
    Can you please provide some light here, if we are missing something on the side of the java.
    Because in ADF, if java customization is hidden then 80% of the requirement comes from the customer, will not be feasible for us to deliver.
    Which was anyway done in the OAF.
    Please suggest.
    Regards;
    Vipin Kumar
    Accenture India.

    Vipin
    There are two things you mentioned here:
    1. Bean Code
    2. VORowImpl code
    For Bean Code yes there is no way to customize that. You cannot customize java in Fusion Apps. One of the solution would be to raise those requirements through Oracle Support. Product teams might suggest alternate options to customize such functionality via other artifacts where customization is allowed. If that is not possible then it would definitely be raised as an Enhancement Request.
    For VORowImpl a lot of time they are in fact not the right place to hardcode any business logic. Declarative validations, adding transient and non transient attributes etc is already supported. A lot of developers get confused when they dont see VORowImpl not getting changed or unable to customize that manually being a java file. However, all the declarative changes on VOs which affects the VORowImpl are written in .xml.xml files and saved into MDS to be applied at the time of application startup.
    Hope this helps!
    Vik
    http://blogs.oracle.com/fadevrel

  • Invoking Derived Class Method

    Hi pls go through the below code, can any one give me solution how to access the Derived class method in this Point.
    Note: In the below code , only in runtime we will come to know which Derived class method is going to invoke(So in runtime we will get Derived class name in the form of String). So Iam trying to Use Class.forName("Clas name") to create the instance of the Derived class and then type casting to base class.
    Why iam casting to base class is , since only in the run time we are geting the Derived class name.
    Result : iam geting the compiletime error says that no valid method fond in Mybase though it contains the reference of derived.
    abstract class MyBase
    public void display(int i)
    System.out.println(" Base class Method");
    class MyDerived extends MyBase
    public void display(String str)
    System.out.println("Derived class Mthode");
    class MyMain
    public static void main(String arg[])
    String DrivObj=arg[0];
    MyBase baseObj=(MyBase) Class.forName("DrivObj").newInstance();
    baseObj.display("SomeString"); }
    }

    The problem is, can not have subclass reference bcoz
    iam geting the subclass name only in the runtime and
    one more thing is cant touch my base and subclass to
    do changes as u said Your design is then definately very bad.
    , is there any other way to do
    it.Yes, you can use reflection to invoke the method.
    Kaj

  • Extending factory-made class

    A library, for instance JDK core APIs, usually offers instances of internal concrete class. For users
    of the library, the class is usually given as an abstract class. Some of them may or may not have static factory method that delivers a concrete class instance. For example, FileSystemView has
    and Graphics hasn't. The difference is not important for the problem of this thread.
    We can get those concrete class by calling Object#getClass() method. But how could we extend
    the class and override just one or two methods for trivial, but important, customization? In other
    words, we'd like to use a major part of the implementation as is, not implementing the abstract
    class from scratch.

    We can get those concrete class by calling
    Object#getClass() method. But how could we extend
    the class and override just one or two methods for
    trivial, but important, customization? In other
    words, we'd like to use a major part of the
    implementation as is, not implementing the abstract
    class from scratch.I'm not sure I fully understand what you want to do but I think you could use the idea behind the Adapter pattern. You create an adapter class with the public interface you want and then you use an object of the class you want to customize (the adptee) to implement that adapter class.
    Most adapter class methods will just call the corresponding methods of the adaptee but some are implemented differently.

  • Extending a nested class and parent access

    I want the child of the abstract inner class to have access to the inner classes parent's variables. I know that an inner class can access it's parent's variables and methods with the "[ParentClass].this.[var/method]" syntax. What's the appropriate syntax for the situation I'm describing?
    My setup is like this:
    class Canister {
      int a = 0;
      public abstract class Behavior
    class Lonely Behavior extends Behavior
      public int getParentVariable() {
        return Canister.this.a;
    }Thanks!
    -stephen

    The correction to my code is:
    class Canister
      int a = 0;
      public abstract class Behavior
    class LonelyBehavior extends Canister.Behavior
      public int getParentVariable() {
        return Canister.this.a;
    }The compiler doesn't have a problem with me extending Canister.Behavior because it's public inside of Canister. But as I explained, the "[ParentClass].this.[var/method]" syntax doesn't work.
    This is inconsistent with inheritance: you'd think that if you extend an inner class, you would inherit the abilities and characteristics of that inner class, just as you would in other cases of inheritance. It's also inconvenient: if the inner class is abstract because you want programmers to extend and upgrade it, those programmers have to change the source code of the enclosing class to include the new classes.
    Anyway, thanks for the info.

  • EXTENDING the string class

    ok, i know extending the string class is illegal because it's final, but i want to make an advanced string class that basically "extends" the string class and i've seen online this can be done through wrapper classes and/or composition, but i'm lost
    here is my sample code that is coming up with numerous compile time errors due to the fact that when i declare a new AdvString object, it doesn't inherit the basic string features (note: Add is a method that can add a character to a specified location in a string)
    class AdvString
         private String s;
         public AdvString(String s)
              this.s = s;
         public void Add(int pos, char ch)
              int this_len = (this.length()) + 1;
              int i;
              for(i=0;i<(this_len);i++)
                   if(pos == i)
                        this = this + ch;
                   else if(pos < i)
                        this = this + this.charAt(i-1);
                   else
                        this = this + this.charAt(i);
         public static void main(String[] args)
              AdvString s1;
              s1 = new AdvString("hello");
              char c = 'x';
              int i = 3;
              s1.Add(i,c);
              //s2 = Add(s1,i,c);
              //String s2_reversed = Reverse(s2);     
              System.out.println("s1 is: " + s1);
    any tips?

    see REString at,
    http://www.geocities.com/rmlchan/mt.html
    you will have to replicate all the String methods you are interested in, and just forward it to the String instance stored in REString or the like. it is like a conduit class and just passes most processing to the 'real' string. maybe a facade pattern.

  • Extending inner [nested] classes

    OK I've got a class (A) with a nested class (B).
    B accesses variables etc. in A and does its own thing, but what I'd like to do is make B abstract and have a number of classes extend it - which is used depends on program arguments.
    The problem I'm having is that the new class (C) that extends B does not seem to have access to any of the variables in A.
    I originally tried:
    class C extends B
    and
    class C extends A$B
    I also tried this, which I found on this site:
    class C extends A.B
    (thats A-dot-B) but it still doesnt seem to be working.
    Is it possible to extend [abstract] inner classes like this? If so, how? Any help appreciated. cheers.

    Here I found a solution. However, it is not so elegant. In fact, I am also having trouble in extending a nested class in an elegant way.
    Here, A is the original top-level class and A.B is the nested class of A. A2 extends A. B2 and B3 extends A.B. Main is the class where the main() method can be found.
    // A.java
    public class A {
      private B b;
      public void setB (B b) {
        this.b = b;
      public B getB () {
        return b;
      public abstract class B {
        public abstract String getName();
    // A2.java
    public class A2 extends A {
      public class B2 extends A.B {
        public String getName () {
          return "Peter";
      public class B3 extends A.B {
        public String getName () {
          return "John";
    public class Main {
      public static void main (String[] args) {
        A a = new A2 ();
        A.B b = ((A2)a).new B2 ();
        a.setB (b);
        System.out.println (a.getB().getName());  // John
        b = ((A2)a).new B3 ();
        a.setB (b);
        System.out.println (a.getB().getName());  // Peter
    }You may see here that I used "A" as the type of "a". Te reason is I want to use "a" as an "A", not "A2". If you don't want to do casting, you may simply use "A2" as the type. The class A2 can be blank. It is only a "container" of the classes B2 and B3.

  • Super class methods not shown when Model is generated

    I have some EJB's that return a result class, that extend a common class.
    eg:
    public class Result extends AResult implements Serializable {
    method getMethodA();
    method getMethodB();
    public abstract class AResult implements Serializable{
    method getMethodC();
    This EJB has been exposed using a web services and I am trying to construct a model based on this WS.
    The in the moded, while doing the context mapping i cannot see the
    getMethodC()
    from the superclass.
    However the code for the model seems to be correct i.e. the proxy classes generated have the correct structure.
    Anyone encountered this before? Is this a bug?
    Thanks,
    Manik.

    thanku very much for the answer.
    I am trying to execute the methods of another class using reflection. So I have to consider the inherited methods also. For that, I have to differentiate between standard classes & user-defined classes.Assume that u have one GUI screen where in once u select a class all its methods including inherited methods have to be displayed.
    I can get the the superclass using the method getSuperClass(). But inorder to get the protected methods of superclass what is the method to be used ? If I use getMethods(), it returns only public methods, where as getDeclaredMethods() returns all the methods. Since I have to execute only public & protected methods, what is the best way to solve this ?

  • How can I extend the Vector class?

    Hi All,
    I'm trying to extend the Vector class so I can get add a .remove(item:T) method to the class.  I've tried this:
    public class VectorCollection extends Vector.<T>
    That gives me the compile error "1017: The definition of base class Vector was not found"
    So then I tried:
    public class VectorCollection extends Vector
    Which gives me the compile error "1016: Base class is final."
    There must be some way to extend the Vector class, though, as on the Vector's official docs page it says:
    Note: To override this method in a subclass of Vector, use ...args for the parameters, as this example shows:
         public override function splice(...args) {
           // your statements here
    So there must be a way to extend the Vector class.  What am I doing wrong?

    No. AS3 doesn't currently have full support for generic types; Vector.<T> was added in an ad-hoc ("ad-hack"?) way. We are considering adding full support in a future version of ActionScript.
    Gordon Smith
    Adobe Flex SDK Team

  • Exporting Tables from BSP to Class Methods

    Afternoon Everybody,
    in true SAP OSS Message style I post this question on it's own thread to enable maximum value from the reward points.
    Question:
    I have a BSP, in an event in my BSP I call a method in my class.
    I have mastered Exporting parameters to the methods from the BSP and Importing parameters back to the BSP from the methods, but now, I need so Export a table to the method and I don't know how to.
    Also, in combination with this, when I create the method I am able to setup the importing parameters, but how can create/define the importing table ?
    If this is not clear I will add more info.
    Thanks for your help,
    Tomas.

    Tomas,
    The key to problem is always to learn a few "nice" things defined in the system. So let me see. The first problem you have is that methods are declared of the form:
    method <parm> <direction> TYPE [REF TO] <t>
    parm = the name of the paramter
    direction = IMPORTING|EXPORTING|CHANGING|RETURNING
    t = type of parm
    However, in this type it is not possible to write that you want "type of table". You can only use predefined types (either internal or indictionary).
    Having said this, most people with extensive ABAP experience before the OO-wave, tend to use character types all the time. However, we nearly always use only type string. And exactly for this type there is a type string_table.
    So the code would be:
    <u>Declaration:</u>
      method lines changing type string_table
    <u>Calling:</u>
      DATA: t TYPE string_table.
      APPEND 'Hello' TO t.
      APPEND 'World' TO t.
      class=>method( CHANGING lines = t ).
    <u>Method Implementation:</u>
      DATA: line LIKE LINE OF lines.
      LOOP AT lines INTO line.
        TRANSLATE line TO UPPER CASE.
        MODIFY lines FROM line. " write back
      ENDLOOP.
    <u>Better Method Implementation (works directly on row):</u>
      FIELD-SYMBOLS: <line> LIKE LINE OF lines.
      LOOP AT lines ASSIGNING <line>.
        TRANSLATE <line> TO UPPER CASE.
      ENDLOOP.
    These two types <b>string</b> and <b>string_table</b> goes a long way. The other two types that I often use are <b>ihttpvnp</b> and <b>Tihttpvnp</b> (table): they are good for name/value pairs of strings.
    Now is the time that you should invest 30 minutes reading each time that you run into a problem. You have the framework, just check up on one aspect each time. (I usually use online help, for example to understand MODIFY for writing this text.)

  • Is it possible to OVERLOAD a super-class method in a sub-class?

    Hi all,
    I have a query that
    Is it possible to OVERLOAD a super-class method in a sub-class?
    If it is possible, please give me an example.
    Thanks,
    Hari

    Hi,
    Is the method int Display(int a){} overloading
    the super-class's void Display() method? If
    possible, please clarify this and how it would be
    method overloading?
    hanks,
    Hari
    Hi Hari,
    Yes, it is possible. Look at this piece of code:
    class Senior
         void Display()
              System.out.println("Super class method");
    class Junior extends Senior
         int Display(int a)
              System.out.println("Subclass method: "+a);
              return(a+10);
         }> }
    class example
         public static void main(String args[])
              Junior j = new Junior();
              j.Display();
    System.out.println("Subclass method
    od "+j.Display(5));
    Is this what you were asking? Hope this helped.Hi,
    I guess you guys are confused here...
    Overloading is achieved by methods in the same class...
    Overriding is across a superclass subclass methds.

  • Overiding super class method to an abstract  method

    public class Super
    public void doSomethingUseful()
    public abstract class Sub extends Super
    public abstract void doSomethingUseful();
    What is the OO principle behind this?
    When do we need to override a super class method in subclass as an abstract?

    Lets first look at a simple design pattern called "Template Method".
    public abstract class Library
    private void collectBooks()
    // collect books here
    private void putBookInShelf()
    // put books in shelf here
    // abstract method sortBooks()
    public abstract void sortBooks();
    public void processBooks()
    collectBooks();
    sortBooks();
    putBooksInShelf();
    this class is an abstract class giving an abstract method called "sortBooks()", what is it useful for? We can make a subclass and implement sortBooks() to sort the books as we want (title wise, author wise, date wise, publisher wise) and then simply call processBooks() to process them.
    One Sub class may look like:
    public class MyLibrary extends Library
    public void sortBooks()
    // sort books by title b/c I like them sorted out by title
    Another sub-class may look like
    public class HisLibrary extends Library
    public void sortBooks()
    // sort books by Author, b/c he likes his books sorted out by author
    Now client will say:
    public static void main(String str[])
    MyLibrary mylib=new MyLibrary();
    mylib.processBooks(); // books will be processed by sorting them title wise
    HisLibrary hislib=new HisLibrary();
    hislib.processBooks(); // books will be processed by sorting them author wise
    So in Library class, method "sortBooks()" was a template method allowing subclasses to sort the books as they want while all other functionality was implemented by Library class itself.
    Now if we go back to your example, a method which is concrete in super class that you converted into an abstract method in sub class ( doSomethingUseful() ) is now a template method, which alows the sub classes of this subclass to do something useful what they think is useful or in other words you are allowing subclasses of this subclass to implement this template method as they want by using their own algorithm.
    Now why whould you do that? answer is that you don't have access to the code of super class, otherwise you must have made this method abstract in super class in the first place.
    Note that the code may not compile, I tried to come up with an exmple and did not pay attention to compiler demands.
    I think I cleared my point, It was tough to explain though.
    Good Luck.
    Khawar.

Maybe you are looking for