Class DeveloperMetadataLocation
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
详细文档
getColumn()
返回此元数据的列位置的 Range
;如果位置类型不是 DeveloperMetadataLocationType.COLUMN
,则返回 null
。
返回
Range
- 此元数据的列位置的 Range
;如果位置类型不是 DeveloperMetadataLocationType.COLUMN
,则为 null
。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getLocationType()
获取营业地点的类型。
返回
DeveloperMetadataLocationType
- 营业地点类型。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRow()
返回此元数据的行位置的 Range
;如果位置类型不是 DeveloperMetadataLocationType.ROW
,则返回 null
。
返回
Range
- 此元数据的行位置的 Range
;如果位置类型不是 DeveloperMetadataLocationType.ROW
,则为 null
。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSheet()
返回此元数据的 Sheet
位置;如果位置类型不是 DeveloperMetadataLocationType.SHEET
,则返回 null
。
返回
Sheet
- 此元数据的 Sheet
位置;如果位置类型不是 DeveloperMetadataLocationType.SHEET
,则为 null
。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSpreadsheet()
返回此元数据的 Spreadsheet
位置;如果位置类型不是 DeveloperMetadataLocationType.SPREADSHEET
,则返回 null
。
返回
Spreadsheet
- 此元数据的 Spreadsheet
位置;如果位置类型不是 DeveloperMetadataLocationType.SPREADSHEET
,则为 null
。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eDeveloperMetadataLocation\u003c/code\u003e provides access to information about the location of developer metadata within a spreadsheet.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to retrieve the location type, which can be a spreadsheet, sheet, row, or column.\u003c/p\u003e\n"],["\u003cp\u003eYou can get the specific Spreadsheet, Sheet, or Range associated with the metadata, depending on its location type.\u003c/p\u003e\n"],["\u003cp\u003eAll methods require authorization with either \u003ccode\u003ehttps://www.googleapis.com/auth/spreadsheets.currentonly\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/spreadsheets\u003c/code\u003e scopes.\u003c/p\u003e\n"]]],[],null,["# Class DeveloperMetadataLocation\n\nDeveloperMetadataLocation\n\nAccess developer metadata location information. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getColumn()](#getColumn()) | [Range](/apps-script/reference/spreadsheet/range) | Returns the [Range](/apps-script/reference/spreadsheet/range) for the column location of this metadata, or `null` if the location type is not `Developer``Metadata``Location``Type.COLUMN`. |\n| [getLocationType()](#getLocationType()) | [DeveloperMetadataLocationType](/apps-script/reference/spreadsheet/developer-metadata-location-type) | Gets the type of location. |\n| [getRow()](#getRow()) | [Range](/apps-script/reference/spreadsheet/range) | Returns the [Range](/apps-script/reference/spreadsheet/range) for the row location of this metadata, or `null` if the location type is not `Developer``Metadata``Location``Type.ROW`. |\n| [getSheet()](#getSheet()) | [Sheet](/apps-script/reference/spreadsheet/sheet) | Returns the [Sheet](/apps-script/reference/spreadsheet/sheet) location of this metadata, or `null` if the location type is not `Developer``Metadata``Location``Type.SHEET`. |\n| [getSpreadsheet()](#getSpreadsheet()) | [Spreadsheet](/apps-script/reference/spreadsheet/spreadsheet) | Returns the [Spreadsheet](/apps-script/reference/spreadsheet/spreadsheet) location of this metadata, or `null` if the location type is not `Developer``Metadata``Location``Type.SPREADSHEET`. |\n\nDetailed documentation\n----------------------\n\n### `get``Column()`\n\nReturns the [Range](/apps-script/reference/spreadsheet/range) for the column location of this metadata, or `null` if the\nlocation type is not `Developer``Metadata``Location``Type.COLUMN`.\n\n#### Return\n\n\n[Range](/apps-script/reference/spreadsheet/range) --- The [Range](/apps-script/reference/spreadsheet/range) for the column location of this metadata, or `null` if the\nlocation type is not `Developer``Metadata``Location``Type.COLUMN`.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Location``Type()`\n\nGets the type of location.\n\n#### Return\n\n\n[DeveloperMetadataLocationType](/apps-script/reference/spreadsheet/developer-metadata-location-type) --- The location type.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Row()`\n\nReturns the [Range](/apps-script/reference/spreadsheet/range) for the row location of this metadata, or `null` if the\nlocation type is not `Developer``Metadata``Location``Type.ROW`.\n\n#### Return\n\n\n[Range](/apps-script/reference/spreadsheet/range) --- The [Range](/apps-script/reference/spreadsheet/range) for the row location of this metadata, or `null` if the\nlocation type is not `Developer``Metadata``Location``Type.ROW`.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Sheet()`\n\nReturns the [Sheet](/apps-script/reference/spreadsheet/sheet) location of this metadata, or `null` if the location type is\nnot `Developer``Metadata``Location``Type.SHEET`.\n\n#### Return\n\n\n[Sheet](/apps-script/reference/spreadsheet/sheet) --- The [Sheet](/apps-script/reference/spreadsheet/sheet) location of this metadata, or `null` if the location type is\nnot `Developer``Metadata``Location``Type.SHEET`.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Spreadsheet()`\n\nReturns the [Spreadsheet](/apps-script/reference/spreadsheet/spreadsheet) location of this metadata, or `null` if the location\ntype is not `Developer``Metadata``Location``Type.SPREADSHEET`.\n\n#### Return\n\n\n[Spreadsheet](/apps-script/reference/spreadsheet/spreadsheet) --- The [Spreadsheet](/apps-script/reference/spreadsheet/spreadsheet) location of this metadata, or `null` if the location\ntype is not `Developer``Metadata``Location``Type.SPREADSHEET`.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`"]]