Makes a built in mode.
@param name The mode name.
@param cls The action class.
@return A Mode object.
185372
private Mode makeBuiltinMode(String name, Class cls) {
    // lookup/create a mode with the given name.
    Mode mode = lookupCreateMode(name);
    // Init the element action set for this mode.
    ActionSet actions = new ActionSet();
    // from the current mode we will use further the built in mode.
    ModeUsage modeUsage = new ModeUsage(Mode.CURRENT, mode);
    // Add the action corresponding to the built in mode.
    if (cls == AttachAction.class)
      actions.setResultAction(new AttachAction(modeUsage));
    else if (cls == AllowAction.class)
      actions.addNoResultAction(new AllowAction(modeUsage));
    else if (cls == UnwrapAction.class)
      actions.setResultAction(new UnwrapAction(modeUsage));
    else
      actions.addNoResultAction(new RejectAction(modeUsage));
    // set the actions on any namespace.
    mode.bindElement(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, actions);
    // the mode is not defined in the script explicitelly
    mode.noteDefined(null);
    // creates attribute actions
    AttributeActionSet attributeActions = new AttributeActionSet();
    // if we have a schema for attributes then in the built in modes
    // we reject attributes by default
    // otherwise we attach attributes by default in the built in modes
    if (attributesSchema)
      attributeActions.setReject(true);
    else
      attributeActions.setAttach(true);
    // set the attribute actions on any namespace
    mode.bindAttribute(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, attributeActions);
    return mode;
  }
844241
public ISarlClassBuilder addSarlClass(String name) {
		ISarlClassBuilder builder = this.iSarlClassBuilderProvider.get();
		builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
		return builder;
	}
112719
@SuppressWarnings("unchecked")
    public static <T> Class<T> forClass(final String clsName) throws IllegalArgumentException {
        return (Class<T>) forClass(clsName, true);
    }
311168
public OvhTemplateModem templateModem_name_GET(String name) throws IOException {
		String qPath = "/xdsl/templateModem/{name}";
		StringBuilder sb = path(qPath, name);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhTemplateModem.class);
	}
432374
public static String buildAction(Class<?> clazz, String action) {
        return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
    }
982846
@SuppressWarnings("unchecked")
  private static Method getMethodOrDie(
      final Class clazz, final String name, final Class... params) {
    try {
      return clazz.getMethod(name, params);
    } catch (NoSuchMethodException e) {
      throw new RuntimeException(
        "Generated message class \"" + clazz.getName() +
        "\" missing method \"" + name + "\".", e);
    }
  }
72150
@SuppressWarnings("unchecked")
        public static <T> ClassSup<T> cls(String clsName) {
                try {
                        return mapper.get(clsName, () -> (ClassSup<T>) cls(Class.forName(clsName)));
                } catch (Exception e) {
                        throw $(e);
                }
        }
1118450
public static MethodDescriptor buildScriptableMethodDescriptor(
    Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes )
  {
    MethodDescriptor md = _buildMethodDescriptor( actionClass, methodName, parameterNames, parameterTypes, parameterTypes );
    makeScriptable( md );
    return md;
  }
28599
public static ClassLoader getClassLoader(Class<?> cls) {
        ClassLoader cl = cls.getClassLoader();
        if (cl == null) {
            cl = getClassLoader();
        }
        return cl;
    }
10331
protected static void buildClassCast(StringBuilder builder, Class cls) {
        builder.append('(');
        buildClass(builder, cls);
        builder.append(')');
    }
300322
private static void buildClass(StringBuilder builder, Class cls) {
        int arrayDims = 0;
        Class tmp = cls;
        while (tmp.isArray()) {
            arrayDims++;
            tmp = tmp.getComponentType();
        }
        builder.append(tmp.getName());
        if (arrayDims > 0) {
            for (; arrayDims > 0 ; arrayDims--) {
                builder.append("[]");
            }
        }
    }
630625
public static Class<?> getPropertyType( Clazz<?> clazz, String name )
	{
		return propertyValues.getPropertyType(clazz, name);
	}
281887
private Set<String> getClasses(String name, ClassLoader cl)
   {
      Set<String> result = new HashSet<String>();
      
      try
      {
         Class<?> clz = Class.forName(name, true, cl);
         while (!Object.class.equals(clz))
         {
            result.add(clz.getName());
            clz = clz.getSuperclass();
         }
      }
      catch (Throwable t)
      {
         log.debugf("Couldn't load: %s", name);
      }

      return result;
   }
1205980
static function begin($name = NULL, $mode = NULL)
	{
		$object = static::_instance($name);
		$name = static::instanceName($name);

		if (static::$transactions[$name]) return FALSE;
		static::$transactions[$name] = $object->begin($mode);

		return static::$transactions[$name];
	}
415862
public static <T> Codec<T> create(Class<T> cls) {
        return create(cls, isDebugEnabled());
    }
1331507
protected ResourceHandle getClassHandle(final String name)
    {
        String path = name.replace('.', '/').concat(".class");
        return getResourceHandle(path);
    }
1139640
public static Method findProperty(Class<?> clazz, String name) {
    	assert clazz != null;
    	assert name != null;
        Class<?> entityClass = clazz;
        while (entityClass != null) {
            Method[] methods = (entityClass.isInterface() ? entityClass.getMethods() : entityClass.getDeclaredMethods());
            for (Method method : methods) {
                if (method.getName().equals("get"+ StringUtils.capitalize(name)) ||
                    method.getName().equals("is"+ StringUtils.capitalize(name))) {
                    return method;
                }
            }
            entityClass = entityClass.getSuperclass();
        }
        return null;
    }