1 23 24 package org.apache.slide.search; 25 26 import org.apache.slide.common.SlideToken; 27 import org.apache.slide.common.Namespace; 28 import org.apache.slide.content.Content; 29 import org.apache.slide.structure.Structure; 30 31 36 public class SearchToken { 37 38 private SlideToken slideToken; 39 private Content contentHelper; 40 private Structure structureHelper; 41 42 private SlideUri slideContext; 43 44 private int maxDepth = Integer.MAX_VALUE; 45 46 private Namespace namespace; 47 48 58 public static SearchToken createSearchToken 59 (SlideToken token, Content content, 60 Structure structure, int maxDepth, 61 String requestUri, Namespace namespace) 62 { 63 return new SearchToken (token, content, structure, maxDepth, requestUri, namespace); 64 } 65 66 74 public static SearchToken createSearchTokenForTestOnly (int maxDepth, String requestUri) { 75 return new SearchToken (null, null, null, maxDepth, requestUri, null); 76 } 77 78 79 88 private SearchToken (SlideToken token, Content content, 89 Structure structure, int maxDepth, 90 String requestUri, Namespace namespace) { 91 92 this.slideToken = token; 93 this.contentHelper = content; 94 this.structureHelper = structure; 95 this.maxDepth = maxDepth; 96 this.slideContext = SlideUri.createWithRequestUri( 97 (String )token.getParameter("slideContextPath"), requestUri); 98 this.namespace = namespace; 99 } 100 101 107 public Namespace getNamespace () { 108 return namespace; 109 } 110 111 117 public SlideToken getSlideToken() { 118 return slideToken; 119 } 120 121 127 public Content getContentHelper() { 128 return contentHelper; 129 } 130 131 137 public Structure getStructureHelper() { 138 return structureHelper; 139 } 140 141 147 public int getMaxDepth() { 148 return maxDepth; 149 } 150 151 157 public SlideUri getSlideContext () { 158 return slideContext; 159 } 160 } 161 162 | Popular Tags |