Generates the code for a new JmesPathProjection.

@param jmesPathProjection JmesPath projection type
@param aVoid              void
@return String that represents a call to
the new list projection
@throws InvalidTypeException
486339
@Override
    public String visit(final JmesPathProjection jmesPathProjection,
                        final Void aVoid) throws InvalidTypeException {
        return "new JmesPathProjection( " + jmesPathProjection.getLhsExpr()
                .accept(this, aVoid) + ", " + jmesPathProjection.getProjectionExpr()
                .accept(this, aVoid) + ")";
    }
174333
@Override
  public PathImpl schemeWalk(String userPath,
                         Map<String,Object> attributes,
                         String filePath,
                         int offset)
  {
    int p = filePath.indexOf('!', offset);
    String backingPath;
    String jarPath;

    if (p > 0) {
      backingPath = filePath.substring(offset, p);
      jarPath = filePath.substring(p + 1);
    }
    else {
      backingPath = filePath.substring(offset);
      jarPath = "";
    }

    PathImpl backing = VfsOld.lookup(backingPath);

    return JarPath.create(backing).lookup(jarPath);
  }
239611
public static void validatePath(String path) throws InvalidPathException {
    boolean invalid = (path == null || path.isEmpty());
    if (!OSUtils.isWindows()) {
      invalid = (invalid || !path.startsWith(AlluxioURI.SEPARATOR));
    }

    if (invalid) {
      throw new InvalidPathException(ExceptionMessage.PATH_INVALID.getMessage(path));
    }
  }
192376
@Override
    public String visit(final JmesPathFlatten flatten, final Void aVoid)
            throws InvalidTypeException {
        return "new JmesPathFlatten( " + flatten.getFlattenExpr()
                .accept(this, aVoid) + ")";
    }
51243
protected void generateTypeParameterBuilderImpl() {
		final TypeReference builderInterface = getTypeParameterBuilderInterface();
		final TypeReference builder = getTypeParameterBuilderImpl();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
					+ " type parameter."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getAbstractBuilderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(builderInterface);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateMembers(false, false));
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}
		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(builder, content);
		javaFile.writeTo(getSrcGen());
	}
1057433
static String getSchemaPath(String projectFilePath, String path) throws IOException
    {
        File file = null;

        if (path.contains(".jar!")) {
            String ddlText = null;
            ddlText = VoltCompilerUtils.readFileFromJarfile(path);
            file = VoltProjectBuilder.writeStringToTempFile(ddlText);
        }
        else {
            file = new File(path);
        }

        if (!file.isAbsolute()) {
            // Resolve schemaPath relative to either the database definition xml file
            // or the working directory.
            if (projectFilePath != null) {
                file = new File(new File(projectFilePath).getParent(), path);
            }
            else {
                file = new File(path);
            }
        }

        return file.getPath();
    }
1370753
public String getPathName(JMFType type) {
    if (type instanceof JSVariant) {
      JMFType boxedBy = ((JSVariant)type).getBoxedBy();
      if (boxedBy != null)
        type = boxedBy;
    }
    JMFType parent = type.getParent();
    while (parent instanceof JSRepeated)
      parent = parent.getParent();
    if (parent == null)
      return "";
    String prePath = getPathName(parent);
    if (type instanceof JSRepeated)
      return prePath;
    String segment = type.getFeatureName();
    if (segment == null)
      segment = "[" + getEffectiveSiblingPosition(type) + "]";
    if (prePath.length() > 0)
      return prePath + "/" + segment;
    else
      return segment;
  }
761151
public Map<Integer, String> listProjects(InputStream is) throws MPXJException
   {
      try
      {
         m_tables = new HashMap<String, List<Row>>();
         processFile(is);

         Map<Integer, String> result = new HashMap<Integer, String>();

         List<Row> rows = getRows("project", null, null);
         for (Row row : rows)
         {
            Integer id = row.getInteger("proj_id");
            String name = row.getString("proj_short_name");
            result.put(id, name);
         }

         return result;
      }

      finally
      {
         m_tables = null;
         m_currentTable = null;
         m_currentFieldNames = null;
      }
   }
886508
protected String toGenModelProjectPath(String path) {
		return null == path || "".equals(path) || path.startsWith("/") || !path.contains("/") ? path : path.substring(path.indexOf("/"));
	}
921247
public Reader generateResource(String path, GeneratorContext context) {
	
		Locale locale = null == context.getLocale() ? Locale.getDefault()
				: context.getLocale();
		String validators = context.getPath();
		String validatorParams = context.getParenthesesParam();

		String messagesNS = MessageBundleScriptCreator.DEFAULT_NAMESPACE;
		boolean stopOnErrors = true;

		StringTokenizer valparams = new StringTokenizer(validatorParams, "|");
		String validatorMappingKey = valparams.nextToken();
		if (valparams.hasMoreTokens())
			messagesNS = valparams.nextToken();
		if (valparams.hasMoreTokens())
			stopOnErrors = Boolean.valueOf(valparams.nextToken())
					.booleanValue();

		// Build the ValidatorResources if it doesn't exist yet
		if (!validatorResourcesMap.containsKey(validatorMappingKey)) {
			createValidatorResources(validatorMappingKey, context.getConfig());
		}

		ValidatorResources validatorResources = (ValidatorResources) validatorResourcesMap
				.get(validatorMappingKey);
		StringBuffer sb = new StringBuffer();
		StringTokenizer tk = new StringTokenizer(validators, "|");
		while (tk.hasMoreTokens()) {
			String validator = tk.nextToken();
			if (STATIC_JAVASCRIPT_KEY.equals(validator)) {
				sb.append(buildStaticJavascript(validatorResources));
			} else
				sb.append(buildFormJavascript(validatorResources, validator,
						locale, messagesNS, stopOnErrors));

		}

		return new StringReader(sb.toString());
	}
479746
@Override
    @GET
    @Path("/invoke/{name}/{namespace}/{projectName}/{path: .*}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response executeCommandViaGet(@PathParam("name") final String name,
                                         @PathParam("namespace") final String namespace,
                                         @PathParam("projectName") final String project,
                                         @PathParam("path") final String path) throws Exception {

        LOG.info("Invoking command " + name + " in project " + namespace + "/" + project + " with path: " + path);

        ExecutionRequest executionRequest = new ExecutionRequest();
        executionRequest.setNamespace(namespace);
        executionRequest.setProjectName(project);
        executionRequest.setResource(path);
        List<Map<String, Object>> inputList = new ArrayList<>();
        Map<String, Object> arguments = new HashMap<>();

        // lets pass in query arguments that are not secret related stuff
        Map<String, String[]> parameterMap = request.getParameterMap();
        for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
            String parameterName = entry.getKey();
            String[] value = entry.getValue();
            if (value != null) {
                if (!RequestParameters.REQUEST_PARAMETERS.contains(parameterName)) {
                    Object paramValue = value;
                    if (value.length == 1) {
                        paramValue = value[0];
                    }
                    arguments.put(parameterName, paramValue);
                }
            }
        }
        inputList.add(arguments);
        executionRequest.setInputList(inputList);
        return executeCommand(name, executionRequest);
    }
137054
private Component createProjectChoice() {
        DropDownChoice<String> dropDownChoice = new DropDownChoice<String>("projectChoice", new IModel<String>() {
            
            private static final long serialVersionUID = -5776062054709043273L;

            @Override
            public String getObject() {
                return getSessionContextId();
            }

            @Override
            public void setObject(String object) {
                ContextHolder.get().setCurrentContextId(object);
            }

            @Override
            public void detach() {
            }
        }, getAvailableContexts()) {

            private static final long serialVersionUID = 1L;

            @Override
            protected boolean wantOnSelectionChangedNotifications() {
                return true;
            }

            @Override
            protected void onModelChanged() {
                setResponsePage(SendEventPage.this.getClass());
            }

        };
        return dropDownChoice;
    }
1280053
protected void generateScriptBuilderImpl() {
		final List<StringConcatenationClient> topElements = generateTopElements(false, false);
		final TypeReference script = getScriptBuilderImpl();
		final TypeReference scriptInterface = getScriptBuilderInterface();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(script.getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getAbstractBuilderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(scriptInterface);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateFieldsAndMethods(false, false));
				for (final StringConcatenationClient element : topElements) {
					it.append(element);
				}
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
			}

		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(script, content);
		javaFile.writeTo(getSrcGen());
	}
157234
@SuppressWarnings("unchecked")
    @Override
    protected Project initProject() {
        Collection errors = new ArrayList();
        String projectFilePathOrURI = getProjectIdentifier();
        return new Project(projectFilePathOrURI, errors);
    }
985250
public <K, V, E extends SimpleExpression<V>> MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType) {
        validate(property, Map.class);
        return super.createMap(property, key, value, queryType);
    }
865597
public void generateCode(final MetadataParserPath path, final boolean verbose) throws TransformerException {
        /** initialize the map which will overwrite global parameters as defined in metadata.xsl/ddJava.xsl */
        final Map<String, String> xsltParameters = new HashMap<String, String>();
        xsltParameters.put("gOutputFolder", getURIPath(path.getPathToImpl()));
        xsltParameters.put("gOutputFolderApi", getURIPath(path.getPathToApi()));
        xsltParameters.put("gOutputFolderTest", getURIPath(path.getPathToTest()));
        xsltParameters.put("gOutputFolderService", getURIPath(path.getPathToServices()));
        xsltParameters.put("gVerbose", Boolean.toString(verbose));

        final InputStream is = MetadataParser.class.getResourceAsStream("/META-INF/ddJavaAll.xsl");
        if (log.isLoggable(Level.FINE)) {
            log.fine("Stream resource: " + is);
        }

        XsltTransformer.simpleTransform(pathToMetadata, is, new File("./tempddJava.xml"), xsltParameters);
    }
151697
private String createErrorMsg(JspLineId jspLineId, int errorLineNr) {
        StringBuffer compilerOutput = new StringBuffer();

        if (jspLineId.getSourceLineCount() <= 1) {
			Object[] objArray = new Object[] { new Integer(jspLineId.getStartSourceLineNum()), jspLineId.getFilePath()};
			if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
			}
			else {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
			}
        }
        else {
			// compute exact JSP line number 
			int actualLineNum=jspLineId.getStartSourceLineNum()+(errorLineNr-jspLineId.getStartGeneratedLineNum());
			if (actualLineNum>=jspLineId.getStartSourceLineNum() && actualLineNum <=(jspLineId.getStartSourceLineNum() + jspLineId.getSourceLineCount() - 1)) {
				Object[] objArray = new Object[] { new Integer(actualLineNum), jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
				}
				else {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
				}
			}
			else {
				Object[] objArray = new Object[] {
					new Integer(jspLineId.getStartSourceLineNum()),
					new Integer((jspLineId.getStartSourceLineNum()) + jspLineId.getSourceLineCount() - 1),
					jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number", objArray));
				}
				else {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number.included.file",objArray));
				}
			}
        }

		compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.corresponding.servlet",new Object[] { jspLineId.getParentFile()}));  // Defect 211450
		    //152470 starts
	        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINER)) {
	            logger.logp(Level.FINER, CLASS_NAME, "createErrorMsg", "The value of the JSP attribute jdkSourceLevel is ["+ jdkSourceLevel +"]");
	        }
	        //152470 ends
        return compilerOutput.toString();
    }