1 19 20 package org.netbeans.modules.xslt.model.enums; 21 22 23 24 28 public enum Validation implements EnumValue { 29 30 STRICT, 31 LAX, 32 PRESERVE, 33 STRIP, 34 INVALID; 35 36 39 40 public boolean isInvalid() { 41 return this == INVALID ; 42 } 43 44 49 50 public String toString() { 51 if ( isInvalid() ) { 52 return ""; 53 } 54 else { 55 return super.toString().toLowerCase(); 56 } 57 } 58 59 66 public static Validation forString( String str ) { 67 if ( str == null ) { 68 return null; 69 } 70 Validation[] validations = values(); 71 for (Validation validation : validations) { 72 if ( str.equals( validation.toString())) { 73 return validation; 74 } 75 } 76 return INVALID; 77 } 78 79 } 80 | Popular Tags |