|
@@ -47,7 +47,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
#pragma mark -
|
|
|
/**
|
|
|
* Initialises the global variables for various predefined namespaces.
|
|
|
- * @attention There is no need to call this method directly. It is automatically invoked during initialization of the RedlandWorld class.
|
|
|
+ * @warning There is no need to call this method directly. It is automatically invoked during initialization of the RedlandWorld class.
|
|
|
*/
|
|
|
+ (void)initGlobalNamespaces
|
|
|
{
|
|
@@ -77,7 +77,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
* @param aPrefix The URI prefix string which will be prepended to objects created by the new instance, e.g. <tt>http://purl.org/dc/elements/1.1/</tt>
|
|
|
* @param aName The short name for this namespace, e.g. <tt>dc</tt>
|
|
|
* @return The newly initialised instance
|
|
|
- * @attention The shortName is currently not used, but may be used later to provide automatic shortening of URIs.
|
|
|
+ * @warning The shortName is currently not used, but may be used later to provide automatic shortening of URIs.
|
|
|
*/
|
|
|
- (id)initWithPrefix:(NSString *)aPrefix shortName:(NSString *)aName
|
|
|
{
|
|
@@ -111,9 +111,9 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
#pragma mark - Registration
|
|
|
/**
|
|
|
* Returns a pre-registered instance with the given short name.
|
|
|
- * @attention This method allows you to retrieve previously registered namespace instances by their short name. For example, if you call
|
|
|
- [RDFSyntaxNS registerInstance], you can then get this instance by calling: [RedlandNamespace namespaceWithShortName:\@"rdf"].
|
|
|
- * @attention Under ARC, this method returns a strong reference.
|
|
|
+ * @warning This method allows you to retrieve previously registered namespace instances by their short name. For example, if you call
|
|
|
+ * [RDFSyntaxNS registerInstance], you can then get this instance by calling: [RedlandNamespace namespaceWithShortName:\@"rdf"].
|
|
|
+ * @warning Under ARC, this method returns a strong reference.
|
|
|
*/
|
|
|
+ (RedlandNamespace *)namespaceWithShortName:(NSString *)aName
|
|
|
{
|
|
@@ -122,7 +122,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
|
|
|
/**
|
|
|
* Registers the current instance so it can be retrieved by calling [RedlandNamespace namespaceWithShortName:].
|
|
|
- * @attention Raises an exception if there is already an instance registered for the receiver's shortName. The receiver automatically unregisters itself when it is deallocated.
|
|
|
+ * @warning Raises an exception if there is already an instance registered for the receiver's shortName. The receiver automatically unregisters itself when it is deallocated.
|
|
|
*/
|
|
|
- (void)registerInstance
|
|
|
{
|
|
@@ -134,9 +134,9 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
|
|
|
/**
|
|
|
* Removes the registration done by [RedlandNamespace registerInstance].
|
|
|
- * @attention Does nothing if the receiver is not registered.
|
|
|
- * @attention Because "+namespaceWithShortName:" returns a strong reference under ARC, we have to query "GlobalNamespaceDict" directly instead since
|
|
|
- this method is called from within "dealloc".
|
|
|
+ * @warning Does nothing if the receiver is not registered.
|
|
|
+ * @warning Because "+namespaceWithShortName:" returns a strong reference under ARC, we have to query "GlobalNamespaceDict" directly instead since
|
|
|
+ * this method is called from within "dealloc".
|
|
|
*/
|
|
|
- (void)unregisterInstance
|
|
|
{
|
|
@@ -233,7 +233,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
* Returns the local name of the given string in the receiver's namespace.
|
|
|
* @param qName A URI string
|
|
|
* @return A string generated by stripping the receiver's namespace prefix from the beginning of aString. If the string does not begin with the same prefix as
|
|
|
- the receiver, nil is returned.
|
|
|
+ * the receiver, nil is returned.
|
|
|
*/
|
|
|
- (NSString *)localNameOfURIString:(NSString *)qName
|
|
|
{
|
|
@@ -248,7 +248,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
* Returns the local name of the given RedlandNode in the receiver's namespace.
|
|
|
* @param aNode A RedlandNode of type resource
|
|
|
* @return A string generated by stripping the receiver's namespace prefix from the beginning of aNode's resource URI. If the node's resource URI does not
|
|
|
- begin with the same prefix as the receiver, or if the node is not of type resource, nil is returned.
|
|
|
+ * begin with the same prefix as the receiver, or if the node is not of type resource, nil is returned.
|
|
|
*/
|
|
|
- (NSString *)localNameOfNode:(RedlandNode *)aNode
|
|
|
{
|
|
@@ -260,7 +260,7 @@ static NSMutableDictionary *GlobalNamespaceDict = nil;
|
|
|
* Returns the local name of the given RedlandURI in the receiver's namespace.
|
|
|
* @param aURI A RedlandURI
|
|
|
* @return A string generated by stripping the receiver's namespace prefix from the beginning of aURI. If the URI does not begin with the same prefix as the
|
|
|
- receiver, nil is returned.
|
|
|
+ * receiver, nil is returned.
|
|
|
*/
|
|
|
- (NSString *)localNameOfURI:(RedlandURI *)aURI
|
|
|
{
|