1 19 20 package org.netbeans.modules.xslt.model.enums; 21 22 23 27 public enum DefaultValidation implements EnumValue { 28 29 PRESERVE, 30 STRIP, 31 INVALID; 32 33 36 37 public boolean isInvalid() { 38 return this == INVALID ; 39 } 40 41 46 47 public String toString() { 48 if ( isInvalid() ) { 49 return ""; 50 } 51 else { 52 return super.toString().toLowerCase(); 53 } 54 } 55 56 63 public static DefaultValidation forString( String str ) { 64 if ( str == null ) { 65 return null; 66 } 67 DefaultValidation[] validations = values(); 68 for (DefaultValidation validation : validations) { 69 if ( str.equals( validation.toString())) { 70 return validation; 71 } 72 } 73 return INVALID; 74 } 75 76 } 77 | Popular Tags |