Class DeveloperMetadataLocation

  • The DeveloperMetadataLocation class provides access to information about the location of developer metadata within a spreadsheet.

  • You can retrieve the location type of the metadata using the getLocationType() method.

  • Methods like getColumn(), getRow(), getSheet(), and getSpreadsheet() return the specific location (Range, Sheet, or Spreadsheet) based on the metadata's location type, or null if it doesn't match.

  • Accessing developer metadata location information typically requires authorization with spreadsheet-related scopes.

DeveloperMetadataLocation

Access developer metadata location information.

Methods

MethodReturn typeBrief description
getColumn() Range Returns the Range for the column location of this metadata, or null if the location type is not DeveloperMetadataLocationType.COLUMN.
getLocationType() DeveloperMetadataLocationType Gets the type of location.
getRow() Range Returns the Range for the row location of this metadata, or null if the location type is not DeveloperMetadataLocationType.ROW.
getSheet() Sheet Returns the Sheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SHEET.
getSpreadsheet() Spreadsheet Returns the Spreadsheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SPREADSHEET.

Detailed documentation

getColumn()

Returns the Range for the column location of this metadata, or null if the location type is not DeveloperMetadataLocationType.COLUMN.

Return

Range — The Range for the column location of this metadata, or null if the location type is not DeveloperMetadataLocationType.COLUMN.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getLocationType()

Gets the type of location.

Return

DeveloperMetadataLocationType — The location type.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getRow()

Returns the Range for the row location of this metadata, or null if the location type is not DeveloperMetadataLocationType.ROW.

Return

Range — The Range for the row location of this metadata, or null if the location type is not DeveloperMetadataLocationType.ROW.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSheet()

Returns the Sheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SHEET.

Return

Sheet — The Sheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SHEET.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSpreadsheet()

Returns the Spreadsheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SPREADSHEET.

Return

Spreadsheet — The Spreadsheet location of this metadata, or null if the location type is not DeveloperMetadataLocationType.SPREADSHEET.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月03日 UTC.