ConfigurationFactory
public
class
ConfigurationFactory
extends Object
implements
IConfigurationFactory
| java.lang.Object | |
| ↳ | com.android.tradefed.config.ConfigurationFactory |
מפעל ליצירת IConfiguration.
סיכום
כיתות מוטמעות | |
|---|---|
class |
ConfigurationFactory.ConfigLoader
הטמעה של IConfigDefLoader שעוקבת אחרי ההגדרות הכלולות מהגדרת שורש אחת, וזורקת חריגה בהכללות מעגליות. |
class |
ConfigurationFactory.ExceptionLoader
|
Constructors מוגנים | |
|---|---|
ConfigurationFactory()
|
|
methods ציבוריים | |
|---|---|
void
|
clearMapConfig()
במקרים מסוימים, צריך לנקות את המפה. |
IConfiguration
|
createConfigurationFromArgs(String[] arrayArgs, List<String> unconsumedArgs, IKeyStoreClient keyStoreClient)
יצירת |
IConfiguration
|
createConfigurationFromArgs(String[] arrayArgs, List<String> unconsumedArgs)
יוצרים את |
IConfiguration
|
createConfigurationFromArgs(String[] arrayArgs)
שיטה נוחה שמפעילה את |
IGlobalConfiguration
|
createGlobalConfigurationFromArgs(String[] arrayArgs, List<String> remainingArgs)
ליצור |
IConfiguration
|
createPartialConfigurationFromArgs(String[] arrayArgs, IKeyStoreClient keyStoreClient, Set<String> allowedObjects, TradefedDelegator delegator)
יוצרים הגדרה שמכילה רק קבוצה של אובייקטים נבחרים. |
void
|
dumpConfig(String configName, PrintStream out)
התוכן של ההגדרה נשמר ב- |
List<String>
|
getConfigList(String subPath, boolean loadFromEnv)
גרסה של |
List<String>
|
getConfigList()
הפונקציה מחזירה את רשימת השמות של כל ההגדרות שנמצאו בקובצי ה-JAR בנתיב המחלקה. |
static
IConfigurationFactory
|
getInstance()
קבלת מופע singleton של |
void
|
loadAllConfigs(boolean discardExceptions)
טוען את כל ההגדרות שנמצאות בנתיב המחלקה ובספריות של תרחישי הבדיקה. |
void
|
loadAndPrintAllConfigs()
שיטת כלי עזר שבודקת שאפשר לטעון ולנתח את כל ההגדרות, ושהוגדרו כל ערכי האפשרויות. |
void
|
printHelp(PrintStream out)
הפונקציה prints עוזרת להפיק פלט עבור המפעל הזה. |
void
|
printHelpForConfig(String[] args, boolean importantOnly, PrintStream out)
הדפסת פלט העזרה עבור
אם 'args' מתייחס להגדרה מוכרת, ייצור אובייקט |
שיטות מוגנות | |
|---|---|
InputStream
|
getBundledConfigStream(String name)
|
String
|
getConfigPrefix()
החזרת קידומת הנתיב של קובצי ה-XML של ההגדרות בנתיב המחלקה המאפיין הזה חשוף כדי שבדיקות יחידה יוכלו לבצע מוקינג. |
BufferedInputStream
|
getConfigStream(String name)
טוען InputStream לשם הגדרה נתון |
ConfigurationDef
|
getConfigurationDef(String name, boolean isGlobal, Map<String, String> templateMap)
מאחזרים את |
Map<ConfigurationFactory.ConfigId, ConfigurationDef>
|
getMapConfig()
חשוף לבדיקה. |
boolean
|
isDirectConfiguration(String configName)
|
String[]
|
reorderArgs(String[] args)
מסדרים מחדש את הארגומנטים כך שכל הארגומנטים של template:map יועברו לתחילת הרשימה. |
IRemoteFileResolver.ResolvedFile
|
resolveRemoteFile(URI configURI, URI destDir)
|
Constructors מוגנים
ConfigurationFactory
protected ConfigurationFactory ()
methods ציבוריים
clearMapConfig
public void clearMapConfig ()
במקרים מסוימים, צריך לנקות את המפה.
createConfigurationFromArgs
public IConfiguration createConfigurationFromArgs (String[] arrayArgs, List<String> unconsumedArgs, IKeyStoreClient keyStoreClient)
יצירת IConfiguration מארגומנטים של שורת פקודה באמצעות מאגר מפתחות.
הפורמט הצפוי הוא 'CONFIG [options]', כאשר CONFIG הוא שם התצורה המובנה או נתיב קובץ לתצורת XML.
| פרמטרים | |
|---|---|
arrayArgs |
String: הארגומנטים בשורת הפקודה |
unconsumedArgs |
List: רשימה שתאוכלס בארגומנטים שלא נצרכו על ידי האובייקטים שמשויכים להגדרה שצוינה. אם הערך הוא null, ההטמעה תזרוק ConfigurationException אם יישארו ארגומנטים שלא עברו עיבוד. |
keyStoreClient |
IKeyStoreClient: IKeyStoreClient שמשמש להשגת מידע רגיש ב-args. |
| החזרות | |
|---|---|
IConfiguration |
הקובץ IConfiguration שנטען. השדות של אובייקט ההרשאה Option אוכלסו בערכים ב-args. |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
|
createConfigurationFromArgs
public IConfiguration createConfigurationFromArgs (String[] arrayArgs, List<String> unconsumedArgs)
יוצרים את IConfiguration מארגומנטים בשורת הפקודה.
הפורמט הצפוי הוא 'CONFIG [options]', כאשר CONFIG הוא שם התצורה המובנה או נתיב קובץ לתצורת XML.
| פרמטרים | |
|---|---|
arrayArgs |
String: הארגומנטים בשורת הפקודה |
unconsumedArgs |
List: רשימה שתאוכלס בארגומנטים שלא נעשה בהם שימוש על ידי האובייקטים שמשויכים להגדרה שצוינה. אם הערך הוא null, ההטמעה תזרוק ConfigurationException אם יישארו ארגומנטים שלא עברו עיבוד. |
| החזרות | |
|---|---|
IConfiguration |
הקובץ IConfiguration שנטען. השדות של אובייקט ההרשאה Option אוכלסו בערכים ב-args. |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
|
createConfigurationFromArgs
public IConfiguration createConfigurationFromArgs (String[] arrayArgs)
שיטה נוחה שמפעילה את createConfigurationFromArgs(String[],List) עם ארגומנט של null שניות. לכן, הפונקציה תחזיר ConfigurationException אם יישארו ארגומנטים שלא נעשה בהם שימוש.
| פרמטרים | |
|---|---|
arrayArgs |
String |
| החזרות | |
|---|---|
IConfiguration |
|
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
|
createGlobalConfigurationFromArgs
public IGlobalConfiguration createGlobalConfigurationFromArgs (String[] arrayArgs, List<String> remainingArgs)
ליצור IGlobalConfiguration מארגומנטים בשורת הפקודה.
הפורמט הצפוי הוא 'CONFIG [options]', כאשר CONFIG הוא שם התצורה המובנה או נתיב קובץ לתצורת XML.
| פרמטרים | |
|---|---|
arrayArgs |
String: הארגומנטים בשורת הפקודה |
remainingArgs |
List: רשימה שתאוכלס בארגומנטים שלא עברו עיבוד כארגומנטים גלובליים |
| החזרות | |
|---|---|
IGlobalConfiguration |
הקובץ IGlobalConfiguration שנטען. השדות של אובייקט הנציג Option אוכלסו בערכים ב-args. |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
|
createPartialConfigurationFromArgs
public IConfiguration createPartialConfigurationFromArgs (String[] arrayArgs, IKeyStoreClient keyStoreClient, Set<String> allowedObjects, TradefedDelegator delegator)
יוצרים הגדרה שמכילה רק קבוצה של אובייקטים נבחרים.
| פרמטרים | |
|---|---|
arrayArgs |
String: הארגומנטים בשורת הפקודה |
keyStoreClient |
IKeyStoreClient: IKeyStoreClient שמשמש להשגת מידע רגיש בארגומנטים. |
allowedObjects |
Set: קבוצת האובייקטים שמותר ליצור |
delegator |
TradefedDelegator |
| החזרות | |
|---|---|
IConfiguration |
הטעינה של IConfiguration. |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
|
dumpConfig
public void dumpConfig (String configName,
PrintStream out)התוכן של ההגדרה נשמר ב-PrintStream שצוין
| פרמטרים | |
|---|---|
configName |
String: שם ההגדרה |
out |
PrintStream: PrintStream שאליו יישלח הפלט |
getConfigList
public List<String> getConfigList (String subPath,
boolean loadFromEnv)גרסה של getConfigList() שבה אפשר לציין אם רוצים לטעון את ההגדרה גם מהסביבה.
| פרמטרים | |
|---|---|
subPath |
String: השם של תיקיות המשנה שבהן צריך לחפש את ההגדרות. אם הערך הוא null, ההתנהגות תהיה זהה לזו של getConfigList(). |
loadFromEnv |
boolean: הערך True אם צריך לטעון את ההגדרה במשתנה הסביבה. |
| החזרות | |
|---|---|
List<String> |
|
getConfigList
public List<String> getConfigList ()
הפונקציה מחזירה את רשימת השמות של כל ההגדרות שנמצאו בקובצי ה-JAR בנתיב המחלקה. לא מנסה לטעון אף אחת מההגדרות, ולכן יכול להיות שיהיו הגדרות שלא פועלות ברשימה הזו.
| החזרות | |
|---|---|
List<String> |
|
getInstance
public static IConfigurationFactory getInstance ()
קבלת מופע singleton של IConfigurationFactory.
| החזרות | |
|---|---|
IConfigurationFactory |
|
loadAllConfigs
public void loadAllConfigs (boolean discardExceptions)
טוען את כל ההגדרות שנמצאות בנתיב המחלקה ובספריות של תרחישי הבדיקה.
| פרמטרים | |
|---|---|
discardExceptions |
boolean: true אם צריך להתעלם מ-ConfigurationException כלשהו. |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
|
com.android.tradefed.config.ConfigurationException |
ConfigurationException |
|
loadAndPrintAllConfigs
public void loadAndPrintAllConfigs ()
שיטת כלי עזר שבודקת שאפשר לטעון ולנתח את כל ההגדרות, ושהוגדרו כל ערכי האפשרויות. המאפיין הזה נחשף רק כדי שהפרויקט התלוי יוכל לאמת את ההגדרות שלו. לא אמור להיות חשוף במסוף.
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
אם טעינת אחת או יותר מההגדרות נכשלה |
printHelp
public void printHelp (PrintStream out)
מדפיס את פלט העזרה עבור המפעל הזה.
מדפיסה מידע כללי על עזרה ומפרטת את כל ההגדרות הזמינות.
| פרמטרים | |
|---|---|
out |
PrintStream: PrintStream שאליו יישלח הפלט |
printHelpForConfig
public void printHelpForConfig (String[] args,
boolean importantOnly,
PrintStream out)הדפסת פלט העזרה עבור IConfiguration שצוין בארגומנטים של שורת הפקודה,
אם 'args' מתייחס להגדרה מוכרת, ייצור אובייקט IConfiguration מ-XML, ויוצג פלט של עזרה לגבי IConfiguration. שימו לב: המערכת תתעלם מכל שאר הערכים של 'args'
(כלומר, טקסט העזרה יתאר את הערכים הנוכחיים של Options
כפי שהם נטענו מ-XML, ולא ישקף את הערכים של האפשרות שמוגדרים על ידי ארגומנטים של שורת הפקודה).
אם 'args' לא מפנה אל IConfiguration ידוע, תוצג עזרה כללית של printHelp(PrintStream).
| פרמטרים | |
|---|---|
args |
String: הארגומנטים בשורת הפקודה |
importantOnly |
boolean: אם true, מדפיסים רשימת עזרה מקוצרת עם הפרטים החשובים בלבד |
out |
PrintStream: PrintStream שאליו יישלח הפלט |
שיטות מוגנות
getBundledConfigStream
protected InputStream getBundledConfigStream (String name)
| פרמטרים | |
|---|---|
name |
String |
| החזרות | |
|---|---|
InputStream |
|
getConfigPrefix
protected String getConfigPrefix ()
החזרת קידומת הנתיב של קובצי ה-XML של ההגדרות בנתיב המחלקה
המאפיין הזה חשוף כדי שבדיקות יחידה יוכלו לבצע מוקינג.
| החזרות | |
|---|---|
String |
String נתיב עם / בסוף |
getConfigStream
protected BufferedInputStream getConfigStream (String name)
טוען InputStream לשם הגדרה נתון
| פרמטרים | |
|---|---|
name |
String: שם ההגדרה לטעינה |
| החזרות | |
|---|---|
BufferedInputStream |
BufferedInputStream לקריאת תוכן ההגדרה |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
אם לא נמצאה הגדרה |
getConfigurationDef
protected ConfigurationDef getConfigurationDef (String name, boolean isGlobal, Map<String, String> templateMap)
מאחזרים את ConfigurationDef של השם שצוין
| פרמטרים | |
|---|---|
name |
String: השם של תצורה מובנית לטעינה או נתיב קובץ לקובץ תצורה לטעינה |
isGlobal |
boolean |
templateMap |
Map |
| החזרות | |
|---|---|
ConfigurationDef |
ConfigurationDef |
| הקפצת הודעות שגיאה (throw) | |
|---|---|
ConfigurationException |
אם אירעה שגיאה בטעינת ההגדרה |
getMapConfig
protected Map<ConfigurationFactory.ConfigId, ConfigurationDef> getMapConfig ()
חשוף לבדיקה. החזרת עותק של המפה.
| החזרות | |
|---|---|
Map<ConfigurationFactory.ConfigId, ConfigurationDef> |
|
isDirectConfiguration
protected boolean isDirectConfiguration (String configName)
| פרמטרים | |
|---|---|
configName |
String |
| החזרות | |
|---|---|
boolean |
|
reorderArgs
protected String[] reorderArgs (String[] args)
מסדרים מחדש את הארגומנטים כך שכל הארגומנטים של template:map יועברו לתחילת הרשימה.
| פרמטרים | |
|---|---|
args |
String |
| החזרות | |
|---|---|
String[] |
|
resolveRemoteFile
protected IRemoteFileResolver.ResolvedFile resolveRemoteFile (URI configURI, URI destDir)
| פרמטרים | |
|---|---|
configURI |
URI |
destDir |
URI |
| החזרות | |
|---|---|
IRemoteFileResolver.ResolvedFile |
|
| הקפצת הודעות שגיאה (throw) | |
|---|---|
BuildRetrievalError |
|