Re: [Simple-support] Error reading overridden interface type
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2007-12-28 16:22:58
|
Hi Frank,
Well firstly I think there maybe an error in you
example. As there is no @Enity annotation. However I
am sure you are using @Element, in which case the
class="MyValidator" does not contain the package name
of the validator object.
The reason you get a TransformException is because it
thinks you are trying to read an IValidator, which
does not have any XML annotations. So you need to
ensure the class="<class name>" is a valid class.
Niall
--- Frank Castellucci <fra...@gm...> wrote:
> IValidator.java
> ===========
> public interface IValidator
> {
>
> }
>
> MyValidator.java
> ============
> @Root
> public class MyValidator implements IValidator,
> Serializable
> {
> @Element(name="model-class",required=true)
> private String clazzName;
>
> @Element(required=false)
> private String description
> }
>
> Item.java
> =======
> @Root(name="item")
> public class Item
> {
> @Entity(name="validate")
> private IValidator ivalidator;
> }
>
> test.xml
> ======
> <item>
> <validate class="MyValidator">
> <model-class>xxx.yyy.zzz</model-class>
> </validate>
> </item>
>
> While I've omitted other attributes and entities,
> here is the top portion of
> the exception I get:
>
>
org.simpleframework.xml.transform.TransformException:
> Transform of interface
> org.fvjc.wd.validator.IValidator not supported
> at
>
org.simpleframework.xml.transform.PackageMatcher.match(
> PackageMatcher.java:91)
> at
>
org.simpleframework.xml.transform.DefaultMatcher.matchType(
> DefaultMatcher.java:111)
> at
>
org.simpleframework.xml.transform.DefaultMatcher.match(
> DefaultMatcher.java:90)
> at
>
org.simpleframework.xml.transform.Transformer.read(Transformer.java
> :106)
> at
>
org.simpleframework.xml.load.PrimitiveFactory.getInstance(
> PrimitiveFactory.java:104)
> at
>
org.simpleframework.xml.load.Primitive.readTemplate(Primitive.java
> :196)
> at
>
org.simpleframework.xml.load.Primitive.readTemplate(Primitive.java
> :178)
> at
>
org.simpleframework.xml.load.Primitive.readElement(Primitive.java
> :150)
> at
>
org.simpleframework.xml.load.Primitive.readElement(Primitive.java
> :133)
>
> Any help would be appreciated
> >
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2005.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/>
_______________________________________________
> Simple-support mailing list
> Sim...@li...
>
https://lists.sourceforge.net/lists/listinfo/simple-support
>
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
|