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
116,100
glyptodon/guacamole-client
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java
LDAPConnectionService.bindAs
public LDAPConnection bindAs(String userDN, String password) throws GuacamoleException { // Obtain appropriately-configured LDAPConnection instance LDAPConnection ldapConnection = createLDAPConnection(); // Configure LDAP connection constraints LDAPConstraints ldapConstrain...
java
public LDAPConnection bindAs(String userDN, String password) throws GuacamoleException { // Obtain appropriately-configured LDAPConnection instance LDAPConnection ldapConnection = createLDAPConnection(); // Configure LDAP connection constraints LDAPConstraints ldapConstrain...
[ "public", "LDAPConnection", "bindAs", "(", "String", "userDN", ",", "String", "password", ")", "throws", "GuacamoleException", "{", "// Obtain appropriately-configured LDAPConnection instance", "LDAPConnection", "ldapConnection", "=", "createLDAPConnection", "(", ")", ";", ...
Binds to the LDAP server using the provided user DN and password. @param userDN The DN of the user to bind as, or null to bind anonymously. @param password The password to use when binding as the specified user, or null to attempt to bind without a password. @return A bound LDAP connection, or null if the connection...
[ "Binds", "to", "the", "LDAP", "server", "using", "the", "provided", "user", "DN", "and", "password", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java#L110-L190
116,101
glyptodon/guacamole-client
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java
LDAPConnectionService.disconnect
public void disconnect(LDAPConnection ldapConnection) { // Attempt disconnect try { ldapConnection.disconnect(); } // Warn if disconnect unexpectedly fails catch (LDAPException e) { logger.warn("Unable to disconnect from LDAP server: {}", e.getMessage())...
java
public void disconnect(LDAPConnection ldapConnection) { // Attempt disconnect try { ldapConnection.disconnect(); } // Warn if disconnect unexpectedly fails catch (LDAPException e) { logger.warn("Unable to disconnect from LDAP server: {}", e.getMessage())...
[ "public", "void", "disconnect", "(", "LDAPConnection", "ldapConnection", ")", "{", "// Attempt disconnect", "try", "{", "ldapConnection", ".", "disconnect", "(", ")", ";", "}", "// Warn if disconnect unexpectedly fails", "catch", "(", "LDAPException", "e", ")", "{", ...
Disconnects the given LDAP connection, logging any failure to do so appropriately. @param ldapConnection The LDAP connection to disconnect.
[ "Disconnects", "the", "given", "LDAP", "connection", "logging", "any", "failure", "to", "do", "so", "appropriately", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java#L199-L212
116,102
glyptodon/guacamole-client
guacamole/src/main/java/org/apache/guacamole/rest/connectiongroup/ConnectionGroupResource.java
ConnectionGroupResource.getConnectionGroupTree
@GET @Path("tree") public APIConnectionGroup getConnectionGroupTree( @QueryParam("permission") List<ObjectPermission.Type> permissions) throws GuacamoleException { // Retrieve the requested tree, filtering by the given permissions ConnectionGroupTree tree = new Connectio...
java
@GET @Path("tree") public APIConnectionGroup getConnectionGroupTree( @QueryParam("permission") List<ObjectPermission.Type> permissions) throws GuacamoleException { // Retrieve the requested tree, filtering by the given permissions ConnectionGroupTree tree = new Connectio...
[ "@", "GET", "@", "Path", "(", "\"tree\"", ")", "public", "APIConnectionGroup", "getConnectionGroupTree", "(", "@", "QueryParam", "(", "\"permission\"", ")", "List", "<", "ObjectPermission", ".", "Type", ">", "permissions", ")", "throws", "GuacamoleException", "{",...
Returns the current connection group along with all descendants. @param permissions If specified and non-empty, limit the returned list to only those connections for which the current user has any of the given permissions. Otherwise, all visible connections are returned. ConnectionGroups are unaffected by this paramet...
[ "Returns", "the", "current", "connection", "group", "along", "with", "all", "descendants", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/rest/connectiongroup/ConnectionGroupResource.java#L103-L116
116,103
glyptodon/guacamole-client
extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/conf/ConfigurationService.java
ConfigurationService.getDigits
public int getDigits() throws GuacamoleException { // Validate legal number of digits int digits = environment.getProperty(TOTP_DIGITS, 6); if (digits < 6 || digits > 8) throw new GuacamoleServerException("TOTP codes may have no fewer " + "than 6 digits and no mo...
java
public int getDigits() throws GuacamoleException { // Validate legal number of digits int digits = environment.getProperty(TOTP_DIGITS, 6); if (digits < 6 || digits > 8) throw new GuacamoleServerException("TOTP codes may have no fewer " + "than 6 digits and no mo...
[ "public", "int", "getDigits", "(", ")", "throws", "GuacamoleException", "{", "// Validate legal number of digits", "int", "digits", "=", "environment", ".", "getProperty", "(", "TOTP_DIGITS", ",", "6", ")", ";", "if", "(", "digits", "<", "6", "||", "digits", "...
Returns the number of digits which should be included in each generated TOTP code. If not specified, 6 will be used by default. @return The number of digits which should be included in each generated TOTP code. @throws GuacamoleException If the "totp-digits" property cannot be read from guacamole.properties.
[ "Returns", "the", "number", "of", "digits", "which", "should", "be", "included", "in", "each", "generated", "TOTP", "code", ".", "If", "not", "specified", "6", "will", "be", "used", "by", "default", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/conf/ConfigurationService.java#L118-L128
116,104
glyptodon/guacamole-client
extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/conf/ConfigurationService.java
ConfigurationService.getMode
public TOTPGenerator.Mode getMode() throws GuacamoleException { return environment.getProperty(TOTP_MODE, TOTPGenerator.Mode.SHA1); }
java
public TOTPGenerator.Mode getMode() throws GuacamoleException { return environment.getProperty(TOTP_MODE, TOTPGenerator.Mode.SHA1); }
[ "public", "TOTPGenerator", ".", "Mode", "getMode", "(", ")", "throws", "GuacamoleException", "{", "return", "environment", ".", "getProperty", "(", "TOTP_MODE", ",", "TOTPGenerator", ".", "Mode", ".", "SHA1", ")", ";", "}" ]
Returns the hash algorithm that should be used to generate TOTP codes. If not specified, SHA1 will be used by default. @return The hash algorithm that should be used to generate TOTP codes. @throws GuacamoleException If the "totp-mode" property cannot be read from guacamole.properties.
[ "Returns", "the", "hash", "algorithm", "that", "should", "be", "used", "to", "generate", "TOTP", "codes", ".", "If", "not", "specified", "SHA1", "will", "be", "used", "by", "default", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/conf/ConfigurationService.java#L157-L159
116,105
glyptodon/guacamole-client
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/EntityService.java
EntityService.retrieveEffectiveGroups
@Transactional public Set<String> retrieveEffectiveGroups(ModeledPermissions<? extends EntityModel> entity, Collection<String> effectiveGroups) { // Retrieve the effective user groups of the given entity, recursively if possible boolean recursive = environment.isRecursiveQuerySupported(...
java
@Transactional public Set<String> retrieveEffectiveGroups(ModeledPermissions<? extends EntityModel> entity, Collection<String> effectiveGroups) { // Retrieve the effective user groups of the given entity, recursively if possible boolean recursive = environment.isRecursiveQuerySupported(...
[ "@", "Transactional", "public", "Set", "<", "String", ">", "retrieveEffectiveGroups", "(", "ModeledPermissions", "<", "?", "extends", "EntityModel", ">", "entity", ",", "Collection", "<", "String", ">", "effectiveGroups", ")", "{", "// Retrieve the effective user grou...
Returns the set of all group identifiers of which the given entity is a member, taking into account the given collection of known group memberships which are not necessarily defined within the database. Note that group visibility with respect to the queried entity is NOT taken into account. If the entity is a member o...
[ "Returns", "the", "set", "of", "all", "group", "identifiers", "of", "which", "the", "given", "entity", "is", "a", "member", "taking", "into", "account", "the", "given", "collection", "of", "known", "group", "memberships", "which", "are", "not", "necessarily", ...
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/EntityService.java#L75-L96
116,106
glyptodon/guacamole-client
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLVersion.java
MySQLVersion.isAtLeast
public boolean isAtLeast(MySQLVersion version) { // If the databases use different version numbering schemes, the // version numbers are not comparable if (isMariaDB != version.isMariaDB) return false; // Compare major, minor, and patch number in order of precedence ...
java
public boolean isAtLeast(MySQLVersion version) { // If the databases use different version numbering schemes, the // version numbers are not comparable if (isMariaDB != version.isMariaDB) return false; // Compare major, minor, and patch number in order of precedence ...
[ "public", "boolean", "isAtLeast", "(", "MySQLVersion", "version", ")", "{", "// If the databases use different version numbering schemes, the", "// version numbers are not comparable", "if", "(", "isMariaDB", "!=", "version", ".", "isMariaDB", ")", "return", "false", ";", "...
Returns whether this version is at least as recent as the given version. @param version The version to compare against. @return true if the versions are associated with the same database server type (MariaDB vs. MySQL) and this version is at least as recent as the given version, false otherwise.
[ "Returns", "whether", "this", "version", "is", "at", "least", "as", "recent", "as", "the", "given", "version", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLVersion.java#L131-L145
116,107
glyptodon/guacamole-client
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUser.java
SimpleUser.addReadPermissions
private void addReadPermissions(Set<ObjectPermission> permissions, Collection<String> identifiers) { // Add a READ permission to the set for each identifier given identifiers.forEach(identifier -> permissions.add(new ObjectPermission( ObjectPermission.Type.READ, ...
java
private void addReadPermissions(Set<ObjectPermission> permissions, Collection<String> identifiers) { // Add a READ permission to the set for each identifier given identifiers.forEach(identifier -> permissions.add(new ObjectPermission( ObjectPermission.Type.READ, ...
[ "private", "void", "addReadPermissions", "(", "Set", "<", "ObjectPermission", ">", "permissions", ",", "Collection", "<", "String", ">", "identifiers", ")", "{", "// Add a READ permission to the set for each identifier given", "identifiers", ".", "forEach", "(", "identifi...
Adds a new READ permission to the given set of permissions for each of the given identifiers. @param permissions The set of permissions to add READ permissions to. @param identifiers The identifiers which should each have a corresponding READ permission added to the given set.
[ "Adds", "a", "new", "READ", "permission", "to", "the", "given", "set", "of", "permissions", "for", "each", "of", "the", "given", "identifiers", "." ]
ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUser.java#L79-L89
116,108
crnk-project/crnk-framework
crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/transform/TSMetaDataObjectTransformation.java
TSMetaDataObjectTransformation.generateAsResource
private static boolean generateAsResource(MetaDataObject metaDataObject) { if (metaDataObject instanceof MetaResource) { return true; } List<MetaDataObject> subTypes = metaDataObject.getSubTypes(true, false); if (!subTypes.isEmpty()) { for (MetaDataObject subType : subTypes) { if (generateAsResource(s...
java
private static boolean generateAsResource(MetaDataObject metaDataObject) { if (metaDataObject instanceof MetaResource) { return true; } List<MetaDataObject> subTypes = metaDataObject.getSubTypes(true, false); if (!subTypes.isEmpty()) { for (MetaDataObject subType : subTypes) { if (generateAsResource(s...
[ "private", "static", "boolean", "generateAsResource", "(", "MetaDataObject", "metaDataObject", ")", "{", "if", "(", "metaDataObject", "instanceof", "MetaResource", ")", "{", "return", "true", ";", "}", "List", "<", "MetaDataObject", ">", "subTypes", "=", "metaData...
Generate resources and their base classes as resources.
[ "Generate", "resources", "and", "their", "base", "classes", "as", "resources", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/transform/TSMetaDataObjectTransformation.java#L183-L197
116,109
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/module/ModuleRegistry.java
ModuleRegistry.addModule
public void addModule(Module module) { LOGGER.debug("adding module {}", module); module.setupModule(new ModuleContextImpl(module)); modules.add(module); }
java
public void addModule(Module module) { LOGGER.debug("adding module {}", module); module.setupModule(new ModuleContextImpl(module)); modules.add(module); }
[ "public", "void", "addModule", "(", "Module", "module", ")", "{", "LOGGER", ".", "debug", "(", "\"adding module {}\"", ",", "module", ")", ";", "module", ".", "setupModule", "(", "new", "ModuleContextImpl", "(", "module", ")", ")", ";", "modules", ".", "ad...
Register an new module to this registry and setup the module. @param module module
[ "Register", "an", "new", "module", "to", "this", "registry", "and", "setup", "the", "module", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/module/ModuleRegistry.java#L195-L199
116,110
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/parser/TypeParser.java
TypeParser.addParser
public <T> void addParser(Class<T> clazz, StringParser<T> parser) { parsers.put(clazz, parser); }
java
public <T> void addParser(Class<T> clazz, StringParser<T> parser) { parsers.put(clazz, parser); }
[ "public", "<", "T", ">", "void", "addParser", "(", "Class", "<", "T", ">", "clazz", ",", "StringParser", "<", "T", ">", "parser", ")", "{", "parsers", ".", "put", "(", "clazz", ",", "parser", ")", ";", "}" ]
Adds a custom parser for the given type.
[ "Adds", "a", "custom", "parser", "for", "the", "given", "type", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/parser/TypeParser.java#L87-L89
116,111
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/parser/TypeParser.java
TypeParser.addMapper
public <T> void addMapper(Class<T> clazz, StringMapper<T> mapper) { addParser(clazz, mapper); mappers.put(clazz, mapper); }
java
public <T> void addMapper(Class<T> clazz, StringMapper<T> mapper) { addParser(clazz, mapper); mappers.put(clazz, mapper); }
[ "public", "<", "T", ">", "void", "addMapper", "(", "Class", "<", "T", ">", "clazz", ",", "StringMapper", "<", "T", ">", "mapper", ")", "{", "addParser", "(", "clazz", ",", "mapper", ")", ";", "mappers", ".", "put", "(", "clazz", ",", "mapper", ")",...
Adds a custom mapper for the given type.
[ "Adds", "a", "custom", "mapper", "for", "the", "given", "type", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/parser/TypeParser.java#L94-L97
116,112
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaEntityRepositoryBase.java
JpaEntityRepositoryBase.getIdFromEntity
@SuppressWarnings("unchecked") protected I getIdFromEntity(EntityManager em, Object entity, ResourceField idField) { Object pk = em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity); PreconditionUtil.verify(pk != null, "pk not available for entity %s", entity); if (pk ...
java
@SuppressWarnings("unchecked") protected I getIdFromEntity(EntityManager em, Object entity, ResourceField idField) { Object pk = em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity); PreconditionUtil.verify(pk != null, "pk not available for entity %s", entity); if (pk ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "I", "getIdFromEntity", "(", "EntityManager", "em", ",", "Object", "entity", ",", "ResourceField", "idField", ")", "{", "Object", "pk", "=", "em", ".", "getEntityManagerFactory", "(", ")", ".", "...
Extracts the resource ID from the entity. By default it uses the entity's primary key if the field name matches the DTO's ID field. Override in subclasses if a different entity field should be used. @return the resource ID or <code>null</code> when it could not be determined
[ "Extracts", "the", "resource", "ID", "from", "the", "entity", ".", "By", "default", "it", "uses", "the", "entity", "s", "primary", "key", "if", "the", "field", "name", "matches", "the", "DTO", "s", "ID", "field", ".", "Override", "in", "subclasses", "if"...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaEntityRepositoryBase.java#L200-L208
116,113
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/boot/CrnkBoot.java
CrnkBoot.boot
public void boot() { LOGGER.debug("performing setup"); checkNotConfiguredYet(); configured = true; // Set the properties provider into the registry early // so that it is available to the modules being bootstrapped moduleRegistry.setPropertiesProvider(propertiesProvider)...
java
public void boot() { LOGGER.debug("performing setup"); checkNotConfiguredYet(); configured = true; // Set the properties provider into the registry early // so that it is available to the modules being bootstrapped moduleRegistry.setPropertiesProvider(propertiesProvider)...
[ "public", "void", "boot", "(", ")", "{", "LOGGER", ".", "debug", "(", "\"performing setup\"", ")", ";", "checkNotConfiguredYet", "(", ")", ";", "configured", "=", "true", ";", "// Set the properties provider into the registry early", "// so that it is available to the mod...
Performs the setup.
[ "Performs", "the", "setup", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/boot/CrnkBoot.java#L182-L197
116,114
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/http/JsonApiRequestProcessor.java
JsonApiRequestProcessor.isJsonApiRequest
@SuppressWarnings("UnnecessaryLocalVariable") public static boolean isJsonApiRequest(HttpRequestContext requestContext, boolean acceptPlainJson) { String method = requestContext.getMethod().toUpperCase(); boolean isPatch = method.equals(HttpMethod.PATCH.toString()); boolean isPost = method.equals(HttpMethod.POST...
java
@SuppressWarnings("UnnecessaryLocalVariable") public static boolean isJsonApiRequest(HttpRequestContext requestContext, boolean acceptPlainJson) { String method = requestContext.getMethod().toUpperCase(); boolean isPatch = method.equals(HttpMethod.PATCH.toString()); boolean isPost = method.equals(HttpMethod.POST...
[ "@", "SuppressWarnings", "(", "\"UnnecessaryLocalVariable\"", ")", "public", "static", "boolean", "isJsonApiRequest", "(", "HttpRequestContext", "requestContext", ",", "boolean", "acceptPlainJson", ")", "{", "String", "method", "=", "requestContext", ".", "getMethod", "...
Determines whether the supplied HTTP request is considered a JSON-API request. @param requestContext The HTTP request @param acceptPlainJson Whether a plain JSON request should also be considered a JSON-API request @return <code>true</code> if it is a JSON-API request; <code>false</code> otherwise @since 2.4
[ "Determines", "whether", "the", "supplied", "HTTP", "request", "is", "considered", "a", "JSON", "-", "API", "request", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/http/JsonApiRequestProcessor.java#L53-L74
116,115
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java
JpaResourceInformationProvider.handleIdOverride
private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) { List<ResourceField> idFields = fields.stream() .filter(field -> field.getResourceFieldType() == ResourceFieldType.ID) .collect(Collectors.toList()); if (idFields.size() == 2) { ...
java
private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) { List<ResourceField> idFields = fields.stream() .filter(field -> field.getResourceFieldType() == ResourceFieldType.ID) .collect(Collectors.toList()); if (idFields.size() == 2) { ...
[ "private", "void", "handleIdOverride", "(", "Class", "<", "?", ">", "resourceClass", ",", "List", "<", "ResourceField", ">", "fields", ")", "{", "List", "<", "ResourceField", ">", "idFields", "=", "fields", ".", "stream", "(", ")", ".", "filter", "(", "f...
make sure that @JsonApiId wins over @Id and @EmbeddedId of JPA.
[ "make", "sure", "that" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java#L137-L160
116,116
crnk-project/crnk-framework
crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/CrnkFeature.java
CrnkFeature.registerActionRepositories
private void registerActionRepositories(FeatureContext context, CrnkBoot boot) { ResourceRegistry resourceRegistry = boot.getResourceRegistry(); Collection<RegistryEntry> registryEntries = resourceRegistry.getEntries(); for (RegistryEntry registryEntry : registryEntries) { ResourceRe...
java
private void registerActionRepositories(FeatureContext context, CrnkBoot boot) { ResourceRegistry resourceRegistry = boot.getResourceRegistry(); Collection<RegistryEntry> registryEntries = resourceRegistry.getEntries(); for (RegistryEntry registryEntry : registryEntries) { ResourceRe...
[ "private", "void", "registerActionRepositories", "(", "FeatureContext", "context", ",", "CrnkBoot", "boot", ")", "{", "ResourceRegistry", "resourceRegistry", "=", "boot", ".", "getResourceRegistry", "(", ")", ";", "Collection", "<", "RegistryEntry", ">", "registryEntr...
All repositories with JAX-RS action need to be registered with JAX-RS as singletons. @param context of jaxrs @param boot of crnk
[ "All", "repositories", "with", "JAX", "-", "RS", "action", "need", "to", "be", "registered", "with", "JAX", "-", "RS", "as", "singletons", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/CrnkFeature.java#L94-L105
116,117
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/document/mapper/IncludeRelationshipLoader.java
IncludeRelationshipLoader.lookupRelatedResource
@SuppressWarnings("unchecked") public Result<Set<Resource>> lookupRelatedResource(IncludeRequest request, Collection<Resource> sourceResources, ResourceField relationshipField) { if (sourceResources.isEmpty()) { return resultFactory.just(Collections.emptySet()); } // directly load where relat...
java
@SuppressWarnings("unchecked") public Result<Set<Resource>> lookupRelatedResource(IncludeRequest request, Collection<Resource> sourceResources, ResourceField relationshipField) { if (sourceResources.isEmpty()) { return resultFactory.just(Collections.emptySet()); } // directly load where relat...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Result", "<", "Set", "<", "Resource", ">", ">", "lookupRelatedResource", "(", "IncludeRequest", "request", ",", "Collection", "<", "Resource", ">", "sourceResources", ",", "ResourceField", "relationshipF...
Loads all related resources for the given resources and relationship field. It updates the relationship data of the source resources accordingly and returns the loaded resources for potential inclusion in the result resource.
[ "Loads", "all", "related", "resources", "for", "the", "given", "resources", "and", "relationship", "field", ".", "It", "updates", "the", "relationship", "data", "of", "the", "source", "resources", "accordingly", "and", "returns", "the", "loaded", "resources", "f...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/document/mapper/IncludeRelationshipLoader.java#L59-L95
116,118
crnk-project/crnk-framework
crnk-validation/src/main/java/io/crnk/validation/internal/ConstraintViolationExceptionMapper.java
ConstraintViolationExceptionMapper.resolvePath
private ResourceRef resolvePath(ConstraintViolation<?> violation) { Object resource = violation.getRootBean(); Object nodeObject = resource; ResourceRef ref = new ResourceRef(resource); Iterator<Node> iterator = violation.getPropertyPath().iterator(); while (iterator.hasNext()) { Node node = iterator.nex...
java
private ResourceRef resolvePath(ConstraintViolation<?> violation) { Object resource = violation.getRootBean(); Object nodeObject = resource; ResourceRef ref = new ResourceRef(resource); Iterator<Node> iterator = violation.getPropertyPath().iterator(); while (iterator.hasNext()) { Node node = iterator.nex...
[ "private", "ResourceRef", "resolvePath", "(", "ConstraintViolation", "<", "?", ">", "violation", ")", "{", "Object", "resource", "=", "violation", ".", "getRootBean", "(", ")", ";", "Object", "nodeObject", "=", "resource", ";", "ResourceRef", "ref", "=", "new"...
Translate validated bean and root path into validated resource and resource path. For example, embeddables belonging to an entity document are mapped back to an entity violation and a proper path to the embeddable attribute. @param violation to compute the reference @return computaed reference
[ "Translate", "validated", "bean", "and", "root", "path", "into", "validated", "resource", "and", "resource", "path", ".", "For", "example", "embeddables", "belonging", "to", "an", "entity", "document", "are", "mapped", "back", "to", "an", "entity", "violation", ...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-validation/src/main/java/io/crnk/validation/internal/ConstraintViolationExceptionMapper.java#L215-L246
116,119
crnk-project/crnk-framework
crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/JsonApiResponseFilter.java
JsonApiResponseFilter.filter
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { Object response = responseContext.getEntity(); if (response == null) { if (feature.getBoot().isNullDataResponseEnabled()) { Document document = new Document();...
java
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { Object response = responseContext.getEntity(); if (response == null) { if (feature.getBoot().isNullDataResponseEnabled()) { Document document = new Document();...
[ "@", "Override", "public", "void", "filter", "(", "ContainerRequestContext", "requestContext", ",", "ContainerResponseContext", "responseContext", ")", "{", "Object", "response", "=", "responseContext", ".", "getEntity", "(", ")", ";", "if", "(", "response", "==", ...
Creates JSON API responses for custom JAX-RS actions returning Crnk resources.
[ "Creates", "JSON", "API", "responses", "for", "custom", "JAX", "-", "RS", "actions", "returning", "Crnk", "resources", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/JsonApiResponseFilter.java#L54-L107
116,120
crnk-project/crnk-framework
crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/JsonApiResponseFilter.java
JsonApiResponseFilter.getRegistryEntry
private Optional<RegistryEntry> getRegistryEntry(Object response) { if (response != null) { Class responseClass = response.getClass(); boolean resourceList = ResourceList.class.isAssignableFrom(responseClass); if (resourceList) { ResourceList responseList = (R...
java
private Optional<RegistryEntry> getRegistryEntry(Object response) { if (response != null) { Class responseClass = response.getClass(); boolean resourceList = ResourceList.class.isAssignableFrom(responseClass); if (resourceList) { ResourceList responseList = (R...
[ "private", "Optional", "<", "RegistryEntry", ">", "getRegistryEntry", "(", "Object", "response", ")", "{", "if", "(", "response", "!=", "null", ")", "{", "Class", "responseClass", "=", "response", ".", "getClass", "(", ")", ";", "boolean", "resourceList", "=...
Determines whether the given response entity is either a Crnk resource or a list of resource;
[ "Determines", "whether", "the", "given", "response", "entity", "is", "either", "a", "Crnk", "resource", "or", "a", "list", "of", "resource", ";" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-setup/crnk-setup-rs/src/main/java/io/crnk/rs/JsonApiResponseFilter.java#L122-L149
116,121
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/QueryBuilder.java
QueryBuilder.applyDistinct
protected int applyDistinct() { int numAutoSelections = 0; boolean distinct; if (query.autoDistinct) { // distinct for many join/fetches or manual // in case of ViewQuery we may not need this here, but we need to do // the selection of order-by columns below distinct = query.autoDistinct && !query.aut...
java
protected int applyDistinct() { int numAutoSelections = 0; boolean distinct; if (query.autoDistinct) { // distinct for many join/fetches or manual // in case of ViewQuery we may not need this here, but we need to do // the selection of order-by columns below distinct = query.autoDistinct && !query.aut...
[ "protected", "int", "applyDistinct", "(", ")", "{", "int", "numAutoSelections", "=", "0", ";", "boolean", "distinct", ";", "if", "(", "query", ".", "autoDistinct", ")", "{", "// distinct for many join/fetches or manual", "// in case of ViewQuery we may not need this here,...
Adds order expressions to selection if in "auto distinct" mode and the query performs a join or fetch on a relation. In this case, attributes from referenced entities inlucded in the sort clause must be added to the select clause as well. @return number of attributes that were needed to compute a distinct
[ "Adds", "order", "expressions", "to", "selection", "if", "in", "auto", "distinct", "mode", "and", "the", "query", "performs", "a", "join", "or", "fetch", "on", "a", "relation", ".", "In", "this", "case", "attributes", "from", "referenced", "entities", "inluc...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/QueryBuilder.java#L54-L73
116,122
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModule.java
JpaModule.newServerModule
@Deprecated public static JpaModule newServerModule(EntityManagerFactory emFactory, EntityManager em, TransactionRunner transactionRunner) { JpaModuleConfig config = new JpaModuleConfig(); config.exposeAllEntities(emFactory); return new JpaModule(c...
java
@Deprecated public static JpaModule newServerModule(EntityManagerFactory emFactory, EntityManager em, TransactionRunner transactionRunner) { JpaModuleConfig config = new JpaModuleConfig(); config.exposeAllEntities(emFactory); return new JpaModule(c...
[ "@", "Deprecated", "public", "static", "JpaModule", "newServerModule", "(", "EntityManagerFactory", "emFactory", ",", "EntityManager", "em", ",", "TransactionRunner", "transactionRunner", ")", "{", "JpaModuleConfig", "config", "=", "new", "JpaModuleConfig", "(", ")", ...
Creates a new JpaModule for a Crnk server. All entities managed by the provided EntityManagerFactory are registered to the module and exposed as JSON API resources if not later configured otherwise. @param emFactory to retrieve the managed entities. @param em to use @param transactionRunner to u...
[ "Creates", "a", "new", "JpaModule", "for", "a", "Crnk", "server", ".", "All", "entities", "managed", "by", "the", "provided", "EntityManagerFactory", "are", "registered", "to", "the", "module", "and", "exposed", "as", "JSON", "API", "resources", "if", "not", ...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModule.java#L168-L174
116,123
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/information/resource/ResourceInformation.java
ResourceInformation.setupManyNesting
private boolean setupManyNesting() { BeanAttributeInformation parentAttribute = null; BeanAttributeInformation idAttribute = null; BeanInformation beanInformation = BeanInformation.get(idField.getType()); for (String attributeName : beanInformation.getAttributeNames()) { Bean...
java
private boolean setupManyNesting() { BeanAttributeInformation parentAttribute = null; BeanAttributeInformation idAttribute = null; BeanInformation beanInformation = BeanInformation.get(idField.getType()); for (String attributeName : beanInformation.getAttributeNames()) { Bean...
[ "private", "boolean", "setupManyNesting", "(", ")", "{", "BeanAttributeInformation", "parentAttribute", "=", "null", ";", "BeanAttributeInformation", "idAttribute", "=", "null", ";", "BeanInformation", "beanInformation", "=", "BeanInformation", ".", "get", "(", "idField...
in the future @JsonApiResource(nested=true), currently just structured id field with local and parent id.
[ "in", "the", "future" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/information/resource/ResourceInformation.java#L238-L298
116,124
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/information/resource/ResourceInformation.java
ResourceInformation.toIdString
public String toIdString(Object id) { if (id == null) { return null; } return idStringMapper.toString(id); }
java
public String toIdString(Object id) { if (id == null) { return null; } return idStringMapper.toString(id); }
[ "public", "String", "toIdString", "(", "Object", "id", ")", "{", "if", "(", "id", "==", "null", ")", "{", "return", "null", ";", "}", "return", "idStringMapper", ".", "toString", "(", "id", ")", ";", "}" ]
Converts the given id to a string. @param id id @return stringified id
[ "Converts", "the", "given", "id", "to", "a", "string", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/information/resource/ResourceInformation.java#L606-L611
116,125
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/dispatcher/controller/BaseController.java
BaseController.handle
@Override @Deprecated public final Response handle(JsonPath jsonPath, QueryAdapter queryAdapter, Document requestDocument) { Result<Response> response = handleAsync(jsonPath, queryAdapter, requestDocument); PreconditionUtil.verify(response != null, "no response by controller provided"); ...
java
@Override @Deprecated public final Response handle(JsonPath jsonPath, QueryAdapter queryAdapter, Document requestDocument) { Result<Response> response = handleAsync(jsonPath, queryAdapter, requestDocument); PreconditionUtil.verify(response != null, "no response by controller provided"); ...
[ "@", "Override", "@", "Deprecated", "public", "final", "Response", "handle", "(", "JsonPath", "jsonPath", ",", "QueryAdapter", "queryAdapter", ",", "Document", "requestDocument", ")", "{", "Result", "<", "Response", ">", "response", "=", "handleAsync", "(", "jso...
Passes the request to controller method. @param jsonPath Requested resource path @param queryAdapter QueryAdapter @param requestDocument Top-level JSON object from method's body of the request passed as {@link Document} @return BaseResponseContext object @deprecated in favor of {@link #handleAsync(JsonPath, ...
[ "Passes", "the", "request", "to", "controller", "method", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/dispatcher/controller/BaseController.java#L54-L61
116,126
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java
ClassUtils.getClassFields
public static List<Field> getClassFields(Class<?> beanClass) { Map<String, Field> resultMap = new HashMap<>(); LinkedList<Field> results = new LinkedList<>(); Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Field field : currentClass.getDeclaredFields()...
java
public static List<Field> getClassFields(Class<?> beanClass) { Map<String, Field> resultMap = new HashMap<>(); LinkedList<Field> results = new LinkedList<>(); Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Field field : currentClass.getDeclaredFields()...
[ "public", "static", "List", "<", "Field", ">", "getClassFields", "(", "Class", "<", "?", ">", "beanClass", ")", "{", "Map", "<", "String", ",", "Field", ">", "resultMap", "=", "new", "HashMap", "<>", "(", ")", ";", "LinkedList", "<", "Field", ">", "r...
Returns a list of class fields. Supports inheritance and doesn't return synthetic fields. @param beanClass class to be searched for @return a list of found fields
[ "Returns", "a", "list", "of", "class", "fields", ".", "Supports", "inheritance", "and", "doesn", "t", "return", "synthetic", "fields", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java#L55-L74
116,127
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java
ClassUtils.getAnnotation
public static <T extends Annotation> Optional<T> getAnnotation(Class<?> beanClass, Class<T> annotationClass) { Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { if (currentClass.isAnnotationPresent(annotationClass)) { return Optional.of(currentClass.getAnnotati...
java
public static <T extends Annotation> Optional<T> getAnnotation(Class<?> beanClass, Class<T> annotationClass) { Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { if (currentClass.isAnnotationPresent(annotationClass)) { return Optional.of(currentClass.getAnnotati...
[ "public", "static", "<", "T", "extends", "Annotation", ">", "Optional", "<", "T", ">", "getAnnotation", "(", "Class", "<", "?", ">", "beanClass", ",", "Class", "<", "T", ">", "annotationClass", ")", "{", "Class", "<", "?", ">", "currentClass", "=", "be...
Returns an instance of bean's annotation @param beanClass class to be searched for @param annotationClass type of an annotation @param <T> type of an annotation @return an instance of an annotation
[ "Returns", "an", "instance", "of", "bean", "s", "annotation" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java#L84-L94
116,128
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java
ClassUtils.findClassField
public static Field findClassField(Class<?> beanClass, String fieldName) { Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Field field : currentClass.getDeclaredFields()) { if (field.isSynthetic()) { continue; } if (field.getName().equals(f...
java
public static Field findClassField(Class<?> beanClass, String fieldName) { Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Field field : currentClass.getDeclaredFields()) { if (field.isSynthetic()) { continue; } if (field.getName().equals(f...
[ "public", "static", "Field", "findClassField", "(", "Class", "<", "?", ">", "beanClass", ",", "String", "fieldName", ")", "{", "Class", "<", "?", ">", "currentClass", "=", "beanClass", ";", "while", "(", "currentClass", "!=", "null", "&&", "currentClass", ...
Tries to find a class fields. Supports inheritance and doesn't return synthetic fields. @param beanClass class to be searched for @param fieldName field name @return a list of found fields
[ "Tries", "to", "find", "a", "class", "fields", ".", "Supports", "inheritance", "and", "doesn", "t", "return", "synthetic", "fields", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java#L103-L119
116,129
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java
ClassUtils.getClassSetters
public static List<Method> getClassSetters(Class<?> beanClass) { Map<String, Method> result = new HashMap<>(); Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Method method : currentClass.getDeclaredMethods()) { if (!method.isSynthetic() && isSetter(m...
java
public static List<Method> getClassSetters(Class<?> beanClass) { Map<String, Method> result = new HashMap<>(); Class<?> currentClass = beanClass; while (currentClass != null && currentClass != Object.class) { for (Method method : currentClass.getDeclaredMethods()) { if (!method.isSynthetic() && isSetter(m...
[ "public", "static", "List", "<", "Method", ">", "getClassSetters", "(", "Class", "<", "?", ">", "beanClass", ")", "{", "Map", "<", "String", ",", "Method", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ";", "Class", "<", "?", ">", "currentCla...
Return a list of class setters. Supports inheritance and overriding, that is when a method is found on the lowest level of inheritance chain, no other method can override it. Supports inheritance and doesn't return synthetic methods. @param beanClass class to be searched for @return a list of found getters
[ "Return", "a", "list", "of", "class", "setters", ".", "Supports", "inheritance", "and", "overriding", "that", "is", "when", "a", "method", "is", "found", "on", "the", "lowest", "level", "of", "inheritance", "chain", "no", "other", "method", "can", "override"...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java#L250-L264
116,130
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java
ClassUtils.getRawType
@Deprecated public static Class<?> getRawType(Type type) { if (type instanceof Class) { return (Class<?>) type; } else if (type instanceof ParameterizedType) { return getRawType(((ParameterizedType) type).getRawType()); } else if (type instanceof TypeVariable<?>) { return getRawType(((TypeVariable<?>) t...
java
@Deprecated public static Class<?> getRawType(Type type) { if (type instanceof Class) { return (Class<?>) type; } else if (type instanceof ParameterizedType) { return getRawType(((ParameterizedType) type).getRawType()); } else if (type instanceof TypeVariable<?>) { return getRawType(((TypeVariable<?>) t...
[ "@", "Deprecated", "public", "static", "Class", "<", "?", ">", "getRawType", "(", "Type", "type", ")", "{", "if", "(", "type", "instanceof", "Class", ")", "{", "return", "(", "Class", "<", "?", ">", ")", "type", ";", "}", "else", "if", "(", "type",...
Given a type, this method resolves the corresponding raw type. This method works if {@code type} is of type {@link Class}, or {@link ParameterizedType}. Its shortcoming is that it cannot resolve {@link TypeVariable} and will always return {@code Object.class}, not attempting to resolve the concrete type that the varia...
[ "Given", "a", "type", "this", "method", "resolves", "the", "corresponding", "raw", "type", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/ClassUtils.java#L349-L359
116,131
crnk-project/crnk-framework
crnk-security/src/main/java/io/crnk/security/SecurityModule.java
SecurityModule.reconfigure
public void reconfigure(SecurityConfig config) { this.config = config; LOGGER.debug("reconfiguring with {} rules", config.getRules().size()); Map<String, Map<String, ResourcePermission>> newPermissions = new HashMap<>(); for (SecurityRule rule : config.getRules()) { String ...
java
public void reconfigure(SecurityConfig config) { this.config = config; LOGGER.debug("reconfiguring with {} rules", config.getRules().size()); Map<String, Map<String, ResourcePermission>> newPermissions = new HashMap<>(); for (SecurityRule rule : config.getRules()) { String ...
[ "public", "void", "reconfigure", "(", "SecurityConfig", "config", ")", "{", "this", ".", "config", "=", "config", ";", "LOGGER", ".", "debug", "(", "\"reconfiguring with {} rules\"", ",", "config", ".", "getRules", "(", ")", ".", "size", "(", ")", ")", ";"...
Applies the new configuration to this module.
[ "Applies", "the", "new", "configuration", "to", "this", "module", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-security/src/main/java/io/crnk/security/SecurityModule.java#L146-L177
116,132
crnk-project/crnk-framework
crnk-security/src/main/java/io/crnk/security/SecurityModule.java
SecurityModule.isUserInRole
public boolean isUserInRole(String role) { if (!isEnabled()) { throw new IllegalStateException("security module is disabled"); } checkInit(); SecurityProvider securityProvider = context.getSecurityProvider(); boolean contained = role == ALL_ROLE || securityProvider.is...
java
public boolean isUserInRole(String role) { if (!isEnabled()) { throw new IllegalStateException("security module is disabled"); } checkInit(); SecurityProvider securityProvider = context.getSecurityProvider(); boolean contained = role == ALL_ROLE || securityProvider.is...
[ "public", "boolean", "isUserInRole", "(", "String", "role", ")", "{", "if", "(", "!", "isEnabled", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"security module is disabled\"", ")", ";", "}", "checkInit", "(", ")", ";", "SecurityProvider...
Checks whether the current user posses the provided role @param role to check @return true if in this role
[ "Checks", "whether", "the", "current", "user", "posses", "the", "provided", "role" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-security/src/main/java/io/crnk/security/SecurityModule.java#L291-L300
116,133
crnk-project/crnk-framework
crnk-client/src/main/java/io/crnk/client/CrnkClient.java
CrnkClient.findModules
public void findModules() { ServiceLoader<ClientModuleFactory> loader = ServiceLoader.load(ClientModuleFactory.class); Iterator<ClientModuleFactory> iterator = loader.iterator(); while (iterator.hasNext()) { ClientModuleFactory factory = iterator.next(); Module module = ...
java
public void findModules() { ServiceLoader<ClientModuleFactory> loader = ServiceLoader.load(ClientModuleFactory.class); Iterator<ClientModuleFactory> iterator = loader.iterator(); while (iterator.hasNext()) { ClientModuleFactory factory = iterator.next(); Module module = ...
[ "public", "void", "findModules", "(", ")", "{", "ServiceLoader", "<", "ClientModuleFactory", ">", "loader", "=", "ServiceLoader", ".", "load", "(", "ClientModuleFactory", ".", "class", ")", ";", "Iterator", "<", "ClientModuleFactory", ">", "iterator", "=", "load...
Finds and registers modules on the classpath trough the use of java.util.ServiceLoader. Each module can register itself for lookup by registering a ClientModuleFactory.
[ "Finds", "and", "registers", "modules", "on", "the", "classpath", "trough", "the", "use", "of", "java", ".", "util", ".", "ServiceLoader", ".", "Each", "module", "can", "register", "itself", "for", "lookup", "by", "registering", "a", "ClientModuleFactory", "."...
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-client/src/main/java/io/crnk/client/CrnkClient.java#L262-L273
116,134
crnk-project/crnk-framework
crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java
TypescriptUtils.getNestedTypeContainer
public static TSModule getNestedTypeContainer(TSType type, boolean create) { TSContainerElement parent = (TSContainerElement) type.getParent(); if (parent == null) { return null; } int insertionIndex = parent.getElements().indexOf(type); return getModule(parent, type.getName(), insertionIndex, create); }
java
public static TSModule getNestedTypeContainer(TSType type, boolean create) { TSContainerElement parent = (TSContainerElement) type.getParent(); if (parent == null) { return null; } int insertionIndex = parent.getElements().indexOf(type); return getModule(parent, type.getName(), insertionIndex, create); }
[ "public", "static", "TSModule", "getNestedTypeContainer", "(", "TSType", "type", ",", "boolean", "create", ")", "{", "TSContainerElement", "parent", "=", "(", "TSContainerElement", ")", "type", ".", "getParent", "(", ")", ";", "if", "(", "parent", "==", "null"...
Creates a module if the same name as the provided type used to hold nested types.
[ "Creates", "a", "module", "if", "the", "same", "name", "as", "the", "provided", "type", "used", "to", "hold", "nested", "types", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java#L90-L97
116,135
crnk-project/crnk-framework
crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java
TypescriptUtils.toFileName
public static String toFileName(String name) { char[] charArray = name.toCharArray(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < charArray.length; i++) { if (Character.isUpperCase(charArray[i]) && i > 0 && !Character.isUpperCase(charArray[i - 1])) { builder.append('.'); } builde...
java
public static String toFileName(String name) { char[] charArray = name.toCharArray(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < charArray.length; i++) { if (Character.isUpperCase(charArray[i]) && i > 0 && !Character.isUpperCase(charArray[i - 1])) { builder.append('.'); } builde...
[ "public", "static", "String", "toFileName", "(", "String", "name", ")", "{", "char", "[", "]", "charArray", "=", "name", ".", "toCharArray", "(", ")", ";", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", ...
transforms "helloWorld" to "hello.world" to more closely resemble typical typescript naming.
[ "transforms", "helloWorld", "to", "hello", ".", "world", "to", "more", "closely", "resemble", "typical", "typescript", "naming", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java#L126-L136
116,136
crnk-project/crnk-framework
crnk-client/src/main/java/io/crnk/client/response/JsonLinksInformation.java
JsonLinksInformation.as
@Override public <L extends LinksInformation> L as(Class<L> linksClass) { try { ObjectReader reader = mapper.readerFor(linksClass); return reader.readValue(data); } catch (IOException e) { throw new IllegalStateException(e); } }
java
@Override public <L extends LinksInformation> L as(Class<L> linksClass) { try { ObjectReader reader = mapper.readerFor(linksClass); return reader.readValue(data); } catch (IOException e) { throw new IllegalStateException(e); } }
[ "@", "Override", "public", "<", "L", "extends", "LinksInformation", ">", "L", "as", "(", "Class", "<", "L", ">", "linksClass", ")", "{", "try", "{", "ObjectReader", "reader", "=", "mapper", ".", "readerFor", "(", "linksClass", ")", ";", "return", "reader...
Converts this generic links information to the provided type. @param linksClass to return @return links information based on the provided type.
[ "Converts", "this", "generic", "links", "information", "to", "the", "provided", "type", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-client/src/main/java/io/crnk/client/response/JsonLinksInformation.java#L32-L40
116,137
crnk-project/crnk-framework
crnk-operations/src/main/java/io/crnk/operations/server/OperationsModule.java
OperationsModule.apply
public List<OperationResponse> apply(List<Operation> operations, QueryContext queryContext) { checkAccess(operations, queryContext); enrichTypeIdInformation(operations); List<OrderedOperation> orderedOperations = orderStrategy.order(operations); DefaultOperationFilterChain chain = new DefaultOperationFilterCh...
java
public List<OperationResponse> apply(List<Operation> operations, QueryContext queryContext) { checkAccess(operations, queryContext); enrichTypeIdInformation(operations); List<OrderedOperation> orderedOperations = orderStrategy.order(operations); DefaultOperationFilterChain chain = new DefaultOperationFilterCh...
[ "public", "List", "<", "OperationResponse", ">", "apply", "(", "List", "<", "Operation", ">", "operations", ",", "QueryContext", "queryContext", ")", "{", "checkAccess", "(", "operations", ",", "queryContext", ")", ";", "enrichTypeIdInformation", "(", "operations"...
Applies the given set of operations. @return responses
[ "Applies", "the", "given", "set", "of", "operations", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-operations/src/main/java/io/crnk/operations/server/OperationsModule.java#L104-L112
116,138
crnk-project/crnk-framework
crnk-operations/src/main/java/io/crnk/operations/server/OperationsModule.java
OperationsModule.checkAccess
private void checkAccess(List<Operation> operations, QueryContext queryContext) { for (Operation operation : operations) { checkAccess(operation, queryContext); } }
java
private void checkAccess(List<Operation> operations, QueryContext queryContext) { for (Operation operation : operations) { checkAccess(operation, queryContext); } }
[ "private", "void", "checkAccess", "(", "List", "<", "Operation", ">", "operations", ",", "QueryContext", "queryContext", ")", "{", "for", "(", "Operation", "operation", ":", "operations", ")", "{", "checkAccess", "(", "operation", ",", "queryContext", ")", ";"...
This is not strictly necessary, but allows to catch security issues early before accessing the individual repositories
[ "This", "is", "not", "strictly", "necessary", "but", "allows", "to", "catch", "security", "issues", "early", "before", "accessing", "the", "individual", "repositories" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-operations/src/main/java/io/crnk/operations/server/OperationsModule.java#L117-L121
116,139
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/document/mapper/DocumentMapper.java
DocumentMapper.compact
private void compact(Document doc, QueryAdapter queryAdapter) { if (queryAdapter != null && queryAdapter.getCompactMode()) { if (doc.getIncluded() != null) { compact(doc.getIncluded()); } if (doc.getData().isPresent()) { if (doc.isMultiple()) { compact(doc.getCollectionData().get()); } else ...
java
private void compact(Document doc, QueryAdapter queryAdapter) { if (queryAdapter != null && queryAdapter.getCompactMode()) { if (doc.getIncluded() != null) { compact(doc.getIncluded()); } if (doc.getData().isPresent()) { if (doc.isMultiple()) { compact(doc.getCollectionData().get()); } else ...
[ "private", "void", "compact", "(", "Document", "doc", ",", "QueryAdapter", "queryAdapter", ")", "{", "if", "(", "queryAdapter", "!=", "null", "&&", "queryAdapter", ".", "getCompactMode", "(", ")", ")", "{", "if", "(", "doc", ".", "getIncluded", "(", ")", ...
removes unncessary json elements
[ "removes", "unncessary", "json", "elements" ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/document/mapper/DocumentMapper.java#L111-L124
116,140
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModuleConfig.java
JpaModuleConfig.addRepository
public <T> void addRepository(JpaRepositoryConfig<T> config) { Class<?> resourceClass = config.getResourceClass(); if (repositoryConfigurationMap.containsKey(resourceClass)) { throw new IllegalStateException(resourceClass.getName() + " is already registered"); } repositoryCon...
java
public <T> void addRepository(JpaRepositoryConfig<T> config) { Class<?> resourceClass = config.getResourceClass(); if (repositoryConfigurationMap.containsKey(resourceClass)) { throw new IllegalStateException(resourceClass.getName() + " is already registered"); } repositoryCon...
[ "public", "<", "T", ">", "void", "addRepository", "(", "JpaRepositoryConfig", "<", "T", ">", "config", ")", "{", "Class", "<", "?", ">", "resourceClass", "=", "config", ".", "getResourceClass", "(", ")", ";", "if", "(", "repositoryConfigurationMap", ".", "...
Adds the resource to this module. @param config to use
[ "Adds", "the", "resource", "to", "this", "module", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModuleConfig.java#L114-L120
116,141
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModuleConfig.java
JpaModuleConfig.exposeAllEntities
public void exposeAllEntities(EntityManagerFactory emf) { Set<ManagedType<?>> managedTypes = emf.getMetamodel().getManagedTypes(); for (ManagedType<?> managedType : managedTypes) { Class<?> managedJavaType = managedType.getJavaType(); if (managedJavaType.getAnnotation(Entity.clas...
java
public void exposeAllEntities(EntityManagerFactory emf) { Set<ManagedType<?>> managedTypes = emf.getMetamodel().getManagedTypes(); for (ManagedType<?> managedType : managedTypes) { Class<?> managedJavaType = managedType.getJavaType(); if (managedJavaType.getAnnotation(Entity.clas...
[ "public", "void", "exposeAllEntities", "(", "EntityManagerFactory", "emf", ")", "{", "Set", "<", "ManagedType", "<", "?", ">", ">", "managedTypes", "=", "emf", ".", "getMetamodel", "(", ")", ".", "getManagedTypes", "(", ")", ";", "for", "(", "ManagedType", ...
Exposes all entities as repositories.
[ "Exposes", "all", "entities", "as", "repositories", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaModuleConfig.java#L125-L133
116,142
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaRepositoryConfig.java
JpaRepositoryConfig.builder
public static <E> JpaRepositoryConfig.Builder<E> builder(Class<E> entityClass) { JpaRepositoryConfig.Builder<E> builder = new JpaRepositoryConfig.Builder<>(); builder.entityClass = entityClass; builder.resourceClass = entityClass; return builder; }
java
public static <E> JpaRepositoryConfig.Builder<E> builder(Class<E> entityClass) { JpaRepositoryConfig.Builder<E> builder = new JpaRepositoryConfig.Builder<>(); builder.entityClass = entityClass; builder.resourceClass = entityClass; return builder; }
[ "public", "static", "<", "E", ">", "JpaRepositoryConfig", ".", "Builder", "<", "E", ">", "builder", "(", "Class", "<", "E", ">", "entityClass", ")", "{", "JpaRepositoryConfig", ".", "Builder", "<", "E", ">", "builder", "=", "new", "JpaRepositoryConfig", "....
Prepares a builder to configure a jpa document for the given entity. @param <E> entity type @param entityClass to directly expose @return builder
[ "Prepares", "a", "builder", "to", "configure", "a", "jpa", "document", "for", "the", "given", "entity", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaRepositoryConfig.java#L134-L139
116,143
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaRepositoryConfig.java
JpaRepositoryConfig.builder
public static <E, D> JpaRepositoryConfig.Builder<D> builder(Class<E> entityClass, Class<D> dtoClass, JpaMapper<E, D> mapper) { JpaRepositoryConfig.Builder<D> builder = new JpaRepositoryConfig.Builder<>(); builder.entityClass = entityClass; ...
java
public static <E, D> JpaRepositoryConfig.Builder<D> builder(Class<E> entityClass, Class<D> dtoClass, JpaMapper<E, D> mapper) { JpaRepositoryConfig.Builder<D> builder = new JpaRepositoryConfig.Builder<>(); builder.entityClass = entityClass; ...
[ "public", "static", "<", "E", ",", "D", ">", "JpaRepositoryConfig", ".", "Builder", "<", "D", ">", "builder", "(", "Class", "<", "E", ">", "entityClass", ",", "Class", "<", "D", ">", "dtoClass", ",", "JpaMapper", "<", "E", ",", "D", ">", "mapper", ...
Prepares a builder to configure a jpa document for the given entity class which is mapped to a DTO with the provided mapper. @param <E> entity type @param <D> dto type @param entityClass to use @param dtoClass to expose @param mapper to convert entity to dto and back @return builder
[ "Prepares", "a", "builder", "to", "configure", "a", "jpa", "document", "for", "the", "given", "entity", "class", "which", "is", "mapped", "to", "a", "DTO", "with", "the", "provided", "mapper", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaRepositoryConfig.java#L152-L159
116,144
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PreconditionUtil.java
PreconditionUtil.fail
public static void fail(String message, Object... args) { throw new IllegalStateException(message == null ? "" : String.format(message, args)); }
java
public static void fail(String message, Object... args) { throw new IllegalStateException(message == null ? "" : String.format(message, args)); }
[ "public", "static", "void", "fail", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "throw", "new", "IllegalStateException", "(", "message", "==", "null", "?", "\"\"", ":", "String", ".", "format", "(", "message", ",", "args", ")", ")",...
Fails a test with the given message. @param message the identifying message for the {@link AssertionError} ( <code>null</code> okay) @see AssertionError
[ "Fails", "a", "test", "with", "the", "given", "message", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PreconditionUtil.java#L49-L51
116,145
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/module/internal/ResourceFilterDirectoryImpl.java
ResourceFilterDirectoryImpl.canAccess
@Override public boolean canAccess(ResourceField field, HttpMethod method, QueryContext queryContext, boolean allowIgnore) { if (field == null) { return true; } FilterBehavior filterBehavior = get(field, method, queryContext); if (filterBehavior == FilterBehavior.NONE) { ...
java
@Override public boolean canAccess(ResourceField field, HttpMethod method, QueryContext queryContext, boolean allowIgnore) { if (field == null) { return true; } FilterBehavior filterBehavior = get(field, method, queryContext); if (filterBehavior == FilterBehavior.NONE) { ...
[ "@", "Override", "public", "boolean", "canAccess", "(", "ResourceField", "field", ",", "HttpMethod", "method", ",", "QueryContext", "queryContext", ",", "boolean", "allowIgnore", ")", "{", "if", "(", "field", "==", "null", ")", "{", "return", "true", ";", "}...
Allows to check whether the given field can be written. @param field from the information model or null if is a dynamic field (like JsonAny).
[ "Allows", "to", "check", "whether", "the", "given", "field", "can", "be", "written", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/module/internal/ResourceFilterDirectoryImpl.java#L126-L143
116,146
crnk-project/crnk-framework
crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/AnyUtils.java
AnyUtils.findAttribute
public static MetaAttribute findAttribute(MetaDataObject meta, Object value) { if (value == null) { throw new IllegalArgumentException("null as value not supported"); } for (MetaAttribute attr : meta.getAttributes()) { if (attr.getName().equals(TYPE_ATTRIBUTE)) { continue; } if (attr.isDerived())...
java
public static MetaAttribute findAttribute(MetaDataObject meta, Object value) { if (value == null) { throw new IllegalArgumentException("null as value not supported"); } for (MetaAttribute attr : meta.getAttributes()) { if (attr.getName().equals(TYPE_ATTRIBUTE)) { continue; } if (attr.isDerived())...
[ "public", "static", "MetaAttribute", "findAttribute", "(", "MetaDataObject", "meta", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"null as value not supported\"", ")", ";", "}", ...
Finds a matching attribute for a given value. @param meta the metadataobject @param value the value @return the attribute which will accept the given value
[ "Finds", "a", "matching", "attribute", "for", "a", "given", "value", "." ]
2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/query/AnyUtils.java#L54-L73
116,147
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.setClassPath
@Override public void setClassPath( URL [] cp ) { baseClassPath.setPath( cp ); initBaseLoader(); loaderMap = new HashMap(); classLoaderChanged(); }
java
@Override public void setClassPath( URL [] cp ) { baseClassPath.setPath( cp ); initBaseLoader(); loaderMap = new HashMap(); classLoaderChanged(); }
[ "@", "Override", "public", "void", "setClassPath", "(", "URL", "[", "]", "cp", ")", "{", "baseClassPath", ".", "setPath", "(", "cp", ")", ";", "initBaseLoader", "(", ")", ";", "loaderMap", "=", "new", "HashMap", "(", ")", ";", "classLoaderChanged", "(", ...
Set a new base classpath and create a new base classloader. This means all types change.
[ "Set", "a", "new", "base", "classpath", "and", "create", "a", "new", "base", "classloader", ".", "This", "means", "all", "types", "change", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L330-L336
116,148
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.reloadAllClasses
@Override public void reloadAllClasses() throws ClassPathException { BshClassPath bcp = new BshClassPath("temp"); bcp.addComponent( baseClassPath ); bcp.addComponent( BshClassPath.getUserClassPath() ); setClassPath( bcp.getPathComponents() ); }
java
@Override public void reloadAllClasses() throws ClassPathException { BshClassPath bcp = new BshClassPath("temp"); bcp.addComponent( baseClassPath ); bcp.addComponent( BshClassPath.getUserClassPath() ); setClassPath( bcp.getPathComponents() ); }
[ "@", "Override", "public", "void", "reloadAllClasses", "(", ")", "throws", "ClassPathException", "{", "BshClassPath", "bcp", "=", "new", "BshClassPath", "(", "\"temp\"", ")", ";", "bcp", ".", "addComponent", "(", "baseClassPath", ")", ";", "bcp", ".", "addComp...
Overlay the entire path with a new class loader. Set the base path to the user path + base path. No point in including the boot class path (can't reload thos).
[ "Overlay", "the", "entire", "path", "with", "a", "new", "class", "loader", ".", "Set", "the", "base", "path", "to", "the", "user", "path", "+", "base", "path", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L344-L351
116,149
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.reloadClasses
@Override public void reloadClasses( String [] classNames ) throws ClassPathException { clearCaches(); // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassL...
java
@Override public void reloadClasses( String [] classNames ) throws ClassPathException { clearCaches(); // validate that it is a class here? // init base class loader if there is none... if ( baseLoader == null ) initBaseLoader(); DiscreteFilesClassL...
[ "@", "Override", "public", "void", "reloadClasses", "(", "String", "[", "]", "classNames", ")", "throws", "ClassPathException", "{", "clearCaches", "(", ")", ";", "// validate that it is a class here?", "// init base class loader if there is none...", "if", "(", "baseLoad...
Reloading classes means creating a new classloader and using it whenever we are asked for classes in the appropriate space. For this we use a DiscreteFilesClassLoader
[ "Reloading", "classes", "means", "creating", "a", "new", "classloader", "and", "using", "it", "whenever", "we", "are", "asked", "for", "classes", "in", "the", "appropriate", "space", ".", "For", "this", "we", "use", "a", "DiscreteFilesClassLoader" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L367-L421
116,150
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.getClassPath
public BshClassPath getClassPath() throws ClassPathException { if ( fullClassPath != null ) return fullClassPath; fullClassPath = new BshClassPath("BeanShell Full Class Path"); fullClassPath.addComponent( BshClassPath.getUserClassPath() ); try { fullClassPath...
java
public BshClassPath getClassPath() throws ClassPathException { if ( fullClassPath != null ) return fullClassPath; fullClassPath = new BshClassPath("BeanShell Full Class Path"); fullClassPath.addComponent( BshClassPath.getUserClassPath() ); try { fullClassPath...
[ "public", "BshClassPath", "getClassPath", "(", ")", "throws", "ClassPathException", "{", "if", "(", "fullClassPath", "!=", "null", ")", "return", "fullClassPath", ";", "fullClassPath", "=", "new", "BshClassPath", "(", "\"BeanShell Full Class Path\"", ")", ";", "full...
Get the full blown classpath.
[ "Get", "the", "full", "blown", "classpath", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L462-L477
116,151
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.classLoaderChanged
@Override protected void classLoaderChanged() { Vector toRemove = new Vector(); // safely remove for ( Enumeration e = listeners.elements(); e.hasMoreElements(); ) { WeakReference wr = (WeakReference)e.nextElement(); Listener l = (Listener)wr.get(); if...
java
@Override protected void classLoaderChanged() { Vector toRemove = new Vector(); // safely remove for ( Enumeration e = listeners.elements(); e.hasMoreElements(); ) { WeakReference wr = (WeakReference)e.nextElement(); Listener l = (Listener)wr.get(); if...
[ "@", "Override", "protected", "void", "classLoaderChanged", "(", ")", "{", "Vector", "toRemove", "=", "new", "Vector", "(", ")", ";", "// safely remove", "for", "(", "Enumeration", "e", "=", "listeners", ".", "elements", "(", ")", ";", "e", ".", "hasMoreEl...
Clear global class cache and notify namespaces to clear their class caches. The listener list is implemented with weak references so that we will not keep every namespace in existence forever.
[ "Clear", "global", "class", "cache", "and", "notify", "namespaces", "to", "clear", "their", "class", "caches", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L573-L588
116,152
beanshell/beanshell
src/main/java/bsh/CallStack.java
CallStack.get
public NameSpace get(int depth) { int size = stack.size(); if ( depth >= size ) return NameSpace.JAVACODE; return stack.toArray(new NameSpace[size])[size-1-depth]; }
java
public NameSpace get(int depth) { int size = stack.size(); if ( depth >= size ) return NameSpace.JAVACODE; return stack.toArray(new NameSpace[size])[size-1-depth]; }
[ "public", "NameSpace", "get", "(", "int", "depth", ")", "{", "int", "size", "=", "stack", ".", "size", "(", ")", ";", "if", "(", "depth", ">=", "size", ")", "return", "NameSpace", ".", "JAVACODE", ";", "return", "stack", ".", "toArray", "(", "new", ...
zero based.
[ "zero", "based", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CallStack.java#L80-L85
116,153
beanshell/beanshell
src/main/java/bsh/CallStack.java
CallStack.set
public synchronized void set(int depth, NameSpace ns) { stack.set( stack.size()-1-depth, ns ); }
java
public synchronized void set(int depth, NameSpace ns) { stack.set( stack.size()-1-depth, ns ); }
[ "public", "synchronized", "void", "set", "(", "int", "depth", ",", "NameSpace", "ns", ")", "{", "stack", ".", "set", "(", "stack", ".", "size", "(", ")", "-", "1", "-", "depth", ",", "ns", ")", ";", "}" ]
This is kind of crazy, but used by the setNameSpace command. zero based.
[ "This", "is", "kind", "of", "crazy", "but", "used", "by", "the", "setNameSpace", "command", ".", "zero", "based", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CallStack.java#L91-L93
116,154
beanshell/beanshell
src/main/java/bsh/CallStack.java
CallStack.swap
public NameSpace swap( NameSpace newTop ) { NameSpace oldTop = stack.pop(); stack.push(newTop); return oldTop; }
java
public NameSpace swap( NameSpace newTop ) { NameSpace oldTop = stack.pop(); stack.push(newTop); return oldTop; }
[ "public", "NameSpace", "swap", "(", "NameSpace", "newTop", ")", "{", "NameSpace", "oldTop", "=", "stack", ".", "pop", "(", ")", ";", "stack", ".", "push", "(", "newTop", ")", ";", "return", "oldTop", ";", "}" ]
Swap in the value as the new top of the stack and return the old value.
[ "Swap", "in", "the", "value", "as", "the", "new", "top", "of", "the", "stack", "and", "return", "the", "old", "value", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/CallStack.java#L107-L111
116,155
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/ClassWriter.java
ClassWriter.replaceAsmInstructions
private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) { Attribute[] attributes = getAttributePrototypes(); firstField = null; lastField = null; firstMethod = null; lastMethod = null; firstAttribute = null; compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_F...
java
private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasFrames) { Attribute[] attributes = getAttributePrototypes(); firstField = null; lastField = null; firstMethod = null; lastMethod = null; firstAttribute = null; compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_F...
[ "private", "byte", "[", "]", "replaceAsmInstructions", "(", "final", "byte", "[", "]", "classFile", ",", "final", "boolean", "hasFrames", ")", "{", "Attribute", "[", "]", "attributes", "=", "getAttributePrototypes", "(", ")", ";", "firstField", "=", "null", ...
Returns the equivalent of the given class file, with the ASM specific instructions replaced with standard ones. This is done with a ClassReader -&gt; ClassWriter round trip. @param classFile a class file containing ASM specific instructions, generated by this ClassWriter. @param hasFrames whether there is at least one...
[ "Returns", "the", "equivalent", "of", "the", "given", "class", "file", "with", "the", "ASM", "specific", "instructions", "replaced", "with", "standard", "ones", ".", "This", "is", "done", "with", "a", "ClassReader", "-", "&gt", ";", "ClassWriter", "round", "...
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/ClassWriter.java#L493-L502
116,156
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.setShutdownOnExit
public static void setShutdownOnExit(final boolean value) { try { SYSTEM_OBJECT.getNameSpace().setVariable("shutdownOnExit", Boolean.valueOf(value), false); } catch (final UtilEvalError utilEvalError) { throw new IllegalStateException(utilEvalError); } }
java
public static void setShutdownOnExit(final boolean value) { try { SYSTEM_OBJECT.getNameSpace().setVariable("shutdownOnExit", Boolean.valueOf(value), false); } catch (final UtilEvalError utilEvalError) { throw new IllegalStateException(utilEvalError); } }
[ "public", "static", "void", "setShutdownOnExit", "(", "final", "boolean", "value", ")", "{", "try", "{", "SYSTEM_OBJECT", ".", "getNameSpace", "(", ")", ".", "setVariable", "(", "\"shutdownOnExit\"", ",", "Boolean", ".", "valueOf", "(", "value", ")", ",", "f...
Shared system object visible under bsh.system
[ "Shared", "system", "object", "visible", "under", "bsh", ".", "system" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L126-L132
116,157
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.main
public static void main( String [] args ) { if ( args.length > 0 ) { String filename = args[0]; String [] bshArgs; if ( args.length > 1 ) { bshArgs = new String [ args.length -1 ]; System.arraycopy( args, 1, bshArgs, 0, args.length-1 ); ...
java
public static void main( String [] args ) { if ( args.length > 0 ) { String filename = args[0]; String [] bshArgs; if ( args.length > 1 ) { bshArgs = new String [ args.length -1 ]; System.arraycopy( args, 1, bshArgs, 0, args.length-1 ); ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", ">", "0", ")", "{", "String", "filename", "=", "args", "[", "0", "]", ";", "String", "[", "]", "bshArgs", ";", "if", "(", "args", "...
Run the text only interpreter on the command line or specify a file.
[ "Run", "the", "text", "only", "interpreter", "on", "the", "command", "line", "or", "specify", "a", "file", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L373-L420
116,158
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.source
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); Interpreter.debug("Sourcing file: ", file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { ...
java
public Object source( String filename, NameSpace nameSpace ) throws FileNotFoundException, IOException, EvalError { File file = pathToFile( filename ); Interpreter.debug("Sourcing file: ", file); Reader sourceIn = new BufferedReader( new FileReader(file) ); try { ...
[ "public", "Object", "source", "(", "String", "filename", ",", "NameSpace", "nameSpace", ")", "throws", "FileNotFoundException", ",", "IOException", ",", "EvalError", "{", "File", "file", "=", "pathToFile", "(", "filename", ")", ";", "Interpreter", ".", "debug", ...
Read text from fileName and eval it.
[ "Read", "text", "from", "fileName", "and", "eval", "it", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L563-L574
116,159
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.source
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
java
public Object source( String filename ) throws FileNotFoundException, IOException, EvalError { return source( filename, globalNameSpace ); }
[ "public", "Object", "source", "(", "String", "filename", ")", "throws", "FileNotFoundException", ",", "IOException", ",", "EvalError", "{", "return", "source", "(", "filename", ",", "globalNameSpace", ")", ";", "}" ]
Read text from fileName and eval it. Convenience method. Use the global namespace.
[ "Read", "text", "from", "fileName", "and", "eval", "it", ".", "Convenience", "method", ".", "Use", "the", "global", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L580-L584
116,160
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.eval
public Object eval( Reader in ) throws EvalError { return eval( in, globalNameSpace, null == sourceFileInfo ? "eval stream" : sourceFileInfo ); }
java
public Object eval( Reader in ) throws EvalError { return eval( in, globalNameSpace, null == sourceFileInfo ? "eval stream" : sourceFileInfo ); }
[ "public", "Object", "eval", "(", "Reader", "in", ")", "throws", "EvalError", "{", "return", "eval", "(", "in", ",", "globalNameSpace", ",", "null", "==", "sourceFileInfo", "?", "\"eval stream\"", ":", "sourceFileInfo", ")", ";", "}" ]
Evaluate the inputstream in this interpreter's global namespace.
[ "Evaluate", "the", "inputstream", "in", "this", "interpreter", "s", "global", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L700-L703
116,161
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.eval
public Object eval( String statements ) throws EvalError { Interpreter.debug("eval(String): ", statements); return eval(statements, globalNameSpace); }
java
public Object eval( String statements ) throws EvalError { Interpreter.debug("eval(String): ", statements); return eval(statements, globalNameSpace); }
[ "public", "Object", "eval", "(", "String", "statements", ")", "throws", "EvalError", "{", "Interpreter", ".", "debug", "(", "\"eval(String): \"", ",", "statements", ")", ";", "return", "eval", "(", "statements", ",", "globalNameSpace", ")", ";", "}" ]
Evaluate the string in this interpreter's global namespace.
[ "Evaluate", "the", "string", "in", "this", "interpreter", "s", "global", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L708-L711
116,162
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.eval
public Object eval( String statements, NameSpace nameSpace ) throws EvalError { String s = ( statements.endsWith(";") ? statements : statements+";" ); return eval( new StringReader(s), nameSpace, "inline evaluation of: ``"+ showEvalString(s)+"''" ); }
java
public Object eval( String statements, NameSpace nameSpace ) throws EvalError { String s = ( statements.endsWith(";") ? statements : statements+";" ); return eval( new StringReader(s), nameSpace, "inline evaluation of: ``"+ showEvalString(s)+"''" ); }
[ "public", "Object", "eval", "(", "String", "statements", ",", "NameSpace", "nameSpace", ")", "throws", "EvalError", "{", "String", "s", "=", "(", "statements", ".", "endsWith", "(", "\";\"", ")", "?", "statements", ":", "statements", "+", "\";\"", ")", ";"...
Evaluate the string in the specified namespace.
[ "Evaluate", "the", "string", "in", "the", "specified", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L716-L723
116,163
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.debug
public final static void debug(Object... msg) { if ( DEBUG.get() ) { StringBuilder sb = new StringBuilder(); for ( Object m : msg ) sb.append(m); Console.debug.println("// Debug: " + sb.toString()); } }
java
public final static void debug(Object... msg) { if ( DEBUG.get() ) { StringBuilder sb = new StringBuilder(); for ( Object m : msg ) sb.append(m); Console.debug.println("// Debug: " + sb.toString()); } }
[ "public", "final", "static", "void", "debug", "(", "Object", "...", "msg", ")", "{", "if", "(", "DEBUG", ".", "get", "(", ")", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Object", "m", ":", "msg", ")", ...
Print a debug message on debug stream associated with this interpreter only if debugging is turned on.
[ "Print", "a", "debug", "message", "on", "debug", "stream", "associated", "with", "this", "interpreter", "only", "if", "debugging", "is", "turned", "on", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L751-L759
116,164
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.getu
Object getu( String name ) { try { return get( name ); } catch ( EvalError e ) { throw new InterpreterError("set: "+e, e); } }
java
Object getu( String name ) { try { return get( name ); } catch ( EvalError e ) { throw new InterpreterError("set: "+e, e); } }
[ "Object", "getu", "(", "String", "name", ")", "{", "try", "{", "return", "get", "(", "name", ")", ";", "}", "catch", "(", "EvalError", "e", ")", "{", "throw", "new", "InterpreterError", "(", "\"set: \"", "+", "e", ",", "e", ")", ";", "}", "}" ]
Unchecked get for internal use
[ "Unchecked", "get", "for", "internal", "use" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L782-L788
116,165
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.setu
void setu(String name, Object value) { try { set(name, value); } catch ( EvalError e ) { throw new InterpreterError("set: "+e, e); } }
java
void setu(String name, Object value) { try { set(name, value); } catch ( EvalError e ) { throw new InterpreterError("set: "+e, e); } }
[ "void", "setu", "(", "String", "name", ",", "Object", "value", ")", "{", "try", "{", "set", "(", "name", ",", "value", ")", ";", "}", "catch", "(", "EvalError", "e", ")", "{", "throw", "new", "InterpreterError", "(", "\"set: \"", "+", "e", ",", "e"...
Unchecked set for internal use
[ "Unchecked", "set", "for", "internal", "use" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L818-L824
116,166
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.unset
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS(...
java
public void unset( String name ) throws EvalError { /* We jump through some hoops here to handle arbitrary cases like unset("bsh.foo"); */ CallStack callstack = new CallStack(); try { LHS lhs = globalNameSpace.getNameResolver( name ).toLHS(...
[ "public", "void", "unset", "(", "String", "name", ")", "throws", "EvalError", "{", "/*\n We jump through some hoops here to handle arbitrary cases like\n unset(\"bsh.foo\");\n */", "CallStack", "callstack", "=", "new", "CallStack", "(", ")", ";", "t...
Unassign the variable name. Name should evaluate to a variable.
[ "Unassign", "the", "variable", "name", ".", "Name", "should", "evaluate", "to", "a", "variable", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L846-L867
116,167
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.readLine
private boolean readLine() throws ParseException { try { return parser.Line(); } catch (ParseException e) { yield(); if ( EOF ) return true; throw e; } }
java
private boolean readLine() throws ParseException { try { return parser.Line(); } catch (ParseException e) { yield(); if ( EOF ) return true; throw e; } }
[ "private", "boolean", "readLine", "(", ")", "throws", "ParseException", "{", "try", "{", "return", "parser", ".", "Line", "(", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "yield", "(", ")", ";", "if", "(", "EOF", ")", "return", "tru...
Blocking call to read a line from the parser. @return true on EOF or false @throws ParseException on parser exception
[ "Blocking", "call", "to", "read", "a", "line", "from", "the", "parser", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L935-L944
116,168
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.pathToFile
public File pathToFile( String fileName ) throws IOException { String cwd = (String)getu("bsh.cwd"); File file = new File( fileName ); // if relative, fix up to bsh.cwd if ( !file.isAbsolute() ) { file = new File( cwd + File.separator + fileName ); } ...
java
public File pathToFile( String fileName ) throws IOException { String cwd = (String)getu("bsh.cwd"); File file = new File( fileName ); // if relative, fix up to bsh.cwd if ( !file.isAbsolute() ) { file = new File( cwd + File.separator + fileName ); } ...
[ "public", "File", "pathToFile", "(", "String", "fileName", ")", "throws", "IOException", "{", "String", "cwd", "=", "(", "String", ")", "getu", "(", "\"bsh.cwd\"", ")", ";", "File", "file", "=", "new", "File", "(", "fileName", ")", ";", "// if relative, fi...
Localize a path to the file name based on the bsh.cwd interpreter working directory.
[ "Localize", "a", "path", "to", "the", "file", "name", "based", "on", "the", "bsh", ".", "cwd", "interpreter", "working", "directory", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L982-L994
116,169
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.readObject
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields setOut( System.out ); setErr( System.err ); }
java
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); // set transient fields setOut( System.out ); setErr( System.err ); }
[ "private", "void", "readObject", "(", "ObjectInputStream", "stream", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "stream", ".", "defaultReadObject", "(", ")", ";", "// set transient fields", "setOut", "(", "System", ".", "out", ")", ";", "set...
De-serialization setup. Default out and err streams to stdout, stderr if they are null.
[ "De", "-", "serialization", "setup", ".", "Default", "out", "and", "err", "streams", "to", "stdout", "stderr", "if", "they", "are", "null", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L1120-L1128
116,170
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.addComponent
public void addComponent( BshClassPath bcp ) { if (bcp == null) return; if ( compPaths == null ) compPaths = new ArrayList(); compPaths.add( bcp ); bcp.addListener( this ); }
java
public void addComponent( BshClassPath bcp ) { if (bcp == null) return; if ( compPaths == null ) compPaths = new ArrayList(); compPaths.add( bcp ); bcp.addListener( this ); }
[ "public", "void", "addComponent", "(", "BshClassPath", "bcp", ")", "{", "if", "(", "bcp", "==", "null", ")", "return", ";", "if", "(", "compPaths", "==", "null", ")", "compPaths", "=", "new", "ArrayList", "(", ")", ";", "compPaths", ".", "add", "(", ...
Add the specified BshClassPath as a component of our path. Changes in the bcp will be reflected through us.
[ "Add", "the", "specified", "BshClassPath", "as", "a", "component", "of", "our", "path", ".", "Changes", "in", "the", "bcp", "will", "be", "reflected", "through", "us", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L129-L136
116,171
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.getClassesForPackage
synchronized public Set getClassesForPackage( String pack ) { insureInitialized(); Set set = new HashSet(); Collection c = (Collection)packageMap.get( pack ); if ( c != null ) set.addAll( c ); if ( compPaths != null ) for (int i=0; i<compPaths.size(); i++...
java
synchronized public Set getClassesForPackage( String pack ) { insureInitialized(); Set set = new HashSet(); Collection c = (Collection)packageMap.get( pack ); if ( c != null ) set.addAll( c ); if ( compPaths != null ) for (int i=0; i<compPaths.size(); i++...
[ "synchronized", "public", "Set", "getClassesForPackage", "(", "String", "pack", ")", "{", "insureInitialized", "(", ")", ";", "Set", "set", "=", "new", "HashSet", "(", ")", ";", "Collection", "c", "=", "(", "Collection", ")", "packageMap", ".", "get", "(",...
Return the set of class names in the specified package including all component paths.
[ "Return", "the", "set", "of", "class", "names", "in", "the", "specified", "package", "including", "all", "component", "paths", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L165-L180
116,172
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.getClassSource
synchronized public ClassSource getClassSource( String className ) { // Before triggering classpath mapping (initialization) check for // explicitly set class sources (e.g. generated classes). These would // take priority over any found in the classpath anyway. ClassSource cs = (Cla...
java
synchronized public ClassSource getClassSource( String className ) { // Before triggering classpath mapping (initialization) check for // explicitly set class sources (e.g. generated classes). These would // take priority over any found in the classpath anyway. ClassSource cs = (Cla...
[ "synchronized", "public", "ClassSource", "getClassSource", "(", "String", "className", ")", "{", "// Before triggering classpath mapping (initialization) check for", "// explicitly set class sources (e.g. generated classes). These would", "// take priority over any found in the classpath anyw...
Return the source of the specified class which may lie in component path.
[ "Return", "the", "source", "of", "the", "specified", "class", "which", "may", "lie", "in", "component", "path", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L186-L428
116,173
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.clearCachedStructures
synchronized private void clearCachedStructures() { mapsInitialized = false; packageMap = new HashMap(); classSource = new HashMap(); unqNameTable = null; nameSpaceChanged(); }
java
synchronized private void clearCachedStructures() { mapsInitialized = false; packageMap = new HashMap(); classSource = new HashMap(); unqNameTable = null; nameSpaceChanged(); }
[ "synchronized", "private", "void", "clearCachedStructures", "(", ")", "{", "mapsInitialized", "=", "false", ";", "packageMap", "=", "new", "HashMap", "(", ")", ";", "classSource", "=", "new", "HashMap", "(", ")", ";", "unqNameTable", "=", "null", ";", "nameS...
Clear anything cached. All will be reconstructed as necessary.
[ "Clear", "anything", "cached", ".", "All", "will", "be", "reconstructed", "as", "necessary", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L442-L448
116,174
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.traverseDirForClasses
static String [] traverseDirForClasses( File dir ) throws IOException { List list = traverseDirForClassesAux( dir, dir ); return (String[])list.toArray( new String[0] ); }
java
static String [] traverseDirForClasses( File dir ) throws IOException { List list = traverseDirForClassesAux( dir, dir ); return (String[])list.toArray( new String[0] ); }
[ "static", "String", "[", "]", "traverseDirForClasses", "(", "File", "dir", ")", "throws", "IOException", "{", "List", "list", "=", "traverseDirForClassesAux", "(", "dir", ",", "dir", ")", ";", "return", "(", "String", "[", "]", ")", "list", ".", "toArray",...
Begin Static stuff
[ "Begin", "Static", "stuff" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L466-L471
116,175
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.searchJrtFSForClasses
static String [] searchJrtFSForClasses( URL url ) throws IOException { try { Path path = FileSystems.getFileSystem(new URI("jrt:/")).getPath("modules", url.getPath()); return Files.walk(path).map(Path::toString) .filter(BshClassPath::isClassFileName) ...
java
static String [] searchJrtFSForClasses( URL url ) throws IOException { try { Path path = FileSystems.getFileSystem(new URI("jrt:/")).getPath("modules", url.getPath()); return Files.walk(path).map(Path::toString) .filter(BshClassPath::isClassFileName) ...
[ "static", "String", "[", "]", "searchJrtFSForClasses", "(", "URL", "url", ")", "throws", "IOException", "{", "try", "{", "Path", "path", "=", "FileSystems", ".", "getFileSystem", "(", "new", "URI", "(", "\"jrt:/\"", ")", ")", ".", "getPath", "(", "\"module...
Search jrt file system for module classes. @param the jrt: file system url @return array of class names found @throws IOException
[ "Search", "jrt", "file", "system", "for", "module", "classes", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L512-L522
116,176
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.searchJarFSForClasses
static String [] searchJarFSForClasses( URL url ) throws IOException { try { try { FileSystems.newFileSystem(url.toURI(), new HashMap<>()); } catch (FileSystemAlreadyExistsException e) { /* ignore */ } Path path = FileSystems.getFileSystem(url.toURI()).getPat...
java
static String [] searchJarFSForClasses( URL url ) throws IOException { try { try { FileSystems.newFileSystem(url.toURI(), new HashMap<>()); } catch (FileSystemAlreadyExistsException e) { /* ignore */ } Path path = FileSystems.getFileSystem(url.toURI()).getPat...
[ "static", "String", "[", "]", "searchJarFSForClasses", "(", "URL", "url", ")", "throws", "IOException", "{", "try", "{", "try", "{", "FileSystems", ".", "newFileSystem", "(", "url", ".", "toURI", "(", ")", ",", "new", "HashMap", "<>", "(", ")", ")", ";...
Search jar file system for classes. @param the jar: file system url @return array of class names found @throws IOException
[ "Search", "jar", "file", "system", "for", "classes", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L528-L542
116,177
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.searchArchiveForClasses
static String [] searchArchiveForClasses( URL url ) throws IOException { List<String> list = new ArrayList<>(); ZipInputStream zip = new ZipInputStream(url.openStream()); ZipEntry ze; while( zip.available() == 1 ) if ( (ze = zip.getNextEntry()) != null &&...
java
static String [] searchArchiveForClasses( URL url ) throws IOException { List<String> list = new ArrayList<>(); ZipInputStream zip = new ZipInputStream(url.openStream()); ZipEntry ze; while( zip.available() == 1 ) if ( (ze = zip.getNextEntry()) != null &&...
[ "static", "String", "[", "]", "searchArchiveForClasses", "(", "URL", "url", ")", "throws", "IOException", "{", "List", "<", "String", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "ZipInputStream", "zip", "=", "new", "ZipInputStream", "(", "ur...
Search Archive for classes. @param the archive file location @return array of class names found @throws IOException
[ "Search", "Archive", "for", "classes", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L548-L560
116,178
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.splitClassname
public static String [] splitClassname ( String classname ) { classname = canonicalizeClassName( classname ); int i=classname.lastIndexOf("."); String classn, packn; if ( i == -1 ) { // top level class classn = classname; packn="<unpackaged>"; ...
java
public static String [] splitClassname ( String classname ) { classname = canonicalizeClassName( classname ); int i=classname.lastIndexOf("."); String classn, packn; if ( i == -1 ) { // top level class classn = classname; packn="<unpackaged>"; ...
[ "public", "static", "String", "[", "]", "splitClassname", "(", "String", "classname", ")", "{", "classname", "=", "canonicalizeClassName", "(", "classname", ")", ";", "int", "i", "=", "classname", ".", "lastIndexOf", "(", "\".\"", ")", ";", "String", "classn...
Split class name into package and name
[ "Split", "class", "name", "into", "package", "and", "name" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L598-L612
116,179
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.removeInnerClassNames
public static Collection removeInnerClassNames( Collection col ) { List list = new ArrayList(); list.addAll(col); Iterator it = list.iterator(); while(it.hasNext()) { String name =(String)it.next(); if (name.indexOf("$") != -1 ) it.remove(); ...
java
public static Collection removeInnerClassNames( Collection col ) { List list = new ArrayList(); list.addAll(col); Iterator it = list.iterator(); while(it.hasNext()) { String name =(String)it.next(); if (name.indexOf("$") != -1 ) it.remove(); ...
[ "public", "static", "Collection", "removeInnerClassNames", "(", "Collection", "col", ")", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "list", ".", "addAll", "(", "col", ")", ";", "Iterator", "it", "=", "list", ".", "iterator", "(", ")", ...
Return a new collection without any inner class names
[ "Return", "a", "new", "collection", "without", "any", "inner", "class", "names" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L617-L627
116,180
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.getPackagesSet
public Set getPackagesSet() { insureInitialized(); Set set = new HashSet(); set.addAll( packageMap.keySet() ); if ( compPaths != null ) for (int i=0; i<compPaths.size(); i++) set.addAll( ((BshClassPath)compPaths.get(i)).packageMap.keyS...
java
public Set getPackagesSet() { insureInitialized(); Set set = new HashSet(); set.addAll( packageMap.keySet() ); if ( compPaths != null ) for (int i=0; i<compPaths.size(); i++) set.addAll( ((BshClassPath)compPaths.get(i)).packageMap.keyS...
[ "public", "Set", "getPackagesSet", "(", ")", "{", "insureInitialized", "(", ")", ";", "Set", "set", "=", "new", "HashSet", "(", ")", ";", "set", ".", "addAll", "(", "packageMap", ".", "keySet", "(", ")", ")", ";", "if", "(", "compPaths", "!=", "null"...
Get a list of all of the known packages
[ "Get", "a", "list", "of", "all", "of", "the", "known", "packages" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L663-L674
116,181
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.nameSpaceChanged
void nameSpaceChanged() { if ( nameSourceListeners == null ) return; for(int i=0; i<nameSourceListeners.size(); i++) ((NameSource.Listener)(nameSourceListeners.get(i))) .nameSourceChanged( this ); }
java
void nameSpaceChanged() { if ( nameSourceListeners == null ) return; for(int i=0; i<nameSourceListeners.size(); i++) ((NameSource.Listener)(nameSourceListeners.get(i))) .nameSourceChanged( this ); }
[ "void", "nameSpaceChanged", "(", ")", "{", "if", "(", "nameSourceListeners", "==", "null", ")", "return", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nameSourceListeners", ".", "size", "(", ")", ";", "i", "++", ")", "", "(", "(", "NameSo...
Fire the NameSourceListeners
[ "Fire", "the", "NameSourceListeners" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L869-L877
116,182
beanshell/beanshell
src/main/java/bsh/classpath/BshClassPath.java
BshClassPath.addNameSourceListener
public void addNameSourceListener( NameSource.Listener listener ) { if ( nameSourceListeners == null ) nameSourceListeners = new ArrayList(); nameSourceListeners.add( listener ); }
java
public void addNameSourceListener( NameSource.Listener listener ) { if ( nameSourceListeners == null ) nameSourceListeners = new ArrayList(); nameSourceListeners.add( listener ); }
[ "public", "void", "addNameSourceListener", "(", "NameSource", ".", "Listener", "listener", ")", "{", "if", "(", "nameSourceListeners", "==", "null", ")", "nameSourceListeners", "=", "new", "ArrayList", "(", ")", ";", "nameSourceListeners", ".", "add", "(", "list...
Implements NameSource Add a listener who is notified upon changes to names in this space.
[ "Implements", "NameSource", "Add", "a", "listener", "who", "is", "notified", "upon", "changes", "to", "names", "in", "this", "space", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/BshClassPath.java#L884-L888
116,183
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getClassInstance
Object getClassInstance() throws UtilEvalError { if (this.classInstance != null) return this.classInstance; if (this.classStatic != null // || (getParent()!=null && getParent().classStatic != null) ) throw new UtilEvalError( "Can't refer to clas...
java
Object getClassInstance() throws UtilEvalError { if (this.classInstance != null) return this.classInstance; if (this.classStatic != null // || (getParent()!=null && getParent().classStatic != null) ) throw new UtilEvalError( "Can't refer to clas...
[ "Object", "getClassInstance", "(", ")", "throws", "UtilEvalError", "{", "if", "(", "this", ".", "classInstance", "!=", "null", ")", "return", "this", ".", "classInstance", ";", "if", "(", "this", ".", "classStatic", "!=", "null", "// || (getParent()!=null && get...
Gets the class instance. @return the class instance @throws UtilEvalError the util eval error
[ "Gets", "the", "class", "instance", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L133-L144
116,184
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.get
public Object get(final String name, final Interpreter interpreter) throws UtilEvalError { final CallStack callstack = new CallStack(this); return this.getNameResolver(name).toObject(callstack, interpreter); }
java
public Object get(final String name, final Interpreter interpreter) throws UtilEvalError { final CallStack callstack = new CallStack(this); return this.getNameResolver(name).toObject(callstack, interpreter); }
[ "public", "Object", "get", "(", "final", "String", "name", ",", "final", "Interpreter", "interpreter", ")", "throws", "UtilEvalError", "{", "final", "CallStack", "callstack", "=", "new", "CallStack", "(", "this", ")", ";", "return", "this", ".", "getNameResolv...
Resolve name to an object through this namespace. @param name the name @param interpreter the interpreter @return the object @throws UtilEvalError the util eval error
[ "Resolve", "name", "to", "an", "object", "through", "this", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L218-L222
116,185
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.setLocalVariable
public Variable setLocalVariable(final String name, final Object value, final boolean strictJava) throws UtilEvalError { return this.setVariable(name, value, strictJava, false/* recurse */); }
java
public Variable setLocalVariable(final String name, final Object value, final boolean strictJava) throws UtilEvalError { return this.setVariable(name, value, strictJava, false/* recurse */); }
[ "public", "Variable", "setLocalVariable", "(", "final", "String", "name", ",", "final", "Object", "value", ",", "final", "boolean", "strictJava", ")", "throws", "UtilEvalError", "{", "return", "this", ".", "setVariable", "(", "name", ",", "value", ",", "strict...
Set a variable explicitly in the local scope. @param name the name @param value the value @param strictJava the strict java @return the variable @throws UtilEvalError the util eval error
[ "Set", "a", "variable", "explicitly", "in", "the", "local", "scope", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L249-L252
116,186
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.isChildOf
public boolean isChildOf(NameSpace parent) { return null != this.getParent() && ( this.getParent().equals(parent) || this.getParent().isChildOf(parent)); }
java
public boolean isChildOf(NameSpace parent) { return null != this.getParent() && ( this.getParent().equals(parent) || this.getParent().isChildOf(parent)); }
[ "public", "boolean", "isChildOf", "(", "NameSpace", "parent", ")", "{", "return", "null", "!=", "this", ".", "getParent", "(", ")", "&&", "(", "this", ".", "getParent", "(", ")", ".", "equals", "(", "parent", ")", "||", "this", ".", "getParent", "(", ...
Check if this namespace is a child of the given namespace. @param parent the possible parent @return true if this is child of parent
[ "Check", "if", "this", "namespace", "is", "a", "child", "of", "the", "given", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L475-L479
116,187
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getSuper
public This getSuper(final Interpreter declaringInterpreter) { if (this.parent != null) return this.parent.getThis(declaringInterpreter); else return this.getThis(declaringInterpreter); }
java
public This getSuper(final Interpreter declaringInterpreter) { if (this.parent != null) return this.parent.getThis(declaringInterpreter); else return this.getThis(declaringInterpreter); }
[ "public", "This", "getSuper", "(", "final", "Interpreter", "declaringInterpreter", ")", "{", "if", "(", "this", ".", "parent", "!=", "null", ")", "return", "this", ".", "parent", ".", "getThis", "(", "declaringInterpreter", ")", ";", "else", "return", "this"...
Get the parent namespace' This reference or this namespace' This reference if we are the top. @param declaringInterpreter the declaring interpreter @return the super
[ "Get", "the", "parent", "namespace", "This", "reference", "or", "this", "namespace", "This", "reference", "if", "we", "are", "the", "top", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L485-L490
116,188
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getClassManager
public BshClassManager getClassManager() { if (this.classManager != null) return this.classManager; if (this.parent != null && this.parent != JAVACODE) return this.parent.getClassManager(); this.setClassManager(BshClassManager .createClassManager(null/* in...
java
public BshClassManager getClassManager() { if (this.classManager != null) return this.classManager; if (this.parent != null && this.parent != JAVACODE) return this.parent.getClassManager(); this.setClassManager(BshClassManager .createClassManager(null/* in...
[ "public", "BshClassManager", "getClassManager", "(", ")", "{", "if", "(", "this", ".", "classManager", "!=", "null", ")", "return", "this", ".", "classManager", ";", "if", "(", "this", ".", "parent", "!=", "null", "&&", "this", ".", "parent", "!=", "JAVA...
Gets the class manager. @return the class manager
[ "Gets", "the", "class", "manager", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L536-L545
116,189
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getVariable
public Object getVariable(final String name, final boolean recurse) throws UtilEvalError { final Variable var = this.getVariableImpl(name, recurse); return this.unwrapVariable(var); }
java
public Object getVariable(final String name, final boolean recurse) throws UtilEvalError { final Variable var = this.getVariableImpl(name, recurse); return this.unwrapVariable(var); }
[ "public", "Object", "getVariable", "(", "final", "String", "name", ",", "final", "boolean", "recurse", ")", "throws", "UtilEvalError", "{", "final", "Variable", "var", "=", "this", ".", "getVariableImpl", "(", "name", ",", "recurse", ")", ";", "return", "thi...
Get the specified variable in this namespace. @param name the name @param recurse If recurse is true then we recursively search through parent namespaces for the variable. <p> Note: this method is primarily intended for use internally. If you use this method outside of the bsh package you will have to use Primitive.unw...
[ "Get", "the", "specified", "variable", "in", "this", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L613-L617
116,190
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.setTypedVariable
@Deprecated public void setTypedVariable(final String name, final Class<?> type, final Object value, final boolean isFinal) throws UtilEvalError { final Modifiers modifiers = new Modifiers(Modifiers.FIELD); if (isFinal) modifiers.addModifier("final"); this.setTypedVar...
java
@Deprecated public void setTypedVariable(final String name, final Class<?> type, final Object value, final boolean isFinal) throws UtilEvalError { final Modifiers modifiers = new Modifiers(Modifiers.FIELD); if (isFinal) modifiers.addModifier("final"); this.setTypedVar...
[ "@", "Deprecated", "public", "void", "setTypedVariable", "(", "final", "String", "name", ",", "final", "Class", "<", "?", ">", "type", ",", "final", "Object", "value", ",", "final", "boolean", "isFinal", ")", "throws", "UtilEvalError", "{", "final", "Modifie...
Sets the typed variable. @param name the name @param type the type @param value the value @param isFinal the is final @throws UtilEvalError the util eval error @deprecated See #setTypedVariable(String, Class, Object, Modifiers)
[ "Sets", "the", "typed", "variable", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L667-L674
116,191
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.setMethod
public void setMethod(BshMethod method) { String name = method.getName(); if (!this.methods.containsKey(name)) this.methods.put(name, new ArrayList<BshMethod>(1)); this.methods.get(name).remove(method); this.methods.get(name).add(0, method); }
java
public void setMethod(BshMethod method) { String name = method.getName(); if (!this.methods.containsKey(name)) this.methods.put(name, new ArrayList<BshMethod>(1)); this.methods.get(name).remove(method); this.methods.get(name).add(0, method); }
[ "public", "void", "setMethod", "(", "BshMethod", "method", ")", "{", "String", "name", "=", "method", ".", "getName", "(", ")", ";", "if", "(", "!", "this", ".", "methods", ".", "containsKey", "(", "name", ")", ")", "this", ".", "methods", ".", "put"...
Dissallow static vars outside of a class. @param name is here just to allow the error message to use it protected void checkVariableModifiers(String name, Modifiers modifiers) throws UtilEvalError { if (modifiers!=null && modifiers.hasModifier("static")) throw new UtilEvalError("Can't declare static variable outside of...
[ "Dissallow", "static", "vars", "outside", "of", "a", "class", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L733-L739
116,192
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getMethod
public BshMethod getMethod(final String name, final Class<?>[] sig) throws UtilEvalError { return this.getMethod(name, sig, false/* declaredOnly */); }
java
public BshMethod getMethod(final String name, final Class<?>[] sig) throws UtilEvalError { return this.getMethod(name, sig, false/* declaredOnly */); }
[ "public", "BshMethod", "getMethod", "(", "final", "String", "name", ",", "final", "Class", "<", "?", ">", "[", "]", "sig", ")", "throws", "UtilEvalError", "{", "return", "this", ".", "getMethod", "(", "name", ",", "sig", ",", "false", "/* declaredOnly */",...
Gets the method. @param name the name @param sig the sig @return the method @throws UtilEvalError the util eval error @see #getMethod(String, Class [], boolean) @see #getMethod(String, Class [])
[ "Gets", "the", "method", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L748-L751
116,193
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.importClass
public void importClass(final String name) { this.importedClasses.put(Name.suffix(name, 1), name); this.nameSpaceChanged(); }
java
public void importClass(final String name) { this.importedClasses.put(Name.suffix(name, 1), name); this.nameSpaceChanged(); }
[ "public", "void", "importClass", "(", "final", "String", "name", ")", "{", "this", ".", "importedClasses", ".", "put", "(", "Name", ".", "suffix", "(", "name", ",", "1", ")", ",", "name", ")", ";", "this", ".", "nameSpaceChanged", "(", ")", ";", "}" ...
Import a class name. Subsequent imports override earlier ones @param name the name
[ "Import", "a", "class", "name", ".", "Subsequent", "imports", "override", "earlier", "ones" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L793-L796
116,194
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.importPackage
public void importPackage(final String name) { this.importedPackages.remove(name); this.importedPackages.add(0, name); this.nameSpaceChanged(); }
java
public void importPackage(final String name) { this.importedPackages.remove(name); this.importedPackages.add(0, name); this.nameSpaceChanged(); }
[ "public", "void", "importPackage", "(", "final", "String", "name", ")", "{", "this", ".", "importedPackages", ".", "remove", "(", "name", ")", ";", "this", ".", "importedPackages", ".", "add", "(", "0", ",", "name", ")", ";", "this", ".", "nameSpaceChang...
subsequent imports override earlier ones. @param name the name
[ "subsequent", "imports", "override", "earlier", "ones", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L800-L804
116,195
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getImportedMethod
protected BshMethod getImportedMethod(final String name, final Class<?>[] sig) throws UtilEvalError { // Try object imports for (final Object object : this.importedObjects) { final Invocable method = Reflect.resolveJavaMethod( object.getClass(), name, sig, fals...
java
protected BshMethod getImportedMethod(final String name, final Class<?>[] sig) throws UtilEvalError { // Try object imports for (final Object object : this.importedObjects) { final Invocable method = Reflect.resolveJavaMethod( object.getClass(), name, sig, fals...
[ "protected", "BshMethod", "getImportedMethod", "(", "final", "String", "name", ",", "final", "Class", "<", "?", ">", "[", "]", "sig", ")", "throws", "UtilEvalError", "{", "// Try object imports", "for", "(", "final", "Object", "object", ":", "this", ".", "im...
Gets the imported method. @param name the name @param sig the sig @return the imported method @throws UtilEvalError the util eval error
[ "Gets", "the", "imported", "method", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L888-L905
116,196
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getImportedVar
protected Variable getImportedVar(final String name) throws UtilEvalError { Variable var = null; // Try object imports for (final Object object : this.importedObjects) { final Invocable field = Reflect.resolveJavaField(object.getClass(), name, false/* onlyStatic *...
java
protected Variable getImportedVar(final String name) throws UtilEvalError { Variable var = null; // Try object imports for (final Object object : this.importedObjects) { final Invocable field = Reflect.resolveJavaField(object.getClass(), name, false/* onlyStatic *...
[ "protected", "Variable", "getImportedVar", "(", "final", "String", "name", ")", "throws", "UtilEvalError", "{", "Variable", "var", "=", "null", ";", "// Try object imports", "for", "(", "final", "Object", "object", ":", "this", ".", "importedObjects", ")", "{", ...
Gets the imported var. @param name the name @return the imported var @throws UtilEvalError the util eval error
[ "Gets", "the", "imported", "var", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L911-L945
116,197
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.loadScriptedCommand
private BshMethod loadScriptedCommand(final InputStream in, final String name, final Class<?>[] argTypes, final String resourcePath, final Interpreter interpreter) throws UtilEvalError { try (FileReader reader = new FileReader(in)) { interpreter.eval(reader, this,...
java
private BshMethod loadScriptedCommand(final InputStream in, final String name, final Class<?>[] argTypes, final String resourcePath, final Interpreter interpreter) throws UtilEvalError { try (FileReader reader = new FileReader(in)) { interpreter.eval(reader, this,...
[ "private", "BshMethod", "loadScriptedCommand", "(", "final", "InputStream", "in", ",", "final", "String", "name", ",", "final", "Class", "<", "?", ">", "[", "]", "argTypes", ",", "final", "String", "resourcePath", ",", "final", "Interpreter", "interpreter", ")...
Load a command script from the input stream and find the BshMethod in the target namespace. @param in the in @param name the name @param argTypes the arg types @param resourcePath the resource path @param interpreter the interpreter @return the bsh method @throws UtilEvalError on error in parsing the script or if the t...
[ "Load", "a", "command", "script", "from", "the", "input", "stream", "and", "find", "the", "BshMethod", "in", "the", "target", "namespace", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L959-L978
116,198
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getClass
public Class<?> getClass(final String name) throws UtilEvalError { final Class<?> c = this.getClassImpl(name); if (c != null) return c; if (this.parent != null) return this.parent.getClass(name); return null; }
java
public Class<?> getClass(final String name) throws UtilEvalError { final Class<?> c = this.getClassImpl(name); if (c != null) return c; if (this.parent != null) return this.parent.getClass(name); return null; }
[ "public", "Class", "<", "?", ">", "getClass", "(", "final", "String", "name", ")", "throws", "UtilEvalError", "{", "final", "Class", "<", "?", ">", "c", "=", "this", ".", "getClassImpl", "(", "name", ")", ";", "if", "(", "c", "!=", "null", ")", "re...
Load a class through this namespace taking into account imports. The class search will proceed through the parent namespaces if necessary. @param name the name @return null if not found. @throws UtilEvalError the util eval error
[ "Load", "a", "class", "through", "this", "namespace", "taking", "into", "account", "imports", ".", "The", "class", "search", "will", "proceed", "through", "the", "parent", "namespaces", "if", "necessary", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L992-L999
116,199
beanshell/beanshell
src/main/java/bsh/NameSpace.java
NameSpace.getAllNames
public String[] getAllNames() { final List<String> vec = new ArrayList<String>(); this.getAllNamesAux(vec); return vec.toArray(new String[vec.size()]); }
java
public String[] getAllNames() { final List<String> vec = new ArrayList<String>(); this.getAllNamesAux(vec); return vec.toArray(new String[vec.size()]); }
[ "public", "String", "[", "]", "getAllNames", "(", ")", "{", "final", "List", "<", "String", ">", "vec", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "this", ".", "getAllNamesAux", "(", "vec", ")", ";", "return", "vec", ".", "toArray", ...
Implements NameSource. @return all variable and method names in this and all parent namespaces
[ "Implements", "NameSource", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1110-L1114