com.google.gdata.data
Class AbstractExtension

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
All Implemented Interfaces:
Extension
Direct Known Subclasses:
AbstractFreeTextExtension, AbstractTextElement, AclScope, AdditionalName, ArchiveComplete, ArchiveFailure, ArchiveNotifyStatus, ArchiveStatus, ArchiveTotal, ArchiveTotalComplete, ArchiveTotalFailure, ClosedDate, ContainsSampledData, Country, CrawlIssueCrawlType, CrawlIssueDateDetected, CrawlIssueIssueType, CustomProperty, Deleted, Duration, EntriesNumber, ExportStatus, ExtensionPoint, FamilyName, FeatureRate, Field, FullName, GivenName, GmItemType, GphotoBytesUsed, GphotoCommentCount, GphotoCommentsEnabled, GphotoCrowdedLength, GphotoFeaturedDate, GphotoHeight, GphotoImageVersion, GphotoMaxPhotos, GphotoPhotosLeft, GphotoPhotosUsed, GphotoPosition, GphotoQuotaLimit, GphotoQuotaUsed, GphotoRotation, GphotoShowLink, GphotoSize, GphotoStarred, GphotoSubscribed, GphotoTimestamp, GphotoVersion, GphotoViewCount, GphotoWeight, GphotoWidth, GwoAutoPruneMode, GwoComboActive, GwoExperimentType, GwoStatus, Id, Jot, Keyword, LastViewed, MaxUploadSize, MediaCategory, MediaCopyright, MediaCredit, MediaHash, MediaKeywords, MediaRating, MediaRestriction, NumberOfSourceWords, ObjectNumber, OrgName, PercentComplete, QuotaBytesTotal, QuotaBytesUsed, QuotaBytesUsedInTrash, Relation, ResourceProperty, Review, Revision, ScopeEntry, Size, Source, Stars, State, Total, TranslationComplete, Usefulness, ValueConstruct, VerificationMethod, YtAge, YtAspectRatio, YtCommentRating, YtCountHint, YtDuration, YtFormatInfo, YtGender, YtIncomplete, YtNoEmbed, YtPlaylistId, YtPosition, YtPrivate, YtPublicationState, YtRacy, YtRating, YtRecorded, YtRelationship, YtSpam, YtStatistics, YtStatus, YtUploaded, YtUserProfileStatistics, YtVideoId

public abstract class AbstractExtension
extends java.lang.Object
implements Extension

Common extension implementation for sharing code among implementers of Extension. The information contained in this class is:

  1. XML namespace of the extension
  2. XML local name of the extension
  3. if the extension is mutable


Method Summary
static void disableStrictValidation()
           
static void enableStrictValidation()
           
 void generate(XmlWriter w, ExtensionProfile p)
          Generates an XML representation for the extension.
 java.lang.String getExtensionLocalName()
          Gets the extension's localname.
 XmlNamespace getExtensionNamespace()
          Gets the extension's namespace.
 XmlParser.ElementHandler getHandler(ExtensionProfile p, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)
          The default implementation uses the AttributesHandler to handle parsing the extension.
 boolean isImmutable()
           
static boolean isStrictValidation()
           
 void setImmutable(boolean isImmutable)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isStrictValidation

public static final boolean isStrictValidation()

enableStrictValidation

public static final void enableStrictValidation()

disableStrictValidation

public static final void disableStrictValidation()

isImmutable

public final boolean isImmutable()

setImmutable

public final void setImmutable(boolean isImmutable)

getExtensionNamespace

public final XmlNamespace getExtensionNamespace()
Gets the extension's namespace.


getExtensionLocalName

public final java.lang.String getExtensionLocalName()
Gets the extension's localname.


generate

public void generate(XmlWriter w,
                     ExtensionProfile p)
              throws java.io.IOException
Description copied from interface: Extension
Generates an XML representation for the extension.

Specified by:
generate in interface Extension
Parameters:
w - XML writer
p - extension profile
Throws:
java.io.IOException

getHandler

public XmlParser.ElementHandler getHandler(ExtensionProfile p,
                                           java.lang.String namespace,
                                           java.lang.String localName,
                                           org.xml.sax.Attributes attrs)
                                    throws ParseException
The default implementation uses the AttributesHandler to handle parsing the extension.

Specified by:
getHandler in interface Extension
Parameters:
p - extension profile
namespace - extension namespace
localName - tag name, without the namespace prefix
attrs - tag attributes
Returns:
an element handler
Throws:
ParseException - when an unexpected tag or badly-formatted XML is detected