Package com.ptc.windchill.util
Class UnitIdentifierUtil
java.lang.Object
com.ptc.windchill.util.UnitIdentifierUtil
Supported API: true
Extendable: false
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char
Supported API: truestatic final char
Supported API: truestatic final char
Supported API: truestatic final char
Supported API: true -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetBaseUnitName(String identifier) Gets the base unit name from a unit identifier.static StringgetModuleName(String identifier) Gets the module name from a unit identifier.static StringgetModuleQualifiedName(String module_name, String unit_name) Gets the module qualified unit identifier, given a module name and a unit name.static StringgetModuleQualifiedName(String module_name, String sub_name, String pkg_name) Gets the module qualified unit identifier, given a module name, subsystem name and and unit name.static StringgetPackageName(String identifier) Gets the package name from a unit identifier.static StringgetSubsystemName(String identifier) Gets the subsystem name from a unit identifier.static StringgetUnitName(String identifier) Gets the unit name from a unit identifier- i.e., strip off the module qualification.static booleanisClassTarget(String target) Determine if target represents a class.static booleanisModuleIdentifier(String identifier) Determine if identifier represents a module.static booleanisModuleQualified(String identifier) Determine if identifier is module qualified (really a unit identifier).static booleanisModuleTarget(String target) Determine if target represents a module.static booleanisPackageIdentifier(String identifier) Determine if identifier represents a module.protected static booleanisPackageQualified(String identifier) Determine if identifier is package qualified.static booleanisSubsystemIdentifier(String identifier) Determine if identifier represents a module.
-
Field Details
-
ASSEMBLY_SEPARATOR
public static final char ASSEMBLY_SEPARATOR
Supported API: true- See Also:
-
MODULE_SEPARATOR
public static final char MODULE_SEPARATOR
Supported API: true- See Also:
-
SUBSYSTEM_SEPARATOR
public static final char SUBSYSTEM_SEPARATOR
Supported API: true- See Also:
-
PACKAGE_SEPARATOR
public static final char PACKAGE_SEPARATOR
Supported API: true- See Also:
-
-
Method Details
-
isPackageIdentifier
Determine if identifier represents a module.Example Usage: UnitIdentifierUtil.isPackageIdentifier( "WNC/CommonCore:wt.util.LogFile" ); // return true (false positive) UnitIdentifierUtil.isPackageIdentifier( "WNC/CommonCore:wt.util" ); // return true UnitIdentifierUtil.isPackageIdentifier( "WNC/CommonCore:wt" ); // return true (if it is defined in property) UnitIdentifierUtil.isPackageIdentifier( "WNC/CommonCore:sub1" ); // return false UnitIdentifierUtil.isPackageIdentifier( "WNC/CommonCore" ); // return false
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- boolean true if it represents a package (either package qualified or included in com.ptc.windchill.packaging.package_units property)
-
isPackageQualified
Determine if identifier is package qualified.Example Usage: UnitIdentifierUtil.isPackageQualified( "WNC/CommonCore:wt.util" ); // return true UnitIdentifierUtil.isPackageQualified( "WNC/CommonCore:wt" ); // return false UnitIdentifierUtil.isPackageQualified( "wt.util" ); // return true
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- boolean true if it is package qualified (contains package separator)
-
isModuleQualified
Determine if identifier is module qualified (really a unit identifier).Example Usage: UnitIdentifierUtil.isModuleQualified( "WNC/CommonCore:wt.util" ); // return true UnitIdentifierUtil.isModuleQualified( "WNC/CommonCore:" ); // return true UnitIdentifierUtil.isModuleQualified( "WNC/CommonCore" ); // return false UnitIdentifierUtil.isModuleQualified( ":" ); // return true
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- boolean true if it is module qualified (contains module separator)
-
isModuleTarget
Determine if target represents a module.Example Usage: UnitIdentifierUtil.isModuleTarget( "WNC/CommonCore:wt.util" ); // return false UnitIdentifierUtil.isModuleTarget( "WNC/CommonCore:sub1" ); // return false UnitIdentifierUtil.isModuleTarget( "WNC/CommonCore:" ); // return true UnitIdentifierUtil.isModuleTarget( "WNC/CommonCore" ); // return true UnitIdentifierUtil.isModuleTarget( "registry" ); // return false
Supported API: true- Parameters:
target- external form for a unit identifier- Returns:
- boolean true if it represents a module
-
isModuleIdentifier
Determine if identifier represents a module.Example Usage: UnitIdentifierUtil.isModuleIdentifier( "WNC/CommonCore:wt.util" ); // return false UnitIdentifierUtil.isModuleIdentifier( "WNC/CommonCore:sub1" ); // return false UnitIdentifierUtil.isModuleIdentifier( "WNC/CommonCore:" ); // return false UnitIdentifierUtil.isModuleIdentifier( "WNC/CommonCore" ); // return true UnitIdentifierUtil.isModuleIdentifier( "registry" ); // return true (false positive)
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- boolean true if it represents a module
-
isSubsystemIdentifier
Determine if identifier represents a module.Example Usage: UnitIdentifierUtil.isSubsystemIdentifier( "WNC/CommonCore:wt.util" ); // return false UnitIdentifierUtil.isSubsystemIdentifier( "WNC/CommonCore:sub1" ); // return true UnitIdentifierUtil.isSubsystemIdentifier( "WNC/CommonCore:wt" ); // return false UnitIdentifierUtil.isSubsystemIdentifier( "WNC/CommonCore" ); // return false
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- boolean true if it represents a subsystem
-
isClassTarget
Determine if target represents a class.Example Usage: UnitIdentifierUtil.isClassTarget( "WNC/CommonCore:wt.util.*" ); // return false UnitIdentifierUtil.isClassTarget( "WNC/CommonCore:wt.util" ); // return true (false positive) UnitIdentifierUtil.isClassTarget( "WNC/CommonCore:wt.util.LogFile" ); // return true
Supported API: true- Parameters:
target- an identifier to process, class target must not end with "*" and must contain a package separator "."- Returns:
- boolean true if it represents a class
-
getModuleName
Gets the module name from a unit identifier.Example Usage: UnitIdentifierUtil.getModuleName( "WNC/CommonCore:wt.util.*" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleName( "WNC/CommonCore:wt.util" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleName( "WNC/CommonCore:wt.util.LogFile" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleName( "WNC/CommonCore:sub1" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleName( "WNC/CommonCore" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleName( "wt.util" ); // return ""
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- String the module name, otherwise empty string ""
-
getSubsystemName
Gets the subsystem name from a unit identifier.Example Usage: UnitIdentifierUtil.getSubsystemName( "WNC/CommonCore:wt.util.*" ); // return "" UnitIdentifierUtil.getSubsystemName( "WNC/CommonCore:wt.util" ); // return "" UnitIdentifierUtil.getSubsystemName( "wt.util" ); // return "" UnitIdentifierUtil.getSubsystemName( "WNC/CommonCore:wt.util.LogFile" ); // return "" UnitIdentifierUtil.getSubsystemName( "WNC/CommonCore:sub1" ); // return "sub1" UnitIdentifierUtil.getSubsystemName( "WNC/CommonCore" ); // return "" UnitIdentifierUtil.getSubsystemName( "WNC/Windchill:ApplicationServices/Indexing/wt.index"); // return "ApplicationServices/Indexing"
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- String the subsystem name
-
getPackageName
Gets the package name from a unit identifier.Example Usage: UnitIdentifierUtil.getPackageName( "WNC/CommonCore:wt.util.*" ); // return "wt.util.*" UnitIdentifierUtil.getPackageName( "WNC/CommonCore:wt.util" ); // return "wt.util" UnitIdentifierUtil.getPackageName( "wt.util" ); // return "wt.util" UnitIdentifierUtil.getPackageName( "WNC/CommonCore:wt.util.LogFile" ); // return "wt.util.LogFile" UnitIdentifierUtil.getPackageName( "WNC/CommonCore:sub1" ); // return "" UnitIdentifierUtil.getPackageName( "WNC/CommonCore" ); // return "" UnitIdentifierUtil.getPackageName( "WNC/Windchill:ApplicationServices/Indexing/wt.index"); // return "wt.index"
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- String the package name
-
getUnitName
Gets the unit name from a unit identifier- i.e., strip off the module qualification.Example Usage: UnitIdentifierUtil.getUnitName( "WNC/CommonCore:wt.util.*" ); // return "wt.util.*" UnitIdentifierUtil.getUnitName( "WNC/CommonCore:wt.util" ); // return "wt.util" UnitIdentifierUtil.getUnitName( "wt.util" ); // return "wt.util" UnitIdentifierUtil.getUnitName( "WNC/CommonCore:wt.util.LogFile" ); // return "wt.util.LogFile" UnitIdentifierUtil.getUnitName( "WNC/CommonCore:sub1" ); // return "sub1" UnitIdentifierUtil.getUnitName( "WNC/CommonCore" ); // return "WNC/CommonCore" UnitIdentifierUtil.getUnitName( "WNC/Windchill:ApplicationServices/Indexing/wt.index"); // return "ApplicationServices/Indexing/wt.index"
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- String the unit name
-
getBaseUnitName
Gets the base unit name from a unit identifier. That is, the most basic level of identifier, without any upper level qualification.Example Usage: UnitIdentifierUtil.getBaseUnitName( "WNC/CommonCore:wt.util.*" ); // return "wt.util.*" UnitIdentifierUtil.getBaseUnitName( "WNC/CommonCore:wt.util" ); // return "wt.util" UnitIdentifierUtil.getBaseUnitName( "wt.util" ); // return "wt.util" UnitIdentifierUtil.getBaseUnitName( "WNC/CommonCore:wt.util.LogFile" ); // return "wt.util.LogFile" UnitIdentifierUtil.getBaseUnitName( "WNC/CommonCore:sub1" ); // return "sub1" UnitIdentifierUtil.getBaseUnitName( "WNC/CommonCore" ); // return "WNC/CommonCore" UnitIdentifierUtil.getBaseUnitName( "WNC/Windchill:ApplicationServices/Indexing/wt.index"); // return "wt.index"
Supported API: true- Parameters:
identifier- external form for a unit identifier- Returns:
- String the base unit name
-
getModuleQualifiedName
Gets the module qualified unit identifier, given a module name and a unit name.Example Usage: UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "wt.util" ); // return "WNC/CommonCore:wt.util.*" UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleQualifiedName( "", "wt.util" ); // return "wt.util" UnitIdentifierUtil.getModuleQualifiedName( "", "" ); // return ""
Supported API: true- Parameters:
module_name- module nameunit_name- unit (subsystem, package or class) name- Returns:
- String module qualified unit name
-
getModuleQualifiedName
Gets the module qualified unit identifier, given a module name, subsystem name and and unit name.Example Usage: UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "", "wt.util" ); // return "WNC/CommonCore:wt.util.*" UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "", "" ); // return "WNC/CommonCore" UnitIdentifierUtil.getModuleQualifiedName( "", "", "wt.util" ); // return "wt.util" UnitIdentifierUtil.getModuleQualifiedName( "", "", "" ); // return "" UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "ApplicationServices/Indexing", "" ); // return "WNC/CommonCore:ApplicationServices/Indexing" UnitIdentifierUtil.getModuleQualifiedName( "WNC/CommonCore", "ApplicationServices/Indexing", "wt.util" ); // return "WNC/CommonCore:ApplicationServices/Indexing/wt.util"
Supported API: true- Parameters:
module_name- module nameunit_name- unit (subsystem, package or class) name- Returns:
- String module qualified unit name
-