| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
package org.trails.link; |
| 13 |
|
|
| 14 |
|
import org.apache.hivemind.util.Defense; |
| 15 |
|
import org.apache.tapestry.annotations.InjectObject; |
| 16 |
|
import org.apache.tapestry.annotations.Parameter; |
| 17 |
|
import org.apache.tapestry.annotations.ComponentClass; |
| 18 |
|
import org.trails.util.Utils; |
| 19 |
|
import org.trails.descriptor.DescriptorService; |
| 20 |
|
import org.trails.descriptor.IClassDescriptor; |
| 21 |
|
|
| 22 |
|
@ComponentClass |
| 23 |
0 |
public abstract class ModelLink extends TrailsLink |
| 24 |
|
{ |
| 25 |
|
|
| 26 |
|
@Parameter(required = true) |
| 27 |
|
public abstract Object getModel(); |
| 28 |
|
|
| 29 |
|
public IClassDescriptor getClassDescriptor() |
| 30 |
|
{ |
| 31 |
0 |
Defense.notNull(getModel(), "model"); |
| 32 |
0 |
return getDescriptorService().getClassDescriptor(Utils.checkForCGLIB(getModel().getClass())); |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
@InjectObject("spring:descriptorService") |
| 36 |
|
public abstract DescriptorService getDescriptorService(); |
| 37 |
|
|
| 38 |
|
} |