本文整理汇总了Java中com.google.gwt.core.ext.BadPropertyValueException类的典型用法代码示例。如果您正苦于以下问题:Java BadPropertyValueException类的具体用法?Java BadPropertyValueException怎么用?Java BadPropertyValueException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BadPropertyValueException类属于com.google.gwt.core.ext包,在下文中一共展示了BadPropertyValueException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractConfigProperty
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private Boolean extractConfigProperty(MortalLogger logger,
PropertyOracle propertyOracle, String configProperty, boolean defaultValue) {
List<String> values;
try {
values = propertyOracle.getConfigurationProperty(configProperty).getValues();
} catch (BadPropertyValueException e) {
logger.warn("No value found for configuration property %s.", configProperty);
return defaultValue;
}
String value = values.get(0);
if (!value.equals(Boolean.FALSE.toString()) && !value.equals(Boolean.TRUE.toString())) {
logger.warn("Unparseable value \"%s\" found for configuration property %s", value,
configProperty);
return defaultValue;
}
return Boolean.valueOf(value);
}
示例2: getPermutationsConditions
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private Set<String> getPermutationsConditions(ResourceContext context,
List<String> permutationAxes) {
Builder<String> setBuilder = ImmutableSet.builder();
PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();
for (String permutationAxis : permutationAxes) {
String propValue = null;
try {
SelectionProperty selProp = oracle.getSelectionProperty(null,
permutationAxis);
propValue = selProp.getCurrentValue();
} catch (BadPropertyValueException e) {
try {
ConfigurationProperty confProp = oracle.getConfigurationProperty(permutationAxis);
propValue = confProp.getValues().get(0);
} catch (BadPropertyValueException e1) {
e1.printStackTrace();
}
}
if (propValue != null) {
setBuilder.add(permutationAxis + ":" + propValue);
}
}
return setBuilder.build();
}
示例3: createCacheKey
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
/**
* Creates a cache key to be used with {@link ResourceContext#putCachedData}.
* The key is based on the ClientBundle type, support for data URLs, and the
* current locale.
*/
private String createCacheKey(ResourceContext context) {
StringBuilder sb = new StringBuilder();
sb.append(context.getClientBundleType().getQualifiedSourceName());
sb.append(":").append(context.supportsDataUrls());
try {
String locale = context.getGeneratorContext().getPropertyOracle().getSelectionProperty(
TreeLogger.NULL, "locale").getCurrentValue();
// add the locale selection property as a permuation axis for our requirements
context.getRequirements().addPermutationAxis("locale");
sb.append(locale);
} catch (BadPropertyValueException e) {
// OK, locale isn't defined
}
return sb.toString();
}
示例4: getValuesForProperty
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private Set<String> getValuesForProperty(String propertyName) {
try {
// Result of getConfigurationProperty can never be null.
return new LinkedHashSet<String>(
propertyOracle.getConfigurationProperty(propertyName).getValues());
} catch (BadPropertyValueException e) {
// Thrown when the configuration property is not defined.
return Collections.emptySet();
}
}
示例5: getGinModulesByProperties
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private String[] getGinModulesByProperties()
throws InvalidMvp4gConfigurationException {
String[] properties = ginModule.getModuleProperties();
String[] propertiesValue;
if (properties != null) {
int size = properties.length;
propertiesValue = new String[size];
String moduleClassName;
List<String> modules = ginModule.getModules();
if (modules == null) {
ginModule.setModules(new String[0]);
modules = ginModule.getModules();
}
String property;
for (int i = 0; i < size; i++) {
property = properties[i];
try {
moduleClassName = propertyOracle.getSelectionProperty(logger,
property)
.getCurrentValue()
.replace("$",
".");
} catch (BadPropertyValueException e) {
throw new InvalidMvp4gConfigurationException(String.format(GIN_MODULE_UNKNOWN_PROPERTY,
module.getSimpleSourceName(),
property,
e.getMessage()));
}
modules.add(moduleClassName);
propertiesValue[i] = moduleClassName;
}
} else {
propertiesValue = null;
}
return propertiesValue;
}
示例6: getSelectionProperty
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public SelectionProperty getSelectionProperty(TreeLogger logger,
String propertyName)
throws BadPropertyValueException {
SelectionProperty property = properties.get(propertyName);
if (property == null) {
throw new BadPropertyValueException("error");
}
return properties.get(propertyName);
}
示例7: getAssetPath
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private String getAssetPath (GeneratorContext context) {
ConfigurationProperty assetPathProperty = null;
try {
assetPathProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetpath");
} catch (BadPropertyValueException e) {
throw new RuntimeException(
"No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
}
if (assetPathProperty.getValues().size() == 0) {
throw new RuntimeException(
"No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
}
String paths = assetPathProperty.getValues().get(0);
if(paths == null) {
throw new RuntimeException(
"No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
} else {
ArrayList<String> existingPaths = new ArrayList<String>();
String[] tokens = paths.split(",");
for(String token: tokens) {
System.out.println(token);
if(new FileWrapper(token).exists() || new FileWrapper("../" + token).exists()) {
return token;
}
}
throw new RuntimeException(
"No valid gdx.assetpath defined. Fix <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> in your GWT projects gwt.xml file");
}
}
示例8: getAssetOutputPath
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private String getAssetOutputPath (GeneratorContext context) {
ConfigurationProperty assetPathProperty = null;
try {
assetPathProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetoutputpath");
} catch (BadPropertyValueException e) {
return null;
}
if (assetPathProperty.getValues().size() == 0) {
return null;
}
String paths = assetPathProperty.getValues().get(0);
if(paths == null) {
return null;
} else {
ArrayList<String> existingPaths = new ArrayList<String>();
String[] tokens = paths.split(",");
String path = null;
for(String token: tokens) {
if (new FileWrapper(token).exists() || new FileWrapper(token).mkdirs()) {
path = token;
}
}
if (path != null && !path.endsWith("/")){
path += "/";
}
return path;
}
}
示例9: getClasspathFiles
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private List<String> getClasspathFiles(GeneratorContext context) {
List<String> classpathFiles = new ArrayList<String>();
try {
ConfigurationProperty prop = context.getPropertyOracle().getConfigurationProperty("gdx.files.classpath");
for (String value : prop.getValues()) {
classpathFiles.add(value);
}
} catch (BadPropertyValueException e) {
// Ignore
}
return classpathFiles;
}
示例10: getStorageTypeFinders
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private static List<StorageTypeFinder> getStorageTypeFinders(GeneratorContext context, TreeLogger logger) throws UnableToCompleteException {
final List<StorageTypeFinder> typeFinders = new ArrayList<>();
JClassType keyProviderIntf = context.getTypeOracle().findType(StorageKeyProvider.class.getName());
if(keyProviderIntf.getSubtypes() != null && keyProviderIntf.getSubtypes().length > 1){
typeFinders.add(new TypeProviderFinder(context, logger));
}
PropertyOracle propertyOracle = context.getPropertyOracle();
try {
ConfigurationProperty property = propertyOracle.getConfigurationProperty(PROP_TYPE_FINDER);
String value = property == null ? TYPE_FINDER_VALUES.get(0) : property.getValues().get(0).toLowerCase();
switch(TYPE_FINDER_VALUES.indexOf(value)){
case 0:
typeFinders.add(new TypeRpcFinder(context, logger));
break;
case 1:
typeFinders.add(new TypeXmlFinder(context, logger));
break;
case 2:
typeFinders.add(new TypeRpcFinder(context, logger));
typeFinders.add(new TypeXmlFinder(context, logger));
break;
default:
break;
}
} catch (BadPropertyValueException e) {
logger.branch(TreeLogger.DEBUG, "Could not find property " + PROP_TYPE_FINDER, e);
}
return typeFinders;
}
示例11: getObfuscationPrefix
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private String getObfuscationPrefix(PropertyOracle propertyOracle, ResourceContext context)
throws BadPropertyValueException {
String prefix = propertyOracle.getConfigurationProperty(KEY_OBFUSCATION_PREFIX)
.getValues().get(0);
if ("empty".equalsIgnoreCase(prefix)) {
return "";
} else if ("default".equalsIgnoreCase(prefix)) {
return getDefaultObfuscationPrefix(context);
}
return prefix;
}
示例12: getConfigurationProperty
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public ConfigurationProperty getConfigurationProperty(String propertyName)
throws BadPropertyValueException {
// nothing to do
return null;
}
示例13: getPropertyValue
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public String getPropertyValue(TreeLogger logger,
String propertyName)
throws BadPropertyValueException {
// nothing to do
return null;
}
示例14: getPropertyValueSet
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public String[] getPropertyValueSet(TreeLogger logger,
String propertyName)
throws BadPropertyValueException {
// TODO Auto-generated method stub
return null;
}
示例15: findReflectedClasses
import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
private Set<JType> findReflectedClasses(final GeneratorContext context, final TypeOracle typeOracle,
final TreeLogger logger) throws UnableToCompleteException {
final Set<JType> types = new HashSet<JType>();
final JPackage[] packages = typeOracle.getPackages();
// gather all types from wanted packages
for (final JPackage jPackage : packages) {
for (final JClassType jType : jPackage.getTypes()) {
gatherTypes(jType.getErasedType(), types, context, logger);
}
}
// gather all types from explicitely requested packages
try {
final ConfigurationProperty reflectionProperties = context.getPropertyOracle()
.getConfigurationProperty("gdx.reflect.include");
for (final String property : reflectionProperties.getValues()) {
final JClassType type = typeOracle.findType(property);
if (type != null) {
gatherTypes(type.getErasedType(), types, context, logger);
}
}
} catch (final BadPropertyValueException exception) {
logger.log(Type.ERROR, "Unknown property: " + "gdx.reflect.include", exception);
throw new UnableToCompleteException();
}
gatherTypes(typeOracle.findType("java.util.List").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.util.ArrayList").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.util.HashMap").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.util.Map").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.String").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Boolean").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Byte").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Long").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Character").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Short").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Integer").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Float").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.CharSequence").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Double").getErasedType(), types, context, logger);
gatherTypes(typeOracle.findType("java.lang.Object").getErasedType(), types, context, logger);
return types;
}