First of all I have read link text and it does not solve my problem.
I am using XStream with aliasing.
Condition is an interface with several different implementations. I want to remove the class attribute. I know that XStream uses the class attribute when it the implementing class is ambiguous and I can setup an alias for at most one of the implementing classes. I want to remove the class attribute all together and use type attribute plus the presence of other child elements to determine the implementing class. Is this possible?
Here is the XML I have currently:
<NextDestinations>
<Connector>
<DestinationId>2</DestinationId>
</Connector>
<Connector>
<DestinationId>3</DestinationId>
<condition class="com.orchestral.rhapsody.configuration.filter.condition.JavaScriptCondition" type="JAVASCRIPT">
...
</condition>
</Connector>
<Connector>
<DestinationId>4</DestinationId>
<condition class="com.orchestral.rhapsody.configuration.filter.condition.MessageTypeCondition">
<type>CONDITIONAL</type>
...
</condition>
</Connector>
<Connector>
<DestinationId>5</DestinationId>
<condition class="com.orchestral.rhapsody.configuration.filter.condition.MessageTypeCondition">
<type>CONDITIONAL</type>
...
</condition>
</Connector>
<Connector>
<DestinationId>6</DestinationId>
<condition class="com.orchestral.rhapsody.configuration.filter.condition.PropertyCondition">
<type>CONDITIONAL</type>
...
</condition>
</Connector>
<Connector>
<DestinationId>7</DestinationId>
<condition class="com.orchestral.rhapsody.configuration.filter.condition.FieldCondition">
<type>CONDITIONAL</type>
...
</condition>
</Connector>
<noMatchDestination>8</noMatchDestination>
<errorDestination>9</errorDestination>
</NextDestinations>
Here is the XML I want:
<NextDestinations>
<Connector>
<DestinationId>1</DestinationId>
</Connector>
<Connector>
<DestinationId>2</DestinationId>
<condition type="JAVASCRIPT">
...
</condition>
</Connector>
<Connector>
<DestinationId>3</DestinationId>
<condition type="CONDITIONAL">
...
</condition>
</Connector>
<Connector>
<DestinationId>4</DestinationId>
<condition type="CONDITIONAL"
...
</condition>
</Connector>
<Connector>
<DestinationId>5</DestinationId>
<condition type="CONDITIONAL">
...
</condition>
</Connector>
<Connector>
<DestinationId>6</DestinationId>
<condition type="CONDITIONAL">
...
</condition>
</Connector>
<Connector>
<DestinationId>7</DestinationId>
<condition type="CONDITIONAL"
...
</condition>
</Connector>
<noMatchDestination>8</noMatchDestination>
<errorDestination>9</errorDestination>
</NextDestinations>