Home
UsETeC User Manual
Contents
1. there was any API example generated for this method public static Map lt Object Object gt toMap Object array if array null return null Open Declaration Open Implementation final Map lt Object Object gt map Open Return Type for int i i lt array leng rz Object object array i i ne if object instanceof Map Entry lt gt Map Entry lt gt entry Map Entry lt gt object map put entry getKey entry getValue else if object instanceof Object Object entry Object object f Object gt int array length 1 5 2 Click this hyperlink then eclipse will open a view named usetecView automatically There will be several tab items in this view and there is an API example in each tab item E Console y Progress S usetecView E3 1 2 3 4 5 try ArrayUtils toMap new Object new Object foo bar illegal type fail exception expected catch llegalArqumentException ex Add to Javadoc 3 Choose a tab item click the button add to javadoc then the corresponding API example will be added to the javadoc comment of this method 4 The button add to javadoc will change to remove from javadoc after the API example is added to the javadoc comment Click it if you want to remove this API example from the javadoc comment then the button will change back to add to javadoc API Example try ArrayUtils toMap new Str
2. UsETeC User Manual System Requirements 1 JDK1 6 2 Eclipse for Java EE Developer 4 3 Kepler Installation 1 Download usetec_1 0 0 1 jar 2 Move usetec_1 0 0 1 jar to your eclipse plugins directory 3 Restart eclipse Generate API Examples 1 Import the Java project you want to analyze into eclipse workspace make sure that there is a source folder named test containing test codes in the project 4 j commons lang3 Ge sre test BA JRE System Library JavaSE 1 7 Be JUnit 3 BA JUnit 4 2 Right click the project in the project explorer of eclipse then click on the item named Generating API Examples from the pop up menu TE Paste K Rename Remove from Context Ctrl Alt Shit Down Import S E p Es Oo sl Refresh F5 Close Project Close Unrelated Projects BA mi A a k r Validate Show in Remote Systems view Generate API Examples Profile As t 3 Wait until the progress finished You can check that in view Progress This grogress may take several minutes fee test gt T usetec usetec El Console Mig Progress 2 Be et T Generate API Example Generating API Example O Synchronizing O Synchronizing lt gt T commons lang3 Generate API Example 096 ae E Show API Examples and Add Them into Javadoc Comments 1 Ctrl click a method in this project There will be a hyperlink named Show API Examples in the pop up menu if
3. alsii val Add to Javadoc 5 Choose the first tab item and click the button named Add to Javadoc then we can find that the javadoc comment of this method have been edited lt p gt Converts the string to the Unicode format u 20 lt p gt lt p gt This format is the Java source code format lt p gt lt pre gt CharUtils unicodeEscaped u 2e CharUtils unicodeEscaped A u 41 lt pre gt lt br gt lt p gt API Example lt p gt lt div style border solid 1px gt lt pre gt for int i param ch the character to convert return the escaped Unicode string HH uf i public static String unicodeEscaped char ch if ch lt x1 return u 0 Integer toHexString ch else if ch lt 0x100 return u Integer toHexString ch else if ch lt x1 0 return u Integer toHexString ch return u Integer toHexString ch t j lt p gt Converts the string to the Unicode format u0020 lt p gt lt p gt This format is the Java source code format lt p gt lt p gt If code null is passed in code null will be returned lt p gt lt pre gt E Console G Progress usetecView 23 1 2 3 for int i 0 i lt 196 i String str CharUtils unicodeEscaped char i assertEquals 6 str length int val Integer parselnt str substring 2 16 assertEquals i val Remove from Javadoc 6 Generate javadoc for the pr
4. ing foo bar short fail exception expected catch IllegalArgumentException ex E Console yy Progress S usetecView 13 1 2 3 4 S try ArrayUtils toMap new Object new Object foo bar illegal type fail exception expected catch legalArgumentException ex Remove from Javadoc Another Usage Example 1 Import project commons Lang into eclipse workspace 2 Generate API examples for this project as above If you have done this step for the project check whether there is a directory named usetec in the project this step can be skipped 3 Suppose we want to look over the generated API examples for method unicodeEscaped char in class org apache commons lang3 CharUtils We open the corresponding java file and find the line which defines the method Ctrl click the method and then click Show API Examples public static String unicodeEscaped char ch if ch lt x16 i return upg Open Declaration else if ch lt Open Implementation aaeh Bpr Open Return Type gich else i ch lt amp E return Wup Show API Examples gich return u Integer toHexString ch 4 We can see three tab items in the view named usetecView Gl Console o Progress B usetec iew 24 1 2 3 for int i 0 1 lt 196 i String str CharUtls unicodeEscaped char i assertEquals 6 str lengthQ int val Integer parselnt str substring 2 16 assertEqu
5. oject We can find that the API example has been added into javadoc unicodeEscaped public static java lang String unicodeEscaped char ch Converts the string to the Unicode format This formatis the Java source code format CharUtils unicodeEscaped Charltils unicodeEscaped 4 lI pe AFI Example or int i 0 i lt 196 i i String str Charltils unicodeEscaped char i assertEquals 4 str length int val Integer parseInt str substring 2 16 assertEquals i val ae h ch the character to convert E Pl the escaped Unicode string
Download Pdf Manuals
Related Search
Related Contents
Copyright © All rights reserved.
Failed to retrieve file