Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Custom list binding, by Jason Pell

Title: Eclipse Community Forums
Subject: Custom list binding Author: Jason Pell Date: Wed, 25 February 2015 17:45
I have a xml format like:

<GeneratorConfig>
<DuplicateConfig>
<duplicateMatching>SingleValue</duplicateMatching>
<ignoreFqn>someFqn</ignoreFqn>
<ignoreFqn>someFqn</ignoreFqn>
</DuplicateConfig>
</GeneratorConfig>

I have a DuplicateConfig class like so. What I actually end up with (based on the following code is:

<GeneratorConfig>
<DuplicateConfig>
<duplicateMatching>SingleValue</duplicateMatching>
<IgnoreFqn>
<ignoreFqn>someFqn</ignoreFqn>
</IgnoreFqn>
<IgnoreFqn>
<ignoreFqn>someFqn</ignoreFqn>
</IgnoreFqn>
</DuplicateConfig>
</GeneratorConfig>

Should I be using a @CustomXmlListBinding in duplicate config and what particular methods should I be overriding. I have used the best google fu I know but can't find anything useful for this.

public interface DuplicateConfig extends Element {
ElementType TYPE = new ElementType(DuplicateConfig.class);

@Type( base = DuplicateMatching.class )
@XmlBinding(path = "duplicateMatching")
@Label(standard = "Duplicate Matching")
@DefaultValue( text = "IgnoreNumericSuffix" )
ValueProperty PROP_DUPLICATE_MATCHING = new ValueProperty(TYPE, "DuplicateMatching");

Value<DuplicateMatching> getDuplicateMatching();
void setDuplicateMatching(String value);
void setDuplicateMatching(DuplicateMatching value);

@Label( standard = "Ignore Fqns" )
@XmlListBinding( path = "" )
@Type( base = IgnoreFqn.class )
ListProperty PROP_IGNORE_FQNS = new ListProperty( TYPE, "IgnoreFqns" );
ElementList<IgnoreFqn> getIgnoreFqns();
}


public interface IgnoreFqn extends Element {
ElementType TYPE = new ElementType(IgnoreFqn.class);

@Label(standard = "Ignore Fqn")
@Required
@XmlBinding( path = "ignoreFqn" )
ValueProperty PROP_LANGUAGE = new ValueProperty(TYPE, "IgnoreFqn");

Value<String> getIgnoreFqn();

void setIgnoreFqn(String value);
}
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top