org.jboss.system.metadata
Class ServiceMetaDataParser

java.lang.Object
  extended by org.jboss.system.metadata.ServiceMetaDataParser

public class ServiceMetaDataParser
extends Object

ServiceMetaDataParser This class is based on the old ServiceConfigurator/Creator.

Version:
$Revision: 85945 $
Author:
Marc Fleury, Hiram Chirino, David Jencks, Jason Dillon, Dimitris Andreadis, Adrian Brock

Constructor Summary
ServiceMetaDataParser(Element config)
          Create a new service meta data parser
 
Method Summary
static String getElementTextContent(Element element)
          Get an element's text content, looking for "trim" and "replace" attributes on the element to determine whether to trim the text and/or perform system property substitution.
static String getElementTextContent(Element element, boolean trim, boolean replace)
          Get an elements text content
static String getRawElementTextContent(Element element)
           
static boolean getReplace(Element element)
           
static boolean getTrim(Element element)
           
 List<ServiceMetaData> parse()
          Parse the xml
static Exception rethrow(String context, Throwable t)
          Rethrow an error as an exception
static String trimAndReplace(String rawText, boolean trim, boolean replace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceMetaDataParser

public ServiceMetaDataParser(Element config)
Create a new service meta data parser

Parameters:
config - the xml config
Method Detail

rethrow

public static Exception rethrow(String context,
                                Throwable t)
                         throws Exception
Rethrow an error as an exception

Parameters:
context - the context
t - the original throwable
Returns:
never
Throws:
Exception - always

parse

public List<ServiceMetaData> parse()
                            throws Exception
Parse the xml

Returns:
the list of service meta data
Throws:
Exception - for any error

getElementTextContent

public static String getElementTextContent(Element element)
                                    throws Exception
Get an element's text content, looking for "trim" and "replace" attributes on the element to determine whether to trim the text and/or perform system property substitution.

Parameters:
element - the element
Returns:
the concatentation of the text nodes
Throws:
Exception - for any error

getTrim

public static boolean getTrim(Element element)

getReplace

public static boolean getReplace(Element element)

getElementTextContent

public static String getElementTextContent(Element element,
                                           boolean trim,
                                           boolean replace)
                                    throws Exception
Get an elements text content

Parameters:
element - the element
trim - whether to trim
replace - whetehr to replace properties
Returns:
the concatentation of the text nodes
Throws:
Exception - for any error

getRawElementTextContent

public static String getRawElementTextContent(Element element)

trimAndReplace

public static String trimAndReplace(String rawText,
                                    boolean trim,
                                    boolean replace)


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.