KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > util > stringifier > ProviderStringifier


1
2 /*
3  * The contents of this file are subject to the terms
4  * of the Common Development and Distribution License
5  * (the License). You may not use this file except in
6  * compliance with the License.
7  *
8  * You can obtain a copy of the license at
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
10  * glassfish/bootstrap/legal/CDDLv1.0.txt.
11  * See the License for the specific language governing
12  * permissions and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL
15  * Header Notice in each file and include the License file
16  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
17  * If applicable, add the following below the CDDL Header,
18  * with the fields enclosed by brackets [] replaced by
19  * you own identifying information:
20  * "Portions Copyrighted [year] [name of copyright owner]"
21  *
22  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23  */

24  
25 /*
26  * $Header: /cvs/glassfish/admin-core/mbeanapi/src/java/com/sun/appserv/management/util/stringifier/ProviderStringifier.java,v 1.3 2005/12/25 03:51:59 tcfujii Exp $
27  * $Revision: 1.3 $
28  * $Date: 2005/12/25 03:51:59 $
29  */

30  
31 package com.sun.appserv.management.util.stringifier;
32
33 import java.security.Provider JavaDoc;
34
35 /**
36     Stringifies a java.security.Provider.
37  */

38  
39 public final class ProviderStringifier implements Stringifier
40 {
41     public final static ProviderStringifier DEFAULT = new ProviderStringifier();
42     
43         public
44     ProviderStringifier()
45     {
46     }
47     
48     
49         public String JavaDoc
50     stringify( Object JavaDoc object )
51     {
52         final Provider JavaDoc provider = (Provider JavaDoc)object;
53         
54         final StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
55
56         buf.append( provider.getInfo() );
57         
58         java.util.Iterator JavaDoc iter = provider.entrySet().iterator();
59         while ( iter.hasNext() )
60         {
61             buf.append( iter.next().toString() + "\n" );
62         }
63
64         return( buf.toString() );
65     }
66 }
67
68
Popular Tags