public Resource fromProperties(Properties properties){
  String name=properties.getProperty(ResourcePropertySet.RESOURCE_NAME);
  String type=properties.getProperty(ResourcePropertySet.RESOURCE_TYPE);
  Resource resource=new Resource(name,type);
  if (properties.containsKey(ResourcePropertySet.RESOURCE_CLASS)) {
    String className=properties.getProperty(ResourcePropertySet.RESOURCE_CLASS);
    resource.setClassName(className);
  }
  if (properties.containsKey(ResourcePropertySet.RESOURCE_ID)) {
    String id=properties.getProperty(ResourcePropertySet.RESOURCE_ID);
    resource.setId(id);
  }
 else {
    resource.setId(createIdFromJndiLocationIfNotNull(name));
  }
  String parametersAsASemicolonDelimitedString=properties.getProperty(ResourcePropertySet.PARAMETERS);
  resource.setParameters(PropertyUtils.toMap(getParametersFromString(PropertyUtils.escapeBackSlashesIfNotNull(parametersAsASemicolonDelimitedString))));
  return resource;
}

public Resource fromProperties ( Properties properties ) { String name = properties . getProperty ( ResourcePropertySet . RESOURCE_NAME ) ; String type = properties . getProperty ( ResourcePropertySet . RESOURCE_TYPE ) ; Resource resource = new Resource ( name , type ) ; if ( properties . containsKey ( ResourcePropertySet . RESOURCE_CLASS ) ) { String className = properties . getProperty ( ResourcePropertySet . RESOURCE_CLASS ) ; resource . setClassName ( className ) ; } if ( properties . containsKey ( ResourcePropertySet . RESOURCE_ID ) ) { String id = properties . getProperty ( ResourcePropertySet . RESOURCE_ID ) ; resource . setId ( id ) ; } else { resource . setId ( createIdFromJndiLocationIfNotNull ( name ) ) ; } String parametersAsASemicolonDelimitedString = properties . getProperty ( ResourcePropertySet . PARAMETERS ) ; resource . setParameters ( PropertyUtils . toMap ( getParametersFromString ( PropertyUtils . escapeBackSlashesIfNotNull ( parametersAsASemicolonDelimitedString ) ) ) ) ; return resource ; }
construct a resource from a list of properties .
