1 22 23 package org.objectweb.petals.tools.jbicommon.descriptor; 24 25 import java.net.URI ; 26 import java.net.URISyntaxException ; 27 28 34 public enum PetalsExtensionsUris { 35 PETALS_EXTENSIONS("http://petals.objectweb.org/extensions/"), 36 PETALS_EXTENSION_KEY_VALUE( 37 "http://petals.objectweb.org/extensions/key-value/"); 38 39 private final String nameSpace; 40 41 private PetalsExtensionsUris(String nameSpace) { 42 this.nameSpace = nameSpace; 43 } 44 45 50 public URI value() { 51 URI extURI = null; 52 try { 53 extURI = new URI (nameSpace); 54 } catch (URISyntaxException e) { 55 throw new Error ("Unexpected Error in JBI URI namespace syntax", e); } 57 return extURI; 58 } 59 60 68 public static PetalsExtensionsUris valueOf(final URI pattern) { 69 PetalsExtensionsUris result = null; 70 for (PetalsExtensionsUris extURI : PetalsExtensionsUris.values()) { 71 if (extURI.nameSpace.equals(pattern.toString())) { 72 result = extURI; 73 } 74 } 75 return result; 76 } 77 } 78 | Popular Tags |