id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
32,500 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java | DefaultEncodingStateRegistry.isPreviousEncoderSafeOrEqual | public static boolean isPreviousEncoderSafeOrEqual(Encoder encoderToApply, Encoder previousEncoder) {
return previousEncoder == encoderToApply || !encoderToApply.isApplyToSafelyEncoded() && previousEncoder.isSafe() && encoderToApply.isSafe()
|| previousEncoder.getCodecIdentifier().isEquivalent(e... | java | public static boolean isPreviousEncoderSafeOrEqual(Encoder encoderToApply, Encoder previousEncoder) {
return previousEncoder == encoderToApply || !encoderToApply.isApplyToSafelyEncoded() && previousEncoder.isSafe() && encoderToApply.isSafe()
|| previousEncoder.getCodecIdentifier().isEquivalent(e... | [
"public",
"static",
"boolean",
"isPreviousEncoderSafeOrEqual",
"(",
"Encoder",
"encoderToApply",
",",
"Encoder",
"previousEncoder",
")",
"{",
"return",
"previousEncoder",
"==",
"encoderToApply",
"||",
"!",
"encoderToApply",
".",
"isApplyToSafelyEncoded",
"(",
")",
"&&",... | Checks if is previous encoder is already "safe", equal or equivalent
@param encoderToApply
the encoder to apply
@param previousEncoder
the previous encoder
@return true, if previous encoder is already "safe", equal or equivalent | [
"Checks",
"if",
"is",
"previous",
"encoder",
"is",
"already",
"safe",
"equal",
"or",
"equivalent"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java#L125-L128 |
32,501 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.isDomainClass | public static boolean isDomainClass(URL url) {
if (url == null) return false;
return KNOWN_DOMAIN_CLASSES.get(url.getFile());
} | java | public static boolean isDomainClass(URL url) {
if (url == null) return false;
return KNOWN_DOMAIN_CLASSES.get(url.getFile());
} | [
"public",
"static",
"boolean",
"isDomainClass",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"false",
";",
"return",
"KNOWN_DOMAIN_CLASSES",
".",
"get",
"(",
"url",
".",
"getFile",
"(",
")",
")",
";",
"}"
] | Checks whether the file referenced by the given url is a domain class
@param url The URL instance
@return true if it is a domain class | [
"Checks",
"whether",
"the",
"file",
"referenced",
"by",
"the",
"given",
"url",
"is",
"a",
"domain",
"class"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L217-L220 |
32,502 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.getClassNameForClassFile | public static String getClassNameForClassFile(String rootDir, String path) {
path = path.replace("/", ".");
path = path.replace('\\', '.');
path = path.substring(0, path.length() - CLASS_EXTENSION.length());
if (rootDir != null) {
path = path.substring(rootDir.length());
... | java | public static String getClassNameForClassFile(String rootDir, String path) {
path = path.replace("/", ".");
path = path.replace('\\', '.');
path = path.substring(0, path.length() - CLASS_EXTENSION.length());
if (rootDir != null) {
path = path.substring(rootDir.length());
... | [
"public",
"static",
"String",
"getClassNameForClassFile",
"(",
"String",
"rootDir",
",",
"String",
"path",
")",
"{",
"path",
"=",
"path",
".",
"replace",
"(",
"\"/\"",
",",
"\".\"",
")",
";",
"path",
"=",
"path",
".",
"replace",
"(",
"'",
"'",
",",
"'"... | Returns the class name for a compiled class file
@param path The path to check
@return The class name or null if it doesn't exist | [
"Returns",
"the",
"class",
"name",
"for",
"a",
"compiled",
"class",
"file"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L305-L313 |
32,503 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.isGrailsResource | public static boolean isGrailsResource(Resource r) {
try {
String file = r.getURL().getFile();
return isGrailsPath(file) || file.endsWith("GrailsPlugin.groovy");
}
catch (IOException e) {
return false;
}
} | java | public static boolean isGrailsResource(Resource r) {
try {
String file = r.getURL().getFile();
return isGrailsPath(file) || file.endsWith("GrailsPlugin.groovy");
}
catch (IOException e) {
return false;
}
} | [
"public",
"static",
"boolean",
"isGrailsResource",
"(",
"Resource",
"r",
")",
"{",
"try",
"{",
"String",
"file",
"=",
"r",
".",
"getURL",
"(",
")",
".",
"getFile",
"(",
")",
";",
"return",
"isGrailsPath",
"(",
"file",
")",
"||",
"file",
".",
"endsWith"... | Checks whether the specific resources is a Grails resource. A Grails resource is a Groovy or Java class under the grails-app directory
@param r The resource to check
@return True if it is a Grails resource | [
"Checks",
"whether",
"the",
"specific",
"resources",
"is",
"a",
"Grails",
"resource",
".",
"A",
"Grails",
"resource",
"is",
"a",
"Groovy",
"or",
"Java",
"class",
"under",
"the",
"grails",
"-",
"app",
"directory"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L714-L722 |
32,504 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.getPathFromBaseDir | public static String getPathFromBaseDir(String path) {
int i = path.indexOf("grails-app/");
if(i > -1 ) {
return path.substring(i + 11);
}
else {
try {
File baseDir = BuildSettings.BASE_DIR;
String basePath = baseDir != null ? baseD... | java | public static String getPathFromBaseDir(String path) {
int i = path.indexOf("grails-app/");
if(i > -1 ) {
return path.substring(i + 11);
}
else {
try {
File baseDir = BuildSettings.BASE_DIR;
String basePath = baseDir != null ? baseD... | [
"public",
"static",
"String",
"getPathFromBaseDir",
"(",
"String",
"path",
")",
"{",
"int",
"i",
"=",
"path",
".",
"indexOf",
"(",
"\"grails-app/\"",
")",
";",
"if",
"(",
"i",
">",
"-",
"1",
")",
"{",
"return",
"path",
".",
"substring",
"(",
"i",
"+"... | Gets the path relative to the project base directory.
Input: /usr/joe/project/grails-app/conf/BootStrap.groovy
Output: grails-app/conf/BootStrap.groovy
@param path The path
@return The path relative to the base directory or null if it can't be established | [
"Gets",
"the",
"path",
"relative",
"to",
"the",
"project",
"base",
"directory",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L861-L879 |
32,505 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java | GrailsResourceUtils.appendPiecesForUri | public static String appendPiecesForUri(String... pieces) {
if (pieces==null || pieces.length==0) return "";
// join parts && strip double slashes
StringBuilder builder = new StringBuilder(16 * pieces.length);
char previous = 0;
for (int i=0; i < pieces.length;i++) {
... | java | public static String appendPiecesForUri(String... pieces) {
if (pieces==null || pieces.length==0) return "";
// join parts && strip double slashes
StringBuilder builder = new StringBuilder(16 * pieces.length);
char previous = 0;
for (int i=0; i < pieces.length;i++) {
... | [
"public",
"static",
"String",
"appendPiecesForUri",
"(",
"String",
"...",
"pieces",
")",
"{",
"if",
"(",
"pieces",
"==",
"null",
"||",
"pieces",
".",
"length",
"==",
"0",
")",
"return",
"\"\"",
";",
"// join parts && strip double slashes",
"StringBuilder",
"buil... | Takes any number of Strings and appends them into a uri, making
sure that a forward slash is inserted between each piece and
making sure that no duplicate slashes are in the uri
<pre>
Input: ""
Output: ""
Input: "/alpha", "/beta", "/gamma"
Output: "/alpha/beta/gamma
Input: "/alpha/, "/beta/", "/gamma"
Output: "/alph... | [
"Takes",
"any",
"number",
"of",
"Strings",
"and",
"appends",
"them",
"into",
"a",
"uri",
"making",
"sure",
"that",
"a",
"forward",
"slash",
"is",
"inserted",
"between",
"each",
"piece",
"and",
"making",
"sure",
"that",
"no",
"duplicate",
"slashes",
"are",
... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/GrailsResourceUtils.java#L926-L949 |
32,506 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.initArtefactHandlers | @SuppressWarnings( "deprecation" )
protected void initArtefactHandlers() {
List<ArtefactHandler> additionalArtefactHandlers = GrailsFactoriesLoader.loadFactories(ArtefactHandler.class, getClassLoader());
for (ArtefactHandler artefactHandler : additionalArtefactHandlers) {
registerArtef... | java | @SuppressWarnings( "deprecation" )
protected void initArtefactHandlers() {
List<ArtefactHandler> additionalArtefactHandlers = GrailsFactoriesLoader.loadFactories(ArtefactHandler.class, getClassLoader());
for (ArtefactHandler artefactHandler : additionalArtefactHandlers) {
registerArtef... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"protected",
"void",
"initArtefactHandlers",
"(",
")",
"{",
"List",
"<",
"ArtefactHandler",
">",
"additionalArtefactHandlers",
"=",
"GrailsFactoriesLoader",
".",
"loadFactories",
"(",
"ArtefactHandler",
".",
"class",... | Initialises the default set of ArtefactHandler instances.
@see grails.core.ArtefactHandler | [
"Initialises",
"the",
"default",
"set",
"of",
"ArtefactHandler",
"instances",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L216-L226 |
32,507 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.configureLoadedClasses | protected void configureLoadedClasses(Class<?>[] classes) {
initArtefactHandlers();
artefactInfo.clear();
allArtefactClasses.clear();
allArtefactClassesArray = null;
allClasses = classes;
// first load the domain classes
log.debug("Going to inspect artefact cla... | java | protected void configureLoadedClasses(Class<?>[] classes) {
initArtefactHandlers();
artefactInfo.clear();
allArtefactClasses.clear();
allArtefactClassesArray = null;
allClasses = classes;
// first load the domain classes
log.debug("Going to inspect artefact cla... | [
"protected",
"void",
"configureLoadedClasses",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
")",
"{",
"initArtefactHandlers",
"(",
")",
";",
"artefactInfo",
".",
"clear",
"(",
")",
";",
"allArtefactClasses",
".",
"clear",
"(",
")",
";",
"allArtefactClas... | Configures the loaded classes within the GrailsApplication instance using the
registered ArtefactHandler instances.
@param classes The classes to configure | [
"Configures",
"the",
"loaded",
"classes",
"within",
"the",
"GrailsApplication",
"instance",
"using",
"the",
"registered",
"ArtefactHandler",
"instances",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L254-L299 |
32,508 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getArtefactCount | protected int getArtefactCount(String artefactType) {
ArtefactInfo info = getArtefactInfo(artefactType);
return info == null ? 0 : info.getClasses().length;
} | java | protected int getArtefactCount(String artefactType) {
ArtefactInfo info = getArtefactInfo(artefactType);
return info == null ? 0 : info.getClasses().length;
} | [
"protected",
"int",
"getArtefactCount",
"(",
"String",
"artefactType",
")",
"{",
"ArtefactInfo",
"info",
"=",
"getArtefactInfo",
"(",
"artefactType",
")",
";",
"return",
"info",
"==",
"null",
"?",
"0",
":",
"info",
".",
"getClasses",
"(",
")",
".",
"length",... | Retrieves the number of artefacts registered for the given artefactType as defined by the ArtefactHandler.
@param artefactType The type of the artefact as defined by the ArtefactHandler
@return The number of registered artefacts | [
"Retrieves",
"the",
"number",
"of",
"artefacts",
"registered",
"for",
"the",
"given",
"artefactType",
"as",
"defined",
"by",
"the",
"ArtefactHandler",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L342-L345 |
32,509 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getClassForName | public Class<?> getClassForName(String className) {
if (!StringUtils.hasText(className)) {
return null;
}
for (Class<?> c : allClasses) {
if (c.getName().equals(className)) {
return c;
}
}
return null;
} | java | public Class<?> getClassForName(String className) {
if (!StringUtils.hasText(className)) {
return null;
}
for (Class<?> c : allClasses) {
if (c.getName().equals(className)) {
return c;
}
}
return null;
} | [
"public",
"Class",
"<",
"?",
">",
"getClassForName",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"className",
")",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"Class",
"<",
"?",
">",
"c",
":",
"al... | Retrieves a class from the GrailsApplication for the given name.
@param className The class name
@return Either the Class instance or null if it doesn't exist | [
"Retrieves",
"a",
"class",
"from",
"the",
"GrailsApplication",
"for",
"the",
"given",
"name",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L362-L373 |
32,510 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.isArtefact | public boolean isArtefact(@SuppressWarnings("rawtypes") Class theClazz) {
String className = theClazz.getName();
for (Class<?> artefactClass : allArtefactClasses) {
if (className.equals(artefactClass.getName())) {
return true;
}
}
return false;
... | java | public boolean isArtefact(@SuppressWarnings("rawtypes") Class theClazz) {
String className = theClazz.getName();
for (Class<?> artefactClass : allArtefactClasses) {
if (className.equals(artefactClass.getName())) {
return true;
}
}
return false;
... | [
"public",
"boolean",
"isArtefact",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Class",
"theClazz",
")",
"{",
"String",
"className",
"=",
"theClazz",
".",
"getName",
"(",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"artefactClass",
":",
"allA... | Returns true if the given class is an artefact identified by one of the registered
ArtefactHandler instances. Uses class name equality to handle class reloading
@param theClazz The class to check
@return true if it is an artefact | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"is",
"an",
"artefact",
"identified",
"by",
"one",
"of",
"the",
"registered",
"ArtefactHandler",
"instances",
".",
"Uses",
"class",
"name",
"equality",
"to",
"handle",
"class",
"reloading"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L417-L425 |
32,511 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.isArtefactOfType | public boolean isArtefactOfType(String artefactType, @SuppressWarnings("rawtypes") Class theClazz) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler == null) {
throw new GrailsConfigurationException(
"Unable to locate arefact handler for sp... | java | public boolean isArtefactOfType(String artefactType, @SuppressWarnings("rawtypes") Class theClazz) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler == null) {
throw new GrailsConfigurationException(
"Unable to locate arefact handler for sp... | [
"public",
"boolean",
"isArtefactOfType",
"(",
"String",
"artefactType",
",",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Class",
"theClazz",
")",
"{",
"ArtefactHandler",
"handler",
"=",
"artefactHandlersByName",
".",
"get",
"(",
"artefactType",
")",
";",
"... | Returns true if the specified class is of the given artefact type as defined by the ArtefactHandler.
@param artefactType The type of the artefact
@param theClazz The class
@return true if it is of the specified artefactType
@see grails.core.ArtefactHandler | [
"Returns",
"true",
"if",
"the",
"specified",
"class",
"is",
"of",
"the",
"given",
"artefact",
"type",
"as",
"defined",
"by",
"the",
"ArtefactHandler",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L435-L443 |
32,512 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getArtefact | public GrailsClass getArtefact(String artefactType, String name) {
ArtefactInfo info = getArtefactInfo(artefactType);
return info == null ? null : info.getGrailsClass(name);
} | java | public GrailsClass getArtefact(String artefactType, String name) {
ArtefactInfo info = getArtefactInfo(artefactType);
return info == null ? null : info.getGrailsClass(name);
} | [
"public",
"GrailsClass",
"getArtefact",
"(",
"String",
"artefactType",
",",
"String",
"name",
")",
"{",
"ArtefactInfo",
"info",
"=",
"getArtefactInfo",
"(",
"artefactType",
")",
";",
"return",
"info",
"==",
"null",
"?",
"null",
":",
"info",
".",
"getGrailsClas... | Retrieves an artefact for the given type and name.
@param artefactType The artefact type as defined by a registered ArtefactHandler
@param name The name of the class
@return A GrailsClass instance or null if none could be found for the given artefactType and name | [
"Retrieves",
"an",
"artefact",
"for",
"the",
"given",
"type",
"and",
"name",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L464-L467 |
32,513 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.addArtefact | public GrailsClass addArtefact(String artefactType, GrailsClass artefactGrailsClass) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler.isArtefactGrailsClass(artefactGrailsClass)) {
// Store the GrailsClass in cache
DefaultArtefactInfo info = getArt... | java | public GrailsClass addArtefact(String artefactType, GrailsClass artefactGrailsClass) {
ArtefactHandler handler = artefactHandlersByName.get(artefactType);
if (handler.isArtefactGrailsClass(artefactGrailsClass)) {
// Store the GrailsClass in cache
DefaultArtefactInfo info = getArt... | [
"public",
"GrailsClass",
"addArtefact",
"(",
"String",
"artefactType",
",",
"GrailsClass",
"artefactGrailsClass",
")",
"{",
"ArtefactHandler",
"handler",
"=",
"artefactHandlersByName",
".",
"get",
"(",
"artefactType",
")",
";",
"if",
"(",
"handler",
".",
"isArtefact... | Adds an artefact of the given type for the given GrailsClass.
@param artefactType The type of the artefact as defined by a ArtefactHandler instance
@param artefactGrailsClass A GrailsClass instance that matches the type defined by the ArtefactHandler
@return The GrailsClass if successful or null if it couldn't ... | [
"Adds",
"an",
"artefact",
"of",
"the",
"given",
"type",
"for",
"the",
"given",
"GrailsClass",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L516-L531 |
32,514 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.registerArtefactHandler | public void registerArtefactHandler(ArtefactHandler handler) {
GrailsApplicationAwareBeanPostProcessor.processAwareInterfaces(this, handler);
artefactHandlersByName.put(handler.getType(), handler);
updateArtefactHandlers();
} | java | public void registerArtefactHandler(ArtefactHandler handler) {
GrailsApplicationAwareBeanPostProcessor.processAwareInterfaces(this, handler);
artefactHandlersByName.put(handler.getType(), handler);
updateArtefactHandlers();
} | [
"public",
"void",
"registerArtefactHandler",
"(",
"ArtefactHandler",
"handler",
")",
"{",
"GrailsApplicationAwareBeanPostProcessor",
".",
"processAwareInterfaces",
"(",
"this",
",",
"handler",
")",
";",
"artefactHandlersByName",
".",
"put",
"(",
"handler",
".",
"getType... | Registers a new ArtefactHandler that is responsible for identifying and managing a
particular artefact type that is defined by some convention.
@param handler The ArtefactHandler to regster | [
"Registers",
"a",
"new",
"ArtefactHandler",
"that",
"is",
"responsible",
"for",
"identifying",
"and",
"managing",
"a",
"particular",
"artefact",
"type",
"that",
"is",
"defined",
"by",
"some",
"convention",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L539-L543 |
32,515 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.initializeArtefacts | protected void initializeArtefacts(ArtefactHandler handler) {
if (handler == null) {
return;
}
ArtefactInfo info = getArtefactInfo(handler.getType());
// Only init those that have data
if (info != null) {
//System.out.println("Initialising artefacts of ki... | java | protected void initializeArtefacts(ArtefactHandler handler) {
if (handler == null) {
return;
}
ArtefactInfo info = getArtefactInfo(handler.getType());
// Only init those that have data
if (info != null) {
//System.out.println("Initialising artefacts of ki... | [
"protected",
"void",
"initializeArtefacts",
"(",
"ArtefactHandler",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"return",
";",
"}",
"ArtefactInfo",
"info",
"=",
"getArtefactInfo",
"(",
"handler",
".",
"getType",
"(",
")",
")",
";",
"... | Re-initialize the artefacts of the specified type. This gives handlers a chance to update caches etc.
@param handler The handler to register | [
"Re",
"-",
"initialize",
"the",
"artefacts",
"of",
"the",
"specified",
"type",
".",
"This",
"gives",
"handlers",
"a",
"chance",
"to",
"update",
"caches",
"etc",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L583-L594 |
32,516 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getArtefactInfo | protected DefaultArtefactInfo getArtefactInfo(String artefactType, boolean create) {
DefaultArtefactInfo cache = (DefaultArtefactInfo) artefactInfo.get(artefactType);
if (cache == null && create) {
cache = new DefaultArtefactInfo();
artefactInfo.put(artefactType, cache);
... | java | protected DefaultArtefactInfo getArtefactInfo(String artefactType, boolean create) {
DefaultArtefactInfo cache = (DefaultArtefactInfo) artefactInfo.get(artefactType);
if (cache == null && create) {
cache = new DefaultArtefactInfo();
artefactInfo.put(artefactType, cache);
... | [
"protected",
"DefaultArtefactInfo",
"getArtefactInfo",
"(",
"String",
"artefactType",
",",
"boolean",
"create",
")",
"{",
"DefaultArtefactInfo",
"cache",
"=",
"(",
"DefaultArtefactInfo",
")",
"artefactInfo",
".",
"get",
"(",
"artefactType",
")",
";",
"if",
"(",
"c... | Get or create the cache of classes for the specified artefact type.
@param artefactType The name of an artefact type
@param create Set to true if you want non-existent caches to be created
@return The cache of classes for the type, or null if no cache exists and create is false | [
"Get",
"or",
"create",
"the",
"cache",
"of",
"classes",
"for",
"the",
"specified",
"artefact",
"type",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L603-L611 |
32,517 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java | DefaultGrailsApplication.getProperty | @Override
public Object getProperty(String propertyName) {
// look for getXXXXClasses
final Matcher match = GETCLASSESPROP_PATTERN.matcher(propertyName);
// find match
match.find();
if (match.matches()) {
String artefactName = GrailsNameUtils.getClassNameRepresent... | java | @Override
public Object getProperty(String propertyName) {
// look for getXXXXClasses
final Matcher match = GETCLASSESPROP_PATTERN.matcher(propertyName);
// find match
match.find();
if (match.matches()) {
String artefactName = GrailsNameUtils.getClassNameRepresent... | [
"@",
"Override",
"public",
"Object",
"getProperty",
"(",
"String",
"propertyName",
")",
"{",
"// look for getXXXXClasses",
"final",
"Matcher",
"match",
"=",
"GETCLASSESPROP_PATTERN",
".",
"matcher",
"(",
"propertyName",
")",
";",
"// find match",
"match",
".",
"find... | Override property access and hit on xxxxClasses to return class arrays of artefacts.
@param propertyName The name of the property, if it ends in *Classes then match and invoke internal ArtefactHandler
@return All the artifacts or delegate to super.getProperty | [
"Override",
"property",
"access",
"and",
"hit",
"on",
"xxxxClasses",
"to",
"return",
"class",
"arrays",
"of",
"artefacts",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java#L690-L703 |
32,518 | grails/grails-core | grails-core/src/main/groovy/grails/core/DefaultArtefactInfo.java | DefaultArtefactInfo.updateComplete | public synchronized void updateComplete() {
grailsClassesByName = Collections.unmodifiableMap(grailsClassesByName);
classesByName = Collections.unmodifiableMap(classesByName);
grailsClassesArray = grailsClasses.toArray(new GrailsClass[grailsClasses.size()]);
// Make classes array
... | java | public synchronized void updateComplete() {
grailsClassesByName = Collections.unmodifiableMap(grailsClassesByName);
classesByName = Collections.unmodifiableMap(classesByName);
grailsClassesArray = grailsClasses.toArray(new GrailsClass[grailsClasses.size()]);
// Make classes array
... | [
"public",
"synchronized",
"void",
"updateComplete",
"(",
")",
"{",
"grailsClassesByName",
"=",
"Collections",
".",
"unmodifiableMap",
"(",
"grailsClassesByName",
")",
";",
"classesByName",
"=",
"Collections",
".",
"unmodifiableMap",
"(",
"classesByName",
")",
";",
"... | Refresh the arrays generated from the maps. | [
"Refresh",
"the",
"arrays",
"generated",
"from",
"the",
"maps",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/DefaultArtefactInfo.java#L83-L90 |
32,519 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.lookupUrlMappings | public static UrlMappingsHolder lookupUrlMappings(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
return (UrlMappingsHolder)wac.getBean(UrlMappingsHolder.BEAN_ID);
} | java | public static UrlMappingsHolder lookupUrlMappings(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
return (UrlMappingsHolder)wac.getBean(UrlMappingsHolder.BEAN_ID);
} | [
"public",
"static",
"UrlMappingsHolder",
"lookupUrlMappings",
"(",
"ServletContext",
"servletContext",
")",
"{",
"WebApplicationContext",
"wac",
"=",
"WebApplicationContextUtils",
".",
"getRequiredWebApplicationContext",
"(",
"servletContext",
")",
";",
"return",
"(",
"UrlM... | Looks up the UrlMappingsHolder instance
@return The UrlMappingsHolder
@param servletContext The ServletContext object | [
"Looks",
"up",
"the",
"UrlMappingsHolder",
"instance"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L89-L92 |
32,520 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.resolveView | public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
String controllerName = info.getControllerName();
return WebUtils.resolveView(request, viewName, controllerName, viewResolver);
} | java | public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
String controllerName = info.getControllerName();
return WebUtils.resolveView(request, viewName, controllerName, viewResolver);
} | [
"public",
"static",
"View",
"resolveView",
"(",
"HttpServletRequest",
"request",
",",
"UrlMappingInfo",
"info",
",",
"String",
"viewName",
",",
"ViewResolver",
"viewResolver",
")",
"throws",
"Exception",
"{",
"String",
"controllerName",
"=",
"info",
".",
"getControl... | Resolves a view for the given view and UrlMappingInfo instance
@param request The request
@param info The info
@param viewName The view name
@param viewResolver The view resolver
@return The view or null
@throws Exception | [
"Resolves",
"a",
"view",
"for",
"the",
"given",
"view",
"and",
"UrlMappingInfo",
"instance"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L104-L107 |
32,521 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.forwardRequestForUrlMappingInfo | @SuppressWarnings({ "unchecked", "rawtypes" })
public static String forwardRequestForUrlMappingInfo(HttpServletRequest request,
HttpServletResponse response, UrlMappingInfo info, Map<String, Object> model, boolean includeParams) throws ServletException, IOException {
String forwardUrl = buildDi... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static String forwardRequestForUrlMappingInfo(HttpServletRequest request,
HttpServletResponse response, UrlMappingInfo info, Map<String, Object> model, boolean includeParams) throws ServletException, IOException {
String forwardUrl = buildDi... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"String",
"forwardRequestForUrlMappingInfo",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"UrlMappingInfo",
"info",
",",
"Map",
... | Forwards a request for the given UrlMappingInfo object and model
@param request The request
@param response The response
@param info The UrlMappingInfo object
@param model The Model
@param includeParams Whether to include any request parameters
@return The URI forwarded too
@throws javax.servlet.ServletException Thro... | [
"Forwards",
"a",
"request",
"for",
"the",
"given",
"UrlMappingInfo",
"object",
"and",
"model"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L218-L242 |
32,522 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.includeForUrlMappingInfo | @SuppressWarnings({ "unchecked", "rawtypes" })
public static IncludedContent includeForUrlMappingInfo(HttpServletRequest request,
HttpServletResponse response, UrlMappingInfo info, Map model, LinkGenerator linkGenerator) {
final String includeUrl = buildDispatchUrlForMapping(info, true, linkGene... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static IncludedContent includeForUrlMappingInfo(HttpServletRequest request,
HttpServletResponse response, UrlMappingInfo info, Map model, LinkGenerator linkGenerator) {
final String includeUrl = buildDispatchUrlForMapping(info, true, linkGene... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"IncludedContent",
"includeForUrlMappingInfo",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"UrlMappingInfo",
"info",
",",
"Map",... | Include whatever the given UrlMappingInfo maps to within the current response
@param request The request
@param response The response
@param info The UrlMappingInfo
@param model The model
@param linkGenerator allows for reverse url mapping
@return The included content | [
"Include",
"whatever",
"the",
"given",
"UrlMappingInfo",
"maps",
"to",
"within",
"the",
"current",
"response"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L274-L281 |
32,523 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.includeForUrl | @SuppressWarnings({ "unchecked", "rawtypes" })
public static IncludedContent includeForUrl(String includeUrl, HttpServletRequest request,
HttpServletResponse response, Map model) {
RequestDispatcher dispatcher = request.getRequestDispatcher(includeUrl);
HttpServletResponse wrapped = Wrap... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static IncludedContent includeForUrl(String includeUrl, HttpServletRequest request,
HttpServletResponse response, Map model) {
RequestDispatcher dispatcher = request.getRequestDispatcher(includeUrl);
HttpServletResponse wrapped = Wrap... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"IncludedContent",
"includeForUrl",
"(",
"String",
"includeUrl",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"Map",
"model",
... | Includes the given URL returning the resulting content as a String
@param includeUrl The URL to include
@param request The request
@param response The response
@param model The model
@return The content | [
"Includes",
"the",
"given",
"URL",
"returning",
"the",
"resulting",
"content",
"as",
"a",
"String"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L357-L407 |
32,524 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java | BinaryGrailsPlugin.getResource | public Resource getResource(String path) {
final Resource descriptorResource = descriptor.getResource();
try {
Resource resource = descriptorResource.createRelative("static" + path);
if (resource.exists()) {
return resource;
}
} catch (IOExcep... | java | public Resource getResource(String path) {
final Resource descriptorResource = descriptor.getResource();
try {
Resource resource = descriptorResource.createRelative("static" + path);
if (resource.exists()) {
return resource;
}
} catch (IOExcep... | [
"public",
"Resource",
"getResource",
"(",
"String",
"path",
")",
"{",
"final",
"Resource",
"descriptorResource",
"=",
"descriptor",
".",
"getResource",
"(",
")",
";",
"try",
"{",
"Resource",
"resource",
"=",
"descriptorResource",
".",
"createRelative",
"(",
"\"s... | Resolves a static resource contained within this binary plugin
@param path The relative path to the static resource
@return The resource or null if it doesn't exist | [
"Resolves",
"a",
"static",
"resource",
"contained",
"within",
"this",
"binary",
"plugin"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java#L202-L214 |
32,525 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java | BinaryGrailsPlugin.getProperties | public Properties getProperties(final Locale locale) {
Resource url = this.baseResourcesResource;
Properties properties = null;
if(url != null) {
StaticResourceLoader resourceLoader = new StaticResourceLoader();
resourceLoader.setBaseResource(url);
ResourcePat... | java | public Properties getProperties(final Locale locale) {
Resource url = this.baseResourcesResource;
Properties properties = null;
if(url != null) {
StaticResourceLoader resourceLoader = new StaticResourceLoader();
resourceLoader.setBaseResource(url);
ResourcePat... | [
"public",
"Properties",
"getProperties",
"(",
"final",
"Locale",
"locale",
")",
"{",
"Resource",
"url",
"=",
"this",
".",
"baseResourcesResource",
";",
"Properties",
"properties",
"=",
"null",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"StaticResourceLoade... | Obtains all properties for this binary plugin for the given locale.
Note this method does not cache so clients should in general cache the results of this method.
@param locale The locale
@return The properties or null if non exist | [
"Obtains",
"all",
"properties",
"for",
"this",
"binary",
"plugin",
"for",
"the",
"given",
"locale",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java#L224-L262 |
32,526 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java | BinaryGrailsPlugin.resolveView | public Class resolveView(String viewName) {
// this is a workaround for GRAILS-9234; in that scenario the viewName will be
// "/WEB-INF/grails-app/views/plugins/plugin9234-0.1/junk/_book.gsp" with the
// extra "/plugins/plugin9234-0.1". I'm not sure if that's needed elsewhere, so
// re... | java | public Class resolveView(String viewName) {
// this is a workaround for GRAILS-9234; in that scenario the viewName will be
// "/WEB-INF/grails-app/views/plugins/plugin9234-0.1/junk/_book.gsp" with the
// extra "/plugins/plugin9234-0.1". I'm not sure if that's needed elsewhere, so
// re... | [
"public",
"Class",
"resolveView",
"(",
"String",
"viewName",
")",
"{",
"// this is a workaround for GRAILS-9234; in that scenario the viewName will be",
"// \"/WEB-INF/grails-app/views/plugins/plugin9234-0.1/junk/_book.gsp\" with the",
"// extra \"/plugins/plugin9234-0.1\". I'm not sure if that'... | Resolves a view for the given view name.
@param viewName The view name
@return The view class which is a subclass of GroovyPage | [
"Resolves",
"a",
"view",
"for",
"the",
"given",
"view",
"name",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java#L311-L321 |
32,527 | grails/grails-core | grails-bootstrap/src/main/groovy/grails/util/CollectionUtils.java | CollectionUtils.getOrCreateChildMap | public static Map getOrCreateChildMap(Map parent, String key) {
Object o = parent.get(key);
if(o instanceof Map) {
return (Map)o;
}
return new LinkedHashMap();
} | java | public static Map getOrCreateChildMap(Map parent, String key) {
Object o = parent.get(key);
if(o instanceof Map) {
return (Map)o;
}
return new LinkedHashMap();
} | [
"public",
"static",
"Map",
"getOrCreateChildMap",
"(",
"Map",
"parent",
",",
"String",
"key",
")",
"{",
"Object",
"o",
"=",
"parent",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"o",
"instanceof",
"Map",
")",
"{",
"return",
"(",
"Map",
")",
"o",
"... | Gets a child map of the given parent map or returns an empty map if it doesn't exist
@param parent The parent map
@param key The key that holds the child map
@return The child map | [
"Gets",
"a",
"child",
"map",
"of",
"the",
"given",
"parent",
"map",
"or",
"returns",
"an",
"empty",
"map",
"if",
"it",
"doesn",
"t",
"exist"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/grails/util/CollectionUtils.java#L70-L76 |
32,528 | grails/grails-core | grails-core/src/main/groovy/org/grails/core/DefaultGrailsServiceClass.java | DefaultGrailsServiceClass.getDatasource | public String getDatasource() {
if (datasourceName == null) {
CharSequence name = getStaticPropertyValue(DATA_SOURCE, CharSequence.class);
datasourceName = name == null ? null : name.toString();
if (datasourceName == null) {
datasourceName = DEFAULT_DATA_SOURC... | java | public String getDatasource() {
if (datasourceName == null) {
CharSequence name = getStaticPropertyValue(DATA_SOURCE, CharSequence.class);
datasourceName = name == null ? null : name.toString();
if (datasourceName == null) {
datasourceName = DEFAULT_DATA_SOURC... | [
"public",
"String",
"getDatasource",
"(",
")",
"{",
"if",
"(",
"datasourceName",
"==",
"null",
")",
"{",
"CharSequence",
"name",
"=",
"getStaticPropertyValue",
"(",
"DATA_SOURCE",
",",
"CharSequence",
".",
"class",
")",
";",
"datasourceName",
"=",
"name",
"=="... | If service is transactional then get data source will always apply
@return name of data source | [
"If",
"service",
"is",
"transactional",
"then",
"get",
"data",
"source",
"will",
"always",
"apply"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/DefaultGrailsServiceClass.java#L47-L57 |
32,529 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java | BasePluginFilter.isDependentOn | protected boolean isDependentOn(GrailsPlugin plugin, String pluginName) {
// check if toCompare depends on the current plugin
String[] dependencyNames = plugin.getDependencyNames();
for (int i = 0; i < dependencyNames.length; i++) {
final String dependencyName = dependencyNames[i];... | java | protected boolean isDependentOn(GrailsPlugin plugin, String pluginName) {
// check if toCompare depends on the current plugin
String[] dependencyNames = plugin.getDependencyNames();
for (int i = 0; i < dependencyNames.length; i++) {
final String dependencyName = dependencyNames[i];... | [
"protected",
"boolean",
"isDependentOn",
"(",
"GrailsPlugin",
"plugin",
",",
"String",
"pluginName",
")",
"{",
"// check if toCompare depends on the current plugin",
"String",
"[",
"]",
"dependencyNames",
"=",
"plugin",
".",
"getDependencyNames",
"(",
")",
";",
"for",
... | Checks whether a plugin is dependent on another plugin with the specified
name
@param plugin
the plugin to compare
@param pluginName
the name to compare against
@return true if <code>plugin</code> depends on <code>pluginName</code> | [
"Checks",
"whether",
"a",
"plugin",
"is",
"dependent",
"on",
"another",
"plugin",
"with",
"the",
"specified",
"name"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java#L134-L150 |
32,530 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java | BasePluginFilter.buildExplicitlyNamedList | private void buildExplicitlyNamedList() {
// each plugin must either be in included set or must be a dependent of
// included set
for (GrailsPlugin plugin : originalPlugins) {
// find explicitly included plugins
String name = plugin.getName();
if (suppliedNames.... | java | private void buildExplicitlyNamedList() {
// each plugin must either be in included set or must be a dependent of
// included set
for (GrailsPlugin plugin : originalPlugins) {
// find explicitly included plugins
String name = plugin.getName();
if (suppliedNames.... | [
"private",
"void",
"buildExplicitlyNamedList",
"(",
")",
"{",
"// each plugin must either be in included set or must be a dependent of",
"// included set",
"for",
"(",
"GrailsPlugin",
"plugin",
":",
"originalPlugins",
")",
"{",
"// find explicitly included plugins",
"String",
"na... | Returns the sublist of the supplied set who are explicitly named, either
as included or excluded plugins
@return a sublist containing the elements of the original list
corresponding with the explicitlyNamed items as passed into the
constructor | [
"Returns",
"the",
"sublist",
"of",
"the",
"supplied",
"set",
"who",
"are",
"explicitly",
"named",
"either",
"as",
"included",
"or",
"excluded",
"plugins"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java#L160-L173 |
32,531 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java | BasePluginFilter.buildNameMap | private void buildNameMap() {
nameMap = new HashMap<String, GrailsPlugin>();
for (GrailsPlugin plugin : originalPlugins) {
nameMap.put(plugin.getName(), plugin);
}
} | java | private void buildNameMap() {
nameMap = new HashMap<String, GrailsPlugin>();
for (GrailsPlugin plugin : originalPlugins) {
nameMap.put(plugin.getName(), plugin);
}
} | [
"private",
"void",
"buildNameMap",
"(",
")",
"{",
"nameMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"GrailsPlugin",
">",
"(",
")",
";",
"for",
"(",
"GrailsPlugin",
"plugin",
":",
"originalPlugins",
")",
"{",
"nameMap",
".",
"put",
"(",
"plugin",
".",... | Builds a name to plugin map from the original list of plugins supplied | [
"Builds",
"a",
"name",
"to",
"plugin",
"map",
"from",
"the",
"original",
"list",
"of",
"plugins",
"supplied"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java#L179-L184 |
32,532 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java | BasePluginFilter.registerDependency | @SuppressWarnings({"unchecked", "rawtypes"})
protected void registerDependency(List additionalList, GrailsPlugin plugin) {
if (!addedNames.contains(plugin.getName())) {
addedNames.add(plugin.getName());
additionalList.add(plugin);
addPluginDependencies(additionalList, plu... | java | @SuppressWarnings({"unchecked", "rawtypes"})
protected void registerDependency(List additionalList, GrailsPlugin plugin) {
if (!addedNames.contains(plugin.getName())) {
addedNames.add(plugin.getName());
additionalList.add(plugin);
addPluginDependencies(additionalList, plu... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"void",
"registerDependency",
"(",
"List",
"additionalList",
",",
"GrailsPlugin",
"plugin",
")",
"{",
"if",
"(",
"!",
"addedNames",
".",
"contains",
"(",
"plugin",
... | Adds a plugin to the additional if this hasn't happened already | [
"Adds",
"a",
"plugin",
"to",
"the",
"additional",
"if",
"this",
"hasn",
"t",
"happened",
"already"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/BasePluginFilter.java#L189-L196 |
32,533 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java | CharSequences.canUseOriginalForSubSequence | public static boolean canUseOriginalForSubSequence(CharSequence str, int start, int count) {
if (start != 0) return false;
final Class<?> csqClass = str.getClass();
return (csqClass == String.class || csqClass == StringBuilder.class || csqClass == StringBuffer.class) && count == str.length();
... | java | public static boolean canUseOriginalForSubSequence(CharSequence str, int start, int count) {
if (start != 0) return false;
final Class<?> csqClass = str.getClass();
return (csqClass == String.class || csqClass == StringBuilder.class || csqClass == StringBuffer.class) && count == str.length();
... | [
"public",
"static",
"boolean",
"canUseOriginalForSubSequence",
"(",
"CharSequence",
"str",
",",
"int",
"start",
",",
"int",
"count",
")",
"{",
"if",
"(",
"start",
"!=",
"0",
")",
"return",
"false",
";",
"final",
"Class",
"<",
"?",
">",
"csqClass",
"=",
"... | Checks if start == 0 and count == length of CharSequence
It does this check only for String, StringBuilder and StringBuffer classes which have a fast way to check length
Calculating length on GStringImpl requires building the result which is costly.
This helper method is to avoid calling length on other that String, S... | [
"Checks",
"if",
"start",
"==",
"0",
"and",
"count",
"==",
"length",
"of",
"CharSequence",
"It",
"does",
"this",
"check",
"only",
"for",
"String",
"StringBuilder",
"and",
"StringBuffer",
"classes",
"which",
"have",
"a",
"fast",
"way",
"to",
"check",
"length"
... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java#L62-L66 |
32,534 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java | CharSequences.writeCharSequence | public static void writeCharSequence(Writer target, CharSequence csq, int start, int end) throws IOException {
final Class<?> csqClass = csq.getClass();
if (csqClass == String.class) {
target.write((String)csq, start, end - start);
}
else if (csqClass == StringBuffer.class) {... | java | public static void writeCharSequence(Writer target, CharSequence csq, int start, int end) throws IOException {
final Class<?> csqClass = csq.getClass();
if (csqClass == String.class) {
target.write((String)csq, start, end - start);
}
else if (csqClass == StringBuffer.class) {... | [
"public",
"static",
"void",
"writeCharSequence",
"(",
"Writer",
"target",
",",
"CharSequence",
"csq",
",",
"int",
"start",
",",
"int",
"end",
")",
"throws",
"IOException",
"{",
"final",
"Class",
"<",
"?",
">",
"csqClass",
"=",
"csq",
".",
"getClass",
"(",
... | Writes a CharSequence instance in the most optimal way to the target writer
@param target writer
@param csq source CharSequence instance
@param start start/offset index
@param end end index + 1
@throws IOException | [
"Writes",
"a",
"CharSequence",
"instance",
"in",
"the",
"most",
"optimal",
"way",
"to",
"the",
"target",
"writer"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java#L86-L110 |
32,535 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java | CharSequences.getChars | public static void getChars(CharSequence csq, int srcBegin, int srcEnd, char dst[], int dstBegin) {
final Class<?> csqClass = csq.getClass();
if (csqClass == String.class) {
((String)csq).getChars(srcBegin, srcEnd, dst, dstBegin);
}
else if (csqClass == StringBuffer.class) {
... | java | public static void getChars(CharSequence csq, int srcBegin, int srcEnd, char dst[], int dstBegin) {
final Class<?> csqClass = csq.getClass();
if (csqClass == String.class) {
((String)csq).getChars(srcBegin, srcEnd, dst, dstBegin);
}
else if (csqClass == StringBuffer.class) {
... | [
"public",
"static",
"void",
"getChars",
"(",
"CharSequence",
"csq",
",",
"int",
"srcBegin",
",",
"int",
"srcEnd",
",",
"char",
"dst",
"[",
"]",
",",
"int",
"dstBegin",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"csqClass",
"=",
"csq",
".",
"getClass",
... | Provides an optimized way to copy CharSequence content to target array.
Uses getChars method available on String, StringBuilder and StringBuffer classes.
Characters are copied from the source sequence <code>csq</code> into the
destination character array <code>dst</code>. The first character to
be copied is at index <... | [
"Provides",
"an",
"optimized",
"way",
"to",
"copy",
"CharSequence",
"content",
"to",
"target",
"array",
".",
"Uses",
"getChars",
"method",
"available",
"on",
"String",
"StringBuilder",
"and",
"StringBuffer",
"classes",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java#L150-L168 |
32,536 | grails/grails-core | grails-shell/src/main/groovy/org/grails/cli/interactive/completers/SortedAggregateCompleter.java | SortedAggregateCompleter.complete | public int complete(final String buffer, final int cursor, final List<CharSequence> candidates) {
// buffer could be null
checkNotNull(candidates);
List<Completion> completions = new ArrayList<Completion>(completers.size());
// Run each completer, saving its completion results
... | java | public int complete(final String buffer, final int cursor, final List<CharSequence> candidates) {
// buffer could be null
checkNotNull(candidates);
List<Completion> completions = new ArrayList<Completion>(completers.size());
// Run each completer, saving its completion results
... | [
"public",
"int",
"complete",
"(",
"final",
"String",
"buffer",
",",
"final",
"int",
"cursor",
",",
"final",
"List",
"<",
"CharSequence",
">",
"candidates",
")",
"{",
"// buffer could be null",
"checkNotNull",
"(",
"candidates",
")",
";",
"List",
"<",
"Completi... | Perform a completion operation across all aggregated completers.
@see Completer#complete(String, int, java.util.List)
@return the highest completion return value from all completers | [
"Perform",
"a",
"completion",
"operation",
"across",
"all",
"aggregated",
"completers",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-shell/src/main/groovy/org/grails/cli/interactive/completers/SortedAggregateCompleter.java#L75-L105 |
32,537 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/CachingLinkGenerator.java | CachingLinkGenerator.appendMapKey | protected void appendMapKey(StringBuilder buffer, Map<String, Object> params) {
if (params==null || params.isEmpty()) {
buffer.append(EMPTY_MAP_STRING);
buffer.append(OPENING_BRACKET);
} else {
buffer.append(OPENING_BRACKET);
Map map = new LinkedHashMap<>(... | java | protected void appendMapKey(StringBuilder buffer, Map<String, Object> params) {
if (params==null || params.isEmpty()) {
buffer.append(EMPTY_MAP_STRING);
buffer.append(OPENING_BRACKET);
} else {
buffer.append(OPENING_BRACKET);
Map map = new LinkedHashMap<>(... | [
"protected",
"void",
"appendMapKey",
"(",
"StringBuilder",
"buffer",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
"||",
"params",
".",
"isEmpty",
"(",
")",
")",
"{",
"buffer",
".",
"append",
"(",... | Based on DGM toMapString, but with StringBuilder instead of StringBuffer | [
"Based",
"on",
"DGM",
"toMapString",
"but",
"with",
"StringBuilder",
"instead",
"of",
"StringBuffer"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/CachingLinkGenerator.java#L94-L127 |
32,538 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java | RegexUrlMapping.convertToRegex | protected Pattern convertToRegex(String url) {
Pattern regex;
String pattern = null;
try {
// Escape any characters that have special meaning in regular expressions,
// such as '.' and '+'.
pattern = url.replace(".", "\\.");
pattern = pattern.repla... | java | protected Pattern convertToRegex(String url) {
Pattern regex;
String pattern = null;
try {
// Escape any characters that have special meaning in regular expressions,
// such as '.' and '+'.
pattern = url.replace(".", "\\.");
pattern = pattern.repla... | [
"protected",
"Pattern",
"convertToRegex",
"(",
"String",
"url",
")",
"{",
"Pattern",
"regex",
";",
"String",
"pattern",
"=",
"null",
";",
"try",
"{",
"// Escape any characters that have special meaning in regular expressions,",
"// such as '.' and '+'.",
"pattern",
"=",
"... | Converts a Grails URL provides via the UrlMappingData interface to a regular expression.
@param url The URL to convert
@return A regex Pattern objet | [
"Converts",
"a",
"Grails",
"URL",
"provides",
"via",
"the",
"UrlMappingData",
"interface",
"to",
"a",
"regular",
"expression",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java#L216-L261 |
32,539 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java | RegexUrlMapping.match | public UrlMappingInfo match(String uri) {
for (Pattern pattern : patterns) {
Matcher m = pattern.matcher(uri);
if (m.matches()) {
UrlMappingInfo urlInfo = createUrlMappingInfo(uri, m);
if (urlInfo != null) {
return urlInfo;
... | java | public UrlMappingInfo match(String uri) {
for (Pattern pattern : patterns) {
Matcher m = pattern.matcher(uri);
if (m.matches()) {
UrlMappingInfo urlInfo = createUrlMappingInfo(uri, m);
if (urlInfo != null) {
return urlInfo;
... | [
"public",
"UrlMappingInfo",
"match",
"(",
"String",
"uri",
")",
"{",
"for",
"(",
"Pattern",
"pattern",
":",
"patterns",
")",
"{",
"Matcher",
"m",
"=",
"pattern",
".",
"matcher",
"(",
"uri",
")",
";",
"if",
"(",
"m",
".",
"matches",
"(",
")",
")",
"... | Matches the given URI and returns a DefaultUrlMappingInfo instance or null
@param uri The URI to match
@return A UrlMappingInfo instance or null
@see grails.web.mapping.UrlMappingInfo | [
"Matches",
"the",
"given",
"URI",
"and",
"returns",
"a",
"DefaultUrlMappingInfo",
"instance",
"or",
"null"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java#L270-L281 |
32,540 | grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java | RegexUrlMapping.createRuntimeConstraintEvaluator | private Object createRuntimeConstraintEvaluator(final String name, ConstrainedProperty[] constraints) {
if (constraints == null) return null;
for (ConstrainedProperty constraint : constraints) {
if (constraint.getPropertyName().equals(name)) {
return new Closure(this) {
... | java | private Object createRuntimeConstraintEvaluator(final String name, ConstrainedProperty[] constraints) {
if (constraints == null) return null;
for (ConstrainedProperty constraint : constraints) {
if (constraint.getPropertyName().equals(name)) {
return new Closure(this) {
... | [
"private",
"Object",
"createRuntimeConstraintEvaluator",
"(",
"final",
"String",
"name",
",",
"ConstrainedProperty",
"[",
"]",
"constraints",
")",
"{",
"if",
"(",
"constraints",
"==",
"null",
")",
"return",
"null",
";",
"for",
"(",
"ConstrainedProperty",
"constrai... | This method will look for a constraint for the given name and return a closure that when executed will
attempt to evaluate its value from the bound request parameters at runtime.
@param name The name of the constrained property
@param constraints The array of current ConstrainedProperty instances
@return Either... | [
"This",
"method",
"will",
"look",
"for",
"a",
"constraint",
"for",
"the",
"given",
"name",
"and",
"return",
"a",
"closure",
"that",
"when",
"executed",
"will",
"attempt",
"to",
"evaluate",
"its",
"value",
"from",
"the",
"bound",
"request",
"parameters",
"at"... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/RegexUrlMapping.java#L700-L717 |
32,541 | grails/grails-core | grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java | RuntimeSpringConfigUtilities.doLoadSpringGroovyResources | private static void doLoadSpringGroovyResources(RuntimeSpringConfiguration config, GrailsApplication application,
GenericApplicationContext context) {
loadExternalSpringConfig(config, application);
if (context != null) {
springGroovyResourc... | java | private static void doLoadSpringGroovyResources(RuntimeSpringConfiguration config, GrailsApplication application,
GenericApplicationContext context) {
loadExternalSpringConfig(config, application);
if (context != null) {
springGroovyResourc... | [
"private",
"static",
"void",
"doLoadSpringGroovyResources",
"(",
"RuntimeSpringConfiguration",
"config",
",",
"GrailsApplication",
"application",
",",
"GenericApplicationContext",
"context",
")",
"{",
"loadExternalSpringConfig",
"(",
"config",
",",
"application",
")",
";",
... | Attempt to load the beans defined by a BeanBuilder DSL closure in "resources.groovy".
@param config
@param context | [
"Attempt",
"to",
"load",
"the",
"beans",
"defined",
"by",
"a",
"BeanBuilder",
"DSL",
"closure",
"in",
"resources",
".",
"groovy",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java#L57-L63 |
32,542 | grails/grails-core | grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java | RuntimeSpringConfigUtilities.loadExternalSpringConfig | public static void loadExternalSpringConfig(RuntimeSpringConfiguration config, final GrailsApplication application) {
if (springGroovyResourcesBeanBuilder == null) {
try {
Class<?> groovySpringResourcesClass = null;
try {
groovySpringResourcesClass... | java | public static void loadExternalSpringConfig(RuntimeSpringConfiguration config, final GrailsApplication application) {
if (springGroovyResourcesBeanBuilder == null) {
try {
Class<?> groovySpringResourcesClass = null;
try {
groovySpringResourcesClass... | [
"public",
"static",
"void",
"loadExternalSpringConfig",
"(",
"RuntimeSpringConfiguration",
"config",
",",
"final",
"GrailsApplication",
"application",
")",
"{",
"if",
"(",
"springGroovyResourcesBeanBuilder",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">"... | Loads any external Spring configuration into the given RuntimeSpringConfiguration object.
@param config The config instance | [
"Loads",
"any",
"external",
"Spring",
"configuration",
"into",
"the",
"given",
"RuntimeSpringConfiguration",
"object",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/RuntimeSpringConfigUtilities.java#L69-L93 |
32,543 | grails/grails-core | grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java | PluginAwareResourceBundleMessageSource.resolveCodeWithoutArgumentsFromPlugins | protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
String result = propHolder.getProperty(code);
if (result != null) {
return resul... | java | protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
String result = propHolder.getProperty(code);
if (result != null) {
return resul... | [
"protected",
"String",
"resolveCodeWithoutArgumentsFromPlugins",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"pluginCacheMillis",
"<",
"0",
")",
"{",
"PropertiesHolder",
"propHolder",
"=",
"getMergedPluginProperties",
"(",
"locale",
")",
";"... | Attempts to resolve a String for the code from the list of plugin base names
@param code The code
@param locale The locale
@return a MessageFormat | [
"Attempts",
"to",
"resolve",
"a",
"String",
"for",
"the",
"code",
"from",
"the",
"list",
"of",
"plugin",
"base",
"names"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java#L195-L209 |
32,544 | grails/grails-core | grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java | PluginAwareResourceBundleMessageSource.resolveCodeFromPlugins | protected MessageFormat resolveCodeFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
MessageFormat result = propHolder.getMessageFormat(code, locale);
if (result != null) {
r... | java | protected MessageFormat resolveCodeFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
MessageFormat result = propHolder.getMessageFormat(code, locale);
if (result != null) {
r... | [
"protected",
"MessageFormat",
"resolveCodeFromPlugins",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"pluginCacheMillis",
"<",
"0",
")",
"{",
"PropertiesHolder",
"propHolder",
"=",
"getMergedPluginProperties",
"(",
"locale",
")",
";",
"Mess... | Attempts to resolve a MessageFormat for the code from the list of plugin base names
@param code The code
@param locale The locale
@return a MessageFormat | [
"Attempts",
"to",
"resolve",
"a",
"MessageFormat",
"for",
"the",
"code",
"from",
"the",
"list",
"of",
"plugin",
"base",
"names"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java#L252-L265 |
32,545 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java | AbstractGrailsPluginManager.doRuntimeConfiguration | public void doRuntimeConfiguration(RuntimeSpringConfiguration springConfig) {
ApplicationContext context = springConfig.getUnrefreshedApplicationContext();
AutowireCapableBeanFactory autowireCapableBeanFactory = context.getAutowireCapableBeanFactory();
if(autowireCapableBeanFactory instanceof Co... | java | public void doRuntimeConfiguration(RuntimeSpringConfiguration springConfig) {
ApplicationContext context = springConfig.getUnrefreshedApplicationContext();
AutowireCapableBeanFactory autowireCapableBeanFactory = context.getAutowireCapableBeanFactory();
if(autowireCapableBeanFactory instanceof Co... | [
"public",
"void",
"doRuntimeConfiguration",
"(",
"RuntimeSpringConfiguration",
"springConfig",
")",
"{",
"ApplicationContext",
"context",
"=",
"springConfig",
".",
"getUnrefreshedApplicationContext",
"(",
")",
";",
"AutowireCapableBeanFactory",
"autowireCapableBeanFactory",
"="... | Base implementation that simply goes through the list of plugins and calls doWithRuntimeConfiguration on each
@param springConfig The RuntimeSpringConfiguration instance | [
"Base",
"implementation",
"that",
"simply",
"goes",
"through",
"the",
"list",
"of",
"plugins",
"and",
"calls",
"doWithRuntimeConfiguration",
"on",
"each"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java#L140-L169 |
32,546 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java | AbstractGrailsPluginManager.doRuntimeConfiguration | public void doRuntimeConfiguration(String pluginName, RuntimeSpringConfiguration springConfig) {
checkInitialised();
GrailsPlugin plugin = getGrailsPlugin(pluginName);
if (plugin == null) {
throw new PluginException("Plugin [" + pluginName + "] not found");
}
if (!pl... | java | public void doRuntimeConfiguration(String pluginName, RuntimeSpringConfiguration springConfig) {
checkInitialised();
GrailsPlugin plugin = getGrailsPlugin(pluginName);
if (plugin == null) {
throw new PluginException("Plugin [" + pluginName + "] not found");
}
if (!pl... | [
"public",
"void",
"doRuntimeConfiguration",
"(",
"String",
"pluginName",
",",
"RuntimeSpringConfiguration",
"springConfig",
")",
"{",
"checkInitialised",
"(",
")",
";",
"GrailsPlugin",
"plugin",
"=",
"getGrailsPlugin",
"(",
"pluginName",
")",
";",
"if",
"(",
"plugin... | Base implementation that will perform runtime configuration for the specified plugin name. | [
"Base",
"implementation",
"that",
"will",
"perform",
"runtime",
"configuration",
"for",
"the",
"specified",
"plugin",
"name",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java#L174-L197 |
32,547 | grails/grails-core | grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java | AbstractGrailsPluginManager.doPostProcessing | public void doPostProcessing(ApplicationContext ctx) {
checkInitialised();
for (GrailsPlugin plugin : pluginList) {
if(isPluginDisabledForProfile(plugin)) continue;
if (plugin.supportsCurrentScopeAndEnvironment()) {
plugin.doWithApplicationContext(ctx);
... | java | public void doPostProcessing(ApplicationContext ctx) {
checkInitialised();
for (GrailsPlugin plugin : pluginList) {
if(isPluginDisabledForProfile(plugin)) continue;
if (plugin.supportsCurrentScopeAndEnvironment()) {
plugin.doWithApplicationContext(ctx);
... | [
"public",
"void",
"doPostProcessing",
"(",
"ApplicationContext",
"ctx",
")",
"{",
"checkInitialised",
"(",
")",
";",
"for",
"(",
"GrailsPlugin",
"plugin",
":",
"pluginList",
")",
"{",
"if",
"(",
"isPluginDisabledForProfile",
"(",
"plugin",
")",
")",
"continue",
... | Base implementation that will simply go through each plugin and call doWithApplicationContext on each. | [
"Base",
"implementation",
"that",
"will",
"simply",
"go",
"through",
"each",
"plugin",
"and",
"call",
"doWithApplicationContext",
"on",
"each",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java#L218-L226 |
32,548 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/buffer/GrailsPrintWriter.java | GrailsPrintWriter.flush | @Override
public synchronized void flush() {
if (trouble) {
return;
}
if (isDestinationActivated()) {
try {
getOut().flush();
}
catch (IOException e) {
handleIOException(e);
}
}
} | java | @Override
public synchronized void flush() {
if (trouble) {
return;
}
if (isDestinationActivated()) {
try {
getOut().flush();
}
catch (IOException e) {
handleIOException(e);
}
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"flush",
"(",
")",
"{",
"if",
"(",
"trouble",
")",
"{",
"return",
";",
"}",
"if",
"(",
"isDestinationActivated",
"(",
")",
")",
"{",
"try",
"{",
"getOut",
"(",
")",
".",
"flush",
"(",
")",
";",
"}"... | Flush the stream.
@see #checkError() | [
"Flush",
"the",
"stream",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/buffer/GrailsPrintWriter.java#L163-L177 |
32,549 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.lookupHandlerInterceptors | public static HandlerInterceptor[] lookupHandlerInterceptors(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
final Collection<HandlerInterceptor> allHandlerInterceptors = new ArrayList<HandlerInterceptor>();
... | java | public static HandlerInterceptor[] lookupHandlerInterceptors(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
final Collection<HandlerInterceptor> allHandlerInterceptors = new ArrayList<HandlerInterceptor>();
... | [
"public",
"static",
"HandlerInterceptor",
"[",
"]",
"lookupHandlerInterceptors",
"(",
"ServletContext",
"servletContext",
")",
"{",
"WebApplicationContext",
"wac",
"=",
"WebApplicationContextUtils",
".",
"getRequiredWebApplicationContext",
"(",
"servletContext",
")",
";",
"... | Looks up all of the HandlerInterceptor instances registered for the application
@param servletContext The ServletContext instance
@return An array of HandlerInterceptor instances | [
"Looks",
"up",
"all",
"of",
"the",
"HandlerInterceptor",
"instances",
"registered",
"for",
"the",
"application"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L100-L113 |
32,550 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.lookupWebRequestInterceptors | public static WebRequestInterceptor[] lookupWebRequestInterceptors(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
final Collection<WebRequestInterceptor> webRequestInterceptors = wac.getBeansOfType(WebRequestInte... | java | public static WebRequestInterceptor[] lookupWebRequestInterceptors(ServletContext servletContext) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
final Collection<WebRequestInterceptor> webRequestInterceptors = wac.getBeansOfType(WebRequestInte... | [
"public",
"static",
"WebRequestInterceptor",
"[",
"]",
"lookupWebRequestInterceptors",
"(",
"ServletContext",
"servletContext",
")",
"{",
"WebApplicationContext",
"wac",
"=",
"WebApplicationContextUtils",
".",
"getRequiredWebApplicationContext",
"(",
"servletContext",
")",
";... | Looks up all of the WebRequestInterceptor instances registered with the application
@param servletContext The ServletContext instance
@return An array of WebRequestInterceptor instances | [
"Looks",
"up",
"all",
"of",
"the",
"WebRequestInterceptor",
"instances",
"registered",
"with",
"the",
"application"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L121-L126 |
32,551 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.findApplicationContext | public static ApplicationContext findApplicationContext(ServletContext servletContext) {
if(servletContext == null) {
return ContextLoader.getCurrentWebApplicationContext();
}
return WebApplicationContextUtils.getWebApplicationContext(servletContext);
} | java | public static ApplicationContext findApplicationContext(ServletContext servletContext) {
if(servletContext == null) {
return ContextLoader.getCurrentWebApplicationContext();
}
return WebApplicationContextUtils.getWebApplicationContext(servletContext);
} | [
"public",
"static",
"ApplicationContext",
"findApplicationContext",
"(",
"ServletContext",
"servletContext",
")",
"{",
"if",
"(",
"servletContext",
"==",
"null",
")",
"{",
"return",
"ContextLoader",
".",
"getCurrentWebApplicationContext",
"(",
")",
";",
"}",
"return",... | Locates the ApplicationContext, returns null if not found
@param servletContext The servlet context
@return The ApplicationContext | [
"Locates",
"the",
"ApplicationContext",
"returns",
"null",
"if",
"not",
"found"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L175-L180 |
32,552 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.resolveView | public static View resolveView(HttpServletRequest request, String viewName, String controllerName, ViewResolver viewResolver) throws Exception {
GrailsWebRequest webRequest = GrailsWebRequest.lookup(request);
Locale locale = webRequest != null ? webRequest.getLocale() : Locale.getDefault() ;
ret... | java | public static View resolveView(HttpServletRequest request, String viewName, String controllerName, ViewResolver viewResolver) throws Exception {
GrailsWebRequest webRequest = GrailsWebRequest.lookup(request);
Locale locale = webRequest != null ? webRequest.getLocale() : Locale.getDefault() ;
ret... | [
"public",
"static",
"View",
"resolveView",
"(",
"HttpServletRequest",
"request",
",",
"String",
"viewName",
",",
"String",
"controllerName",
",",
"ViewResolver",
"viewResolver",
")",
"throws",
"Exception",
"{",
"GrailsWebRequest",
"webRequest",
"=",
"GrailsWebRequest",
... | Resolves a view for the given view name and controller name
@param request The request
@param viewName The view name
@param controllerName The controller name
@param viewResolver The resolver
@return A View or null
@throws Exception Thrown if an error occurs | [
"Resolves",
"a",
"view",
"for",
"the",
"given",
"view",
"name",
"and",
"controller",
"name"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L191-L195 |
32,553 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.exposeRequestAttributeIfNotPresent | private static void exposeRequestAttributeIfNotPresent(ServletRequest request, String name, Object value) {
if (request.getAttribute(name) == null) {
request.setAttribute(name, value);
}
} | java | private static void exposeRequestAttributeIfNotPresent(ServletRequest request, String name, Object value) {
if (request.getAttribute(name) == null) {
request.setAttribute(name, value);
}
} | [
"private",
"static",
"void",
"exposeRequestAttributeIfNotPresent",
"(",
"ServletRequest",
"request",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"request",
".",
"getAttribute",
"(",
"name",
")",
"==",
"null",
")",
"{",
"request",
".",
... | Expose the specified request attribute if not already present.
@param request current servlet request
@param name the name of the attribute
@param value the suggested value of the attribute | [
"Expose",
"the",
"specified",
"request",
"attribute",
"if",
"not",
"already",
"present",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L277-L281 |
32,554 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.fromQueryString | @SuppressWarnings({ "unchecked", "rawtypes" })
public static Map<String, Object> fromQueryString(String queryString) {
Map<String, Object> result = new LinkedHashMap<String, Object>();
if (queryString.startsWith("?")) queryString = queryString.substring(1);
String[] pairs = queryString.spli... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static Map<String, Object> fromQueryString(String queryString) {
Map<String, Object> result = new LinkedHashMap<String, Object>();
if (queryString.startsWith("?")) queryString = queryString.substring(1);
String[] pairs = queryString.spli... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"fromQueryString",
"(",
"String",
"queryString",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
... | Takes a query string and returns the results as a map where the values are either a single entry or a list of values
@param queryString The query String
@return A map | [
"Takes",
"a",
"query",
"string",
"and",
"returns",
"the",
"results",
"as",
"a",
"map",
"where",
"the",
"values",
"are",
"either",
"a",
"single",
"entry",
"or",
"a",
"list",
"of",
"values"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L289-L323 |
32,555 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.toQueryString | @SuppressWarnings("rawtypes")
public static String toQueryString(Map params, String encoding) throws UnsupportedEncodingException {
if (encoding == null) encoding = "UTF-8";
StringBuilder queryString = new StringBuilder("?");
for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
... | java | @SuppressWarnings("rawtypes")
public static String toQueryString(Map params, String encoding) throws UnsupportedEncodingException {
if (encoding == null) encoding = "UTF-8";
StringBuilder queryString = new StringBuilder("?");
for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"String",
"toQueryString",
"(",
"Map",
"params",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"encoding",
"=",
"\"U... | Converts the given params into a query string started with ?
@param params The params
@param encoding The encoding to use
@return The query string
@throws UnsupportedEncodingException If the given encoding is not supported | [
"Converts",
"the",
"given",
"params",
"into",
"a",
"query",
"string",
"started",
"with",
"?"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L332-L344 |
32,556 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.areFileExtensionsEnabled | @SuppressWarnings("rawtypes")
public static boolean areFileExtensionsEnabled() {
Config config = GrailsWebUtil.currentApplication().getConfig();
return config.getProperty(ENABLE_FILE_EXTENSIONS, Boolean.class, true);
} | java | @SuppressWarnings("rawtypes")
public static boolean areFileExtensionsEnabled() {
Config config = GrailsWebUtil.currentApplication().getConfig();
return config.getProperty(ENABLE_FILE_EXTENSIONS, Boolean.class, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"boolean",
"areFileExtensionsEnabled",
"(",
")",
"{",
"Config",
"config",
"=",
"GrailsWebUtil",
".",
"currentApplication",
"(",
")",
".",
"getConfig",
"(",
")",
";",
"return",
"config",
".",
... | Returns the value of the "grails.mime.file.extensions" setting configured in application.groovy
@return true if file extensions are enabled | [
"Returns",
"the",
"value",
"of",
"the",
"grails",
".",
"mime",
".",
"file",
".",
"extensions",
"setting",
"configured",
"in",
"application",
".",
"groovy"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L427-L431 |
32,557 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.storeGrailsWebRequest | public static void storeGrailsWebRequest(GrailsWebRequest webRequest) {
RequestContextHolder.setRequestAttributes(webRequest);
webRequest.getRequest().setAttribute(GrailsApplicationAttributes.WEB_REQUEST, webRequest);
} | java | public static void storeGrailsWebRequest(GrailsWebRequest webRequest) {
RequestContextHolder.setRequestAttributes(webRequest);
webRequest.getRequest().setAttribute(GrailsApplicationAttributes.WEB_REQUEST, webRequest);
} | [
"public",
"static",
"void",
"storeGrailsWebRequest",
"(",
"GrailsWebRequest",
"webRequest",
")",
"{",
"RequestContextHolder",
".",
"setRequestAttributes",
"(",
"webRequest",
")",
";",
"webRequest",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"GrailsApplicat... | Helper method to store the given GrailsWebRequest for the current
request. Ensures consistency between RequestContextHolder and the
relevant request attribute. This is the preferred means of updating
the current web request. | [
"Helper",
"method",
"to",
"store",
"the",
"given",
"GrailsWebRequest",
"for",
"the",
"current",
"request",
".",
"Ensures",
"consistency",
"between",
"RequestContextHolder",
"and",
"the",
"relevant",
"request",
"attribute",
".",
"This",
"is",
"the",
"preferred",
"m... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L455-L458 |
32,558 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.clearGrailsWebRequest | public static void clearGrailsWebRequest() {
RequestAttributes reqAttrs = RequestContextHolder.getRequestAttributes();
if (reqAttrs != null) {
// First remove the web request from the HTTP request attributes.
GrailsWebRequest webRequest = (GrailsWebRequest) reqAttrs;
... | java | public static void clearGrailsWebRequest() {
RequestAttributes reqAttrs = RequestContextHolder.getRequestAttributes();
if (reqAttrs != null) {
// First remove the web request from the HTTP request attributes.
GrailsWebRequest webRequest = (GrailsWebRequest) reqAttrs;
... | [
"public",
"static",
"void",
"clearGrailsWebRequest",
"(",
")",
"{",
"RequestAttributes",
"reqAttrs",
"=",
"RequestContextHolder",
".",
"getRequestAttributes",
"(",
")",
";",
"if",
"(",
"reqAttrs",
"!=",
"null",
")",
"{",
"// First remove the web request from the HTTP re... | Removes any GrailsWebRequest instance from the current request. | [
"Removes",
"any",
"GrailsWebRequest",
"instance",
"from",
"the",
"current",
"request",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L463-L473 |
32,559 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java | WebUtils.getForwardURI | public static String getForwardURI(HttpServletRequest request) {
String result = (String) request.getAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE);
if (GrailsStringUtils.isBlank(result)) result = request.getRequestURI();
return result;
} | java | public static String getForwardURI(HttpServletRequest request) {
String result = (String) request.getAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE);
if (GrailsStringUtils.isBlank(result)) result = request.getRequestURI();
return result;
} | [
"public",
"static",
"String",
"getForwardURI",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"result",
"=",
"(",
"String",
")",
"request",
".",
"getAttribute",
"(",
"WebUtils",
".",
"FORWARD_REQUEST_URI_ATTRIBUTE",
")",
";",
"if",
"(",
"GrailsStringUti... | Obtains the forwardURI from the request, since Grails uses a forwarding technique for URL mappings. The actual
request URI is held within a request attribute
@param request The request
@return The forward URI | [
"Obtains",
"the",
"forwardURI",
"from",
"the",
"request",
"since",
"Grails",
"uses",
"a",
"forwarding",
"technique",
"for",
"URL",
"mappings",
".",
"The",
"actual",
"request",
"URI",
"is",
"held",
"within",
"a",
"request",
"attribute"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java#L482-L486 |
32,560 | grails/grails-core | grails-encoder/src/main/groovy/org/grails/buffer/StreamCharBuffer.java | StreamCharBuffer.methodMissing | public Object methodMissing(String name, Object args) {
String str = this.toString();
return InvokerHelper.invokeMethod(str, name, args);
} | java | public Object methodMissing(String name, Object args) {
String str = this.toString();
return InvokerHelper.invokeMethod(str, name, args);
} | [
"public",
"Object",
"methodMissing",
"(",
"String",
"name",
",",
"Object",
"args",
")",
"{",
"String",
"str",
"=",
"this",
".",
"toString",
"(",
")",
";",
"return",
"InvokerHelper",
".",
"invokeMethod",
"(",
"str",
",",
"name",
",",
"args",
")",
";",
"... | Delegates methodMissing to String object
@param name The name of the method
@param args The arguments
@return The return value | [
"Delegates",
"methodMissing",
"to",
"String",
"object"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/buffer/StreamCharBuffer.java#L2910-L2913 |
32,561 | grails/grails-core | grails-bootstrap/src/main/groovy/org/grails/io/support/AbstractFileResolvingResource.java | AbstractFileResolvingResource.getFile | public File getFile() throws IOException {
URL url = getURL();
return GrailsResourceUtils.getFile(url, getDescription());
} | java | public File getFile() throws IOException {
URL url = getURL();
return GrailsResourceUtils.getFile(url, getDescription());
} | [
"public",
"File",
"getFile",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getURL",
"(",
")",
";",
"return",
"GrailsResourceUtils",
".",
"getFile",
"(",
"url",
",",
"getDescription",
"(",
")",
")",
";",
"}"
] | This implementation returns a File reference for the underlying class path
resource, provided that it refers to a file in the file system. | [
"This",
"implementation",
"returns",
"a",
"File",
"reference",
"for",
"the",
"underlying",
"class",
"path",
"resource",
"provided",
"that",
"it",
"refers",
"to",
"a",
"file",
"in",
"the",
"file",
"system",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/support/AbstractFileResolvingResource.java#L42-L45 |
32,562 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java | JSONArray.put | public JSONArray put(int index, double value) throws JSONException {
put(index, Double.valueOf(value));
return this;
} | java | public JSONArray put(int index, double value) throws JSONException {
put(index, Double.valueOf(value));
return this;
} | [
"public",
"JSONArray",
"put",
"(",
"int",
"index",
",",
"double",
"value",
")",
"throws",
"JSONException",
"{",
"put",
"(",
"index",
",",
"Double",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Put or replace a double value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad
it out.
@param index The subscript.
@param value A double value.
@return this
@throws JSONException If the index is negative or if the value is
not finite. | [
"Put",
"or",
"replace",
"a",
"double",
"value",
".",
"If",
"the",
"index",
"is",
"greater",
"than",
"the",
"length",
"of",
"the",
"JSONArray",
"then",
"null",
"elements",
"will",
"be",
"added",
"as",
"necessary",
"to",
"pad",
"it",
"out",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java#L688-L691 |
32,563 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java | JSONArray.put | public JSONArray put(int index, int value) throws JSONException {
put(index, Integer.valueOf(value));
return this;
} | java | public JSONArray put(int index, int value) throws JSONException {
put(index, Integer.valueOf(value));
return this;
} | [
"public",
"JSONArray",
"put",
"(",
"int",
"index",
",",
"int",
"value",
")",
"throws",
"JSONException",
"{",
"put",
"(",
"index",
",",
"Integer",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Put or replace an int value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad
it out.
@param index The subscript.
@param value An int value.
@return this
@throws JSONException If the index is negative. | [
"Put",
"or",
"replace",
"an",
"int",
"value",
".",
"If",
"the",
"index",
"is",
"greater",
"than",
"the",
"length",
"of",
"the",
"JSONArray",
"then",
"null",
"elements",
"will",
"be",
"added",
"as",
"necessary",
"to",
"pad",
"it",
"out",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java#L704-L707 |
32,564 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java | JSONArray.put | public JSONArray put(int index, long value) throws JSONException {
put(index, Long.valueOf(value));
return this;
} | java | public JSONArray put(int index, long value) throws JSONException {
put(index, Long.valueOf(value));
return this;
} | [
"public",
"JSONArray",
"put",
"(",
"int",
"index",
",",
"long",
"value",
")",
"throws",
"JSONException",
"{",
"put",
"(",
"index",
",",
"Long",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Put or replace a long value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad
it out.
@param index The subscript.
@param value A long value.
@return this
@throws JSONException If the index is negative. | [
"Put",
"or",
"replace",
"a",
"long",
"value",
".",
"If",
"the",
"index",
"is",
"greater",
"than",
"the",
"length",
"of",
"the",
"JSONArray",
"then",
"null",
"elements",
"will",
"be",
"added",
"as",
"necessary",
"to",
"pad",
"it",
"out",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java#L720-L723 |
32,565 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getChar | public Character getChar(String name) {
Object o = get(name);
if (o instanceof Character) {
return (Character)o;
}
if (o != null) {
String string = o.toString();
if (string != null && string.length() == 1) {
return string.charAt(0);
... | java | public Character getChar(String name) {
Object o = get(name);
if (o instanceof Character) {
return (Character)o;
}
if (o != null) {
String string = o.toString();
if (string != null && string.length() == 1) {
return string.charAt(0);
... | [
"public",
"Character",
"getChar",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Character",
")",
"{",
"return",
"(",
"Character",
")",
"o",
";",
"}",
"if",
"(",
"o",
"!=",
"null",
... | Helper method for obtaining Character value from parameter
@param name The name of the parameter
@return The Character value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"Character",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L142-L155 |
32,566 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getLong | public Long getLong(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).longValue();
}
if (o != null) {
try {
return Long.parseLong(o.toString());
}
catch (NumberFormatException e) {}
... | java | public Long getLong(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).longValue();
}
if (o != null) {
try {
return Long.parseLong(o.toString());
}
catch (NumberFormatException e) {}
... | [
"public",
"Long",
"getLong",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"(",
"Number",
")",
"o",
")",
".",
"longValue",
"(",
")",
";",
"}",
... | Helper method for obtaining long value from parameter
@param name The name of the parameter
@return The long value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"long",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L201-L214 |
32,567 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getShort | public Short getShort(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).shortValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Short.pa... | java | public Short getShort(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).shortValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Short.pa... | [
"public",
"Short",
"getShort",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"(",
"Number",
")",
"o",
")",
".",
"shortValue",
"(",
")",
";",
"}"... | Helper method for obtaining short value from parameter
@param name The name of the parameter
@return The short value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"short",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L229-L245 |
32,568 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getDouble | public Double getDouble(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).doubleValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Doubl... | java | public Double getDouble(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).doubleValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Doubl... | [
"public",
"Double",
"getDouble",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"(",
"Number",
")",
"o",
")",
".",
"doubleValue",
"(",
")",
";",
... | Helper method for obtaining double value from parameter
@param name The name of the parameter
@return The double value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"double",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L260-L276 |
32,569 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getFloat | public Float getFloat(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).floatValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Float.pa... | java | public Float getFloat(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).floatValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Float.pa... | [
"public",
"Float",
"getFloat",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"(",
"Number",
")",
"o",
")",
".",
"floatValue",
"(",
")",
";",
"}"... | Helper method for obtaining float value from parameter
@param name The name of the parameter
@return The double value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"float",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L291-L307 |
32,570 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getBoolean | public Boolean getBoolean(String name) {
Object o = get(name);
if (o instanceof Boolean) {
return (Boolean)o;
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return GrailsStringUtils... | java | public Boolean getBoolean(String name) {
Object o = get(name);
if (o instanceof Boolean) {
return (Boolean)o;
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return GrailsStringUtils... | [
"public",
"Boolean",
"getBoolean",
"(",
"String",
"name",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"o",
"instanceof",
"Boolean",
")",
"{",
"return",
"(",
"Boolean",
")",
"o",
";",
"}",
"if",
"(",
"o",
"!=",
"null",
"... | Helper method for obtaining boolean value from parameter
@param name The name of the parameter
@return The boolean value or null if there isn't one | [
"Helper",
"method",
"for",
"obtaining",
"boolean",
"value",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L322-L338 |
32,571 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getDate | public Date getDate(String name, String format) {
Object value = get(name);
if (value instanceof Date) {
return (Date)value;
}
if (value != null) {
try {
return new SimpleDateFormat(format).parse(value.toString());
} catch (Par... | java | public Date getDate(String name, String format) {
Object value = get(name);
if (value instanceof Date) {
return (Date)value;
}
if (value != null) {
try {
return new SimpleDateFormat(format).parse(value.toString());
} catch (Par... | [
"public",
"Date",
"getDate",
"(",
"String",
"name",
",",
"String",
"format",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"instanceof",
"Date",
")",
"{",
"return",
"(",
"Date",
")",
"value",
";",
"}",
"if",
"(... | Obtains a date from the parameter using the given format
@param name The name
@param format The format
@return The date or null | [
"Obtains",
"a",
"date",
"from",
"the",
"parameter",
"using",
"the",
"given",
"format"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L365-L379 |
32,572 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.date | public Date date(String name, Collection<String> formats) {
return getDate(name, formats);
} | java | public Date date(String name, Collection<String> formats) {
return getDate(name, formats);
} | [
"public",
"Date",
"date",
"(",
"String",
"name",
",",
"Collection",
"<",
"String",
">",
"formats",
")",
"{",
"return",
"getDate",
"(",
"name",
",",
"formats",
")",
";",
"}"
] | Obtains a date for the given parameter name and format
@param name The name of the parameter
@param formats The formats
@return The date object or null if it cannot be parsed | [
"Obtains",
"a",
"date",
"for",
"the",
"given",
"parameter",
"name",
"and",
"format"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L409-L411 |
32,573 | grails/grails-core | grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java | AbstractTypeConvertingMap.getList | public List getList(String name) {
Object paramValues = get(name);
if (paramValues == null) {
return Collections.emptyList();
}
if (paramValues.getClass().isArray()) {
return Arrays.asList((Object[])paramValues);
}
if (paramValues instanceof Collec... | java | public List getList(String name) {
Object paramValues = get(name);
if (paramValues == null) {
return Collections.emptyList();
}
if (paramValues.getClass().isArray()) {
return Arrays.asList((Object[])paramValues);
}
if (paramValues instanceof Collec... | [
"public",
"List",
"getList",
"(",
"String",
"name",
")",
"{",
"Object",
"paramValues",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"paramValues",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"if",
"(",
"par... | Helper method for obtaining a list of values from parameter
@param name The name of the parameter
@return A list of values | [
"Helper",
"method",
"for",
"obtaining",
"a",
"list",
"of",
"values",
"from",
"parameter"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/AbstractTypeConvertingMap.java#L426-L438 |
32,574 | grails/grails-core | grails-plugin-validation/src/main/groovy/grails/validation/DefaultASTValidateableHelper.java | DefaultASTValidateableHelper.getPropertiesToEnsureConstraintsFor | protected Map<String, ClassNode> getPropertiesToEnsureConstraintsFor(final ClassNode classNode) {
final Map<String, ClassNode> fieldsToConstrain = new HashMap<String, ClassNode>();
final List<FieldNode> allFields = classNode.getFields();
for (final FieldNode field : allFields) {
if (... | java | protected Map<String, ClassNode> getPropertiesToEnsureConstraintsFor(final ClassNode classNode) {
final Map<String, ClassNode> fieldsToConstrain = new HashMap<String, ClassNode>();
final List<FieldNode> allFields = classNode.getFields();
for (final FieldNode field : allFields) {
if (... | [
"protected",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"getPropertiesToEnsureConstraintsFor",
"(",
"final",
"ClassNode",
"classNode",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"fieldsToConstrain",
"=",
"new",
"HashMap",
"<",
"String",
",... | Retrieves a Map describing all of the properties which need to be constrained for the class
represented by classNode. The keys in the Map will be property names and the values are the
type of the corresponding property.
@param classNode the class to inspect
@return a Map describing all of the properties which need to... | [
"Retrieves",
"a",
"Map",
"describing",
"all",
"of",
"the",
"properties",
"which",
"need",
"to",
"be",
"constrained",
"for",
"the",
"class",
"represented",
"by",
"classNode",
".",
"The",
"keys",
"in",
"the",
"Map",
"will",
"be",
"property",
"names",
"and",
... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-plugin-validation/src/main/groovy/grails/validation/DefaultASTValidateableHelper.java#L177-L211 |
32,575 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.implementsZeroArgMethod | public static boolean implementsZeroArgMethod(ClassNode classNode, String methodName) {
MethodNode method = classNode.getDeclaredMethod(methodName, Parameter.EMPTY_ARRAY);
return method != null && (method.isPublic() || method.isProtected()) && !method.isAbstract();
} | java | public static boolean implementsZeroArgMethod(ClassNode classNode, String methodName) {
MethodNode method = classNode.getDeclaredMethod(methodName, Parameter.EMPTY_ARRAY);
return method != null && (method.isPublic() || method.isProtected()) && !method.isAbstract();
} | [
"public",
"static",
"boolean",
"implementsZeroArgMethod",
"(",
"ClassNode",
"classNode",
",",
"String",
"methodName",
")",
"{",
"MethodNode",
"method",
"=",
"classNode",
".",
"getDeclaredMethod",
"(",
"methodName",
",",
"Parameter",
".",
"EMPTY_ARRAY",
")",
";",
"... | Tests whether the ClasNode implements the specified method name.
@param classNode The ClassNode
@param methodName The method name
@return true if it does implement the method | [
"Tests",
"whether",
"the",
"ClasNode",
"implements",
"the",
"specified",
"method",
"name",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L163-L166 |
32,576 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.createArgumentListFromParameters | public static ArgumentListExpression createArgumentListFromParameters(Parameter[] parameterTypes, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders) {
ArgumentListExpression arguments = new ArgumentListExpression();
if (thisAsFirstArgument) {
arguments.addExpression(n... | java | public static ArgumentListExpression createArgumentListFromParameters(Parameter[] parameterTypes, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders) {
ArgumentListExpression arguments = new ArgumentListExpression();
if (thisAsFirstArgument) {
arguments.addExpression(n... | [
"public",
"static",
"ArgumentListExpression",
"createArgumentListFromParameters",
"(",
"Parameter",
"[",
"]",
"parameterTypes",
",",
"boolean",
"thisAsFirstArgument",
",",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"genericsPlaceholders",
")",
"{",
"ArgumentListExpressi... | Creates an argument list from the given parameter types.
@param parameterTypes The parameter types
@param thisAsFirstArgument Whether to include a reference to 'this' as the first argument
@param genericsPlaceholders
@return the arguments | [
"Creates",
"an",
"argument",
"list",
"from",
"the",
"given",
"parameter",
"types",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L333-L344 |
32,577 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.getRemainingParameterTypes | public static Parameter[] getRemainingParameterTypes(Parameter[] parameters) {
if (parameters.length == 0) {
return GrailsArtefactClassInjector.ZERO_PARAMETERS;
}
Parameter[] newParameters = new Parameter[parameters.length - 1];
System.arraycopy(parameters, 1, newParameters,... | java | public static Parameter[] getRemainingParameterTypes(Parameter[] parameters) {
if (parameters.length == 0) {
return GrailsArtefactClassInjector.ZERO_PARAMETERS;
}
Parameter[] newParameters = new Parameter[parameters.length - 1];
System.arraycopy(parameters, 1, newParameters,... | [
"public",
"static",
"Parameter",
"[",
"]",
"getRemainingParameterTypes",
"(",
"Parameter",
"[",
"]",
"parameters",
")",
"{",
"if",
"(",
"parameters",
".",
"length",
"==",
"0",
")",
"{",
"return",
"GrailsArtefactClassInjector",
".",
"ZERO_PARAMETERS",
";",
"}",
... | Gets the remaining parameters excluding the first parameter in the given list
@param parameters The parameters
@return A new array with the first parameter removed | [
"Gets",
"the",
"remaining",
"parameters",
"excluding",
"the",
"first",
"parameter",
"in",
"the",
"given",
"list"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L352-L360 |
32,578 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateStaticMethod | public static MethodNode addDelegateStaticMethod(ClassNode classNode, MethodNode delegateMethod) {
ClassExpression classExpression = new ClassExpression(delegateMethod.getDeclaringClass());
return addDelegateStaticMethod(classExpression, classNode, delegateMethod);
} | java | public static MethodNode addDelegateStaticMethod(ClassNode classNode, MethodNode delegateMethod) {
ClassExpression classExpression = new ClassExpression(delegateMethod.getDeclaringClass());
return addDelegateStaticMethod(classExpression, classNode, delegateMethod);
} | [
"public",
"static",
"MethodNode",
"addDelegateStaticMethod",
"(",
"ClassNode",
"classNode",
",",
"MethodNode",
"delegateMethod",
")",
"{",
"ClassExpression",
"classExpression",
"=",
"new",
"ClassExpression",
"(",
"delegateMethod",
".",
"getDeclaringClass",
"(",
")",
")"... | Adds a static method call to given class node that delegates to the given method
@param classNode The class node
@param delegateMethod The delegate method
@return The added method node or null if it couldn't be added | [
"Adds",
"a",
"static",
"method",
"call",
"to",
"given",
"class",
"node",
"that",
"delegates",
"to",
"the",
"given",
"method"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L369-L372 |
32,579 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateConstructor | public static ConstructorNode addDelegateConstructor(ClassNode classNode, MethodNode constructorMethod, Map<String, ClassNode> genericsPlaceholders) {
BlockStatement constructorBody = new BlockStatement();
Parameter[] constructorParams = getRemainingParameterTypes(constructorMethod.getParameters());
... | java | public static ConstructorNode addDelegateConstructor(ClassNode classNode, MethodNode constructorMethod, Map<String, ClassNode> genericsPlaceholders) {
BlockStatement constructorBody = new BlockStatement();
Parameter[] constructorParams = getRemainingParameterTypes(constructorMethod.getParameters());
... | [
"public",
"static",
"ConstructorNode",
"addDelegateConstructor",
"(",
"ClassNode",
"classNode",
",",
"MethodNode",
"constructorMethod",
",",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"genericsPlaceholders",
")",
"{",
"BlockStatement",
"constructorBody",
"=",
"new",
... | Adds or modifies an existing constructor to delegate to the
given static constructor method for initialization logic.
@param classNode The class node
@param constructorMethod The constructor static method | [
"Adds",
"or",
"modifies",
"an",
"existing",
"constructor",
"to",
"delegate",
"to",
"the",
"given",
"static",
"constructor",
"method",
"for",
"initialization",
"logic",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L443-L502 |
32,580 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.findConstructor | public static ConstructorNode findConstructor(ClassNode classNode,Parameter[] constructorParams) {
List<ConstructorNode> declaredConstructors = classNode.getDeclaredConstructors();
for (ConstructorNode declaredConstructor : declaredConstructors) {
if (parametersEqual(constructorParams, decla... | java | public static ConstructorNode findConstructor(ClassNode classNode,Parameter[] constructorParams) {
List<ConstructorNode> declaredConstructors = classNode.getDeclaredConstructors();
for (ConstructorNode declaredConstructor : declaredConstructors) {
if (parametersEqual(constructorParams, decla... | [
"public",
"static",
"ConstructorNode",
"findConstructor",
"(",
"ClassNode",
"classNode",
",",
"Parameter",
"[",
"]",
"constructorParams",
")",
"{",
"List",
"<",
"ConstructorNode",
">",
"declaredConstructors",
"=",
"classNode",
".",
"getDeclaredConstructors",
"(",
")",... | Finds a constructor for the given class node and parameter types
@param classNode The class node
@param constructorParams The parameter types
@return The located constructor or null | [
"Finds",
"a",
"constructor",
"for",
"the",
"given",
"class",
"node",
"and",
"parameter",
"types"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L511-L519 |
32,581 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.getDefaultConstructor | public static ConstructorNode getDefaultConstructor(ClassNode classNode) {
for (ConstructorNode cons : classNode.getDeclaredConstructors()) {
if (cons.getParameters().length == 0) {
return cons;
}
}
return null;
} | java | public static ConstructorNode getDefaultConstructor(ClassNode classNode) {
for (ConstructorNode cons : classNode.getDeclaredConstructors()) {
if (cons.getParameters().length == 0) {
return cons;
}
}
return null;
} | [
"public",
"static",
"ConstructorNode",
"getDefaultConstructor",
"(",
"ClassNode",
"classNode",
")",
"{",
"for",
"(",
"ConstructorNode",
"cons",
":",
"classNode",
".",
"getDeclaredConstructors",
"(",
")",
")",
"{",
"if",
"(",
"cons",
".",
"getParameters",
"(",
")... | Obtains the default constructor for the given class node.
@param classNode The class node
@return The default constructor or null if there isn't one | [
"Obtains",
"the",
"default",
"constructor",
"for",
"the",
"given",
"class",
"node",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L544-L551 |
32,582 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.isAssignableFrom | public static boolean isAssignableFrom(ClassNode superClass, ClassNode childClass) {
ClassNode currentSuper = childClass;
while (currentSuper != null) {
if (currentSuper.equals(superClass)) {
return true;
}
currentSuper = currentSuper.getSuperClass()... | java | public static boolean isAssignableFrom(ClassNode superClass, ClassNode childClass) {
ClassNode currentSuper = childClass;
while (currentSuper != null) {
if (currentSuper.equals(superClass)) {
return true;
}
currentSuper = currentSuper.getSuperClass()... | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"ClassNode",
"superClass",
",",
"ClassNode",
"childClass",
")",
"{",
"ClassNode",
"currentSuper",
"=",
"childClass",
";",
"while",
"(",
"currentSuper",
"!=",
"null",
")",
"{",
"if",
"(",
"currentSuper",
"."... | Determines if the class or interface represented by the superClass
argument is either the same as, or is a superclass or superinterface of,
the class or interface represented by the specified subClass parameter.
@param superClass The super class to check
@param childClass The sub class the check
@return true if the ch... | [
"Determines",
"if",
"the",
"class",
"or",
"interface",
"represented",
"by",
"the",
"superClass",
"argument",
"is",
"either",
"the",
"same",
"as",
"or",
"is",
"a",
"superclass",
"or",
"superinterface",
"of",
"the",
"class",
"or",
"interface",
"represented",
"by... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L655-L665 |
32,583 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addExpressionToAnnotationMember | public static void addExpressionToAnnotationMember(AnnotationNode annotationNode, String memberName, Expression expression) {
Expression exclude = annotationNode.getMember(memberName);
if(exclude instanceof ListExpression) {
((ListExpression)exclude).addExpression(expression);
}
... | java | public static void addExpressionToAnnotationMember(AnnotationNode annotationNode, String memberName, Expression expression) {
Expression exclude = annotationNode.getMember(memberName);
if(exclude instanceof ListExpression) {
((ListExpression)exclude).addExpression(expression);
}
... | [
"public",
"static",
"void",
"addExpressionToAnnotationMember",
"(",
"AnnotationNode",
"annotationNode",
",",
"String",
"memberName",
",",
"Expression",
"expression",
")",
"{",
"Expression",
"exclude",
"=",
"annotationNode",
".",
"getMember",
"(",
"memberName",
")",
";... | Adds the given expression as a member of the given annotation
@param annotationNode The annotation node
@param memberName The name of the member
@param expression The expression | [
"Adds",
"the",
"given",
"expression",
"as",
"a",
"member",
"of",
"the",
"given",
"annotation"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L794-L808 |
32,584 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addEnhancedAnnotation | public static AnnotationNode addEnhancedAnnotation(final ClassNode classNode, final String... enhancedFor) {
final AnnotationNode enhancedAnnotationNode;
final List<AnnotationNode> annotations = classNode.getAnnotations(ENHANCED_CLASS_NODE);
if (annotations.isEmpty()) {
enhancedAnnot... | java | public static AnnotationNode addEnhancedAnnotation(final ClassNode classNode, final String... enhancedFor) {
final AnnotationNode enhancedAnnotationNode;
final List<AnnotationNode> annotations = classNode.getAnnotations(ENHANCED_CLASS_NODE);
if (annotations.isEmpty()) {
enhancedAnnot... | [
"public",
"static",
"AnnotationNode",
"addEnhancedAnnotation",
"(",
"final",
"ClassNode",
"classNode",
",",
"final",
"String",
"...",
"enhancedFor",
")",
"{",
"final",
"AnnotationNode",
"enhancedAnnotationNode",
";",
"final",
"List",
"<",
"AnnotationNode",
">",
"annot... | Add the grails.artefact.Enhanced annotation to classNode if it does not already exist and ensure that
all of the features in the enhancedFor array are represented in the enhancedFor attribute of the
Enhanced annnotation
@param classNode the class to add the Enhanced annotation to
@param enhancedFor an array of feature ... | [
"Add",
"the",
"grails",
".",
"artefact",
".",
"Enhanced",
"annotation",
"to",
"classNode",
"if",
"it",
"does",
"not",
"already",
"exist",
"and",
"ensure",
"that",
"all",
"of",
"the",
"features",
"in",
"the",
"enhancedFor",
"array",
"are",
"represented",
"in"... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L880-L919 |
32,585 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.hasAnnotation | public static boolean hasAnnotation(final ClassNode classNode, final Class<? extends Annotation> annotationClass) {
return !classNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
} | java | public static boolean hasAnnotation(final ClassNode classNode, final Class<? extends Annotation> annotationClass) {
return !classNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
} | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"final",
"ClassNode",
"classNode",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"!",
"classNode",
".",
"getAnnotations",
"(",
"new",
"ClassNode",
"(",
... | Returns true if classNode is marked with annotationClass
@param classNode A ClassNode to inspect
@param annotationClass an annotation to look for
@return true if classNode is marked with annotationClass, otherwise false | [
"Returns",
"true",
"if",
"classNode",
"is",
"marked",
"with",
"annotationClass"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L945-L947 |
32,586 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.hasAnnotation | public static boolean hasAnnotation(final MethodNode methodNode, final Class<? extends Annotation> annotationClass) {
return !methodNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
} | java | public static boolean hasAnnotation(final MethodNode methodNode, final Class<? extends Annotation> annotationClass) {
return !methodNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
} | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"final",
"MethodNode",
"methodNode",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"!",
"methodNode",
".",
"getAnnotations",
"(",
"new",
"ClassNode",
"("... | Returns true if MethodNode is marked with annotationClass
@param methodNode A MethodNode to inspect
@param annotationClass an annotation to look for
@return true if classNode is marked with annotationClass, otherwise false | [
"Returns",
"true",
"if",
"MethodNode",
"is",
"marked",
"with",
"annotationClass"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L955-L957 |
32,587 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.getAssocationMap | public static Map<String, ClassNode> getAssocationMap(ClassNode classNode, String associationType) {
PropertyNode property = classNode.getProperty(associationType);
Map<String, ClassNode> associationMap = new HashMap<String, ClassNode>();
if (property != null && property.isStatic()) {
... | java | public static Map<String, ClassNode> getAssocationMap(ClassNode classNode, String associationType) {
PropertyNode property = classNode.getProperty(associationType);
Map<String, ClassNode> associationMap = new HashMap<String, ClassNode>();
if (property != null && property.isStatic()) {
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"ClassNode",
">",
"getAssocationMap",
"(",
"ClassNode",
"classNode",
",",
"String",
"associationType",
")",
"{",
"PropertyNode",
"property",
"=",
"classNode",
".",
"getProperty",
"(",
"associationType",
")",
";",
"M... | Returns a map containing the names and types of the given association type. eg. GrailsDomainClassProperty.HAS_MANY
@param classNode The target class ndoe
@param associationType The associationType
@return A map | [
"Returns",
"a",
"map",
"containing",
"the",
"names",
"and",
"types",
"of",
"the",
"given",
"association",
"type",
".",
"eg",
".",
"GrailsDomainClassProperty",
".",
"HAS_MANY"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1082-L1099 |
32,588 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.isSubclassOf | public static boolean isSubclassOf(ClassNode classNode, String parentClassName) {
ClassNode currentSuper = classNode.getSuperClass();
while (currentSuper != null && !currentSuper.getName().equals(OBJECT_CLASS)) {
if (currentSuper.getName().equals(parentClassName)) return true;
cu... | java | public static boolean isSubclassOf(ClassNode classNode, String parentClassName) {
ClassNode currentSuper = classNode.getSuperClass();
while (currentSuper != null && !currentSuper.getName().equals(OBJECT_CLASS)) {
if (currentSuper.getName().equals(parentClassName)) return true;
cu... | [
"public",
"static",
"boolean",
"isSubclassOf",
"(",
"ClassNode",
"classNode",
",",
"String",
"parentClassName",
")",
"{",
"ClassNode",
"currentSuper",
"=",
"classNode",
".",
"getSuperClass",
"(",
")",
";",
"while",
"(",
"currentSuper",
"!=",
"null",
"&&",
"!",
... | Returns true if the given class name is a parent class of the given class
@param classNode The class node
@param parentClassName the parent class name
@return True if it is a subclass | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"name",
"is",
"a",
"parent",
"class",
"of",
"the",
"given",
"class"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1148-L1155 |
32,589 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.buildSetPropertyExpression | public static MethodCallExpression buildSetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final Expression valueExpression) {
String methodName = "set" + MetaClassHelper.capitalize(propertyName);
MethodCallExpression methodCallExpression... | java | public static MethodCallExpression buildSetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final Expression valueExpression) {
String methodName = "set" + MetaClassHelper.capitalize(propertyName);
MethodCallExpression methodCallExpression... | [
"public",
"static",
"MethodCallExpression",
"buildSetPropertyExpression",
"(",
"final",
"Expression",
"objectExpression",
",",
"final",
"String",
"propertyName",
",",
"final",
"ClassNode",
"targetClassNode",
",",
"final",
"Expression",
"valueExpression",
")",
"{",
"String... | Build static direct call to setter of a property
@param objectExpression
@param propertyName
@param targetClassNode
@param valueExpression
@return The method call expression | [
"Build",
"static",
"direct",
"call",
"to",
"setter",
"of",
"a",
"property"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1333-L1341 |
32,590 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.buildPutMapExpression | public static MethodCallExpression buildPutMapExpression(final Expression objectExpression, final String keyName, final Expression valueExpression) {
return applyDefaultMethodTarget(new MethodCallExpression(objectExpression, "put", new ArgumentListExpression(new ConstantExpression(keyName), valueExpression)), M... | java | public static MethodCallExpression buildPutMapExpression(final Expression objectExpression, final String keyName, final Expression valueExpression) {
return applyDefaultMethodTarget(new MethodCallExpression(objectExpression, "put", new ArgumentListExpression(new ConstantExpression(keyName), valueExpression)), M... | [
"public",
"static",
"MethodCallExpression",
"buildPutMapExpression",
"(",
"final",
"Expression",
"objectExpression",
",",
"final",
"String",
"keyName",
",",
"final",
"Expression",
"valueExpression",
")",
"{",
"return",
"applyDefaultMethodTarget",
"(",
"new",
"MethodCallEx... | Build static direct call to put entry in Map
@param objectExpression
@param keyName
@param valueExpression
@return The method call expression | [
"Build",
"static",
"direct",
"call",
"to",
"put",
"entry",
"in",
"Map"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1351-L1353 |
32,591 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.buildGetMapExpression | public static MethodCallExpression buildGetMapExpression(final Expression objectExpression, final String keyName) {
return applyDefaultMethodTarget(new MethodCallExpression(objectExpression, "get", new ArgumentListExpression(new ConstantExpression(keyName))), Map.class);
} | java | public static MethodCallExpression buildGetMapExpression(final Expression objectExpression, final String keyName) {
return applyDefaultMethodTarget(new MethodCallExpression(objectExpression, "get", new ArgumentListExpression(new ConstantExpression(keyName))), Map.class);
} | [
"public",
"static",
"MethodCallExpression",
"buildGetMapExpression",
"(",
"final",
"Expression",
"objectExpression",
",",
"final",
"String",
"keyName",
")",
"{",
"return",
"applyDefaultMethodTarget",
"(",
"new",
"MethodCallExpression",
"(",
"objectExpression",
",",
"\"get... | Build static direct call to get entry from Map
@param objectExpression
@param keyName
@return The method call expression | [
"Build",
"static",
"direct",
"call",
"to",
"get",
"entry",
"from",
"Map"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1362-L1364 |
32,592 | grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.getSourceUrl | public static URL getSourceUrl(SourceUnit source) {
URL url = null;
final String filename = source.getName();
if(filename==null) {
return null;
}
Resource resource = new FileSystemResource(filename);
if (resource.exists()) {
try {
... | java | public static URL getSourceUrl(SourceUnit source) {
URL url = null;
final String filename = source.getName();
if(filename==null) {
return null;
}
Resource resource = new FileSystemResource(filename);
if (resource.exists()) {
try {
... | [
"public",
"static",
"URL",
"getSourceUrl",
"(",
"SourceUnit",
"source",
")",
"{",
"URL",
"url",
"=",
"null",
";",
"final",
"String",
"filename",
"=",
"source",
".",
"getName",
"(",
")",
";",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"nul... | Find URL of SourceUnit
source.getSource().getURI() fails in Groovy-Eclipse compiler
@param source
@return URL of SourceUnit | [
"Find",
"URL",
"of",
"SourceUnit"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1488-L1504 |
32,593 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/json/JSONWriter.java | JSONWriter.value | public JSONWriter value(Number number) {
return number != null ? append(number.toString()) : valueNull();
} | java | public JSONWriter value(Number number) {
return number != null ? append(number.toString()) : valueNull();
} | [
"public",
"JSONWriter",
"value",
"(",
"Number",
"number",
")",
"{",
"return",
"number",
"!=",
"null",
"?",
"append",
"(",
"number",
".",
"toString",
"(",
")",
")",
":",
"valueNull",
"(",
")",
";",
"}"
] | Append a number value
@param number
@return | [
"Append",
"a",
"number",
"value"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONWriter.java#L327-L329 |
32,594 | grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/json/JSONWriter.java | JSONWriter.value | public JSONWriter value(Object o) {
return o != null ? append(new QuotedWritable(o)) : valueNull();
} | java | public JSONWriter value(Object o) {
return o != null ? append(new QuotedWritable(o)) : valueNull();
} | [
"public",
"JSONWriter",
"value",
"(",
"Object",
"o",
")",
"{",
"return",
"o",
"!=",
"null",
"?",
"append",
"(",
"new",
"QuotedWritable",
"(",
"o",
")",
")",
":",
"valueNull",
"(",
")",
";",
"}"
] | Append an object value.
@param o The object to append. It can be null, or a Boolean, Number,
String, JSONObject, or JSONArray.
@return this | [
"Append",
"an",
"object",
"value",
"."
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONWriter.java#L352-L354 |
32,595 | grails/grails-core | grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java | DataBindingUtils.assignBidirectionalAssociations | public static void assignBidirectionalAssociations(Object object, Map source, PersistentEntity persistentEntity) {
if (source == null) {
return;
}
for (Object key : source.keySet()) {
String propertyName = key.toString();
if (propertyName.indexOf('.') > -1) {... | java | public static void assignBidirectionalAssociations(Object object, Map source, PersistentEntity persistentEntity) {
if (source == null) {
return;
}
for (Object key : source.keySet()) {
String propertyName = key.toString();
if (propertyName.indexOf('.') > -1) {... | [
"public",
"static",
"void",
"assignBidirectionalAssociations",
"(",
"Object",
"object",
",",
"Map",
"source",
",",
"PersistentEntity",
"persistentEntity",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Object",
"key",
... | Associations both sides of any bidirectional relationships found in the object and source map to bind
@param object The object
@param source The source map
@param persistentEntity The PersistentEntity for the object | [
"Associations",
"both",
"sides",
"of",
"any",
"bidirectional",
"relationships",
"found",
"in",
"the",
"object",
"and",
"source",
"map",
"to",
"bind"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java#L74-L101 |
32,596 | grails/grails-core | grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java | DataBindingUtils.bindToCollection | public static <T> void bindToCollection(final Class<T> targetType, final Collection<T> collectionToPopulate, final CollectionDataBindingSource collectionBindingSource) throws InstantiationException, IllegalAccessException {
final GrailsApplication application = Holders.findApplication();
PersistentEntit... | java | public static <T> void bindToCollection(final Class<T> targetType, final Collection<T> collectionToPopulate, final CollectionDataBindingSource collectionBindingSource) throws InstantiationException, IllegalAccessException {
final GrailsApplication application = Holders.findApplication();
PersistentEntit... | [
"public",
"static",
"<",
"T",
">",
"void",
"bindToCollection",
"(",
"final",
"Class",
"<",
"T",
">",
"targetType",
",",
"final",
"Collection",
"<",
"T",
">",
"collectionToPopulate",
",",
"final",
"CollectionDataBindingSource",
"collectionBindingSource",
")",
"thro... | For each DataBindingSource provided by collectionBindingSource a new instance of targetType is created,
data binding is imposed on that instance with the DataBindingSource and the instance is added to the end of
collectionToPopulate
@param targetType The type of objects to create, must be a concrete class
@param colle... | [
"For",
"each",
"DataBindingSource",
"provided",
"by",
"collectionBindingSource",
"a",
"new",
"instance",
"of",
"targetType",
"is",
"created",
"data",
"binding",
"is",
"imposed",
"on",
"that",
"instance",
"with",
"the",
"DataBindingSource",
"and",
"the",
"instance",
... | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java#L164-L180 |
32,597 | grails/grails-core | grails-core/src/main/groovy/org/grails/core/DefaultGrailsControllerClass.java | DefaultGrailsControllerClass.invoke | @Override
public Object invoke(Object controller, String action) throws Throwable {
if(action == null) action = this.defaultActionName;
ActionInvoker handle = actions.get(action);
if(handle == null) throw new IllegalArgumentException("Invalid action name: " + action);
return handle.i... | java | @Override
public Object invoke(Object controller, String action) throws Throwable {
if(action == null) action = this.defaultActionName;
ActionInvoker handle = actions.get(action);
if(handle == null) throw new IllegalArgumentException("Invalid action name: " + action);
return handle.i... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"controller",
",",
"String",
"action",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"action",
"==",
"null",
")",
"action",
"=",
"this",
".",
"defaultActionName",
";",
"ActionInvoker",
"handle",
"="... | Invokes the controller action for the given name on the given controller instance
@param controller The controller instance
@param action The action name
@return The result of the action
@throws Throwable | [
"Invokes",
"the",
"controller",
"action",
"for",
"the",
"given",
"name",
"on",
"the",
"given",
"controller",
"instance"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/DefaultGrailsControllerClass.java#L183-L189 |
32,598 | grails/grails-core | grails-web/src/main/groovy/org/grails/web/servlet/context/GrailsConfigUtils.java | GrailsConfigUtils.isConfigTrue | public static boolean isConfigTrue(GrailsApplication application, String propertyName) {
return application.getConfig().getProperty(propertyName, Boolean.class, false);
} | java | public static boolean isConfigTrue(GrailsApplication application, String propertyName) {
return application.getConfig().getProperty(propertyName, Boolean.class, false);
} | [
"public",
"static",
"boolean",
"isConfigTrue",
"(",
"GrailsApplication",
"application",
",",
"String",
"propertyName",
")",
"{",
"return",
"application",
".",
"getConfig",
"(",
")",
".",
"getProperty",
"(",
"propertyName",
",",
"Boolean",
".",
"class",
",",
"fal... | Checks if a Config parameter is true or a System property with the same name is true
@param application
@param propertyName
@return true if the Config parameter is true or the System property with the same name is true | [
"Checks",
"if",
"a",
"Config",
"parameter",
"is",
"true",
"or",
"a",
"System",
"property",
"with",
"the",
"same",
"name",
"is",
"true"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web/src/main/groovy/org/grails/web/servlet/context/GrailsConfigUtils.java#L117-L119 |
32,599 | grails/grails-core | grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java | ReloadableResourceBundleMessageSource.getBundleCodes | public Set<String> getBundleCodes(Locale locale,String...basenames){
List<String> validBaseNames = getValidBasenames(basenames);
Set<String> codes = new HashSet<>();
for(String basename: validBaseNames){
List<Pair<String, Resource>> filenamesAndResources = calculateAllFilenames(basename,locale);
for (Pai... | java | public Set<String> getBundleCodes(Locale locale,String...basenames){
List<String> validBaseNames = getValidBasenames(basenames);
Set<String> codes = new HashSet<>();
for(String basename: validBaseNames){
List<Pair<String, Resource>> filenamesAndResources = calculateAllFilenames(basename,locale);
for (Pai... | [
"public",
"Set",
"<",
"String",
">",
"getBundleCodes",
"(",
"Locale",
"locale",
",",
"String",
"...",
"basenames",
")",
"{",
"List",
"<",
"String",
">",
"validBaseNames",
"=",
"getValidBasenames",
"(",
"basenames",
")",
";",
"Set",
"<",
"String",
">",
"cod... | Retrieves all codes from one or multiple basenames
@param locale the locale
@param basenames the basenames of the bundle
@return a list with all codes from valid registered bundles | [
"Retrieves",
"all",
"codes",
"from",
"one",
"or",
"multiple",
"basenames"
] | c0b08aa995b0297143b75d05642abba8cb7b4122 | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java#L159-L173 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.