当前位置: 首页>>代码示例>>Java>>正文


Java BadPropertyValueException类代码示例

本文整理汇总了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);
}
 
开发者ID:ahome-it,项目名称:ahome-core,代码行数:20,代码来源:UiBinderGenerator.java

示例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();
}
 
开发者ID:jDramaix,项目名称:gss.gwt,代码行数:27,代码来源:GssResourceGenerator.java

示例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();
}
 
开发者ID:kDCYorke,项目名称:RetinaImages,代码行数:24,代码来源:RetinaImageResourceGenerator.java

示例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();
  }
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:11,代码来源:GinjectorGenerator.java

示例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;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:37,代码来源:Mvp4gConfiguration.java

示例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);
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:10,代码来源:PropertyOracleStub.java

示例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");
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:30,代码来源:PreloaderBundleGenerator.java

示例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;
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:PreloaderBundleGenerator.java

示例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;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:13,代码来源:PreloaderBundleGenerator.java

示例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;
}
 
开发者ID:seanchenxi,项目名称:gwt-storage,代码行数:32,代码来源:StorageTypeFinder.java

示例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;
}
 
开发者ID:jDramaix,项目名称:gss.gwt,代码行数:13,代码来源:GssResourceGenerator.java

示例12: getConfigurationProperty

import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public ConfigurationProperty getConfigurationProperty(String propertyName)
  throws BadPropertyValueException {
  // nothing to do
  return null;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:6,代码来源:PropertyOracleStub.java

示例13: getPropertyValue

import com.google.gwt.core.ext.BadPropertyValueException; //导入依赖的package包/类
public String getPropertyValue(TreeLogger logger,
                               String propertyName)
  throws BadPropertyValueException {
  // nothing to do
  return null;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:7,代码来源:PropertyOracleStub.java

示例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;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:7,代码来源:PropertyOracleStub.java

示例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;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:46,代码来源:ReflectionPoolGenerator.java


注:本文中的com.google.gwt.core.ext.BadPropertyValueException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。