Class GenericSkeletonSimplifier

  • All Implemented Interfaces:
    IEventConverter, IResourceSimplifier

    public class GenericSkeletonSimplifier
    extends AbstractResourceSimplifier
    Simplifies events, i.e. splits the generic skeleton of a given event resource into parts to contain no references. The skeleton parts are attached to newly created DOCUMENT_PART events. Original references are converted either to skeleton parts, or TEXT_UNIT events. The sequence of DOCUMENT_PART and TEXT_UNIT events is packed into a single MULTI_EVENT event. This class can handle only GenericSkeletonWriter and its subclasses.
    • Constructor Detail

      • GenericSkeletonSimplifier

        public GenericSkeletonSimplifier​(LocaleId trgLoc)
      • GenericSkeletonSimplifier

        public GenericSkeletonSimplifier​(String outEncoding,
                                         LocaleId trgLoc)
      • GenericSkeletonSimplifier

        public GenericSkeletonSimplifier()
    • Method Detail

      • initialize

        public void initialize()
      • packMultiEvent

        public static MultiEvent packMultiEvent​(MultiEvent me)
        Merges adjacent document parts into one. Will work for simple resources only.
        Parameters:
        me - the multi-event containing the events to merge.
        Returns:
        the resulting multi-event.
      • convertEvent

        protected Event convertEvent​(Event event)
        Converts a given event into a multi-event if it contains references in its source's codes or in skeleton, or passes it on if either the skeleton is no instance of GenericSkeleton, contains no references, or the resource is referent.
        Specified by:
        convertEvent in class AbstractResourceSimplifier
        Parameters:
        event - the given event
        Returns:
        the given event or a newly created multi-event