パッケージ org.mixer2.xhtml

クラス PathAdjuster


  • public class PathAdjuster
    extends java.lang.Object

    path ajustment utility for image, style sheet, etc.

    target tag and attribute.
    tag attribute
    ahref
    appletcode
    codebase
    areahref
    audiosrc
    basehref
    blockquotecite
    delcite
    embedsrc
    formaction
    iframesrc
    imgsrc
    usemap
    inputsrc
    usemap
    inscite
    linkhref
    objectcodebase
    data
    usemap
    qcite
    scriptsrc
    tracksrc
    videosrc
    • コンストラクタの概要

      コンストラクタ 
      コンストラクタ 説明
      PathAdjuster()  
    • メソッドの概要

      すべてのメソッド staticメソッド concreteメソッド 
      修飾子とタイプ メソッド 説明
      static <T extends AbstractJaxb>
      void
      replacePath​(T target, java.util.regex.Pattern pattern, java.lang.String replacement)
      replace all the path.
      static <T extends AbstractJaxb>
      void
      replacePathExclude​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.String> excludeClazz, java.util.List<java.lang.Class<?>> excludeTagType)  
      static <T extends AbstractJaxb>
      void
      replacePathExcludeClass​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.String> excludeClazz)  
      static <T extends AbstractJaxb>
      void
      replacePathExcludeTag​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.Class<?>> excludeTagType)  
      static <T extends AbstractJaxb>
      void
      replacePathInclude​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.String> includeClazz, java.util.List<java.lang.Class<?>> includeTagType)  
      static <T extends AbstractJaxb>
      void
      replacePathIncludeClass​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.String> includeClazz)  
      static <T extends AbstractJaxb>
      void
      replacePathIncludeTag​(T target, java.util.regex.Pattern pattern, java.lang.String replacement, java.util.List<java.lang.Class<?>> includeTagType)  
      • クラスから継承されたメソッド java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • PathAdjuster

        public PathAdjuster()
    • メソッドの詳細

      • replacePath

        public static <T extends AbstractJaxb> void replacePath​(T target,
                                                                java.util.regex.Pattern pattern,
                                                                java.lang.String replacement)

        replace all the path.

        template html
        
         <html>
         <head>
           <script src="foo/bar.js"> </script>
         </head>
         <body>
           <a href="foo/bar.html">bar.html</a>
           <img src="foo/bar.png" />
         </body>
         </html>
         
        code
        
         Html html = mixer2Engine.loadHtmlTemplate(templateString);
         PathAjuster.replacePath(html, Pattern.compile("^foo/"), "xyz/");
         System.out.println(mixer2Engine.saveToString(html));
         
        result:
        
         <html>
         <head>
           <script src="xyz/bar.js"> </script>
         </head>
         <body>
           <a href="xyz/bar.html">bar.html</a>
           <img src="xyz/bar.png" />
         </body>
         </html>
         
        パラメータ:
        target - tag
        pattern - regex pattern
        replacement - replacemnet string.
      • replacePathIncludeClass

        public static <T extends AbstractJaxb> void replacePathIncludeClass​(T target,
                                                                            java.util.regex.Pattern pattern,
                                                                            java.lang.String replacement,
                                                                            java.util.List<java.lang.String> includeClazz)
      • replacePathIncludeTag

        public static <T extends AbstractJaxb> void replacePathIncludeTag​(T target,
                                                                          java.util.regex.Pattern pattern,
                                                                          java.lang.String replacement,
                                                                          java.util.List<java.lang.Class<?>> includeTagType)
      • replacePathInclude

        public static <T extends AbstractJaxb> void replacePathInclude​(T target,
                                                                       java.util.regex.Pattern pattern,
                                                                       java.lang.String replacement,
                                                                       java.util.List<java.lang.String> includeClazz,
                                                                       java.util.List<java.lang.Class<?>> includeTagType)
      • replacePathExcludeClass

        public static <T extends AbstractJaxb> void replacePathExcludeClass​(T target,
                                                                            java.util.regex.Pattern pattern,
                                                                            java.lang.String replacement,
                                                                            java.util.List<java.lang.String> excludeClazz)
      • replacePathExcludeTag

        public static <T extends AbstractJaxb> void replacePathExcludeTag​(T target,
                                                                          java.util.regex.Pattern pattern,
                                                                          java.lang.String replacement,
                                                                          java.util.List<java.lang.Class<?>> excludeTagType)
      • replacePathExclude

        public static <T extends AbstractJaxb> void replacePathExclude​(T target,
                                                                       java.util.regex.Pattern pattern,
                                                                       java.lang.String replacement,
                                                                       java.util.List<java.lang.String> excludeClazz,
                                                                       java.util.List<java.lang.Class<?>> excludeTagType)