1 25 package org.objectweb.jonas_lib.deployment.rules; 26 27 import javax.xml.namespace.QName ; 28 29 import org.objectweb.jonas_lib.deployment.xml.Qname; 30 31 32 36 public class AnonymousQNameRule extends QNameRule { 37 38 51 public void body(String namespace, String name, String text) { 52 53 if (text == null) { 55 throw new IllegalArgumentException ("No QName found in the body of the tag " + name); 56 } 57 58 int colonIndex = text.lastIndexOf(":"); 60 if (colonIndex == -1) { 61 throw new IllegalArgumentException ("QName must be on the form namespace:localpart for element " + name); 62 } 63 String namespaceURI = text.substring(0, colonIndex); 64 String localPart = text.substring(colonIndex + 1, text.length()); 65 66 QName qName = new QName (namespaceURI, localPart); 68 69 Qname qNameObject = (Qname) digester.peek(); 71 qNameObject.setName(name); 72 qNameObject.setQName(qName); 73 74 } 75 76 } 77 | Popular Tags |