Interface IClipStrategy

public interface IClipStrategy

Interface for clipping a web page. The exact strategy used for a portlet depends on how the preferences for that portlet are set.

If ClipperConstants.CLIP_CUSTOM_CLASS_PREFERENCE ("clipCustomClass") is set, and the value is the fully-qualified name of a class that can be found in the classpath, and which has a no-argument constructor, then that class will be used to clip for a portlet. If this preference is set, then any values of the preferences ClipperConstants.CLIP_XPATH_PREFERENCE ("clipXPath"), ClipperConstants.CLIP_START_REGEX_PREFERENCE ("clipStartText"), and ClipperConstants.CLIP_END_REGEX_PREFERENCE ("clipEndText") will be ignored.

Otherwise, if ClipperConstants.CLIP_XPATH_PREFERENCE is set, then that value will be taken as an XPath expression, and applied to the original page markup.

Otherwise, if both ClipperConstants.CLIP_START_REGEX_PREFERENCE and ClipperConstants.CLIP_END_REGEX_PREFERENCE are set, then all text between the first appearance of the start value, and the last index of the end value, inclusively, will be clipped.

For example, if your markup reads 123abcdef123abc, and your start regex was 123, and your end regex was abc, then the clipped output would be 123abc. If your markup is 123abcdef123abc, your start regex was abc, and your end regex was f123, then the clipped output would be abcdef123.

Otherwise, the page will not be clipped at all, and the clipper portlet will display the whole remote page.

See Also

Method Summary
 String clip(String markup)
          Clip some text.

Method Detail


String clip(String markup)
Clip some text.

Copyright © 2011, Oracle. All rights reserved.