public class

Segment

extends ExtensionPoint
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.analytics.Segment

Class Overview

Describes a segment.

Summary

Constants
String ID XML "id" attribute name
String NAME XML "name" attribute name
String XML_NAME XML element name
Fields
private String id Id of the segment
private String name Name of the segment
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Segment()
Default mutable constructor.
Segment(String id, String name)
Immutable constructor.
Public Methods
void addProperty(Property property)
Adds a new property.
void declareExtensions(ExtensionProfile extProfile)
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
Returns the extension description, specifying whether it is required, and whether it is repeatable.
Definition getDefinition()
Returns the definition.
String getId()
Returns the id of the segment.
String getName()
Returns the name of the segment.
List<Property> getProperties()
Returns the properties.
String getProperty(String name)
Returns the value of the named property of this entry.
boolean hasDefinition()
Returns whether it has the definition.
boolean hasId()
Returns whether it has the id of the segment.
boolean hasName()
Returns whether it has the name of the segment.
boolean hasProperties()
Returns whether it has the properties.
void setDefinition(Definition definition)
Sets the definition.
void setId(String id)
Sets the id of the segment.
void setName(String name)
Sets the name of the segment.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String ID

XML "id" attribute name

Constant Value: "id"

private static final String NAME

XML "name" attribute name

Constant Value: "name"

static final String XML_NAME

XML element name

Constant Value: "segment"

Fields

private String id

Id of the segment

private String name

Name of the segment

Public Constructors

public Segment ()

Default mutable constructor.

public Segment (String id, String name)

Immutable constructor.

Parameters
id Id of the segment.
name Name of the segment.

Public Methods

public void addProperty (Property property)

Adds a new property.

Parameters
property Property

public void declareExtensions (ExtensionProfile extProfile)

Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

Parameters
extProfile The ExtensionProfile to initialize.

public static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

public Definition getDefinition ()

Returns the definition.

Returns
  • definition

public String getId ()

Returns the id of the segment.

Returns
  • id of the segment

public String getName ()

Returns the name of the segment.

Returns
  • name of the segment

public List<Property> getProperties ()

Returns the properties.

Returns
  • properties

public String getProperty (String name)

Returns the value of the named property of this entry. More specifically, it returns the content of the value attribute of the dxp:property whose name attribute matches the argument. Returns null if no such property exists.

Parameters
name The property to retrieve from this entry
Returns
  • string value of the named property or null if it doesn't exist

public boolean hasDefinition ()

Returns whether it has the definition.

Returns
  • whether it has the definition

public boolean hasId ()

Returns whether it has the id of the segment.

Returns
  • whether it has the id of the segment

public boolean hasName ()

Returns whether it has the name of the segment.

Returns
  • whether it has the name of the segment

public boolean hasProperties ()

Returns whether it has the properties.

Returns
  • whether it has the properties

public void setDefinition (Definition definition)

Sets the definition.

Parameters
definition Definition or null to reset

public void setId (String id)

Sets the id of the segment.

Parameters
id Id of the segment or null to reset

public void setName (String name)

Sets the name of the segment.

Parameters
name Name of the segment or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.