/Source/externals/GData/Source/Clients/WebmasterTools/GDataSiteKeyword.m

http://google-email-uploader-mac.googlecode.com/ · Objective C · 73 lines · 35 code · 19 blank · 19 comment · 1 complexity · 032fb1e63cf17f9a51805ebdf5ac64c7 MD5 · raw file

  1. /* Copyright (c) 2008 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataSiteKeyword.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
  19. #import "GDataSiteKeyword.h"
  20. #import "GDataWebmasterToolsConstants.h"
  21. // keyword, like
  22. // <wt:keyword source='internal'>cake</wt:keyword>
  23. static NSString* const kSourceAttr = @"source";
  24. @implementation GDataSiteKeyword
  25. + (NSString *)extensionElementPrefix { return kGDataNamespaceWebmasterToolsPrefix; }
  26. + (NSString *)extensionElementURI { return kGDataNamespaceWebmasterTools; }
  27. + (NSString *)extensionElementLocalName { return @"keyword"; }
  28. + (GDataSiteKeyword *)keywordWithSource:(NSString *)source
  29. stringValue:(NSString *)value {
  30. GDataSiteKeyword *obj = [self object];
  31. [obj setSource:source];
  32. [obj setStringValue:value];
  33. return obj;
  34. }
  35. - (void)addParseDeclarations {
  36. NSArray *attrs = [NSArray arrayWithObject:kSourceAttr];
  37. [self addLocalAttributeDeclarations:attrs];
  38. [self addContentValueDeclaration];
  39. }
  40. #pragma mark -
  41. - (NSString *)source {
  42. return [self stringValueForAttribute:kSourceAttr];
  43. }
  44. - (void)setSource:(NSString *)str {
  45. [self setStringValue:str forAttribute:kSourceAttr];
  46. }
  47. - (NSString *)stringValue {
  48. return [self contentStringValue];
  49. }
  50. - (void)setStringValue:(NSString *)str {
  51. [self setContentStringValue:str];
  52. }
  53. @end
  54. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE