PageRenderTime 24ms CodeModel.GetById 14ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/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//
17//  GDataSiteKeyword.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE
21
22#import "GDataSiteKeyword.h"
23#import "GDataWebmasterToolsConstants.h"
24
25// keyword, like
26//  <wt:keyword source='internal'>cake</wt:keyword>
27
28static NSString* const kSourceAttr = @"source";
29
30@implementation GDataSiteKeyword
31
32+ (NSString *)extensionElementPrefix    { return kGDataNamespaceWebmasterToolsPrefix; }
33+ (NSString *)extensionElementURI       { return kGDataNamespaceWebmasterTools; }
34+ (NSString *)extensionElementLocalName { return @"keyword"; }
35
36+ (GDataSiteKeyword *)keywordWithSource:(NSString *)source
37                            stringValue:(NSString *)value {
38
39  GDataSiteKeyword *obj = [self object];
40  [obj setSource:source];
41  [obj setStringValue:value];
42  return obj;
43}
44
45- (void)addParseDeclarations {
46
47  NSArray *attrs = [NSArray arrayWithObject:kSourceAttr];
48  [self addLocalAttributeDeclarations:attrs];
49
50  [self addContentValueDeclaration];
51}
52
53#pragma mark -
54
55- (NSString *)source {
56  return [self stringValueForAttribute:kSourceAttr];
57}
58
59- (void)setSource:(NSString *)str {
60  [self setStringValue:str forAttribute:kSourceAttr];
61}
62
63- (NSString *)stringValue {
64  return [self contentStringValue];
65}
66
67- (void)setStringValue:(NSString *)str {
68  [self setContentStringValue:str];
69}
70
71@end
72
73#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_WEBMASTERTOOLS_SERVICE