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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
svenkubiak/embedded-mongodb | src/main/java/de/svenkubiak/embeddedmongodb/EmbeddedMongoDB.java | EmbeddedMongoDB.start | public EmbeddedMongoDB start() {
if (!this.active) {
try {
this.mongodProcess = MongodStarter.getDefaultInstance().prepare(new MongodConfigBuilder()
.version(this.version)
.net(new Net(this.host, this.port, false))
.build()).start();
... | java | public EmbeddedMongoDB start() {
if (!this.active) {
try {
this.mongodProcess = MongodStarter.getDefaultInstance().prepare(new MongodConfigBuilder()
.version(this.version)
.net(new Net(this.host, this.port, false))
.build()).start();
... | [
"public",
"EmbeddedMongoDB",
"start",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"active",
")",
"{",
"try",
"{",
"this",
".",
"mongodProcess",
"=",
"MongodStarter",
".",
"getDefaultInstance",
"(",
")",
".",
"prepare",
"(",
"new",
"MongodConfigBuilder",
"(... | Starts the EmbeddedMongoDB instance
@return EmbeddedMongoDB instance | [
"Starts",
"the",
"EmbeddedMongoDB",
"instance"
] | c4394065bdce5917491a6537efdc808675047629 | https://github.com/svenkubiak/embedded-mongodb/blob/c4394065bdce5917491a6537efdc808675047629/src/main/java/de/svenkubiak/embeddedmongodb/EmbeddedMongoDB.java#L84-L100 | train |
svenkubiak/embedded-mongodb | src/main/java/de/svenkubiak/embeddedmongodb/EmbeddedMongoDB.java | EmbeddedMongoDB.stop | public void stop() {
if (this.active) {
this.mongodProcess.stop();
this.active = false;
LOG.info("Successfully stopped EmbeddedMongoDB @ {}:{}", this.host, this.port);
}
} | java | public void stop() {
if (this.active) {
this.mongodProcess.stop();
this.active = false;
LOG.info("Successfully stopped EmbeddedMongoDB @ {}:{}", this.host, this.port);
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"this",
".",
"active",
")",
"{",
"this",
".",
"mongodProcess",
".",
"stop",
"(",
")",
";",
"this",
".",
"active",
"=",
"false",
";",
"LOG",
".",
"info",
"(",
"\"Successfully stopped EmbeddedMongoDB @ {}... | Stops the EmbeddedMongoDB instance | [
"Stops",
"the",
"EmbeddedMongoDB",
"instance"
] | c4394065bdce5917491a6537efdc808675047629 | https://github.com/svenkubiak/embedded-mongodb/blob/c4394065bdce5917491a6537efdc808675047629/src/main/java/de/svenkubiak/embeddedmongodb/EmbeddedMongoDB.java#L105-L112 | train |
TNG/property-loader | src/main/java/com/tngtech/propertyloader/Obfuscator.java | Obfuscator.encrypt | public String encrypt(String toEncrypt) {
byte[] encryptedBytes = encryptInternal(dataEncryptionSecretKeySpec, toEncrypt);
return new String(base64Encoder.encode(encryptedBytes));
} | java | public String encrypt(String toEncrypt) {
byte[] encryptedBytes = encryptInternal(dataEncryptionSecretKeySpec, toEncrypt);
return new String(base64Encoder.encode(encryptedBytes));
} | [
"public",
"String",
"encrypt",
"(",
"String",
"toEncrypt",
")",
"{",
"byte",
"[",
"]",
"encryptedBytes",
"=",
"encryptInternal",
"(",
"dataEncryptionSecretKeySpec",
",",
"toEncrypt",
")",
";",
"return",
"new",
"String",
"(",
"base64Encoder",
".",
"encode",
"(",
... | Encrypt and base64-encode a String.
@param toEncrypt - the String to encrypt.
@return the Blowfish-encrypted and base64-encoded String. | [
"Encrypt",
"and",
"base64",
"-",
"encode",
"a",
"String",
"."
] | 0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f | https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L41-L44 | train |
TNG/property-loader | src/main/java/com/tngtech/propertyloader/Obfuscator.java | Obfuscator.encryptInternal | private byte[] encryptInternal(SecretKeySpec key, String toEncrypt) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.ENCRYPT_MODE, key);
return cipher.doFinal(toEncrypt.getBytes(ENCODING));
} catch (G... | java | private byte[] encryptInternal(SecretKeySpec key, String toEncrypt) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.ENCRYPT_MODE, key);
return cipher.doFinal(toEncrypt.getBytes(ENCODING));
} catch (G... | [
"private",
"byte",
"[",
"]",
"encryptInternal",
"(",
"SecretKeySpec",
"key",
",",
"String",
"toEncrypt",
")",
"{",
"try",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"ENCRYPTION_ALGORITHM",
"+",
"ENCRYPTION_ALGORITHM_MODIFIER",
")",
";",
"ci... | Internal Encryption method.
@param key - the SecretKeySpec used to encrypt
@param toEncrypt - the String to encrypt
@return the encrypted String (as byte[]) | [
"Internal",
"Encryption",
"method",
"."
] | 0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f | https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L53-L63 | train |
TNG/property-loader | src/main/java/com/tngtech/propertyloader/Obfuscator.java | Obfuscator.decrypt | public String decrypt(String toDecrypt) {
byte[] encryptedBytes = base64Decoder.decode(toDecrypt);
return decryptInternal(dataEncryptionSecretKeySpec, encryptedBytes);
} | java | public String decrypt(String toDecrypt) {
byte[] encryptedBytes = base64Decoder.decode(toDecrypt);
return decryptInternal(dataEncryptionSecretKeySpec, encryptedBytes);
} | [
"public",
"String",
"decrypt",
"(",
"String",
"toDecrypt",
")",
"{",
"byte",
"[",
"]",
"encryptedBytes",
"=",
"base64Decoder",
".",
"decode",
"(",
"toDecrypt",
")",
";",
"return",
"decryptInternal",
"(",
"dataEncryptionSecretKeySpec",
",",
"encryptedBytes",
")",
... | Decrypt an encrypted and base64-encoded String
@param toDecrypt - the encrypted and base64-encoded String
@return the plaintext String | [
"Decrypt",
"an",
"encrypted",
"and",
"base64",
"-",
"encoded",
"String"
] | 0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f | https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L71-L74 | train |
TNG/property-loader | src/main/java/com/tngtech/propertyloader/Obfuscator.java | Obfuscator.decryptInternal | private String decryptInternal(SecretKeySpec key, byte[] encryptedBytes) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
... | java | private String decryptInternal(SecretKeySpec key, byte[] encryptedBytes) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
... | [
"private",
"String",
"decryptInternal",
"(",
"SecretKeySpec",
"key",
",",
"byte",
"[",
"]",
"encryptedBytes",
")",
"{",
"try",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"ENCRYPTION_ALGORITHM",
"+",
"ENCRYPTION_ALGORITHM_MODIFIER",
")",
";",
... | Internal decryption method.
@param key - the SecretKeySpec used to decrypt
@param encryptedBytes - the byte[] to decrypt
@return the decrypted plaintext String. | [
"Internal",
"decryption",
"method",
"."
] | 0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f | https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L83-L94 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-reindexing/src/main/java/org/fcrepo/camel/reindexing/RestProcessor.java | RestProcessor.process | public void process(final Exchange exchange) throws Exception {
final Message in = exchange.getIn();
final String contentType = in.getHeader(CONTENT_TYPE, "", String.class);
final String body = in.getBody(String.class);
final Set<String> endpoints = new HashSet<>();
for (final ... | java | public void process(final Exchange exchange) throws Exception {
final Message in = exchange.getIn();
final String contentType = in.getHeader(CONTENT_TYPE, "", String.class);
final String body = in.getBody(String.class);
final Set<String> endpoints = new HashSet<>();
for (final ... | [
"public",
"void",
"process",
"(",
"final",
"Exchange",
"exchange",
")",
"throws",
"Exception",
"{",
"final",
"Message",
"in",
"=",
"exchange",
".",
"getIn",
"(",
")",
";",
"final",
"String",
"contentType",
"=",
"in",
".",
"getHeader",
"(",
"CONTENT_TYPE",
... | Convert the incoming REST request into the correct
Fcrepo header fields.
@param exchange the current message exchange | [
"Convert",
"the",
"incoming",
"REST",
"request",
"into",
"the",
"correct",
"Fcrepo",
"header",
"fields",
"."
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-reindexing/src/main/java/org/fcrepo/camel/reindexing/RestProcessor.java#L62-L88 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java | AuditSparqlProcessor.process | public void process(final Exchange exchange) throws Exception {
final Message in = exchange.getIn();
final String eventURIBase = in.getHeader(AuditHeaders.EVENT_BASE_URI, String.class);
final String eventID = in.getHeader(FCREPO_EVENT_ID, String.class);
final Resource eventURI = createRe... | java | public void process(final Exchange exchange) throws Exception {
final Message in = exchange.getIn();
final String eventURIBase = in.getHeader(AuditHeaders.EVENT_BASE_URI, String.class);
final String eventID = in.getHeader(FCREPO_EVENT_ID, String.class);
final Resource eventURI = createRe... | [
"public",
"void",
"process",
"(",
"final",
"Exchange",
"exchange",
")",
"throws",
"Exception",
"{",
"final",
"Message",
"in",
"=",
"exchange",
".",
"getIn",
"(",
")",
";",
"final",
"String",
"eventURIBase",
"=",
"in",
".",
"getHeader",
"(",
"AuditHeaders",
... | Define how a message should be processed.
@param exchange the current camel message exchange | [
"Define",
"how",
"a",
"message",
"should",
"be",
"processed",
"."
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java#L86-L101 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java | AuditSparqlProcessor.serializedGraphForMessage | private static String serializedGraphForMessage(final Message message, final Resource subject) throws IOException {
// serialize triples
final ByteArrayOutputStream serializedGraph = new ByteArrayOutputStream();
final Model model = createDefaultModel();
// get info from jms message hea... | java | private static String serializedGraphForMessage(final Message message, final Resource subject) throws IOException {
// serialize triples
final ByteArrayOutputStream serializedGraph = new ByteArrayOutputStream();
final Model model = createDefaultModel();
// get info from jms message hea... | [
"private",
"static",
"String",
"serializedGraphForMessage",
"(",
"final",
"Message",
"message",
",",
"final",
"Resource",
"subject",
")",
"throws",
"IOException",
"{",
"// serialize triples",
"final",
"ByteArrayOutputStream",
"serializedGraph",
"=",
"new",
"ByteArrayOutpu... | Convert a Camel message to audit event description.
@param message Camel message produced by an audit event
@param subject RDF subject of the audit description | [
"Convert",
"a",
"Camel",
"message",
"to",
"audit",
"event",
"description",
"."
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java#L120-L155 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java | AuditSparqlProcessor.getAuditEventType | private static Optional<String> getAuditEventType(final List<String> eventType, final List<String> resourceType) {
// mapping event type/properties to audit event type
if (eventType.contains(EVENT_NAMESPACE + "ResourceCreation") || eventType.contains(AS_NAMESPACE + "Create")) {
if (resourceT... | java | private static Optional<String> getAuditEventType(final List<String> eventType, final List<String> resourceType) {
// mapping event type/properties to audit event type
if (eventType.contains(EVENT_NAMESPACE + "ResourceCreation") || eventType.contains(AS_NAMESPACE + "Create")) {
if (resourceT... | [
"private",
"static",
"Optional",
"<",
"String",
">",
"getAuditEventType",
"(",
"final",
"List",
"<",
"String",
">",
"eventType",
",",
"final",
"List",
"<",
"String",
">",
"resourceType",
")",
"{",
"// mapping event type/properties to audit event type",
"if",
"(",
... | Returns the Audit event type based on fedora event type and properties.
@param eventType from Fedora
@param properties associated with the Fedora event
@return Audit event | [
"Returns",
"the",
"Audit",
"event",
"type",
"based",
"on",
"fedora",
"event",
"type",
"and",
"properties",
"."
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-audit-triplestore/src/main/java/org/fcrepo/camel/audit/triplestore/AuditSparqlProcessor.java#L164-L188 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/LDPathWrapper.java | LDPathWrapper.programQuery | public List<Map<String, Collection<?>>> programQuery(final String uri, final InputStream program)
throws LDPathParseException {
return singletonList(ldpath.programQuery(new URIImpl(uri), new InputStreamReader(program)));
} | java | public List<Map<String, Collection<?>>> programQuery(final String uri, final InputStream program)
throws LDPathParseException {
return singletonList(ldpath.programQuery(new URIImpl(uri), new InputStreamReader(program)));
} | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"Collection",
"<",
"?",
">",
">",
">",
"programQuery",
"(",
"final",
"String",
"uri",
",",
"final",
"InputStream",
"program",
")",
"throws",
"LDPathParseException",
"{",
"return",
"singletonList",
"(",
"ldpat... | Execute an LDPath query
@param uri the URI to query
@param program the LDPath program
@return a result object wrapped in a List
@throws LDPathParseException if the LDPath program was malformed | [
"Execute",
"an",
"LDPath",
"query"
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/LDPathWrapper.java#L102-L105 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/ClientFactory.java | ClientFactory.createClient | public static ClientConfiguration createClient(final AuthScope authScope, final Credentials credentials,
final List<Endpoint> endpoints, final List<DataProvider> providers) {
final ClientConfiguration client = new ClientConfiguration();
if (credentials != null && authScope != null) {
... | java | public static ClientConfiguration createClient(final AuthScope authScope, final Credentials credentials,
final List<Endpoint> endpoints, final List<DataProvider> providers) {
final ClientConfiguration client = new ClientConfiguration();
if (credentials != null && authScope != null) {
... | [
"public",
"static",
"ClientConfiguration",
"createClient",
"(",
"final",
"AuthScope",
"authScope",
",",
"final",
"Credentials",
"credentials",
",",
"final",
"List",
"<",
"Endpoint",
">",
"endpoints",
",",
"final",
"List",
"<",
"DataProvider",
">",
"providers",
")"... | Create a linked data client suitable for use with a Fedora Repository.
@param authScope the authentication scope
@param credentials the credentials
@param endpoints additional endpoints to enable on the client
@param providers additional providers to enable on the client
@return a configuration for use with an LDClient | [
"Create",
"a",
"linked",
"data",
"client",
"suitable",
"for",
"use",
"with",
"a",
"Fedora",
"Repository",
"."
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/ClientFactory.java#L104-L129 | train |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-serialization/src/main/java/org/fcrepo/camel/serialization/SerializationRouter.java | SerializationRouter.configure | public void configure() throws Exception {
final Namespaces ns = new Namespaces("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
.add("fedora", REPOSITORY);
/**
* A generic error handler (specific to this RouteBuilder)
*/
onException(Exception.class)
... | java | public void configure() throws Exception {
final Namespaces ns = new Namespaces("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
.add("fedora", REPOSITORY);
/**
* A generic error handler (specific to this RouteBuilder)
*/
onException(Exception.class)
... | [
"public",
"void",
"configure",
"(",
")",
"throws",
"Exception",
"{",
"final",
"Namespaces",
"ns",
"=",
"new",
"Namespaces",
"(",
"\"rdf\"",
",",
"\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",
")",
".",
"add",
"(",
"\"fedora\"",
",",
"REPOSITORY",
")",
";",
"... | Configure the message route workflow | [
"Configure",
"the",
"message",
"route",
"workflow"
] | 9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-serialization/src/main/java/org/fcrepo/camel/serialization/SerializationRouter.java#L74-L140 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java | JsonPropertyMeta.name | public JsonPropertyBuilder<T, P> name(String name) {
return new JsonPropertyBuilder<T, P>(coderClass, name, null, null);
} | java | public JsonPropertyBuilder<T, P> name(String name) {
return new JsonPropertyBuilder<T, P>(coderClass, name, null, null);
} | [
"public",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"name",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"(",
"coderClass",
",",
"name",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets a new instance of property builder for the given key name.
@param name
@return a new property builder instance
@author vvakame | [
"Gets",
"a",
"new",
"instance",
"of",
"property",
"builder",
"for",
"the",
"given",
"key",
"name",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java#L43-L45 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java | JsonPropertyMeta.coder | public JsonPropertyBuilder<T, P> coder(JsonModelCoder<P> coder) {
return new JsonPropertyBuilder<T, P>(coderClass, name, coder, null);
} | java | public JsonPropertyBuilder<T, P> coder(JsonModelCoder<P> coder) {
return new JsonPropertyBuilder<T, P>(coderClass, name, coder, null);
} | [
"public",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"coder",
"(",
"JsonModelCoder",
"<",
"P",
">",
"coder",
")",
"{",
"return",
"new",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"(",
"coderClass",
",",
"name",
",",
"coder",
",",
"null",
")",... | Gets a new instance of property builder for the given value coder.
@param coder
@return a new property builder instance
@author vvakame | [
"Gets",
"a",
"new",
"instance",
"of",
"property",
"builder",
"for",
"the",
"given",
"value",
"coder",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java#L53-L55 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java | JsonPropertyMeta.router | public JsonPropertyBuilder<T, P> router(JsonCoderRouter<P> router) {
return new JsonPropertyBuilder<T, P>(coderClass, name, null, router);
} | java | public JsonPropertyBuilder<T, P> router(JsonCoderRouter<P> router) {
return new JsonPropertyBuilder<T, P>(coderClass, name, null, router);
} | [
"public",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"router",
"(",
"JsonCoderRouter",
"<",
"P",
">",
"router",
")",
"{",
"return",
"new",
"JsonPropertyBuilder",
"<",
"T",
",",
"P",
">",
"(",
"coderClass",
",",
"name",
",",
"null",
",",
"router",
... | Gets a new instance of property builder for the given coder router.
@param router
@return a new property builder instance
@author vvakame | [
"Gets",
"a",
"new",
"instance",
"of",
"property",
"builder",
"for",
"the",
"given",
"coder",
"router",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonPropertyMeta.java#L63-L65 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonHash.java | JsonHash.put | @Deprecated
public Object put(String key, Object value, State state) {
return put(key, value, Type.from(state));
} | java | @Deprecated
public Object put(String key, Object value, State state) {
return put(key, value, Type.from(state));
} | [
"@",
"Deprecated",
"public",
"Object",
"put",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"State",
"state",
")",
"{",
"return",
"put",
"(",
"key",
",",
"value",
",",
"Type",
".",
"from",
"(",
"state",
")",
")",
";",
"}"
] | put with State.
@param key
@param value
@param state
@return The instance of the value for the given key
@deprecated {@link State} is confuse the users. replace to {@link Type} in about {@link JsonHash}. since 1.4.12. | [
"put",
"with",
"State",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonHash.java#L375-L378 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/JsonModelGenerator.java | JsonModelGenerator.write | public void write() throws IOException {
{
Filer filer = processingEnv.getFiler();
String generateClassName =
jsonModel.getPackageName() + "." + jsonModel.getTarget() + postfix;
JavaFileObject fileObject = filer.createSourceFile(generateClassName, classElement);
Template.writeGen(fileObject, jsonMode... | java | public void write() throws IOException {
{
Filer filer = processingEnv.getFiler();
String generateClassName =
jsonModel.getPackageName() + "." + jsonModel.getTarget() + postfix;
JavaFileObject fileObject = filer.createSourceFile(generateClassName, classElement);
Template.writeGen(fileObject, jsonMode... | [
"public",
"void",
"write",
"(",
")",
"throws",
"IOException",
"{",
"{",
"Filer",
"filer",
"=",
"processingEnv",
".",
"getFiler",
"(",
")",
";",
"String",
"generateClassName",
"=",
"jsonModel",
".",
"getPackageName",
"(",
")",
"+",
"\".\"",
"+",
"jsonModel",
... | Generates the source code.
@throws IOException
@author vvakame | [
"Generates",
"the",
"source",
"code",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/JsonModelGenerator.java#L124-L139 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/JsonModelGenerator.java | JsonModelGenerator.getElementKeyString | String getElementKeyString(Element element) {
JsonKey key = element.getAnnotation(JsonKey.class);
JsonModel model = element.getEnclosingElement().getAnnotation(JsonModel.class);
if (!"".equals(key.value())) {
return key.value();
} else if ("".equals(key.value()) && key.decamelize()) {
return decamelize(el... | java | String getElementKeyString(Element element) {
JsonKey key = element.getAnnotation(JsonKey.class);
JsonModel model = element.getEnclosingElement().getAnnotation(JsonModel.class);
if (!"".equals(key.value())) {
return key.value();
} else if ("".equals(key.value()) && key.decamelize()) {
return decamelize(el... | [
"String",
"getElementKeyString",
"(",
"Element",
"element",
")",
"{",
"JsonKey",
"key",
"=",
"element",
".",
"getAnnotation",
"(",
"JsonKey",
".",
"class",
")",
";",
"JsonModel",
"model",
"=",
"element",
".",
"getEnclosingElement",
"(",
")",
".",
"getAnnotatio... | Get JSON key string.
@param element
@return JSON key string
@author vvakame | [
"Get",
"JSON",
"key",
"string",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/JsonModelGenerator.java#L222-L234 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/Stack.java | Stack.pop | public T pop() {
final int max = stack.size() - 1;
if (max < 0) {
throw new NoSuchElementException();
}
return stack.remove(max);
} | java | public T pop() {
final int max = stack.size() - 1;
if (max < 0) {
throw new NoSuchElementException();
}
return stack.remove(max);
} | [
"public",
"T",
"pop",
"(",
")",
"{",
"final",
"int",
"max",
"=",
"stack",
".",
"size",
"(",
")",
"-",
"1",
";",
"if",
"(",
"max",
"<",
"0",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"return",
"stack",
".",
"remove",
... | Pops the value from the top of stack and returns it.
@return The value has been popped.
@author vvakame | [
"Pops",
"the",
"value",
"from",
"the",
"top",
"of",
"stack",
"and",
"returns",
"it",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/Stack.java#L51-L57 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/Stack.java | Stack.peek | public T peek() {
final int top = stack.size() - 1;
if (top < 0) {
throw new NoSuchElementException();
}
return stack.get(top);
} | java | public T peek() {
final int top = stack.size() - 1;
if (top < 0) {
throw new NoSuchElementException();
}
return stack.get(top);
} | [
"public",
"T",
"peek",
"(",
")",
"{",
"final",
"int",
"top",
"=",
"stack",
".",
"size",
"(",
")",
"-",
"1",
";",
"if",
"(",
"top",
"<",
"0",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"return",
"stack",
".",
"get",
... | Returns the value currently on the top of the stack.
@return The value on the top.
@author vvakame | [
"Returns",
"the",
"value",
"currently",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/Stack.java#L64-L70 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserInteger | public static Integer parserInteger(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (int) parser.getValueLong();
} else {
throw new IllegalS... | java | public static Integer parserInteger(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (int) parser.getValueLong();
} else {
throw new IllegalS... | [
"public",
"static",
"Integer",
"parserInteger",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
... | Parses the current token as an integer.
@param parser
@return {@link Integer}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"an",
"integer",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L43-L55 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserLong | public static Long parserLong(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return parser.getValueLong();
} else {
throw new IllegalStateException("... | java | public static Long parserLong(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return parser.getValueLong();
} else {
throw new IllegalStateException("... | [
"public",
"static",
"Long",
"parserLong",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
"VALU... | Parses the current token as a long.
@param parser
@return {@link Long}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"long",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L65-L76 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserByte | public static Byte parserByte(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (byte) parser.getValueLong();
} else {
throw new IllegalStateExce... | java | public static Byte parserByte(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (byte) parser.getValueLong();
} else {
throw new IllegalStateExce... | [
"public",
"static",
"Byte",
"parserByte",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
"VALU... | Parses the current token as a byte.
@param parser
@return {@link Byte}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"byte",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L86-L97 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserShort | public static Short parserShort(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (short) parser.getValueLong();
} else {
throw new IllegalStateE... | java | public static Short parserShort(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_LONG) {
return (short) parser.getValueLong();
} else {
throw new IllegalStateE... | [
"public",
"static",
"Short",
"parserShort",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
"VA... | Parses the current token as a short.
@param parser
@return {@link Short}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"short",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L107-L118 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserBoolean | public static Boolean parserBoolean(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_BOOLEAN) {
return parser.getValueBoolean();
} else {
throw new IllegalS... | java | public static Boolean parserBoolean(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_BOOLEAN) {
return parser.getValueBoolean();
} else {
throw new IllegalS... | [
"public",
"static",
"Boolean",
"parserBoolean",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
... | Parses the current token as a boolean.
@param parser
@return {@link Boolean}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"boolean",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L128-L140 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserCharacter | public static Character parserCharacter(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_STRING) {
String str = parser.getValueString();
if (str.length() != 1... | java | public static Character parserCharacter(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_STRING) {
String str = parser.getValueString();
if (str.length() != 1... | [
"public",
"static",
"Character",
"parserCharacter",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".... | Parses the current token as a character.
@param parser
@return {@link Character}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"character",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L150-L167 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserDouble | public static Double parserDouble(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_DOUBLE) {
return parser.getValueDouble();
} else {
throw new IllegalState... | java | public static Double parserDouble(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_DOUBLE) {
return parser.getValueDouble();
} else {
throw new IllegalState... | [
"public",
"static",
"Double",
"parserDouble",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
"... | Parses the current token as a double-precision floating point value.
@param parser
@return {@link Double}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"double",
"-",
"precision",
"floating",
"point",
"value",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L177-L189 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserFloat | public static Float parserFloat(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_DOUBLE) {
return (float) parser.getValueDouble();
} else {
throw new IllegalSt... | java | public static Float parserFloat(JsonPullParser parser) throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
} else if (eventType == State.VALUE_DOUBLE) {
return (float) parser.getValueDouble();
} else {
throw new IllegalSt... | [
"public",
"static",
"Float",
"parserFloat",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"State",
".",
"VA... | Parses the current token as a single-precision floating point value.
@param parser
@return {@link Float}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"single",
"-",
"precision",
"floating",
"point",
"value",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L199-L210 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserIntegerList | public static List<Integer> parserIntegerList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
... | java | public static List<Integer> parserIntegerList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"parserIntegerList",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",... | Parses the current token as a list of integers.
@param parser
@return List of {@link Integer}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"integers",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L220-L244 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserBooleanList | public static List<Boolean> parserBooleanList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
... | java | public static List<Boolean> parserBooleanList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
... | [
"public",
"static",
"List",
"<",
"Boolean",
">",
"parserBooleanList",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",... | Parses the current token as a list of booleans.
@param parser
@return List of {@link Boolean}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"booleans",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L356-L380 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserCharacterList | public static List<Character> parserCharacterList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
... | java | public static List<Character> parserCharacterList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
... | [
"public",
"static",
"List",
"<",
"Character",
">",
"parserCharacterList",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventTy... | Parses the current token as a list of characters.
@param parser
@return List of {@link Character}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"characters",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L390-L419 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserDoubleList | public static List<Double> parserDoubleList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
L... | java | public static List<Double> parserDoubleList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
L... | [
"public",
"static",
"List",
"<",
"Double",
">",
"parserDoubleList",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
... | Parses the current token as a list of double-precision floating point numbers.
@param parser
@return List of {@link Double}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"double",
"-",
"precision",
"floating",
"point",
"numbers",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L429-L453 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserStringList | public static List<String> parserStringList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
L... | java | public static List<String> parserStringList(JsonPullParser parser) throws IOException,
JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("not started brace!");
}
L... | [
"public",
"static",
"List",
"<",
"String",
">",
"parserStringList",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"eventType",
... | Parses the current token as a list of strings.
@param parser
@return List of {@link String}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"strings",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L497-L521 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java | JsonParseUtil.parserEnumList | public static <T extends Enum<T>>List<T> parserEnumList(JsonPullParser parser, Class<T> clazz)
throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("n... | java | public static <T extends Enum<T>>List<T> parserEnumList(JsonPullParser parser, Class<T> clazz)
throws IOException, JsonFormatException {
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
throw new IllegalStateException("n... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"List",
"<",
"T",
">",
"parserEnumList",
"(",
"JsonPullParser",
"parser",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"... | Parses the current token as a list of Enums.
@param <T>
@param parser
@param clazz
@return List of {@link Enum}s
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"current",
"token",
"as",
"a",
"list",
"of",
"Enums",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonParseUtil.java#L568-L593 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelBuilder.java | JsonModelBuilder.rm | public JsonModelBuilder<T> rm(String... names) {
for (String name : names) {
rmSub(name);
}
return this;
} | java | public JsonModelBuilder<T> rm(String... names) {
for (String name : names) {
rmSub(name);
}
return this;
} | [
"public",
"JsonModelBuilder",
"<",
"T",
">",
"rm",
"(",
"String",
"...",
"names",
")",
"{",
"for",
"(",
"String",
"name",
":",
"names",
")",
"{",
"rmSub",
"(",
"name",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Detaches property builder for the given names.
@param names
@return this
@author vvakame | [
"Detaches",
"property",
"builder",
"for",
"the",
"given",
"names",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelBuilder.java#L529-L534 | train |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java | JsonArray.fromParser | public static JsonArray fromParser(JsonPullParser parser) throws IOException,
JsonFormatException {
State state = parser.getEventType();
if (state == State.VALUE_NULL) {
return null;
} else if (state != State.START_ARRAY) {
throw new JsonFormatException("unexpected token. token=" + state, parser);
}
... | java | public static JsonArray fromParser(JsonPullParser parser) throws IOException,
JsonFormatException {
State state = parser.getEventType();
if (state == State.VALUE_NULL) {
return null;
} else if (state != State.START_ARRAY) {
throw new JsonFormatException("unexpected token. token=" + state, parser);
}
... | [
"public",
"static",
"JsonArray",
"fromParser",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"state",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"state",
"==",
"State",
".",
"VALUE_N... | Parses the given JSON data as an array.
@param parser {@link JsonPullParser} with some JSON-formatted data
@return {@link JsonArray}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"given",
"JSON",
"data",
"as",
"an",
"array",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java#L63-L80 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/Log.java | Log.e | public static void e(String msg, Element element) {
messager.printMessage(Diagnostic.Kind.ERROR, msg, element);
} | java | public static void e(String msg, Element element) {
messager.printMessage(Diagnostic.Kind.ERROR, msg, element);
} | [
"public",
"static",
"void",
"e",
"(",
"String",
"msg",
",",
"Element",
"element",
")",
"{",
"messager",
".",
"printMessage",
"(",
"Diagnostic",
".",
"Kind",
".",
"ERROR",
",",
"msg",
",",
"element",
")",
";",
"}"
] | Logs error message about the given element.
@param msg Message
@param element Offending element
@author vvakame | [
"Logs",
"error",
"message",
"about",
"the",
"given",
"element",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/Log.java#L114-L116 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/Log.java | Log.e | public static void e(Throwable e) {
messager.printMessage(Diagnostic.Kind.ERROR, "exception thrown! " + e.getMessage());
} | java | public static void e(Throwable e) {
messager.printMessage(Diagnostic.Kind.ERROR, "exception thrown! " + e.getMessage());
} | [
"public",
"static",
"void",
"e",
"(",
"Throwable",
"e",
")",
"{",
"messager",
".",
"printMessage",
"(",
"Diagnostic",
".",
"Kind",
".",
"ERROR",
",",
"\"exception thrown! \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}"
] | Logs error message about the given exception.
@param e Offending throwable
@author vvakame | [
"Logs",
"error",
"message",
"about",
"the",
"given",
"exception",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/Log.java#L123-L125 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.isPrimitiveWrapper | public static boolean isPrimitiveWrapper(Element element) {
if (element == null) {
return false;
} else if (element.toString().equals(Boolean.class.getCanonicalName())) {
return true;
} else if (element.toString().equals(Integer.class.getCanonicalName())) {
return true;
} else if (element.toString().eq... | java | public static boolean isPrimitiveWrapper(Element element) {
if (element == null) {
return false;
} else if (element.toString().equals(Boolean.class.getCanonicalName())) {
return true;
} else if (element.toString().equals(Integer.class.getCanonicalName())) {
return true;
} else if (element.toString().eq... | [
"public",
"static",
"boolean",
"isPrimitiveWrapper",
"(",
"Element",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"element",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"Boolean",
... | Tests if the given element is a primitive wrapper.
@param element
@return true if the element is a primitive wrapper, false otherwise.
@author vvakame | [
"Tests",
"if",
"the",
"given",
"element",
"is",
"a",
"primitive",
"wrapper",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L94-L116 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.isInternalType | public static boolean isInternalType(Types typeUtils, TypeMirror type) {
Element element = ((TypeElement) typeUtils.asElement(type)).getEnclosingElement();
return element.getKind() != ElementKind.PACKAGE;
} | java | public static boolean isInternalType(Types typeUtils, TypeMirror type) {
Element element = ((TypeElement) typeUtils.asElement(type)).getEnclosingElement();
return element.getKind() != ElementKind.PACKAGE;
} | [
"public",
"static",
"boolean",
"isInternalType",
"(",
"Types",
"typeUtils",
",",
"TypeMirror",
"type",
")",
"{",
"Element",
"element",
"=",
"(",
"(",
"TypeElement",
")",
"typeUtils",
".",
"asElement",
"(",
"type",
")",
")",
".",
"getEnclosingElement",
"(",
"... | Test if the given type is an internal type.
@param typeUtils
@param type
@return True if the type is an internal type, false otherwise.
@author vvakame | [
"Test",
"if",
"the",
"given",
"type",
"is",
"an",
"internal",
"type",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L135-L138 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.isPackagePrivate | public static boolean isPackagePrivate(Element element) {
if (isPublic(element)) {
return false;
} else if (isProtected(element)) {
return false;
} else if (isPrivate(element)) {
return false;
}
return true;
} | java | public static boolean isPackagePrivate(Element element) {
if (isPublic(element)) {
return false;
} else if (isProtected(element)) {
return false;
} else if (isPrivate(element)) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isPackagePrivate",
"(",
"Element",
"element",
")",
"{",
"if",
"(",
"isPublic",
"(",
"element",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"isProtected",
"(",
"element",
")",
")",
"{",
"return",
"false",... | Tests if the given element has the package-private visibility.
@param element
@return true if package-private, false otherwise
@author vvakame | [
"Tests",
"if",
"the",
"given",
"element",
"has",
"the",
"package",
"-",
"private",
"visibility",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L360-L369 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.getElementSetter | public static String getElementSetter(Element element) {
// 後続処理注意 hogeに対して sethoge が取得される. setHoge ではない.
String setterName = null;
if (isPrimitiveBoolean(element)) {
Pattern pattern = Pattern.compile("^is[^a-z].*$");
Matcher matcher = pattern.matcher(element.getSimpleName().toString());
if (matcher.matc... | java | public static String getElementSetter(Element element) {
// 後続処理注意 hogeに対して sethoge が取得される. setHoge ではない.
String setterName = null;
if (isPrimitiveBoolean(element)) {
Pattern pattern = Pattern.compile("^is[^a-z].*$");
Matcher matcher = pattern.matcher(element.getSimpleName().toString());
if (matcher.matc... | [
"public",
"static",
"String",
"getElementSetter",
"(",
"Element",
"element",
")",
"{",
"// 後続処理注意 hogeに対して sethoge が取得される. setHoge ではない.",
"String",
"setterName",
"=",
"null",
";",
"if",
"(",
"isPrimitiveBoolean",
"(",
"element",
")",
")",
"{",
"Pattern",
"pattern",
... | Returns the name of corresponding setter.
@param element the field
@return setter name
@author vvakame | [
"Returns",
"the",
"name",
"of",
"corresponding",
"setter",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L425-L457 | train |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.getElementGetter | public static String getElementGetter(Element element) {
// TODO 型(boolean)による絞り込みをするべき
String getterName1 = "get" + element.getSimpleName().toString();
String getterName2 = "is" + element.getSimpleName().toString();
String getterName3 = element.getSimpleName().toString();
Element getter = null;
for (Eleme... | java | public static String getElementGetter(Element element) {
// TODO 型(boolean)による絞り込みをするべき
String getterName1 = "get" + element.getSimpleName().toString();
String getterName2 = "is" + element.getSimpleName().toString();
String getterName3 = element.getSimpleName().toString();
Element getter = null;
for (Eleme... | [
"public",
"static",
"String",
"getElementGetter",
"(",
"Element",
"element",
")",
"{",
"// TODO 型(boolean)による絞り込みをするべき",
"String",
"getterName1",
"=",
"\"get\"",
"+",
"element",
".",
"getSimpleName",
"(",
")",
".",
"toString",
"(",
")",
";",
"String",
"getterName2... | Returns the name of corresponding getter.
@param element the field
@return getter name
@author vvakame | [
"Returns",
"the",
"name",
"of",
"corresponding",
"getter",
"."
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L465-L498 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.setInputFile | public void setInputFile (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.inputFile = value;
} | java | public void setInputFile (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.inputFile = value;
} | [
"public",
"void",
"setInputFile",
"(",
"final",
"File",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path is not absolute: \"",
"+",
"value... | Sets the absolute path to the grammar file to pass into JTB for
preprocessing.
@param value
The absolute path to the grammar file to pass into JTB for
preprocessing. | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"grammar",
"file",
"to",
"pass",
"into",
"JTB",
"for",
"preprocessing",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L138-L145 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.setOutputDirectory | public void setOutputDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.outputDirectory = value;
} | java | public void setOutputDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.outputDirectory = value;
} | [
"public",
"void",
"setOutputDirectory",
"(",
"final",
"File",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path is not absolute: \"",
"+",
... | Sets the absolute path to the output directory for the generated grammar
file.
@param value
The absolute path to the output directory for the generated grammar
file. If this directory does not exist yet, it is created. Note that
this path should already include the desired package hierarchy
because JTB will not append... | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"generated",
"grammar",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L158-L165 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getOutputFile | public File getOutputFile ()
{
File outputFile = null;
if (this.outputDirectory != null && this.inputFile != null)
{
final String fileName = FileUtils.removeExtension (this.inputFile.getName ()) + ".jj";
outputFile = new File (this.outputDirectory, fileName);
}
return outputFile;
} | java | public File getOutputFile ()
{
File outputFile = null;
if (this.outputDirectory != null && this.inputFile != null)
{
final String fileName = FileUtils.removeExtension (this.inputFile.getName ()) + ".jj";
outputFile = new File (this.outputDirectory, fileName);
}
return outputFile;
} | [
"public",
"File",
"getOutputFile",
"(",
")",
"{",
"File",
"outputFile",
"=",
"null",
";",
"if",
"(",
"this",
".",
"outputDirectory",
"!=",
"null",
"&&",
"this",
".",
"inputFile",
"!=",
"null",
")",
"{",
"final",
"String",
"fileName",
"=",
"FileUtils",
".... | Gets the absolute path to the enhanced grammar file generated by JTB.
@return The absolute path to the enhanced grammar file generated by JTB or
<code>null</code> if either the input file or the output directory
have not been set. | [
"Gets",
"the",
"absolute",
"path",
"to",
"the",
"enhanced",
"grammar",
"file",
"generated",
"by",
"JTB",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L174-L183 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.setNodeDirectory | public void setNodeDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.nodeDirectory = value;
} | java | public void setNodeDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.nodeDirectory = value;
} | [
"public",
"void",
"setNodeDirectory",
"(",
"final",
"File",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path is not absolute: \"",
"+",
"v... | Sets the absolute path to the output directory for the syntax tree files.
@param value
The absolute path to the output directory for the generated syntax
tree files, may be <code>null</code> to use a sub directory in the
output directory of the grammar file. If this directory does not
exist yet, it is created. Note th... | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"syntax",
"tree",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L196-L203 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getEffectiveNodeDirectory | private File getEffectiveNodeDirectory ()
{
if (this.nodeDirectory != null)
return this.nodeDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveNodePackageName ()));
return null;
} | java | private File getEffectiveNodeDirectory ()
{
if (this.nodeDirectory != null)
return this.nodeDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveNodePackageName ()));
return null;
} | [
"private",
"File",
"getEffectiveNodeDirectory",
"(",
")",
"{",
"if",
"(",
"this",
".",
"nodeDirectory",
"!=",
"null",
")",
"return",
"this",
".",
"nodeDirectory",
";",
"if",
"(",
"this",
".",
"outputDirectory",
"!=",
"null",
")",
"return",
"new",
"File",
"... | Gets the absolute path to the output directory for the syntax tree files.
@return The absolute path to the output directory for the syntax tree
files, only <code>null</code> if neither {@link #outputDirectory}
nor {@link #nodeDirectory} have been set. | [
"Gets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"syntax",
"tree",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L212-L219 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.setVisitorDirectory | public void setVisitorDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.visitorDirectory = value;
} | java | public void setVisitorDirectory (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.visitorDirectory = value;
} | [
"public",
"void",
"setVisitorDirectory",
"(",
"final",
"File",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path is not absolute: \"",
"+",
... | Sets the absolute path to the output directory for the visitor files.
@param value
The absolute path to the output directory for the generated visitor
files, may be <code>null</code> to use a sub directory in the output
directory of the grammar file. If this directory does not exist yet,
it is created. Note that this ... | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"visitor",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L232-L239 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getEffectiveVisitorDirectory | private File getEffectiveVisitorDirectory ()
{
if (this.visitorDirectory != null)
return this.visitorDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveVisitorPackageName ()));
return null;
} | java | private File getEffectiveVisitorDirectory ()
{
if (this.visitorDirectory != null)
return this.visitorDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveVisitorPackageName ()));
return null;
} | [
"private",
"File",
"getEffectiveVisitorDirectory",
"(",
")",
"{",
"if",
"(",
"this",
".",
"visitorDirectory",
"!=",
"null",
")",
"return",
"this",
".",
"visitorDirectory",
";",
"if",
"(",
"this",
".",
"outputDirectory",
"!=",
"null",
")",
"return",
"new",
"F... | Gets the absolute path to the output directory for the visitor files.
@return The absolute path to the output directory for the visitor, only
<code>null</code> if neither {@link #outputDirectory} nor
{@link #visitorDirectory} have been set. | [
"Gets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"visitor",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L248-L255 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getEffectiveNodePackageName | private String getEffectiveNodePackageName ()
{
if (this.packageName != null)
return this.packageName.length () <= 0 ? SYNTAX_TREE : this.packageName + '.' + SYNTAX_TREE;
if (this.nodePackageName != null)
return this.nodePackageName;
return SYNTAX_TREE;
} | java | private String getEffectiveNodePackageName ()
{
if (this.packageName != null)
return this.packageName.length () <= 0 ? SYNTAX_TREE : this.packageName + '.' + SYNTAX_TREE;
if (this.nodePackageName != null)
return this.nodePackageName;
return SYNTAX_TREE;
} | [
"private",
"String",
"getEffectiveNodePackageName",
"(",
")",
"{",
"if",
"(",
"this",
".",
"packageName",
"!=",
"null",
")",
"return",
"this",
".",
"packageName",
".",
"length",
"(",
")",
"<=",
"0",
"?",
"SYNTAX_TREE",
":",
"this",
".",
"packageName",
"+",... | Gets the effective package name for the syntax tree files.
@return The effective package name for the syntax tree files, never
<code>null</code>. | [
"Gets",
"the",
"effective",
"package",
"name",
"for",
"the",
"syntax",
"tree",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L286-L294 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getEffectiveVisitorPackageName | private String getEffectiveVisitorPackageName ()
{
if (this.packageName != null)
return this.packageName.length () <= 0 ? VISITOR : this.packageName + '.' + VISITOR;
if (this.visitorPackageName != null)
return this.visitorPackageName;
return VISITOR;
} | java | private String getEffectiveVisitorPackageName ()
{
if (this.packageName != null)
return this.packageName.length () <= 0 ? VISITOR : this.packageName + '.' + VISITOR;
if (this.visitorPackageName != null)
return this.visitorPackageName;
return VISITOR;
} | [
"private",
"String",
"getEffectiveVisitorPackageName",
"(",
")",
"{",
"if",
"(",
"this",
".",
"packageName",
"!=",
"null",
")",
"return",
"this",
".",
"packageName",
".",
"length",
"(",
")",
"<=",
"0",
"?",
"VISITOR",
":",
"this",
".",
"packageName",
"+",
... | Gets the effective package name for the visitor files.
@return The effective package name for the visitor files, never
<code>null</code>. | [
"Gets",
"the",
"effective",
"package",
"name",
"for",
"the",
"visitor",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L313-L320 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.generateArguments | private String [] generateArguments ()
{
final List <String> argsList = new ArrayList <> ();
argsList.add ("-np");
argsList.add (getEffectiveNodePackageName ());
argsList.add ("-vp");
argsList.add (getEffectiveVisitorPackageName ());
if (this.supressErrorChecking != null && this.supressErro... | java | private String [] generateArguments ()
{
final List <String> argsList = new ArrayList <> ();
argsList.add ("-np");
argsList.add (getEffectiveNodePackageName ());
argsList.add ("-vp");
argsList.add (getEffectiveVisitorPackageName ());
if (this.supressErrorChecking != null && this.supressErro... | [
"private",
"String",
"[",
"]",
"generateArguments",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"argsList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"argsList",
".",
"add",
"(",
"\"-np\"",
")",
";",
"argsList",
".",
"add",
"(",
"getEffecti... | Assembles the command line arguments for the invocation of JTB according to
the configuration.
@return A string array that represents the command line arguments to use
for JTB. | [
"Assembles",
"the",
"command",
"line",
"arguments",
"for",
"the",
"invocation",
"of",
"JTB",
"according",
"to",
"the",
"configuration",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L455-L519 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getLastPackageName | private String getLastPackageName (final String name)
{
if (name != null)
{
return name.substring (name.lastIndexOf ('.') + 1);
}
return null;
} | java | private String getLastPackageName (final String name)
{
if (name != null)
{
return name.substring (name.lastIndexOf ('.') + 1);
}
return null;
} | [
"private",
"String",
"getLastPackageName",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"return",
"name",
".",
"substring",
"(",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";",
"}",
"return"... | Gets the last identifier from the specified package name. For example,
returns "apache" upon input of "org.apache". JTB uses this approach to
derive the output directories for the visitor and syntax tree files.
@param name
The package name from which to retrieve the last sub package, may be
<code>null</code>.
@return ... | [
"Gets",
"the",
"last",
"identifier",
"from",
"the",
"specified",
"package",
"name",
".",
"For",
"example",
"returns",
"apache",
"upon",
"input",
"of",
"org",
".",
"apache",
".",
"JTB",
"uses",
"this",
"approach",
"to",
"derive",
"the",
"output",
"directories... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L532-L539 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJTreeJavaCCMojo.java | JJTreeJavaCCMojo.newJJTree | protected JJTree newJJTree ()
{
final JJTree jjtree = new JJTree ();
jjtree.setLog (getLog ());
jjtree.setGrammarEncoding (getGrammarEncoding ());
jjtree.setOutputEncoding (getOutputEncoding ());
jjtree.setJdkVersion (getJdkVersion ());
jjtree.setBuildNodeFiles (this.buildNodeFiles);
jjtre... | java | protected JJTree newJJTree ()
{
final JJTree jjtree = new JJTree ();
jjtree.setLog (getLog ());
jjtree.setGrammarEncoding (getGrammarEncoding ());
jjtree.setOutputEncoding (getOutputEncoding ());
jjtree.setJdkVersion (getJdkVersion ());
jjtree.setBuildNodeFiles (this.buildNodeFiles);
jjtre... | [
"protected",
"JJTree",
"newJJTree",
"(",
")",
"{",
"final",
"JJTree",
"jjtree",
"=",
"new",
"JJTree",
"(",
")",
";",
"jjtree",
".",
"setLog",
"(",
"getLog",
"(",
")",
")",
";",
"jjtree",
".",
"setGrammarEncoding",
"(",
"getGrammarEncoding",
"(",
")",
")"... | Creates a new facade to invoke JJTree. Most options for the invocation are
derived from the current values of the corresponding mojo parameters. The
caller is responsible to set the input file, output directory and package
on the returned facade.
@return The facade for the tool invocation, never <code>null</code>. | [
"Creates",
"a",
"new",
"facade",
"to",
"invoke",
"JJTree",
".",
"Most",
"options",
"for",
"the",
"invocation",
"are",
"derived",
"from",
"the",
"current",
"values",
"of",
"the",
"corresponding",
"mojo",
"parameters",
".",
"The",
"caller",
"is",
"responsible",
... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJTreeJavaCCMojo.java#L366-L388 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java | ForkedJvm.addClassPathEntry | public final void addClassPathEntry (@Nullable final File path)
{
if (path != null)
m_aClassPathEntries.add (path.getAbsolutePath ());
} | java | public final void addClassPathEntry (@Nullable final File path)
{
if (path != null)
m_aClassPathEntries.add (path.getAbsolutePath ());
} | [
"public",
"final",
"void",
"addClassPathEntry",
"(",
"@",
"Nullable",
"final",
"File",
"path",
")",
"{",
"if",
"(",
"path",
"!=",
"null",
")",
"m_aClassPathEntries",
".",
"add",
"(",
"path",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"}"
] | Adds the specified path to the class path of the forked JVM.
@param path
The path to add, may be <code>null</code>. | [
"Adds",
"the",
"specified",
"path",
"to",
"the",
"class",
"path",
"of",
"the",
"forked",
"JVM",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java#L168-L172 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java | ForkedJvm._getResourceSource | @Nullable
private static File _getResourceSource (final String resource, final ClassLoader loader)
{
if (resource != null)
{
URL url;
if (loader != null)
{
url = loader.getResource (resource);
}
else
{
url = ClassLoader.getSystemResource (resource);
... | java | @Nullable
private static File _getResourceSource (final String resource, final ClassLoader loader)
{
if (resource != null)
{
URL url;
if (loader != null)
{
url = loader.getResource (resource);
}
else
{
url = ClassLoader.getSystemResource (resource);
... | [
"@",
"Nullable",
"private",
"static",
"File",
"_getResourceSource",
"(",
"final",
"String",
"resource",
",",
"final",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"URL",
"url",
";",
"if",
"(",
"loader",
"!=",
"null",
... | Gets the JAR file or directory that contains the specified resource.
@param resource
The absolute name of the resource to find, may be <code>null</code>.
@param loader
The class loader to use for searching the resource, may be
<code>null</code>.
@return The absolute path to the resource location or <code>null</code> i... | [
"Gets",
"the",
"JAR",
"file",
"or",
"directory",
"that",
"contains",
"the",
"specified",
"resource",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java#L234-L251 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java | ForkedJvm._createCommandLine | private Commandline _createCommandLine ()
{
/*
* NOTE: This method is designed to work with plexus-utils:1.1 which is used
* by all Maven versions before 2.0.6 regardless of our plugin dependency.
* Therefore, we use setWorkingDirectory(String) rather than
* setWorkingDirectory(File) and addAr... | java | private Commandline _createCommandLine ()
{
/*
* NOTE: This method is designed to work with plexus-utils:1.1 which is used
* by all Maven versions before 2.0.6 regardless of our plugin dependency.
* Therefore, we use setWorkingDirectory(String) rather than
* setWorkingDirectory(File) and addAr... | [
"private",
"Commandline",
"_createCommandLine",
"(",
")",
"{",
"/*\n * NOTE: This method is designed to work with plexus-utils:1.1 which is used\n * by all Maven versions before 2.0.6 regardless of our plugin dependency.\n * Therefore, we use setWorkingDirectory(String) rather than\n * s... | Creates the command line for the new JVM based on the current
configuration.
@return The command line used to fork the JVM, never <code>null</code>. | [
"Creates",
"the",
"command",
"line",
"for",
"the",
"new",
"JVM",
"based",
"on",
"the",
"current",
"configuration",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java#L347-L379 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.getSourceDirectories | private File [] getSourceDirectories ()
{
final Set <File> directories = new LinkedHashSet <> ();
if (this.sourceDirectories != null && this.sourceDirectories.length > 0)
{
directories.addAll (Arrays.asList (this.sourceDirectories));
}
else
{
if (this.defaultGrammarDirectoryJavaCC ... | java | private File [] getSourceDirectories ()
{
final Set <File> directories = new LinkedHashSet <> ();
if (this.sourceDirectories != null && this.sourceDirectories.length > 0)
{
directories.addAll (Arrays.asList (this.sourceDirectories));
}
else
{
if (this.defaultGrammarDirectoryJavaCC ... | [
"private",
"File",
"[",
"]",
"getSourceDirectories",
"(",
")",
"{",
"final",
"Set",
"<",
"File",
">",
"directories",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"if",
"(",
"this",
".",
"sourceDirectories",
"!=",
"null",
"&&",
"this",
".",
"sourceDi... | Get the source directories that should be scanned for grammar files.
@return The source directories that should be scanned for grammar files,
never <code>null</code>. | [
"Get",
"the",
"source",
"directories",
"that",
"should",
"be",
"scanned",
"for",
"grammar",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L249-L272 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.executeReport | @Override
public void executeReport (final Locale locale) throws MavenReportException
{
final Sink sink = getSink ();
createReportHeader (getBundle (locale), sink);
final File [] sourceDirs = getSourceDirectories ();
for (final File sourceDir : sourceDirs)
{
final GrammarInfo [] grammarI... | java | @Override
public void executeReport (final Locale locale) throws MavenReportException
{
final Sink sink = getSink ();
createReportHeader (getBundle (locale), sink);
final File [] sourceDirs = getSourceDirectories ();
for (final File sourceDir : sourceDirs)
{
final GrammarInfo [] grammarI... | [
"@",
"Override",
"public",
"void",
"executeReport",
"(",
"final",
"Locale",
"locale",
")",
"throws",
"MavenReportException",
"{",
"final",
"Sink",
"sink",
"=",
"getSink",
"(",
")",
";",
"createReportHeader",
"(",
"getBundle",
"(",
"locale",
")",
",",
"sink",
... | Run the actual report.
@param locale
The locale to use for this report.
@throws MavenReportException
If the report generation failed. | [
"Run",
"the",
"actual",
"report",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L337-L386 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.createReportHeader | private void createReportHeader (final ResourceBundle bundle, final Sink sink)
{
sink.head ();
sink.title ();
sink.text (bundle.getString ("report.jjdoc.title"));
sink.title_ ();
sink.head_ ();
sink.body ();
sink.section1 ();
sink.sectionTitle1 ();
sink.text (bundle.getString ("r... | java | private void createReportHeader (final ResourceBundle bundle, final Sink sink)
{
sink.head ();
sink.title ();
sink.text (bundle.getString ("report.jjdoc.title"));
sink.title_ ();
sink.head_ ();
sink.body ();
sink.section1 ();
sink.sectionTitle1 ();
sink.text (bundle.getString ("r... | [
"private",
"void",
"createReportHeader",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"Sink",
"sink",
")",
"{",
"sink",
".",
"head",
"(",
")",
";",
"sink",
".",
"title",
"(",
")",
";",
"sink",
".",
"text",
"(",
"bundle",
".",
"getString",
"(... | Create the header and title for the HTML report page.
@param bundle
The resource bundle with the text.
@param sink
The sink for writing to the main report file. | [
"Create",
"the",
"header",
"and",
"title",
"for",
"the",
"HTML",
"report",
"page",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L416-L440 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.createReportLink | private void createReportLink (final Sink sink, final File sourceDirectory, final File grammarFile, String linkPath)
{
sink.tableRow ();
sink.tableCell ();
if (linkPath.startsWith ("/"))
{
linkPath = linkPath.substring (1);
}
sink.link (linkPath);
String grammarFileRelativePath = sou... | java | private void createReportLink (final Sink sink, final File sourceDirectory, final File grammarFile, String linkPath)
{
sink.tableRow ();
sink.tableCell ();
if (linkPath.startsWith ("/"))
{
linkPath = linkPath.substring (1);
}
sink.link (linkPath);
String grammarFileRelativePath = sou... | [
"private",
"void",
"createReportLink",
"(",
"final",
"Sink",
"sink",
",",
"final",
"File",
"sourceDirectory",
",",
"final",
"File",
"grammarFile",
",",
"String",
"linkPath",
")",
"{",
"sink",
".",
"tableRow",
"(",
")",
";",
"sink",
".",
"tableCell",
"(",
"... | Create a table row containing a link to the JJDoc report for a grammar
file.
@param sink
The sink to write the report
@param sourceDirectory
The source directory of the grammar file.
@param grammarFile
The JavaCC grammar file.
@param linkPath
The path to the JJDoc output. | [
"Create",
"a",
"table",
"row",
"containing",
"a",
"link",
"to",
"the",
"JJDoc",
"report",
"for",
"a",
"grammar",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L455-L473 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.newJJDoc | private JJDoc newJJDoc ()
{
final JJDoc jjdoc = new JJDoc ();
jjdoc.setLog (getLog ());
jjdoc.setGrammarEncoding (this.grammarEncoding);
jjdoc.setOutputEncoding (this.outputEncoding);
jjdoc.setCssHref (this.cssHref);
jjdoc.setText (this.text);
jjdoc.setBnf (this.bnf);
jjdoc.setOneTable... | java | private JJDoc newJJDoc ()
{
final JJDoc jjdoc = new JJDoc ();
jjdoc.setLog (getLog ());
jjdoc.setGrammarEncoding (this.grammarEncoding);
jjdoc.setOutputEncoding (this.outputEncoding);
jjdoc.setCssHref (this.cssHref);
jjdoc.setText (this.text);
jjdoc.setBnf (this.bnf);
jjdoc.setOneTable... | [
"private",
"JJDoc",
"newJJDoc",
"(",
")",
"{",
"final",
"JJDoc",
"jjdoc",
"=",
"new",
"JJDoc",
"(",
")",
";",
"jjdoc",
".",
"setLog",
"(",
"getLog",
"(",
")",
")",
";",
"jjdoc",
".",
"setGrammarEncoding",
"(",
"this",
".",
"grammarEncoding",
")",
";",
... | Creates a new facade to invoke JJDoc. Most options for the invocation are
derived from the current values of the corresponding mojo parameters. The
caller is responsible to set the input file and output file on the returned
facade.
@return The facade for the tool invocation, never <code>null</code>. | [
"Creates",
"a",
"new",
"facade",
"to",
"invoke",
"JJDoc",
".",
"Most",
"options",
"for",
"the",
"invocation",
"are",
"derived",
"from",
"the",
"current",
"values",
"of",
"the",
"corresponding",
"mojo",
"parameters",
".",
"The",
"caller",
"is",
"responsible",
... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L495-L506 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.scanForGrammars | private GrammarInfo [] scanForGrammars (final File sourceDirectory) throws MavenReportException
{
if (!sourceDirectory.isDirectory ())
{
return null;
}
GrammarInfo [] grammarInfos;
getLog ().debug ("Scanning for grammars: " + sourceDirectory);
try
{
final String [] includes =... | java | private GrammarInfo [] scanForGrammars (final File sourceDirectory) throws MavenReportException
{
if (!sourceDirectory.isDirectory ())
{
return null;
}
GrammarInfo [] grammarInfos;
getLog ().debug ("Scanning for grammars: " + sourceDirectory);
try
{
final String [] includes =... | [
"private",
"GrammarInfo",
"[",
"]",
"scanForGrammars",
"(",
"final",
"File",
"sourceDirectory",
")",
"throws",
"MavenReportException",
"{",
"if",
"(",
"!",
"sourceDirectory",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"GrammarInfo",
"[... | Searches the specified source directory to find grammar files that can be
documented.
@param sourceDirectory
The source directory to scan for grammar files.
@return An array of grammar infos describing the found grammar files or
<code>null</code> if the source directory does not exist.
@throws MavenReportException
If ... | [
"Searches",
"the",
"specified",
"source",
"directory",
"to",
"find",
"grammar",
"files",
"that",
"can",
"be",
"documented",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L519-L545 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.execute | public void execute () throws MojoExecutionException, MojoFailureException
{
final GrammarInfo [] grammarInfos = scanForGrammars ();
if (grammarInfos == null)
{
getLog ().info ("Skipping non-existing source directory: " + getSourceDirectory ());
return;
}
else
if (grammarInfos.l... | java | public void execute () throws MojoExecutionException, MojoFailureException
{
final GrammarInfo [] grammarInfos = scanForGrammars ();
if (grammarInfos == null)
{
getLog ().info ("Skipping non-existing source directory: " + getSourceDirectory ());
return;
}
else
if (grammarInfos.l... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"final",
"GrammarInfo",
"[",
"]",
"grammarInfos",
"=",
"scanForGrammars",
"(",
")",
";",
"if",
"(",
"grammarInfos",
"==",
"null",
")",
"{",
"getLog",
"... | Execute the tool.
@throws MojoExecutionException
If the invocation of the tool failed.
@throws MojoFailureException
If the tool reported a non-zero exit code. | [
"Execute",
"the",
"tool",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L433-L473 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.scanForGrammars | private GrammarInfo [] scanForGrammars () throws MojoExecutionException
{
if (!getSourceDirectory ().isDirectory ())
{
return null;
}
GrammarInfo [] grammarInfos;
getLog ().debug ("Scanning for grammars: " + getSourceDirectory ());
try
{
final GrammarDirectoryScanner scanner ... | java | private GrammarInfo [] scanForGrammars () throws MojoExecutionException
{
if (!getSourceDirectory ().isDirectory ())
{
return null;
}
GrammarInfo [] grammarInfos;
getLog ().debug ("Scanning for grammars: " + getSourceDirectory ());
try
{
final GrammarDirectoryScanner scanner ... | [
"private",
"GrammarInfo",
"[",
"]",
"scanForGrammars",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"!",
"getSourceDirectory",
"(",
")",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"GrammarInfo",
"[",
"]",
"grammarInf... | Scans the configured source directory for grammar files which need
processing.
@return An array of grammar infos describing the found grammar files or
<code>null</code> if the source directory does not exist.
@throws MojoExecutionException
If the source directory could not be scanned. | [
"Scans",
"the",
"configured",
"source",
"directory",
"for",
"grammar",
"files",
"which",
"need",
"processing",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L497-L526 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.deleteTempDirectory | protected void deleteTempDirectory (final File tempDirectory)
{
try
{
FileUtils.deleteDirectory (tempDirectory);
}
catch (final IOException e)
{
getLog ().warn ("Failed to delete temporary directory: " + tempDirectory, e);
}
} | java | protected void deleteTempDirectory (final File tempDirectory)
{
try
{
FileUtils.deleteDirectory (tempDirectory);
}
catch (final IOException e)
{
getLog ().warn ("Failed to delete temporary directory: " + tempDirectory, e);
}
} | [
"protected",
"void",
"deleteTempDirectory",
"(",
"final",
"File",
"tempDirectory",
")",
"{",
"try",
"{",
"FileUtils",
".",
"deleteDirectory",
"(",
"tempDirectory",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"e",
")",
"{",
"getLog",
"(",
")",
".",
... | Deletes the specified temporary directory.
@param tempDirectory
The directory to delete, must not be <code>null</code>. | [
"Deletes",
"the",
"specified",
"temporary",
"directory",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L544-L554 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.findSourceFile | private File findSourceFile (final String filename)
{
final Collection <File> sourceRoots = this.nonGeneratedSourceRoots;
for (final File sourceRoot : sourceRoots)
{
final File sourceFile = new File (sourceRoot, filename);
if (sourceFile.exists ())
{
return sourceFile;
}
... | java | private File findSourceFile (final String filename)
{
final Collection <File> sourceRoots = this.nonGeneratedSourceRoots;
for (final File sourceRoot : sourceRoots)
{
final File sourceFile = new File (sourceRoot, filename);
if (sourceFile.exists ())
{
return sourceFile;
}
... | [
"private",
"File",
"findSourceFile",
"(",
"final",
"String",
"filename",
")",
"{",
"final",
"Collection",
"<",
"File",
">",
"sourceRoots",
"=",
"this",
".",
"nonGeneratedSourceRoots",
";",
"for",
"(",
"final",
"File",
"sourceRoot",
":",
"sourceRoots",
")",
"{"... | Determines whether the specified source file is already present in any of the
compile source roots registered with the current Maven project.
@param filename
The source filename to check, relative to a source root, must not be
<code>null</code>.
@return The (absolute) path to the existing source file if any,
<code>nul... | [
"Determines",
"whether",
"the",
"specified",
"source",
"file",
"is",
"already",
"present",
"in",
"any",
"of",
"the",
"compile",
"source",
"roots",
"registered",
"with",
"the",
"current",
"Maven",
"project",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L693-L705 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.addSourceRoot | private void addSourceRoot (final File directory)
{
if (this.project != null)
{
getLog ().debug ("Adding compile source root: " + directory);
this.project.addCompileSourceRoot (directory.getAbsolutePath ());
}
} | java | private void addSourceRoot (final File directory)
{
if (this.project != null)
{
getLog ().debug ("Adding compile source root: " + directory);
this.project.addCompileSourceRoot (directory.getAbsolutePath ());
}
} | [
"private",
"void",
"addSourceRoot",
"(",
"final",
"File",
"directory",
")",
"{",
"if",
"(",
"this",
".",
"project",
"!=",
"null",
")",
"{",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"Adding compile source root: \"",
"+",
"directory",
")",
";",
"this",
".",
... | Registers the specified directory as a compile source root for the current
project.
@param directory
The absolute path to the source root, must not be <code>null</code>. | [
"Registers",
"the",
"specified",
"directory",
"as",
"a",
"compile",
"source",
"root",
"for",
"the",
"current",
"project",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L728-L735 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.newJavaCC | protected JavaCC newJavaCC ()
{
final JavaCC javacc = new JavaCC ();
javacc.setLog (getLog ());
javacc.setGrammarEncoding (this.grammarEncoding);
javacc.setOutputEncoding (this.outputEncoding);
javacc.setJdkVersion (this.jdkVersion);
javacc.setBuildParser (this.buildParser);
javacc.setBuil... | java | protected JavaCC newJavaCC ()
{
final JavaCC javacc = new JavaCC ();
javacc.setLog (getLog ());
javacc.setGrammarEncoding (this.grammarEncoding);
javacc.setOutputEncoding (this.outputEncoding);
javacc.setJdkVersion (this.jdkVersion);
javacc.setBuildParser (this.buildParser);
javacc.setBuil... | [
"protected",
"JavaCC",
"newJavaCC",
"(",
")",
"{",
"final",
"JavaCC",
"javacc",
"=",
"new",
"JavaCC",
"(",
")",
";",
"javacc",
".",
"setLog",
"(",
"getLog",
"(",
")",
")",
";",
"javacc",
".",
"setGrammarEncoding",
"(",
"this",
".",
"grammarEncoding",
")"... | Creates a new facade to invoke JavaCC. Most options for the invocation are
derived from the current values of the corresponding mojo parameters. The
caller is responsible to set the input file and output directory on the
returned facade.
@return The facade for the tool invocation, never <code>null</code>. | [
"Creates",
"a",
"new",
"facade",
"to",
"invoke",
"JavaCC",
".",
"Most",
"options",
"for",
"the",
"invocation",
"are",
"derived",
"from",
"the",
"current",
"values",
"of",
"the",
"corresponding",
"mojo",
"parameters",
".",
"The",
"caller",
"is",
"responsible",
... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L745-L777 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/UrlUtils.java | UrlUtils.getResourceRoot | public static File getResourceRoot (final URL url, final String resource)
{
String path = null;
if (url != null)
{
final String spec = url.toExternalForm ();
if ((JAR_FILE).regionMatches (true, 0, spec, 0, JAR_FILE.length ()))
{
URL jar;
try
{
jar = new ... | java | public static File getResourceRoot (final URL url, final String resource)
{
String path = null;
if (url != null)
{
final String spec = url.toExternalForm ();
if ((JAR_FILE).regionMatches (true, 0, spec, 0, JAR_FILE.length ()))
{
URL jar;
try
{
jar = new ... | [
"public",
"static",
"File",
"getResourceRoot",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"resource",
")",
"{",
"String",
"path",
"=",
"null",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"final",
"String",
"spec",
"=",
"url",
".",
"toExtern... | Gets the absolute filesystem path to the class path root for the specified
resource. The root is either a JAR file or a directory with loose class
files. If the URL does not use a supported protocol, an exception will be
thrown.
@param url
The URL to the resource, may be <code>null</code>.
@param resource
The name of ... | [
"Gets",
"the",
"absolute",
"filesystem",
"path",
"to",
"the",
"class",
"path",
"root",
"for",
"the",
"specified",
"resource",
".",
"The",
"root",
"is",
"either",
"a",
"JAR",
"file",
"or",
"a",
"directory",
"with",
"loose",
"class",
"files",
".",
"If",
"t... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/UrlUtils.java#L70-L101 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTBJavaCCMojo.java | JTBJavaCCMojo.newJTB | private JTB newJTB ()
{
final JTB jtb = new JTB ();
jtb.setLog (getLog ());
jtb.setDescriptiveFieldNames (this.descriptiveFieldNames);
jtb.setJavadocFriendlyComments (this.javadocFriendlyComments);
jtb.setNodeParentClass (this.nodeParentClass);
jtb.setParentPointers (this.parentPointers);
... | java | private JTB newJTB ()
{
final JTB jtb = new JTB ();
jtb.setLog (getLog ());
jtb.setDescriptiveFieldNames (this.descriptiveFieldNames);
jtb.setJavadocFriendlyComments (this.javadocFriendlyComments);
jtb.setNodeParentClass (this.nodeParentClass);
jtb.setParentPointers (this.parentPointers);
... | [
"private",
"JTB",
"newJTB",
"(",
")",
"{",
"final",
"JTB",
"jtb",
"=",
"new",
"JTB",
"(",
")",
";",
"jtb",
".",
"setLog",
"(",
"getLog",
"(",
")",
")",
";",
"jtb",
".",
"setDescriptiveFieldNames",
"(",
"this",
".",
"descriptiveFieldNames",
")",
";",
... | Creates a new facade to invoke JTB. Most options for the invocation are
derived from the current values of the corresponding mojo parameters. The
caller is responsible to set the input file, output directories and
packages on the returned facade.
@return The facade for the tool invocation, never <code>null</code>. | [
"Creates",
"a",
"new",
"facade",
"to",
"invoke",
"JTB",
".",
"Most",
"options",
"for",
"the",
"invocation",
"are",
"derived",
"from",
"the",
"current",
"values",
"of",
"the",
"corresponding",
"mojo",
"parameters",
".",
"The",
"caller",
"is",
"responsible",
"... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTBJavaCCMojo.java#L401-L414 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java | GrammarDirectoryScanner.setSourceDirectory | public void setSourceDirectory (final File directory)
{
if (!directory.isAbsolute ())
{
throw new IllegalArgumentException ("source directory is not absolute: " + directory);
}
this.scanner.setBasedir (directory);
} | java | public void setSourceDirectory (final File directory)
{
if (!directory.isAbsolute ())
{
throw new IllegalArgumentException ("source directory is not absolute: " + directory);
}
this.scanner.setBasedir (directory);
} | [
"public",
"void",
"setSourceDirectory",
"(",
"final",
"File",
"directory",
")",
"{",
"if",
"(",
"!",
"directory",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"source directory is not absolute: \"",
"+",
"directory",
")... | Sets the absolute path to the source directory to scan for grammar files.
This directory must exist or the scanner will report an error.
@param directory
The absolute path to the source directory to scan, must not be
<code>null</code>. | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"source",
"directory",
"to",
"scan",
"for",
"grammar",
"files",
".",
"This",
"directory",
"must",
"exist",
"or",
"the",
"scanner",
"will",
"report",
"an",
"error",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java#L90-L97 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java | GrammarDirectoryScanner.setOutputDirectory | public void setOutputDirectory (final File directory)
{
if (directory != null && !directory.isAbsolute ())
{
throw new IllegalArgumentException ("output directory is not absolute: " + directory);
}
this.outputDirectory = directory;
} | java | public void setOutputDirectory (final File directory)
{
if (directory != null && !directory.isAbsolute ())
{
throw new IllegalArgumentException ("output directory is not absolute: " + directory);
}
this.outputDirectory = directory;
} | [
"public",
"void",
"setOutputDirectory",
"(",
"final",
"File",
"directory",
")",
"{",
"if",
"(",
"directory",
"!=",
"null",
"&&",
"!",
"directory",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output directory is not ... | Sets the absolute path to the output directory used to detect stale target
files.
@param directory
The absolute path to the output directory used to detect stale target
files by timestamp checking, may be <code>null</code> if no stale
detection should be performed. | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"used",
"to",
"detect",
"stale",
"target",
"files",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java#L145-L152 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java | GrammarDirectoryScanner.scan | public void scan () throws IOException
{
this.includedGrammars.clear ();
this.scanner.scan ();
final String [] includedFiles = this.scanner.getIncludedFiles ();
for (final String includedFile : includedFiles)
{
final GrammarInfo grammarInfo = new GrammarInfo (this.scanner.getBasedir (), inc... | java | public void scan () throws IOException
{
this.includedGrammars.clear ();
this.scanner.scan ();
final String [] includedFiles = this.scanner.getIncludedFiles ();
for (final String includedFile : includedFiles)
{
final GrammarInfo grammarInfo = new GrammarInfo (this.scanner.getBasedir (), inc... | [
"public",
"void",
"scan",
"(",
")",
"throws",
"IOException",
"{",
"this",
".",
"includedGrammars",
".",
"clear",
"(",
")",
";",
"this",
".",
"scanner",
".",
"scan",
"(",
")",
";",
"final",
"String",
"[",
"]",
"includedFiles",
"=",
"this",
".",
"scanner... | Scans the source directory for grammar files that match at least one
inclusion pattern but no exclusion pattern, optionally performing timestamp
checking to exclude grammars whose corresponding parser files are up to date.
@throws IOException
If a grammar file could not be analyzed for metadata. | [
"Scans",
"the",
"source",
"directory",
"for",
"grammar",
"files",
"that",
"match",
"at",
"least",
"one",
"inclusion",
"pattern",
"but",
"no",
"exclusion",
"pattern",
"optionally",
"performing",
"timestamp",
"checking",
"to",
"exclude",
"grammars",
"whose",
"corres... | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java#L176-L204 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java | GrammarDirectoryScanner.getTargetFiles | protected File [] getTargetFiles (final File targetDirectory, final String grammarFile, final GrammarInfo grammarInfo)
{
final File parserFile = new File (targetDirectory, grammarInfo.getParserFile ());
return new File [] { parserFile };
} | java | protected File [] getTargetFiles (final File targetDirectory, final String grammarFile, final GrammarInfo grammarInfo)
{
final File parserFile = new File (targetDirectory, grammarInfo.getParserFile ());
return new File [] { parserFile };
} | [
"protected",
"File",
"[",
"]",
"getTargetFiles",
"(",
"final",
"File",
"targetDirectory",
",",
"final",
"String",
"grammarFile",
",",
"final",
"GrammarInfo",
"grammarInfo",
")",
"{",
"final",
"File",
"parserFile",
"=",
"new",
"File",
"(",
"targetDirectory",
",",... | Determines the output files corresponding to the specified grammar file.
@param targetDirectory
The absolute path to the output directory for the target files, must
not be <code>null</code>.
@param grammarFile
The path to the grammar file, relative to the scanned source
directory, must not be <code>null</code>.
@param... | [
"Determines",
"the",
"output",
"files",
"corresponding",
"to",
"the",
"specified",
"grammar",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarDirectoryScanner.java#L220-L224 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarInfo.java | GrammarInfo.findPackageName | private String findPackageName (final String grammar)
{
final String packageDeclaration = "package\\s+([^\\s.;]+(\\.[^\\s.;]+)*)\\s*;";
final Matcher matcher = Pattern.compile (packageDeclaration).matcher (grammar);
if (matcher.find ())
{
return matcher.group (1);
}
return "";
} | java | private String findPackageName (final String grammar)
{
final String packageDeclaration = "package\\s+([^\\s.;]+(\\.[^\\s.;]+)*)\\s*;";
final Matcher matcher = Pattern.compile (packageDeclaration).matcher (grammar);
if (matcher.find ())
{
return matcher.group (1);
}
return "";
} | [
"private",
"String",
"findPackageName",
"(",
"final",
"String",
"grammar",
")",
"{",
"final",
"String",
"packageDeclaration",
"=",
"\"package\\\\s+([^\\\\s.;]+(\\\\.[^\\\\s.;]+)*)\\\\s*;\"",
";",
"final",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compile",
"(",
"packa... | Extracts the declared package name from the specified grammar file.
@param grammar
The contents of the grammar file, must not be <code>null</code>.
@return The declared package name or an empty string if not found. | [
"Extracts",
"the",
"declared",
"package",
"name",
"from",
"the",
"specified",
"grammar",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarInfo.java#L171-L180 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/GrammarInfo.java | GrammarInfo.findParserName | private String findParserName (final String grammar)
{
final String parserBegin = "PARSER_BEGIN\\s*\\(\\s*([^\\s\\)]+)\\s*\\)";
final Matcher matcher = Pattern.compile (parserBegin).matcher (grammar);
if (matcher.find ())
{
return matcher.group (1);
}
return "";
} | java | private String findParserName (final String grammar)
{
final String parserBegin = "PARSER_BEGIN\\s*\\(\\s*([^\\s\\)]+)\\s*\\)";
final Matcher matcher = Pattern.compile (parserBegin).matcher (grammar);
if (matcher.find ())
{
return matcher.group (1);
}
return "";
} | [
"private",
"String",
"findParserName",
"(",
"final",
"String",
"grammar",
")",
"{",
"final",
"String",
"parserBegin",
"=",
"\"PARSER_BEGIN\\\\s*\\\\(\\\\s*([^\\\\s\\\\)]+)\\\\s*\\\\)\"",
";",
"final",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compile",
"(",
"parserBeg... | Extracts the simple parser name from the specified grammar file.
@param grammar
The contents of the grammar file, must not be <code>null</code>.
@return The parser name or an empty string if not found. | [
"Extracts",
"the",
"simple",
"parser",
"name",
"from",
"the",
"specified",
"grammar",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/GrammarInfo.java#L189-L198 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractToolFacade.java | AbstractToolFacade.getToolName | protected String getToolName ()
{
final String name = getClass ().getName ();
return name.substring (name.lastIndexOf ('.') + 1);
} | java | protected String getToolName ()
{
final String name = getClass ().getName ();
return name.substring (name.lastIndexOf ('.') + 1);
} | [
"protected",
"String",
"getToolName",
"(",
")",
"{",
"final",
"String",
"name",
"=",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"return",
"name",
".",
"substring",
"(",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";",
"... | Gets the name of the tool.
@return The name of the tool, never <code>null</code>. | [
"Gets",
"the",
"name",
"of",
"the",
"tool",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractToolFacade.java#L81-L85 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractToolFacade.java | AbstractToolFacade.run | public void run () throws MojoExecutionException, MojoFailureException
{
ESuccess exitCode;
try
{
if (getLog ().isDebugEnabled ())
{
getLog ().debug ("Running " + getToolName () + ": " + this);
}
exitCode = execute ();
}
catch (final Exception e)
{
throw n... | java | public void run () throws MojoExecutionException, MojoFailureException
{
ESuccess exitCode;
try
{
if (getLog ().isDebugEnabled ())
{
getLog ().debug ("Running " + getToolName () + ": " + this);
}
exitCode = execute ();
}
catch (final Exception e)
{
throw n... | [
"public",
"void",
"run",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"ESuccess",
"exitCode",
";",
"try",
"{",
"if",
"(",
"getLog",
"(",
")",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"getLog",
"(",
")",
".",
"debug",
... | Runs the tool using the previously set parameters.
@throws MojoExecutionException
If the tool could not be invoked.
@throws MojoFailureException
If the tool reported a non-zero exit code. | [
"Runs",
"the",
"tool",
"using",
"the",
"previously",
"set",
"parameters",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractToolFacade.java#L105-L124 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDoc.java | JJDoc.setOutputFile | public void setOutputFile (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.outputFile = value;
} | java | public void setOutputFile (final File value)
{
if (value != null && !value.isAbsolute ())
{
throw new IllegalArgumentException ("path is not absolute: " + value);
}
this.outputFile = value;
} | [
"public",
"void",
"setOutputFile",
"(",
"final",
"File",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isAbsolute",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"path is not absolute: \"",
"+",
"valu... | Sets the absolute path to the output file.
@param value
The absolute path to the HTML/text file to generate. | [
"Sets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"file",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDoc.java#L104-L111 | train |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDoc.java | JJDoc._generateArguments | private String [] _generateArguments ()
{
final List <String> argsList = new ArrayList <> ();
if (StringUtils.isNotEmpty (this.grammarEncoding))
{
argsList.add ("-GRAMMAR_ENCODING=" + this.grammarEncoding);
}
if (StringUtils.isNotEmpty (this.outputEncoding))
{
argsList.add ("-OUT... | java | private String [] _generateArguments ()
{
final List <String> argsList = new ArrayList <> ();
if (StringUtils.isNotEmpty (this.grammarEncoding))
{
argsList.add ("-GRAMMAR_ENCODING=" + this.grammarEncoding);
}
if (StringUtils.isNotEmpty (this.outputEncoding))
{
argsList.add ("-OUT... | [
"private",
"String",
"[",
"]",
"_generateArguments",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"argsList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"this",
".",
"grammarEncoding",
")",
")",... | Assembles the command line arguments for the invocation of JJDoc according
to the configuration.
@return A string array that represents the arguments to use for JJDoc. | [
"Assembles",
"the",
"command",
"line",
"arguments",
"for",
"the",
"invocation",
"of",
"JJDoc",
"according",
"to",
"the",
"configuration",
"."
] | 99497a971fe59ab2289258ca7ddcfa40e651f19f | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDoc.java#L217-L262 | train |
NextFaze/power-adapters | power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java | PowerAdapter.offset | @CheckResult
@NonNull
public final PowerAdapter offset(int offset) {
if (offset <= 0) {
return this;
}
if (offset == Integer.MAX_VALUE) {
return EMPTY;
}
return new OffsetAdapter(this, offset);
} | java | @CheckResult
@NonNull
public final PowerAdapter offset(int offset) {
if (offset <= 0) {
return this;
}
if (offset == Integer.MAX_VALUE) {
return EMPTY;
}
return new OffsetAdapter(this, offset);
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"final",
"PowerAdapter",
"offset",
"(",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"<=",
"0",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"offset",
"==",
"Integer",
".",
"MAX_VALUE",
")",
"{",
"... | Returns a new adapter that presents all items of this adapter, starting at the specified offset.
@param offset The item offset.
@return A new adapter. | [
"Returns",
"a",
"new",
"adapter",
"that",
"presents",
"all",
"items",
"of",
"this",
"adapter",
"starting",
"at",
"the",
"specified",
"offset",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java#L482-L492 | train |
NextFaze/power-adapters | power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java | PowerAdapter.limit | @CheckResult
@NonNull
public final PowerAdapter limit(int limit) {
if (limit == Integer.MAX_VALUE) {
return this;
}
if (limit <= 0) {
return EMPTY;
}
return new LimitAdapter(this, limit);
} | java | @CheckResult
@NonNull
public final PowerAdapter limit(int limit) {
if (limit == Integer.MAX_VALUE) {
return this;
}
if (limit <= 0) {
return EMPTY;
}
return new LimitAdapter(this, limit);
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"final",
"PowerAdapter",
"limit",
"(",
"int",
"limit",
")",
"{",
"if",
"(",
"limit",
"==",
"Integer",
".",
"MAX_VALUE",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"limit",
"<=",
"0",
")",
"{",
"retu... | Returns a new adapter that presents all items of this adapter, up until the specified limit.
@param limit The item limit.
@return A new adapter. | [
"Returns",
"a",
"new",
"adapter",
"that",
"presents",
"all",
"items",
"of",
"this",
"adapter",
"up",
"until",
"the",
"specified",
"limit",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java#L499-L509 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/widget/DataLayout.java | DataLayout.shouldAnimate | private boolean shouldAnimate() {
if (!mAnimationEnabled) {
return false;
}
Display display = currentDisplay();
if (display == null) {
return false;
}
if (mVisibleStartTime <= 0) {
return false;
}
long threshold = (long)... | java | private boolean shouldAnimate() {
if (!mAnimationEnabled) {
return false;
}
Display display = currentDisplay();
if (display == null) {
return false;
}
if (mVisibleStartTime <= 0) {
return false;
}
long threshold = (long)... | [
"private",
"boolean",
"shouldAnimate",
"(",
")",
"{",
"if",
"(",
"!",
"mAnimationEnabled",
")",
"{",
"return",
"false",
";",
"}",
"Display",
"display",
"=",
"currentDisplay",
"(",
")",
";",
"if",
"(",
"display",
"==",
"null",
")",
"{",
"return",
"false",... | Returns whether now is an appropriate time to perform animations. | [
"Returns",
"whether",
"now",
"is",
"an",
"appropriate",
"time",
"to",
"perform",
"animations",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/widget/DataLayout.java#L733-L747 | train |
NextFaze/power-adapters | power-adapters/src/main/java/com/nextfaze/poweradapters/Condition.java | Condition.notifyChanged | protected final void notifyChanged() {
for (int i = mObservers.size() - 1; i >= 0; i--) {
mObservers.get(i).onChanged();
}
} | java | protected final void notifyChanged() {
for (int i = mObservers.size() - 1; i >= 0; i--) {
mObservers.get(i).onChanged();
}
} | [
"protected",
"final",
"void",
"notifyChanged",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"mObservers",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"mObservers",
".",
"get",
"(",
"i",
")",
".",
"onChanged",
... | Notify observers that the condition has changed. | [
"Notify",
"observers",
"that",
"the",
"condition",
"has",
"changed",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/Condition.java#L36-L40 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/Data.java | Data.notifyError | protected final void notifyError(@NonNull final Throwable e) {
//noinspection ThrowableResultOfMethodCallIgnored
checkNotNull(e, "e");
runOnUiThread(new Runnable() {
@Override
public void run() {
mErrorObservable.notifyError(e);
}
});
... | java | protected final void notifyError(@NonNull final Throwable e) {
//noinspection ThrowableResultOfMethodCallIgnored
checkNotNull(e, "e");
runOnUiThread(new Runnable() {
@Override
public void run() {
mErrorObservable.notifyError(e);
}
});
... | [
"protected",
"final",
"void",
"notifyError",
"(",
"@",
"NonNull",
"final",
"Throwable",
"e",
")",
"{",
"//noinspection ThrowableResultOfMethodCallIgnored",
"checkNotNull",
"(",
"e",
",",
"\"e\"",
")",
";",
"runOnUiThread",
"(",
"new",
"Runnable",
"(",
")",
"{",
... | Dispatch an error notification on the UI thread. | [
"Dispatch",
"an",
"error",
"notification",
"on",
"the",
"UI",
"thread",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/Data.java#L420-L429 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/Data.java | Data.filter | @CheckResult
@NonNull
public final <O> Data<O> filter(@NonNull final Class<O> type) {
//noinspection unchecked
return (Data<O>) new FilterData<>(this, new Predicate<Object>() {
@Override
public boolean apply(Object o) {
return type.isInstance(o);
... | java | @CheckResult
@NonNull
public final <O> Data<O> filter(@NonNull final Class<O> type) {
//noinspection unchecked
return (Data<O>) new FilterData<>(this, new Predicate<Object>() {
@Override
public boolean apply(Object o) {
return type.isInstance(o);
... | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"final",
"<",
"O",
">",
"Data",
"<",
"O",
">",
"filter",
"(",
"@",
"NonNull",
"final",
"Class",
"<",
"O",
">",
"type",
")",
"{",
"//noinspection unchecked",
"return",
"(",
"Data",
"<",
"O",
">",
")",
"new... | Filter this data by class. The resulting elements are guaranteed to be of the given type. | [
"Filter",
"this",
"data",
"by",
"class",
".",
"The",
"resulting",
"elements",
"are",
"guaranteed",
"to",
"be",
"of",
"the",
"given",
"type",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/Data.java#L457-L467 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/IncrementalArrayData.java | IncrementalArrayData.loadLoop | private void loadLoop() throws InterruptedException {
boolean firstItem = true;
boolean moreAvailable = true;
// Loop until all loaded.
while (moreAvailable) {
// Thread interruptions terminate the loop.
if (currentThread().isInterrupted()) {
thro... | java | private void loadLoop() throws InterruptedException {
boolean firstItem = true;
boolean moreAvailable = true;
// Loop until all loaded.
while (moreAvailable) {
// Thread interruptions terminate the loop.
if (currentThread().isInterrupted()) {
thro... | [
"private",
"void",
"loadLoop",
"(",
")",
"throws",
"InterruptedException",
"{",
"boolean",
"firstItem",
"=",
"true",
";",
"boolean",
"moreAvailable",
"=",
"true",
";",
"// Loop until all loaded.",
"while",
"(",
"moreAvailable",
")",
"{",
"// Thread interruptions termi... | Loads each increment until full range has been loading, halting in between increment until instructed to
proceed. | [
"Loads",
"each",
"increment",
"until",
"full",
"range",
"has",
"been",
"loading",
"halting",
"in",
"between",
"increment",
"until",
"instructed",
"to",
"proceed",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/IncrementalArrayData.java#L228-L283 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java | CursorData.updateCursorObserver | private void updateCursorObserver() {
Cursor newObservedCursor = getDataObserverCount() > 0 ? mCursor : null;
if (newObservedCursor != mObservedCursor) {
if (mObservedCursor != null) {
mObservedCursor.unregisterContentObserver(mCursorContentObserver);
}
... | java | private void updateCursorObserver() {
Cursor newObservedCursor = getDataObserverCount() > 0 ? mCursor : null;
if (newObservedCursor != mObservedCursor) {
if (mObservedCursor != null) {
mObservedCursor.unregisterContentObserver(mCursorContentObserver);
}
... | [
"private",
"void",
"updateCursorObserver",
"(",
")",
"{",
"Cursor",
"newObservedCursor",
"=",
"getDataObserverCount",
"(",
")",
">",
"0",
"?",
"mCursor",
":",
"null",
";",
"if",
"(",
"newObservedCursor",
"!=",
"mObservedCursor",
")",
"{",
"if",
"(",
"mObserved... | Registers or unregisters with the cursor. Idempotent. | [
"Registers",
"or",
"unregisters",
"with",
"the",
"cursor",
".",
"Idempotent",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java#L208-L219 | train |
NextFaze/power-adapters | power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java | CursorData.closeCursor | private void closeCursor() {
if (mCursor != null) {
int count = mCursor.getCount();
mCursor.close();
mCursor = null;
notifyItemRangeRemoved(0, count);
}
updateCursorObserver();
} | java | private void closeCursor() {
if (mCursor != null) {
int count = mCursor.getCount();
mCursor.close();
mCursor = null;
notifyItemRangeRemoved(0, count);
}
updateCursorObserver();
} | [
"private",
"void",
"closeCursor",
"(",
")",
"{",
"if",
"(",
"mCursor",
"!=",
"null",
")",
"{",
"int",
"count",
"=",
"mCursor",
".",
"getCount",
"(",
")",
";",
"mCursor",
".",
"close",
"(",
")",
";",
"mCursor",
"=",
"null",
";",
"notifyItemRangeRemoved"... | Closes the cursor, notifying observers of data changes as necessary. | [
"Closes",
"the",
"cursor",
"notifying",
"observers",
"of",
"data",
"changes",
"as",
"necessary",
"."
] | cdf00b1b723ed9d6bcd549ae9741a19dd59651e1 | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/CursorData.java#L222-L230 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java | XmlPrintStream.printElement | public void printElement(String elementName, Object value) {
println("<" + elementName + ">" + (value == null ? "" : escape(value.toString())) + "</" + elementName + ">");
} | java | public void printElement(String elementName, Object value) {
println("<" + elementName + ">" + (value == null ? "" : escape(value.toString())) + "</" + elementName + ">");
} | [
"public",
"void",
"printElement",
"(",
"String",
"elementName",
",",
"Object",
"value",
")",
"{",
"println",
"(",
"\"<\"",
"+",
"elementName",
"+",
"\">\"",
"+",
"(",
"value",
"==",
"null",
"?",
"\"\"",
":",
"escape",
"(",
"value",
".",
"toString",
"(",
... | Output a complete element with the given content.
@param elementName Name of element.
@param value Content of element. | [
"Output",
"a",
"complete",
"element",
"with",
"the",
"given",
"content",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L109-L111 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java | XmlPrintStream.printElement | public void printElement(String elementName, String value, Map<String, String> attributes) {
print("<" + elementName);
for (Entry<String, String> entry : attributes.entrySet()) {
print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\"");
}
if (value != null) {
println(">" + esc... | java | public void printElement(String elementName, String value, Map<String, String> attributes) {
print("<" + elementName);
for (Entry<String, String> entry : attributes.entrySet()) {
print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\"");
}
if (value != null) {
println(">" + esc... | [
"public",
"void",
"printElement",
"(",
"String",
"elementName",
",",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"print",
"(",
"\"<\"",
"+",
"elementName",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
... | Output a complete element with the given content and attributes.
@param elementName Name of element.
@param value Content of element.
@param attributes A map of name value pairs which will be used to add attributes to
the element. | [
"Output",
"a",
"complete",
"element",
"with",
"the",
"given",
"content",
"and",
"attributes",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L133-L145 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java | XmlPrintStream.escape | public String escape(String in) {
StringBuffer out = new StringBuffer();
for (char c : in.toCharArray()) {
switch (c) {
case '<':
out.append("<");
break;
case '>':
out.append(">");
break;
case '&':
out.append("&");
... | java | public String escape(String in) {
StringBuffer out = new StringBuffer();
for (char c : in.toCharArray()) {
switch (c) {
case '<':
out.append("<");
break;
case '>':
out.append(">");
break;
case '&':
out.append("&");
... | [
"public",
"String",
"escape",
"(",
"String",
"in",
")",
"{",
"StringBuffer",
"out",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"char",
"c",
":",
"in",
".",
"toCharArray",
"(",
")",
")",
"{",
"switch",
"(",
"c",
")",
"{",
"case",
"'",
... | Translate reserved XML characters to XML entities.
@param in Input string. | [
"Translate",
"reserved",
"XML",
"characters",
"to",
"XML",
"entities",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L167-L190 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java | XmlPrintStream.removeNewLines | public static String removeNewLines(String textContent) {
if (textContent == null) {
return "";
}
StringBuilder s = new StringBuilder();
boolean inNl = false;
for (char c : textContent.toCharArray()) {
if (c == '\n') {
if (!inNl) {
s.append(' ');
inNl = true... | java | public static String removeNewLines(String textContent) {
if (textContent == null) {
return "";
}
StringBuilder s = new StringBuilder();
boolean inNl = false;
for (char c : textContent.toCharArray()) {
if (c == '\n') {
if (!inNl) {
s.append(' ');
inNl = true... | [
"public",
"static",
"String",
"removeNewLines",
"(",
"String",
"textContent",
")",
"{",
"if",
"(",
"textContent",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"inNl",
"=",
... | Replace multiple newline characters with a single space.
@param textContent input String | [
"Replace",
"multiple",
"newline",
"characters",
"with",
"a",
"single",
"space",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L196-L216 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java | Element.buildAll | public void buildAll(MessageMLParser context, org.w3c.dom.Element element) throws InvalidInputException,
ProcessingException {
NamedNodeMap attr = element.getAttributes();
for (int i = 0; i < attr.getLength(); i++) {
buildAttribute(attr.item(i));
}
NodeList children = element.getChildNodes... | java | public void buildAll(MessageMLParser context, org.w3c.dom.Element element) throws InvalidInputException,
ProcessingException {
NamedNodeMap attr = element.getAttributes();
for (int i = 0; i < attr.getLength(); i++) {
buildAttribute(attr.item(i));
}
NodeList children = element.getChildNodes... | [
"public",
"void",
"buildAll",
"(",
"MessageMLParser",
"context",
",",
"org",
".",
"w3c",
".",
"dom",
".",
"Element",
"element",
")",
"throws",
"InvalidInputException",
",",
"ProcessingException",
"{",
"NamedNodeMap",
"attr",
"=",
"element",
".",
"getAttributes",
... | Process a DOM element, descending into its children, and construct the output MessageML tree. | [
"Process",
"a",
"DOM",
"element",
"descending",
"into",
"its",
"children",
"and",
"construct",
"the",
"output",
"MessageML",
"tree",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java#L80-L93 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java | Element.buildAttribute | void buildAttribute(org.w3c.dom.Node item) throws InvalidInputException {
switch (item.getNodeName()) {
case CLASS_ATTR:
attributes.put(CLASS_ATTR, getStringAttribute(item));
break;
case STYLE_ATTR:
final String styleAttribute = getStringAttribute(item);
Styles.validate(s... | java | void buildAttribute(org.w3c.dom.Node item) throws InvalidInputException {
switch (item.getNodeName()) {
case CLASS_ATTR:
attributes.put(CLASS_ATTR, getStringAttribute(item));
break;
case STYLE_ATTR:
final String styleAttribute = getStringAttribute(item);
Styles.validate(s... | [
"void",
"buildAttribute",
"(",
"org",
".",
"w3c",
".",
"dom",
".",
"Node",
"item",
")",
"throws",
"InvalidInputException",
"{",
"switch",
"(",
"item",
".",
"getNodeName",
"(",
")",
")",
"{",
"case",
"CLASS_ATTR",
":",
"attributes",
".",
"put",
"(",
"CLAS... | Parse a DOM attribute into MessageML element properties. | [
"Parse",
"a",
"DOM",
"attribute",
"into",
"MessageML",
"element",
"properties",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java#L98-L112 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java | Element.buildNode | private void buildNode(MessageMLParser context, org.w3c.dom.Node node) throws InvalidInputException, ProcessingException {
switch (node.getNodeType()) {
case org.w3c.dom.Node.TEXT_NODE:
buildText((Text) node);
break;
case org.w3c.dom.Node.ELEMENT_NODE:
buildElement(context, (org... | java | private void buildNode(MessageMLParser context, org.w3c.dom.Node node) throws InvalidInputException, ProcessingException {
switch (node.getNodeType()) {
case org.w3c.dom.Node.TEXT_NODE:
buildText((Text) node);
break;
case org.w3c.dom.Node.ELEMENT_NODE:
buildElement(context, (org... | [
"private",
"void",
"buildNode",
"(",
"MessageMLParser",
"context",
",",
"org",
".",
"w3c",
".",
"dom",
".",
"Node",
"node",
")",
"throws",
"InvalidInputException",
",",
"ProcessingException",
"{",
"switch",
"(",
"node",
".",
"getNodeType",
"(",
")",
")",
"{"... | Build a text node or a MessageML element based on the provided DOM node. | [
"Build",
"a",
"text",
"node",
"or",
"a",
"MessageML",
"element",
"based",
"on",
"the",
"provided",
"DOM",
"node",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java#L117-L131 | train |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java | Element.buildElement | private void buildElement(MessageMLParser context, org.w3c.dom.Element element) throws InvalidInputException,
ProcessingException {
Element child = context.createElement(element, this);
child.buildAll(context, element);
child.validate();
addChild(child);
} | java | private void buildElement(MessageMLParser context, org.w3c.dom.Element element) throws InvalidInputException,
ProcessingException {
Element child = context.createElement(element, this);
child.buildAll(context, element);
child.validate();
addChild(child);
} | [
"private",
"void",
"buildElement",
"(",
"MessageMLParser",
"context",
",",
"org",
".",
"w3c",
".",
"dom",
".",
"Element",
"element",
")",
"throws",
"InvalidInputException",
",",
"ProcessingException",
"{",
"Element",
"child",
"=",
"context",
".",
"createElement",
... | Build a MessageML element based on the provided DOM element and descend into its children. | [
"Build",
"a",
"MessageML",
"element",
"based",
"on",
"the",
"provided",
"DOM",
"element",
"and",
"descend",
"into",
"its",
"children",
"."
] | 68daed66267062d144a05b3ee9a9bf4b715e3f95 | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/elements/Element.java#L136-L142 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.