Given a jsii enum ref in the form "fqn/member" returns the Java enum value for it.
@param enumRef The jsii enum ref.
@return The java enum value.
183402
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Enum<?> findEnumValue(final String enumRef) {
        int sep = enumRef.lastIndexOf('/');
        if (sep == -1) {
            throw new JsiiException("Malformed enum reference: " + enumRef);
        }

        String typeName = enumRef.substring(0, sep);
        String valueName = enumRef.substring(sep + 1);
        try {
            Class klass = resolveJavaClass(typeName);
            return Enum.valueOf(klass, valueName);
        } catch (final ClassNotFoundException e) {
            throw new JsiiException("Unable to resolve enum type " + typeName, e);
        }
    }
681239
public static <E extends Enum<E>> EnumCliParam<E> fromDef(EnumParamDef<E> def) {
        return new EnumCliParam<>(def.getIdentifier(), def.getDefaultValueSupplier(), def.isNullable(), def.getEnumClass());
    }
994194
public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass, TEnum defaultValue)
    {
        String name = getString(key);

        if (name == null)
        {
            return defaultValue;
        }

        try
        {
            return Enum.valueOf(enumClass, name);
        }
        catch (RuntimeException e)
        {
            return defaultValue;
        }
    }
257575
public static String getOidFromRef(String ref) {
        Matcher matcher = match(ref);
        return matcher != null ? matcher.group(2) : null;
    }
484375
public final ProtoParser.enum_field_return enum_field(Proto proto, Message message, EnumGroup enumGroup) throws RecognitionException {
        ProtoParser.enum_field_return retval = new ProtoParser.enum_field_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token ID127=null;
        Token ASSIGN128=null;
        Token NUMINT129=null;
        Token SEMICOLON131=null;
        ProtoParser.enum_options_return enum_options130 = null;


        Object ID127_tree=null;
        Object ASSIGN128_tree=null;
        Object NUMINT129_tree=null;
        Object SEMICOLON131_tree=null;


            EnumGroup.Value v = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:547:5: ( ID ASSIGN NUMINT ( enum_options[proto, enumGroup, v] )? SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:547:9: ID ASSIGN NUMINT ( enum_options[proto, enumGroup, v] )? SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            ID127=(Token)match(input,ID,FOLLOW_ID_in_enum_field2181); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID127_tree = (Object)adaptor.create(ID127);
            adaptor.addChild(root_0, ID127_tree);
            }
            ASSIGN128=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_enum_field2183); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN128_tree = (Object)adaptor.create(ASSIGN128);
            adaptor.addChild(root_0, ASSIGN128_tree);
            }
            NUMINT129=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_enum_field2185); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            NUMINT129_tree = (Object)adaptor.create(NUMINT129);
            adaptor.addChild(root_0, NUMINT129_tree);
            }
            if ( state.backtracking==0 ) {

                          v = new EnumGroup.Value((ID127!=null?ID127.getText():null), Integer.parseInt((NUMINT129!=null?NUMINT129.getText():null)), enumGroup);
                          proto.addAnnotationsTo(v);
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:550:11: ( enum_options[proto, enumGroup, v] )?
            int alt25=2;
            switch ( input.LA(1) ) {
                case LEFTSQUARE:
                    {
                    alt25=1;
                    }
                    break;
            }

            switch (alt25) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:550:12: enum_options[proto, enumGroup, v]
                    {
                    pushFollow(FOLLOW_enum_options_in_enum_field2190);
                    enum_options130=enum_options(proto, enumGroup, v);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_options130.getTree());

                    }
                    break;

            }

            SEMICOLON131=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_enum_field2195); if (state.failed) return retval;

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
121282
JCExpression memberReferenceSuffix(JCExpression t) {
        int pos1 = token.pos;
        accept(COLCOL);
        return memberReferenceSuffix(pos1, t);
    }
1115277
final public Selector FieldRef() throws ParseException {
                        Token tok; String id;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IDENTIFIER:
      tok = jj_consume_token(IDENTIFIER);
                         id = tok.image;
                         // Identifiers with '.' in their name are not JMS conformant
                         if (strict && id.indexOf('.') != -1)
                         {if (true) throw generateParseException();}
      break;
    case QUOTED_IDENTIFIER:
      tok = jj_consume_token(QUOTED_IDENTIFIER);
                                  if (strict) {if (true) throw generateParseException();}
                                  id = tok.image.substring(1, tok.image.length()-1);
      break;
    default:
      jj_la1[19] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    Selector ans = new IdentifierImpl(id);
    {if (true) return ans;}
    throw new Error("Missing return statement in function");
  }
634858
@GET
    @Path("/enumdef/name/{name}")
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public AtlasEnumDef getEnumDefByName(@PathParam("name") String name) throws AtlasBaseException {
        AtlasEnumDef ret = typeDefStore.getEnumDefByName(name);

        return ret;
    }
483961
public EnumConstant getConstant(String name) {
        for (EnumConstant enumConstant : getConstants()) {
            if (enumConstant.getName().equals(name)) {
                return enumConstant;
            }
        }
        return null;
    }
269622
public E getSelectedEnum ()
    {
        int selidx = getSelectedIndex();
        return (selidx < 0) ? null : Enum.valueOf(_eclass, getValue(selidx));
    }
720970
static Class<?> getKeyTypeFromEnumMap(Object enumMap)
    {
        if(__keyTypeFromEnumMap == null)
        {
            throw new RuntimeException("Could not access (reflection) the private " +
                    "field *keyType* (enumClass) from: class java.util.EnumMap");
        }
        
        try
        {
            return (Class<?>)__keyTypeFromEnumMap.get(enumMap);
        }
        catch (IllegalArgumentException e)
        {
            throw new RuntimeException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new RuntimeException(e);
        }
    }
815047
static <T extends Enum<T>> T getEnumFromString(Class<T> c, String string) throws
            XmlPullParserException {
        if (c != null && string != null) {
            try {
                T t = Enum.valueOf(c, string.trim().toUpperCase());
                return t;
            } catch (IllegalArgumentException e) {
                throw new XmlPullParserException("Invalid value for " + c.getSimpleName());
            }
        } else {
            throw new XmlPullParserException("Null class or string");
        }
    }
991732
public static Reference getReference(Serializable object) throws NamingException
    {
        ByteArrayOutputStream outStream;
        try
        {
            outStream = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream(outStream);
            out.writeObject(object);
            out.close();
        }
        catch (IOException e)
        {
            throw new NamingException(e.getMessage());
        }

        BinaryRefAddr handle = new BinaryRefAddr("com.impetus.kundera.persistence.jta", outStream.toByteArray());
        Reference ret = new Reference(object.getClass().getName(), handle, UserTransactionFactory.class.getName(), null);
        return ret;
    }
1020597
public static String enumValues(Class<?> enumClass) {
    Preconditions.checkNotNull(enumClass, "enumClass cannot be null");
    Preconditions.checkState(enumClass.isEnum(), "enumClass must be an enum.");
    return Joiner.on(", ").join(enumClass.getEnumConstants());
  }
336156
public static boolean isOptionalInt(TypeRef type) {
        if (!(type instanceof ClassRef)) {
            return false;
        }

        return JAVA_UTIL_OPTIONAL_INT.equals(((ClassRef)type).getDefinition().getFullyQualifiedName());
    }
698297
public static String getTypeFromRef(String ref) {
        Matcher matcher = match(ref);
        return matcher != null ? matcher.group(1) : null;
    }
698556
private JvmAnnotationReference annotationClassRef(Class<? extends Annotation> type,
			List<? extends JvmTypeReference> values) {
		try {
			final JvmAnnotationReference annot = this._annotationTypesBuilder.annotationRef(type);
			final JvmTypeAnnotationValue annotationValue = this.services.getTypesFactory().createJvmTypeAnnotationValue();
			for (final JvmTypeReference value : values) {
				annotationValue.getValues().add(this.typeBuilder.cloneWithProxies(value));
			}
			annot.getExplicitValues().add(annotationValue);
			return annot;
		} catch (IllegalArgumentException exception) {
			// ignore
		}
		return null;
	}