/** n o w j a v a . c o m 提 供 **/
/*******************************************************************************
* Copyright (c) 2004 Actuate Corporation.
* 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
*
* Contributors:
* Actuate Corporation - initial API and implementation
*******************************************************************************/
public class Main{
public static void main(String[] argv){
String qualifiedName = "nowjava.com";
System.out.println(extractNamespace(qualifiedName));
}
/**
* Extracts the library namespace from the given qualified reference value.
* <p>
* For example,
* <ul>
* <li>"LibA" is extracted from "LibA.style1"
* <li>null is returned from "style1"
* </ul>
*
* @param qualifiedName
* the qualified reference value
* @return the library namespace
*/
public static String extractNamespace(String qualifiedName) {
if (qualifiedName == null)
return null;
int pos = qualifiedName.indexOf('.');
if (pos == -1)
return null;
return trimString(qualifiedName.substring(0, pos));
/*
*来 自
时代Java
*/
}
/**
* Trim a string. Removes leading and trailing blanks. If the resulting
* string is empty, normalizes the string to an null string.
*
* @param value
* the string to trim
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。