AmpComponent

Inheritance: java.lang.Object

public abstract class AmpComponent

Base class to representation amp components.

Constructors

Constructor Description
AmpComponent()

Methods

Method Description
getRequiredScript() Required script that muct be added to head section.
toAmpHtml() Represents amp html version of component.
toHtml() Represents html version of component.
getAttributes() AMP provides a set of common attributes that are extended to many AMP components.
getFallback() A fallback is a convention that allows the element to communicate to the reader that the browser does not support the element.
setFallback(String value) A fallback is a convention that allows the element to communicate to the reader that the browser does not support the element.
getPlaceholder() The element marked with the placeholder attribute acts as a placeholder for the parent AMP element.
setPlaceholder(AmpComponent value) The element marked with the placeholder attribute acts as a placeholder for the parent AMP element.

AmpComponent()

public AmpComponent()

getRequiredScript()

public abstract String getRequiredScript()

Required script that muct be added to head section.

Returns: java.lang.String

toAmpHtml()

public abstract String toAmpHtml()

Represents amp html version of component.

Returns: java.lang.String -

toHtml()

public abstract String toHtml()

Represents html version of component.

Returns: java.lang.String -

getAttributes()

public final AmpAttributes getAttributes()

AMP provides a set of common attributes that are extended to many AMP components.

Returns: AmpAttributes

getFallback()

public final String getFallback()

A fallback is a convention that allows the element to communicate to the reader that the browser does not support the element.

Returns: java.lang.String

setFallback(String value)

public final void setFallback(String value)

A fallback is a convention that allows the element to communicate to the reader that the browser does not support the element.

Parameters:

Parameter Type Description
value java.lang.String

getPlaceholder()

public final AmpComponent getPlaceholder()

The element marked with the placeholder attribute acts as a placeholder for the parent AMP element. If specified, a placeholder element must be a direct child of the AMP element.

Returns: AmpComponent

setPlaceholder(AmpComponent value)

public final void setPlaceholder(AmpComponent value)

The element marked with the placeholder attribute acts as a placeholder for the parent AMP element. If specified, a placeholder element must be a direct child of the AMP element.

Parameters:

Parameter Type Description
value AmpComponent