Can getter/setter annotation handle delegation to getter/setter for properties on another object?

8 views
Skip to first unread message

Arthur

unread,
Feb 15, 2011, 1:46:12 PM2/15/11
to jenabean-dev
So I want to create a JenaBean facade to another class that I may not
alter. I want getters and setters of a JenaBean class to delegate to
properties defined on the other class. I have a JenaBeans class,
WellJB, whose getters and setters set and get properties on another
object Well. I have tried annotating the WellJB getter (see abridged
example below) and it is not persisting the property
(operatingCompany) that I am delegating.

When you annotate a getter with @RdfProperty annotation does it expect
the property being accessed to be defined in the same class?

Thanks
Arthur

@Namespace(WellVocab.NS)
@RdfType(WellVocab.LOCALNAME)
public class WellJB extends DomainObjectJB implements WellProvenance {
private transient Well well;

public WellJB(Well well, URI uri) {
super(uri);
this.well = well; // Point the JB well at it's domain
doppelganger
}

@Override
@RdfProperty(WellVocab.OPERATINGCOMPANY)
public String getOperatingCompany() {
//return operatingCompany;
return well.getOperatingCompany();
}

@Override
public void setOperatingCompany(String operatingCompany) {
//this.operatingCompany = operatingcompany;
well.setOperatingCompany(operatingCompany);
}

Taylor Cowan

unread,
Feb 16, 2011, 6:30:08 PM2/16/11
to Arthur, jenabean-dev
Are you using inheritance in this case?

Sent from my Windows Phone From: Arthur
Sent: Tuesday, February 15, 2011 10:46 AM
To: jenabean-dev
Subject: Can getter/setter annotation handle delegation to
getter/setter for properties on another object?

Thanks
Arthur

--
You received this message because you are subscribed to the Google
Groups "jenabean-dev" group.
To post to this group, send email to jenabe...@googlegroups.com.
To unsubscribe from this group, send email to
jenabean-dev...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/jenabean-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages