/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataBatchOperation.m

http://macfuse.googlecode.com/ · Objective C · 55 lines · 23 code · 13 blank · 19 comment · 0 complexity · c37de38f66900109e8061154c60bf4b1 MD5 · raw file

  1. /* Copyright (c) 2007-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. // GDataBatchOperation.m
  17. //
  18. #define GDATABATCH_DEFINE_GLOBALS 1
  19. #import "GDataBatchOperation.h"
  20. static NSString* const kTypeAttr = @"type";
  21. @implementation GDataBatchOperation
  22. // for batch operations, like
  23. // <batch:operation type="insert"/>
  24. + (NSString *)extensionElementURI { return kGDataNamespaceBatch; }
  25. + (NSString *)extensionElementPrefix { return kGDataNamespaceBatchPrefix; }
  26. + (NSString *)extensionElementLocalName { return @"operation"; }
  27. + (GDataBatchOperation *)batchOperationWithType:(NSString *)type {
  28. GDataBatchOperation* obj = [self object];
  29. [obj setType:type];
  30. return obj;
  31. }
  32. - (void)addParseDeclarations {
  33. NSArray *attrs = [NSArray arrayWithObject:kTypeAttr];
  34. [self addLocalAttributeDeclarations:attrs];
  35. }
  36. - (NSString *)type {
  37. return [self stringValueForAttribute:kTypeAttr];
  38. }
  39. - (void)setType:(NSString *)str {
  40. [self setStringValue:str forAttribute:kTypeAttr];
  41. }
  42. @end