Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Using IntelliJ select the desired type (e.g., java.lang.Number) and open subtypes hierarchy.
- # Using the toolbar in the Hierarchy window click the button to export the hierarchy into a file.
- # The exported file (let's call it init.txt) should look like below:
- Number (java.lang)
- Float (java.lang)
- MutableInt (org.apache.commons.lang3.mutable)
- MutableInt (org.apache.commons.lang3.mutable)
- BigFraction (org.apache.commons.math3.fraction)
- BigFraction (org.apache.commons.math3.fraction)
- BigFraction (org.apache.commons.math3.fraction)
- Integer (java.lang)
- MyInteger in MyClass (org.some.package)
- # The first step is to treat inner classes which appear as type MyInteger in MyClass to look like MyClass$MyInteger
- sed 's/\([[:alnum:]]\+\)$\([[:alnum:]]\+\)/\2$\1/' init.txt > step1.txt
- # The second step is to remove whitespaces to have all classes at the same level
- sed 's/\s\+//g' step1.txt > step2.txt
- # The third step is to bring package name in front of class name and remove parentheses
- sed 's/\(.\+\)(\(.\+\))/\2.\1/' step2.txt > step3.txt
- # The previous can be done using piped sed expressions as follows
- sed 's/\([[:alnum:]]\+\)$\([[:alnum:]]\+\)/\2$\1/' init.txt | sed 's/\s\+//g' | sed 's/\(.\+\)(\(.\+\))/\2.\1/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement