若要使用「版權」規則,使用者必須處理三個欄位
1. 併入套件:
對於這個欄位,使用者必須利用逗點分隔的套件規格來決定套用這個版權的類別。
(如 com.ibm.package1,com.ibm.package2)。這個欄位也支援萬用字元(如 com.ibm.package1.*、com.ibm.package2.*)。
但 "com.ibm.package1" 和 "com.ibm.package1.*" 的意義不同。如果使用者只想將這個版權註解用於單一
類別,便會使用 "com.ibm.package1"。但如果想要將它用於開頭是 "com.ibm.package1" 的所有類別,
便使用 "com.ibm.package1.*"
對於這個欄位,並非強制要提供值。如果未指定任何值,便會針對所有套件來執行規則
2. 排除套件:
這個欄位的內容與「併入套件」欄位相同。但使用者將使用這個欄位來指定
不要執行這個規則的套件。
對於這個欄位,並非強制要提供值。如果未指定任何值,便會針對所有套件來執行規則
3. 版權註解:
使用者必須輸入有效的 Java 註解區塊,其中含有所需要的版權聲明。
使用者可以使用 [date],預期版權日期出現在這裡。例如,
/**********************************************************************
* Copyright © [date] IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
如果檔案中沒有任何版權註解,且現行的年份是 2007,在快速修正之後,版權註解看起來如下:
/**********************************************************************
* Copyright © 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
如果檔案有版權註解如下:
/**********************************************************************
* Copyright © 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
但這個檔案的前次修改日期是在 2006 年,且現行的年份是 2006。在快速修正之後,註解看起來會如下:
/**********************************************************************
* Copyright © 2005,2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
但如果現行的年份是 2007,而前次修改年份為 2006 年,在快速修正之後,檔案看起來如下:
/**********************************************************************
* Copyright © 2005,2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
如果使用者想要忽略任何一行的比較,便必須在這行上使用 [ignore]。但 [ignore] 標籤必須是這行所輸入的唯一內容
(甚至 [ignore] 標籤的前後也不能有空格)。例如,
/**********************************************************************
* Copyright © [date] IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
[ignore]
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
但快速修正會從檔案的版權註解中取得這一行,且用來取代 [ignore]。
如果檔案中沒有版權註解,快速修正會刪除含有 [ignore] 的行
當沒有 [date] 和 [ignore] 標籤時,規則會比較作為參數而傳遞的任何內容。
但在這個情況下,必須輸入版權年份。例如,
/**********************************************************************
* Copyright © 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* $Id: Copyright_Help.html,v 1.1 2008/02/29 15:07:43 linda_hillis Exp $
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/