站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

ObjectNamePatternHelper (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.util
Class ObjectNamePatternHelper

java.lang.Object
  extended byorg.jboss.mx.util.ObjectNamePatternHelper

public class ObjectNamePatternHelper
extends Object

ObjectName pattern matching Helper.

Contains various routines for matching domains and properties.

Routines based on work done Trevor in the registry.

Version:
$Revision: 1.4 $
Author:
Adrian Brock., Trevor Squires.

Nested Class Summary
static class ObjectNamePatternHelper.PropertyPattern
          Encapsulation of property information
 
Constructor Summary
ObjectNamePatternHelper()
           
 
Method Summary
static boolean patternMatch(char[] test, int tpos, char[] pattern, int ppos)
          Compare where ? and * chars are significant.
static boolean patternMatch(ObjectName test, ObjectName pattern)
          Compare an object name against a pattern.
static boolean patternMatch(String test, String pattern)
          Compare strings where ? and * chars are significant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectNamePatternHelper

public ObjectNamePatternHelper()
Method Detail

patternMatch

public static boolean patternMatch(ObjectName test,
                                   ObjectName pattern)
Compare an object name against a pattern.

Parameters:
test - the string to test
pattern - the pattern to match

patternMatch

public static boolean patternMatch(String test,
                                   String pattern)
Compare strings where ? and * chars are significant.

Parameters:
test - the string to test
pattern - the pattern to match

patternMatch

public static boolean patternMatch(char[] test,
                                   int tpos,
                                   char[] pattern,
                                   int ppos)
Compare where ? and * chars are significant.

I arrived at this solution after quite a bit of trial and error - it's all a bit interwoven. Obviously I'm no good at parsers and there must be a clearer or more elegant way to do this. I'm suitably in awe of the perl regex hackers now.

Parameters:
test - the string to test
tpos - the start of the test string
pattern - the pattern to match
ppos - the start of the pattern string


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.