Search in sources :

Example 1 with TraitPointIdComparator

use of delta.games.lotro.stats.traitPoints.comparators.TraitPointIdComparator in project lotro-companion by dmorcellet.

the class TraitPointsRegistryXMLWriter method write.

/**
 * Write a trait points registry to the given XML stream.
 * @param hd XML output stream.
 * @param registry Registry to write.
 * @throws Exception If an error occurs.
 */
public void write(TransformerHandler hd, TraitPointsRegistry registry) throws Exception {
    AttributesImpl attrs = new AttributesImpl();
    hd.startElement("", "", TraitPointsRegistryXMLConstants.TRAIT_POINTS_REGISTRY_TAG, attrs);
    List<TraitPoint> points = registry.getAll();
    Collections.sort(points, new TraitPointIdComparator());
    for (TraitPoint point : points) {
        write(hd, point);
    }
    hd.endElement("", "", TraitPointsRegistryXMLConstants.TRAIT_POINTS_REGISTRY_TAG);
}
Also used : TraitPointIdComparator(delta.games.lotro.stats.traitPoints.comparators.TraitPointIdComparator) TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Aggregations

TraitPoint (delta.games.lotro.stats.traitPoints.TraitPoint)1 TraitPointIdComparator (delta.games.lotro.stats.traitPoints.comparators.TraitPointIdComparator)1 AttributesImpl (org.xml.sax.helpers.AttributesImpl)1