1 | /*
|
---|
2 | * Copyright 2000-2002,2004 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant.taskdefs.optional.depend;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Utility class file routines. This class provides a number of static
|
---|
21 | * utility methods to convert between the formats used in the Java class
|
---|
22 | * file format and those commonly used in Java programming.
|
---|
23 | *
|
---|
24 | *
|
---|
25 | */
|
---|
26 | public class ClassFileUtils {
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Convert a class name from class file slash notation to java source
|
---|
30 | * file dot notation.
|
---|
31 | *
|
---|
32 | * @param name the class name in slash notation org/apache/ant
|
---|
33 | * @return the class name in dot notation (eg. java.lang.Object).
|
---|
34 | */
|
---|
35 | public static String convertSlashName(String name) {
|
---|
36 | return name.replace('\\', '.').replace('/', '.');
|
---|
37 | }
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Convert a class name from java source file dot notation to class file
|
---|
41 | * slash notation..
|
---|
42 | *
|
---|
43 | * @param dotName the class name in dot notation (eg. java.lang.Object).
|
---|
44 | * @return the class name in slash notation (eg. java/lang/Object).
|
---|
45 | */
|
---|
46 | public static String convertDotName(String dotName) {
|
---|
47 | return dotName.replace('.', '/');
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|