G
glunk
I have a class called PdfWriter. Its constructor has several params. It has
a method setFields which must be overloaded.
I have a subclass called ConsolidationApplicationPdfWriter. What I could do
is have the constructor of this class have the same params as the super
class.
public ConsolidationApplicationPdfWriter (String templateName, boolean
stength128Bit, String userPassword, char acrobatVersion)
then call
super (templateName, strength128Bit, userPassword, acrobatVersion)
These values are stored in an XML file for each Application. So within
ConsolidationApplicationPdfWriter, I would like to get the values from the
XML file, then call super() with the values I have gotten.
But I cannot, of course, because super() has to be the first command in a
constructor whcih uses it.
This is where I get confused. How can I give the values for the parameters
in the super constructor? There is no need for it to be a mutable object
other than this. But the only thing I can think of to do is have a zero
param constructor and then use setters. But I do not want to do this since I
am sure I am just misunderstanding how to implement inheritence.
Thanks for your help. You guys have already helped me understand a ton. I
appreciate it.
S
a method setFields which must be overloaded.
I have a subclass called ConsolidationApplicationPdfWriter. What I could do
is have the constructor of this class have the same params as the super
class.
public ConsolidationApplicationPdfWriter (String templateName, boolean
stength128Bit, String userPassword, char acrobatVersion)
then call
super (templateName, strength128Bit, userPassword, acrobatVersion)
These values are stored in an XML file for each Application. So within
ConsolidationApplicationPdfWriter, I would like to get the values from the
XML file, then call super() with the values I have gotten.
But I cannot, of course, because super() has to be the first command in a
constructor whcih uses it.
This is where I get confused. How can I give the values for the parameters
in the super constructor? There is no need for it to be a mutable object
other than this. But the only thing I can think of to do is have a zero
param constructor and then use setters. But I do not want to do this since I
am sure I am just misunderstanding how to implement inheritence.
Thanks for your help. You guys have already helped me understand a ton. I
appreciate it.
S