1 package org.jacorb.notification.filter.etcl; 2 3 23 24 import org.jacorb.notification.filter.EvaluationContext; 25 import org.jacorb.notification.filter.EvaluationException; 26 import org.jacorb.notification.filter.EvaluationResult; 27 import org.jacorb.notification.interfaces.Message; 28 29 33 34 public class DomainNameShorthandNode 35 extends ETCLComponentName { 36 37 private static final AbstractTCLNode expandedPath_; 38 private static final String COMP_NAME = "$.header.fixed_header.event_type.domain_name"; 39 public static final String SHORT_NAME = "domain_name"; 40 41 static { 42 try { 43 expandedPath_ = TCLParser.parse( COMP_NAME ); 44 expandedPath_.acceptInOrder( new TCLCleanUp() ); 45 } catch (Exception e) { 46 throw new RuntimeException (e.getMessage()); 48 } 49 } 50 51 public DomainNameShorthandNode() { 52 setName("DomainNameShorthandNode"); 53 } 54 55 public String getComponentName() { 56 return COMP_NAME; 57 } 58 59 public void acceptInOrder(AbstractTCLVisitor v) { 60 61 } 62 63 public void acceptPostOrder(AbstractTCLVisitor v) { 64 65 } 66 67 public void acceptPreOrder(AbstractTCLVisitor v) { 68 69 } 70 71 public EvaluationResult evaluate( EvaluationContext context ) 72 throws EvaluationException { 73 74 Message _event = context.getCurrentMessage(); 75 76 EvaluationResult _result = new EvaluationResult(); 77 78 switch (_event.getType()) { 79 case Message.TYPE_ANY: 80 _result = expandedPath_.evaluate(context); 81 break; 82 case Message.TYPE_STRUCTURED: 83 String _domainName = _event.toStructuredEvent().header.fixed_header.event_type.domain_name; 84 _result.setString(_domainName); 85 break; 86 default: 87 throw new RuntimeException (); 88 } 89 90 return _result; 91 } 92 93 public String toString() { 94 return COMP_NAME; 95 } 96 } 97 | Popular Tags |