1 /* 2 * (c) Copyright 2006-2020 by rapiddweller GmbH & Volker Bergmann. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, is permitted under the terms of the 6 * GNU General Public License. 7 * 8 * For redistributing this software or a derivative work under a license other 9 * than the GPL-compatible Free Software License as defined by the Free 10 * Software Foundation or approved by OSI, you must first obtain a commercial 11 * license to this software product from rapiddweller GmbH & Volker Bergmann. 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 * WITHOUT A WARRANTY OF ANY KIND. ALL EXPRESS OR IMPLIED CONDITIONS, 15 * REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE 17 * HEREBY EXCLUDED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27 package com.rapiddweller.benerator; 28 29 import com.rapiddweller.benerator.factory.GeneratorFactory; 30 import com.rapiddweller.benerator.wrapper.ProductWrapper; 31 import com.rapiddweller.common.Context; 32 33 import java.util.Locale; 34 import java.util.concurrent.ExecutorService; 35 36 /** 37 * Provides configuration and variable space for {@link Generator}s.<br/><br/> 38 * Created: 14.03.2010 13:14:00 39 * 40 * @author Volker Bergmann 41 * @since 0.6.0 42 */ 43 public interface GeneratorContext extends Context { 44 45 // global properties ----------------------------------------------------------------------------------------------- 46 47 /** 48 * Gets default encoding. 49 * 50 * @return the default encoding 51 */ 52 String getDefaultEncoding(); 53 54 /** 55 * Gets default line separator. 56 * 57 * @return the default line separator 58 */ 59 String getDefaultLineSeparator(); 60 61 /** 62 * Gets default locale. 63 * 64 * @return the default locale 65 */ 66 Locale getDefaultLocale(); 67 68 /** 69 * Gets default dataset. 70 * 71 * @return the default dataset 72 */ 73 String getDefaultDataset(); 74 75 /** 76 * Gets default page size. 77 * 78 * @return the default page size 79 */ 80 long getDefaultPageSize(); 81 82 /** 83 * Gets default script. 84 * 85 * @return the default script 86 */ 87 String getDefaultScript(); 88 89 /** 90 * Is default null boolean. 91 * 92 * @return the boolean 93 */ 94 boolean isDefaultNull(); 95 96 /** 97 * Gets default separator. 98 * 99 * @return the default separator 100 */ 101 char getDefaultSeparator(); 102 103 /** 104 * Gets default error handler. 105 * 106 * @return the default error handler 107 */ 108 String getDefaultErrorHandler(); 109 110 /** 111 * Gets context uri. 112 * 113 * @return the context uri 114 */ 115 String getContextUri(); 116 117 /** 118 * Is validate boolean. 119 * 120 * @return the boolean 121 */ 122 boolean isValidate(); 123 124 /** 125 * Gets max count. 126 * 127 * @return the max count 128 */ 129 Long getMaxCount(); 130 131 // other features -------------------------------------------------------------------------------------------------- 132 133 /** 134 * Gets generator factory. 135 * 136 * @return the generator factory 137 */ 138 GeneratorFactory getGeneratorFactory(); 139 140 /** 141 * Gets global. 142 * 143 * @param name the name 144 * @return the global 145 */ 146 Object getGlobal(String name); 147 148 /** 149 * For name class. 150 * 151 * @param className the class name 152 * @return the class 153 */ 154 Class<?> forName(String className); 155 156 /** 157 * Gets executor service. 158 * 159 * @return the executor service 160 */ 161 ExecutorService getExecutorService(); 162 163 /** 164 * Resolve relative uri string. 165 * 166 * @param relativeUri the relative uri 167 * @return the string 168 */ 169 String resolveRelativeUri(String relativeUri); 170 171 /** 172 * Gets current product. 173 * 174 * @return the current product 175 */ 176 ProductWrapper<?> getCurrentProduct(); 177 178 /** 179 * Sets current product. 180 * 181 * @param currentProduct the current product 182 */ 183 void setCurrentProduct(ProductWrapper<?> currentProduct); 184 185 }