public class CDataUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
EMPTY_STRING_ARRAY |
Constructor and Description |
---|
CDataUtil() |
Modifier and Type | Method and Description |
---|---|
static ICSourceEntry |
addExcludePaths(ICSourceEntry entry,
Collection<org.eclipse.core.runtime.IPath> paths,
boolean removePrefix) |
static ICExclusionPatternPathEntry |
addRemoveExclusionsToEntry(ICExclusionPatternPathEntry entry,
org.eclipse.core.runtime.IPath[] paths,
boolean add) |
static CConfigurationData |
adjustConfig(CConfigurationData cfg,
CDataFactory factory) |
static ICOutputEntry[] |
adjustEntries(ICOutputEntry[] entries,
boolean makeAbsolute,
org.eclipse.core.resources.IProject project) |
static ICSourceEntry[] |
adjustEntries(ICSourceEntry[] entries) |
static ICSourceEntry[] |
adjustEntries(ICSourceEntry[] entries,
boolean makeAbsolute,
org.eclipse.core.resources.IProject project) |
static String |
arrayToString(Object[] array,
String separator) |
static String |
arrayToString(String[] array,
String separator) |
static boolean |
canExclude(org.eclipse.core.runtime.IPath path,
boolean isFolder,
boolean excluded,
ICSourceEntry[] entries) |
static CIncludeFileEntry |
createCIncludeFileEntry(String name,
int flags)
Utility method to create
CIncludeFileEntry . |
static CIncludePathEntry |
createCIncludePathEntry(String name,
int flags)
Utility method to create
CIncludePathEntry . |
static CLibraryFileEntry |
createCLibraryFileEntry(String name,
int flags)
Utility method to create
CLibraryFileEntry . |
static CLibraryPathEntry |
createCLibraryPathEntry(String name,
int flags)
Utility method to create
CLibraryPathEntry . |
static CMacroEntry |
createCMacroEntry(String name,
String value,
int flags)
Utility method to create
CMacroEntry . |
static CMacroFileEntry |
createCMacroFileEntry(String name,
int flags)
Utility method to create
CMacroFileEntry . |
static CConfigurationData |
createEmptyData(String id,
String name,
CDataFactory factory,
boolean performLangAdjustment) |
static ICLanguageSettingEntry |
createEntry(ICLanguageSettingEntry entry,
int flags)
Convenience method to clone
ICLanguageSettingEntry with different flags. |
static ICLanguageSettingEntry |
createEntry(ICLanguageSettingEntry entry,
int flagsToAdd,
int flafsToClear)
Convenience method to clone
ICLanguageSettingEntry with modified flags. |
static ICSettingEntry |
createEntry(int kind,
String name,
String value,
org.eclipse.core.runtime.IPath[] exclusionPatterns,
int flags)
Convenience method to create
ICSettingEntry depending on kind. |
static ICSettingEntry |
createEntry(int kind,
String name,
String value,
org.eclipse.core.runtime.IPath[] exclusionPatterns,
int flags,
org.eclipse.core.runtime.IPath sourceAttachmentPath,
org.eclipse.core.runtime.IPath sourceAttachmentRootPath,
org.eclipse.core.runtime.IPath sourceAttachmentPrefixMapping)
Convenience method to create
ICSettingEntry depending on kind. |
static Map<org.eclipse.core.runtime.IPath,CResourceData> |
createPathRcDataMap(CConfigurationData data) |
static PathSettingsContainer |
createRcDataHolder(CConfigurationData data) |
static Map<EntryContentsKey,ICSettingEntry> |
fillEntriesMapByContentsKey(Map<EntryContentsKey,ICSettingEntry> map,
ICSettingEntry[] entries) |
static Map<EntryNameKey,ICSettingEntry> |
fillEntriesMapByNameKey(Map<EntryNameKey,ICSettingEntry> map,
ICSettingEntry[] entries) |
static CLanguageData |
findLanguagDataForFile(String fileName,
org.eclipse.core.resources.IProject project,
CFolderData fData) |
static CLanguageData |
findLanguagDataForFile(String fileName,
org.eclipse.core.resources.IProject project,
CLanguageData[] datas) |
static CLanguageData |
findLanguageDataForExtension(String ext,
CLanguageData[] datas) |
static String |
genId(String baseId) |
static int |
genRandomNumber() |
static boolean |
getBoolean(ICStorageElement el,
String attr,
boolean defaultValue) |
static String[] |
getContentTypeFileSpecs(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.content.IContentType type) |
static String[] |
getExtensionsFromContentTypes(org.eclipse.core.resources.IProject project,
String[] typeIds) |
static int |
getInteger(ICStorageElement el,
String attr,
int defaultValue) |
static <T extends ICSettingEntry> |
getPooledEntry(T entry)
Return entry cached in setting entries pool to optimize for memory usage.
|
static String[] |
getSourceExtensions(org.eclipse.core.resources.IProject project,
CLanguageData data) |
static boolean |
isEqual(ICSourceEntry[] ein,
ICSourceEntry[] aus) |
static boolean |
isExcluded(org.eclipse.core.runtime.IPath path,
ICSourceEntry entry) |
static boolean |
isExcluded(org.eclipse.core.runtime.IPath path,
ICSourceEntry[] entries) |
static boolean |
isOnSourceEntry(org.eclipse.core.runtime.IPath path,
ICSourceEntry entry) |
static ICExclusionPatternPathEntry[] |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICExclusionPatternPathEntry[] entries,
boolean force) |
static ICExclusionPatternPathEntry |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICExclusionPatternPathEntry entry,
boolean force) |
static ICOutputEntry |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICOutputEntry entry) |
static ICOutputEntry[] |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICOutputEntry[] entries) |
static ICSourceEntry |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICSourceEntry entry) |
static ICSourceEntry[] |
makeAbsolute(org.eclipse.core.resources.IProject project,
ICSourceEntry[] entries) |
static ICExclusionPatternPathEntry[] |
makeRelative(org.eclipse.core.resources.IProject project,
ICExclusionPatternPathEntry[] entries,
boolean force) |
static ICExclusionPatternPathEntry |
makeRelative(org.eclipse.core.resources.IProject project,
ICExclusionPatternPathEntry entry,
boolean force) |
static ICOutputEntry |
makeRelative(org.eclipse.core.resources.IProject project,
ICOutputEntry entry) |
static ICOutputEntry[] |
makeRelative(org.eclipse.core.resources.IProject project,
ICOutputEntry[] entries) |
static ICSourceEntry |
makeRelative(org.eclipse.core.resources.IProject project,
ICSourceEntry entry) |
static ICSourceEntry[] |
makeRelative(org.eclipse.core.resources.IProject project,
ICSourceEntry[] entries) |
static boolean |
objectsEqual(Object o1,
Object o2) |
static ICLanguageSettingEntry[] |
resolveEntries(ICLanguageSettingEntry[] entries,
ICConfigurationDescription cfgDes) |
static ICOutputEntry[] |
resolveEntries(ICOutputEntry[] entries,
ICConfigurationDescription cfgDes) |
static ICSettingEntry[] |
resolveEntries(ICSettingEntry[] entries,
ICConfigurationDescription cfgDes) |
static ICSourceEntry[] |
resolveEntries(ICSourceEntry[] entries,
ICConfigurationDescription cfgDes) |
static void |
setBoolean(ICStorageElement el,
String attr,
boolean value) |
static ICSourceEntry[] |
setExcluded(org.eclipse.core.runtime.IPath path,
boolean isFolder,
boolean excluded,
ICSourceEntry[] entries) |
static ICSourceEntry[] |
setExcluded(org.eclipse.core.runtime.IPath path,
boolean isFolder,
boolean excluded,
ICSourceEntry[] entries,
boolean throwExceptionOnErr) |
static ICSourceEntry[] |
setExcludedIfPossible(org.eclipse.core.runtime.IPath path,
boolean isFolder,
boolean excluded,
ICSourceEntry[] entries) |
static void |
setInteger(ICStorageElement el,
String attr,
int value) |
static String[] |
stringToArray(String string,
String separator) |
public static final String[] EMPTY_STRING_ARRAY
public static int genRandomNumber()
public static ICSettingEntry[] resolveEntries(ICSettingEntry[] entries, ICConfigurationDescription cfgDes)
public static ICLanguageSettingEntry[] resolveEntries(ICLanguageSettingEntry[] entries, ICConfigurationDescription cfgDes)
public static ICSourceEntry[] resolveEntries(ICSourceEntry[] entries, ICConfigurationDescription cfgDes)
public static ICOutputEntry[] resolveEntries(ICOutputEntry[] entries, ICConfigurationDescription cfgDes)
public static <T extends ICSettingEntry> T getPooledEntry(T entry)
public static ICLanguageSettingEntry createEntry(ICLanguageSettingEntry entry, int flagsToAdd, int flafsToClear)
ICLanguageSettingEntry
with modified flags.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.entry
- - source entry.flagsToAdd
- - binary combination of bits to add to the flags.flafsToClear
- - binary combination of bits to clear in the flags.public static ICLanguageSettingEntry createEntry(ICLanguageSettingEntry entry, int flags)
ICLanguageSettingEntry
with different flags.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.entry
- - source entry.flags
- - new flags.public static ICSettingEntry createEntry(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags)
ICSettingEntry
depending on kind.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static ICSettingEntry createEntry(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath sourceAttachmentPrefixMapping)
ICSettingEntry
depending on kind.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CIncludePathEntry createCIncludePathEntry(String name, int flags)
CIncludePathEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CIncludeFileEntry createCIncludeFileEntry(String name, int flags)
CIncludeFileEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CMacroEntry createCMacroEntry(String name, String value, int flags)
CMacroEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CMacroFileEntry createCMacroFileEntry(String name, int flags)
CMacroFileEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CLibraryPathEntry createCLibraryPathEntry(String name, int flags)
CLibraryPathEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static CLibraryFileEntry createCLibraryFileEntry(String name, int flags)
CLibraryFileEntry
.
Note that this method keeps the entries in the pool to avoid proliferation of duplicates.public static String[] getSourceExtensions(org.eclipse.core.resources.IProject project, CLanguageData data)
public static String[] getExtensionsFromContentTypes(org.eclipse.core.resources.IProject project, String[] typeIds)
public static String[] getContentTypeFileSpecs(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.content.IContentType type)
public static CLanguageData findLanguagDataForFile(String fileName, org.eclipse.core.resources.IProject project, CFolderData fData)
public static CLanguageData findLanguagDataForFile(String fileName, org.eclipse.core.resources.IProject project, CLanguageData[] datas)
public static CLanguageData findLanguageDataForExtension(String ext, CLanguageData[] datas)
public static Map<org.eclipse.core.runtime.IPath,CResourceData> createPathRcDataMap(CConfigurationData data)
public static PathSettingsContainer createRcDataHolder(CConfigurationData data)
public static CConfigurationData createEmptyData(String id, String name, CDataFactory factory, boolean performLangAdjustment)
public static CConfigurationData adjustConfig(CConfigurationData cfg, CDataFactory factory)
public static boolean isExcluded(org.eclipse.core.runtime.IPath path, ICSourceEntry[] entries)
public static boolean isExcluded(org.eclipse.core.runtime.IPath path, ICSourceEntry entry)
public static boolean isOnSourceEntry(org.eclipse.core.runtime.IPath path, ICSourceEntry entry)
public static boolean canExclude(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries)
public static boolean isEqual(ICSourceEntry[] ein, ICSourceEntry[] aus)
ein
- - initial source entriesaus
- - resulting source entriespublic static ICSourceEntry[] setExcluded(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public static ICSourceEntry[] setExcludedIfPossible(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries)
public static ICSourceEntry[] setExcluded(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries, boolean throwExceptionOnErr) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public static ICSourceEntry[] adjustEntries(ICSourceEntry[] entries)
public static ICOutputEntry[] adjustEntries(ICOutputEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project)
public static ICSourceEntry[] adjustEntries(ICSourceEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project)
public static ICSourceEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICSourceEntry entry)
public static ICSourceEntry makeRelative(org.eclipse.core.resources.IProject project, ICSourceEntry entry)
public static ICSourceEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries)
public static ICSourceEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries)
public static ICOutputEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICOutputEntry entry)
public static ICOutputEntry makeRelative(org.eclipse.core.resources.IProject project, ICOutputEntry entry)
public static ICOutputEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries)
public static ICOutputEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries)
public static ICSourceEntry addExcludePaths(ICSourceEntry entry, Collection<org.eclipse.core.runtime.IPath> paths, boolean removePrefix)
public static Map<EntryNameKey,ICSettingEntry> fillEntriesMapByNameKey(Map<EntryNameKey,ICSettingEntry> map, ICSettingEntry[] entries)
public static Map<EntryContentsKey,ICSettingEntry> fillEntriesMapByContentsKey(Map<EntryContentsKey,ICSettingEntry> map, ICSettingEntry[] entries)
public static boolean getBoolean(ICStorageElement el, String attr, boolean defaultValue)
public static void setBoolean(ICStorageElement el, String attr, boolean value)
public static int getInteger(ICStorageElement el, String attr, int defaultValue)
public static void setInteger(ICStorageElement el, String attr, int value)
public static ICExclusionPatternPathEntry addRemoveExclusionsToEntry(ICExclusionPatternPathEntry entry, org.eclipse.core.runtime.IPath[] paths, boolean add) throws IllegalArgumentException
IllegalArgumentException
public static ICExclusionPatternPathEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force)
public static ICExclusionPatternPathEntry makeRelative(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force)
public static ICExclusionPatternPathEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force)
public static ICExclusionPatternPathEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.