Package gw.internal.gosu.properties
Class PropertiesPropertySet.Source
- java.lang.Object
-
- gw.internal.gosu.properties.PropertiesPropertySet.Source
-
- All Implemented Interfaces:
PropertySetSource
- Enclosing class:
- PropertiesPropertySet
public static class PropertiesPropertySet.Source extends java.lang.Object implements PropertySetSource
Knows how to find all the property files in a module and create PropertiesPropertySets from them.
-
-
Field Summary
Fields Modifier and Type Field Description private LockingLazyVar<java.util.Map<java.lang.String,IFile>>_filesByTypeNameprivate IModule_moduleprivate static java.lang.StringEXTENSION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddAllLocalResourceFilesByExtensionInternal(java.lang.String relativePath, IDirectory dir, java.lang.String extension, java.util.List<Pair<java.lang.String,IFile>> results)private static java.lang.StringappendResourceNameToPath(java.lang.String relativePath, java.lang.String resourceName)private static voidcloseSafely(java.io.InputStream inputStream)java.util.List<Pair<java.lang.String,IFile>>findAllFilesByExtension(java.lang.String extension)IFilegetFile(java.lang.String name)Returns the file for the given name.PropertySetgetPropertySet(java.lang.String name)Return the named property setPropertySetgetPropertySetForFile(IFile file)Return the property set for the given filejava.util.Set<java.lang.String>getPropertySetNames()The names of all the property sets available from this sourceprivate static booleanisValidTypeName(java.lang.String typeName)
-
-
-
Field Detail
-
EXTENSION
private static final java.lang.String EXTENSION
- See Also:
- Constant Field Values
-
_module
private final IModule _module
-
_filesByTypeName
private final LockingLazyVar<java.util.Map<java.lang.String,IFile>> _filesByTypeName
-
-
Constructor Detail
-
Source
public Source(IModule module)
-
-
Method Detail
-
findAllFilesByExtension
public java.util.List<Pair<java.lang.String,IFile>> findAllFilesByExtension(java.lang.String extension)
-
addAllLocalResourceFilesByExtensionInternal
private void addAllLocalResourceFilesByExtensionInternal(java.lang.String relativePath, IDirectory dir, java.lang.String extension, java.util.List<Pair<java.lang.String,IFile>> results)
-
appendResourceNameToPath
private static java.lang.String appendResourceNameToPath(java.lang.String relativePath, java.lang.String resourceName)
-
getPropertySetForFile
public PropertySet getPropertySetForFile(IFile file)
Description copied from interface:PropertySetSourceReturn the property set for the given file- Specified by:
getPropertySetForFilein interfacePropertySetSource- Parameters:
file- the name of the file- Returns:
- a property set, or null if the name is not in the set returned by
PropertySetSource.getPropertySetNames()
-
getFile
public IFile getFile(java.lang.String name)
Description copied from interface:PropertySetSourceReturns the file for the given name.- Specified by:
getFilein interfacePropertySetSource
-
getPropertySetNames
public java.util.Set<java.lang.String> getPropertySetNames()
Description copied from interface:PropertySetSourceThe names of all the property sets available from this source- Specified by:
getPropertySetNamesin interfacePropertySetSource- Returns:
- a non null set of property set names
-
getPropertySet
public PropertySet getPropertySet(java.lang.String name)
Description copied from interface:PropertySetSourceReturn the named property set- Specified by:
getPropertySetin interfacePropertySetSource- Parameters:
name- the name of the property set- Returns:
- a property set, or null if the name is not in the set returned by
PropertySetSource.getPropertySetNames()
-
isValidTypeName
private static boolean isValidTypeName(java.lang.String typeName)
-
closeSafely
private static void closeSafely(java.io.InputStream inputStream)
-
-