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
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5DeleteFile.java
FineUploader5DeleteFile.setMethod
@Nonnull public FineUploader5DeleteFile setMethod (@Nonnull final EHttpMethod eMethod) { ValueEnforcer.notNull (eMethod, "Method"); m_eDeleteFileMethod = eMethod; return this; }
java
@Nonnull public FineUploader5DeleteFile setMethod (@Nonnull final EHttpMethod eMethod) { ValueEnforcer.notNull (eMethod, "Method"); m_eDeleteFileMethod = eMethod; return this; }
[ "@", "Nonnull", "public", "FineUploader5DeleteFile", "setMethod", "(", "@", "Nonnull", "final", "EHttpMethod", "eMethod", ")", "{", "ValueEnforcer", ".", "notNull", "(", "eMethod", ",", "\"Method\"", ")", ";", "m_eDeleteFileMethod", "=", "eMethod", ";", "return", ...
Set the method to use for delete requests. Accepts 'POST' or 'DELETE'. @param eMethod New value. May not be <code>null</code>. @return this for chaining
[ "Set", "the", "method", "to", "use", "for", "delete", "requests", ".", "Accepts", "POST", "or", "DELETE", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5DeleteFile.java#L161-L167
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java
CommentProcessor.javaDocOnly
public List<JavaComment> javaDocOnly(final List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>( originals.size()); for (JavaComment comment : originals) { comment._switch(new JavaComment.SwitchBlockWithDefault() { @Override public void _case(JavaDocComment x) { results.add(x); } @Override protected void _default(JavaComment x) { // do nothing, we only want to add javadocs } }); } return results; }
java
public List<JavaComment> javaDocOnly(final List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>( originals.size()); for (JavaComment comment : originals) { comment._switch(new JavaComment.SwitchBlockWithDefault() { @Override public void _case(JavaDocComment x) { results.add(x); } @Override protected void _default(JavaComment x) { // do nothing, we only want to add javadocs } }); } return results; }
[ "public", "List", "<", "JavaComment", ">", "javaDocOnly", "(", "final", "List", "<", "JavaComment", ">", "originals", ")", "{", "final", "List", "<", "JavaComment", ">", "results", "=", "new", "ArrayList", "<", "JavaComment", ">", "(", "originals", ".", "s...
Turns a list of JavaComment into list of comments that only has javadoc comments
[ "Turns", "a", "list", "of", "JavaComment", "into", "list", "of", "comments", "that", "only", "has", "javadoc", "comments" ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java#L56-L74
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java
CommentProcessor.stripTags
public List<JavaComment> stripTags(final Set<String> tagNames, List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>( originals.size()); for (JavaComment original : originals) { results.add(original .match(new JavaComment.MatchBlock<JavaComment>() { @Override public JavaComment _case(JavaDocComment x) { final List<JDTagSection> newTagSections = new ArrayList<JDTagSection>( x.tagSections.size()); for (JDTagSection tagSection : x.tagSections) { if (!tagNames.contains(tagSection.name)) { newTagSections.add(tagSection); } } return _JavaDocComment(x.start, x.generalSection, newTagSections, x.end); } @Override public JavaComment _case(JavaBlockComment x) { return x; } @Override public JavaComment _case(JavaEOLComment x) { return x; } })); } return results; }
java
public List<JavaComment> stripTags(final Set<String> tagNames, List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>( originals.size()); for (JavaComment original : originals) { results.add(original .match(new JavaComment.MatchBlock<JavaComment>() { @Override public JavaComment _case(JavaDocComment x) { final List<JDTagSection> newTagSections = new ArrayList<JDTagSection>( x.tagSections.size()); for (JDTagSection tagSection : x.tagSections) { if (!tagNames.contains(tagSection.name)) { newTagSections.add(tagSection); } } return _JavaDocComment(x.start, x.generalSection, newTagSections, x.end); } @Override public JavaComment _case(JavaBlockComment x) { return x; } @Override public JavaComment _case(JavaEOLComment x) { return x; } })); } return results; }
[ "public", "List", "<", "JavaComment", ">", "stripTags", "(", "final", "Set", "<", "String", ">", "tagNames", ",", "List", "<", "JavaComment", ">", "originals", ")", "{", "final", "List", "<", "JavaComment", ">", "results", "=", "new", "ArrayList", "<", "...
Produce a copy of a list of comments where all javadoc comments have had the specified tags removed. Non javadoc comments are left alone. @param tagNames Set of tag names (including leading @) to be removed @param originals List of Comments to be processed @return a new list of comments with the specified tags removed
[ "Produce", "a", "copy", "of", "a", "list", "of", "comments", "where", "all", "javadoc", "comments", "have", "had", "the", "specified", "tags", "removed", ".", "Non", "javadoc", "comments", "are", "left", "alone", "." ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java#L86-L119
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java
CommentProcessor.paramDoc
public List<JavaComment> paramDoc(final String paramName, List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>(originals.size()); for (JavaComment original : originals) { original._switch(new JavaComment.SwitchBlock() { @Override public void _case(JavaDocComment x) { paramDocSections(paramName, x.tagSections, results); } @Override public void _case(JavaBlockComment x) { // skip } @Override public void _case(JavaEOLComment x) { // skip } }); } return results; }
java
public List<JavaComment> paramDoc(final String paramName, List<JavaComment> originals) { final List<JavaComment> results = new ArrayList<JavaComment>(originals.size()); for (JavaComment original : originals) { original._switch(new JavaComment.SwitchBlock() { @Override public void _case(JavaDocComment x) { paramDocSections(paramName, x.tagSections, results); } @Override public void _case(JavaBlockComment x) { // skip } @Override public void _case(JavaEOLComment x) { // skip } }); } return results; }
[ "public", "List", "<", "JavaComment", ">", "paramDoc", "(", "final", "String", "paramName", ",", "List", "<", "JavaComment", ">", "originals", ")", "{", "final", "List", "<", "JavaComment", ">", "results", "=", "new", "ArrayList", "<", "JavaComment", ">", ...
Produce a copy of a list of JavaDoc comments by pulling specified parameter tags out of an orignal list of comments. Block and EOL comments are skipped. JavaDoc comments are stripped down to only have the content of the specified param tag
[ "Produce", "a", "copy", "of", "a", "list", "of", "JavaDoc", "comments", "by", "pulling", "specified", "parameter", "tags", "out", "of", "an", "orignal", "list", "of", "comments", ".", "Block", "and", "EOL", "comments", "are", "skipped", ".", "JavaDoc", "co...
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java#L126-L147
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(final int intVal) { this.type = ClassWriter.INT; this.intVal = intVal; this.hashCode = 0x7FFFFFFF & (type + intVal); }
java
void set(final int intVal) { this.type = ClassWriter.INT; this.intVal = intVal; this.hashCode = 0x7FFFFFFF & (type + intVal); }
[ "void", "set", "(", "final", "int", "intVal", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "INT", ";", "this", ".", "intVal", "=", "intVal", ";", "this", ".", "hashCode", "=", "0x7FFFFFFF", "&", "(", "type", "+", "intVal", ")", ";", "}" ...
Sets this item to an integer item. @param intVal the value of this item.
[ "Sets", "this", "item", "to", "an", "integer", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L151-L155
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(final long longVal) { this.type = ClassWriter.LONG; this.longVal = longVal; this.hashCode = 0x7FFFFFFF & (type + (int) longVal); }
java
void set(final long longVal) { this.type = ClassWriter.LONG; this.longVal = longVal; this.hashCode = 0x7FFFFFFF & (type + (int) longVal); }
[ "void", "set", "(", "final", "long", "longVal", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "LONG", ";", "this", ".", "longVal", "=", "longVal", ";", "this", ".", "hashCode", "=", "0x7FFFFFFF", "&", "(", "type", "+", "(", "int", ")", "l...
Sets this item to a long item. @param longVal the value of this item.
[ "Sets", "this", "item", "to", "a", "long", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L163-L167
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(final float floatVal) { this.type = ClassWriter.FLOAT; this.intVal = Float.floatToRawIntBits(floatVal); this.hashCode = 0x7FFFFFFF & (type + (int) floatVal); }
java
void set(final float floatVal) { this.type = ClassWriter.FLOAT; this.intVal = Float.floatToRawIntBits(floatVal); this.hashCode = 0x7FFFFFFF & (type + (int) floatVal); }
[ "void", "set", "(", "final", "float", "floatVal", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "FLOAT", ";", "this", ".", "intVal", "=", "Float", ".", "floatToRawIntBits", "(", "floatVal", ")", ";", "this", ".", "hashCode", "=", "0x7FFFFFFF", ...
Sets this item to a float item. @param floatVal the value of this item.
[ "Sets", "this", "item", "to", "a", "float", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L175-L179
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(final double doubleVal) { this.type = ClassWriter.DOUBLE; this.longVal = Double.doubleToRawLongBits(doubleVal); this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal); }
java
void set(final double doubleVal) { this.type = ClassWriter.DOUBLE; this.longVal = Double.doubleToRawLongBits(doubleVal); this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal); }
[ "void", "set", "(", "final", "double", "doubleVal", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "DOUBLE", ";", "this", ".", "longVal", "=", "Double", ".", "doubleToRawLongBits", "(", "doubleVal", ")", ";", "this", ".", "hashCode", "=", "0x7FF...
Sets this item to a double item. @param doubleVal the value of this item.
[ "Sets", "this", "item", "to", "a", "double", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L187-L191
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(String name, String desc, int bsmIndex) { this.type = ClassWriter.INDY; this.longVal = bsmIndex; this.strVal1 = name; this.strVal2 = desc; this.hashCode = 0x7FFFFFFF & (ClassWriter.INDY + bsmIndex * strVal1.hashCode() * strVal2.hashCode()); }
java
void set(String name, String desc, int bsmIndex) { this.type = ClassWriter.INDY; this.longVal = bsmIndex; this.strVal1 = name; this.strVal2 = desc; this.hashCode = 0x7FFFFFFF & (ClassWriter.INDY + bsmIndex * strVal1.hashCode() * strVal2.hashCode()); }
[ "void", "set", "(", "String", "name", ",", "String", "desc", ",", "int", "bsmIndex", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "INDY", ";", "this", ".", "longVal", "=", "bsmIndex", ";", "this", ".", "strVal1", "=", "name", ";", "this", ...
Sets the item to an InvokeDynamic item. @param name invokedynamic's name. @param desc invokedynamic's desc. @param bsmIndex zero based index into the class attribute BootrapMethods.
[ "Sets", "the", "item", "to", "an", "InvokeDynamic", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L248-L255
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java
Item.set
void set(int position, int hashCode) { this.type = ClassWriter.BSM; this.intVal = position; this.hashCode = hashCode; }
java
void set(int position, int hashCode) { this.type = ClassWriter.BSM; this.intVal = position; this.hashCode = hashCode; }
[ "void", "set", "(", "int", "position", ",", "int", "hashCode", ")", "{", "this", ".", "type", "=", "ClassWriter", ".", "BSM", ";", "this", ".", "intVal", "=", "position", ";", "this", ".", "hashCode", "=", "hashCode", ";", "}" ]
Sets the item to a BootstrapMethod item. @param position position in byte in the class attribute BootrapMethods. @param hashCode hashcode of the item. This hashcode is processed from the hashcode of the bootstrap method and the hashcode of all bootstrap arguments.
[ "Sets", "the", "item", "to", "a", "BootstrapMethod", "item", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/Item.java#L267-L271
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java
DependencyAnalyzer.isClassAffected
public synchronized boolean isClassAffected(String className) { if (isOnMustRunList(className)) { return true; } boolean isAffected = true; String fullMethodName = className + "." + CLASS_EXT; Set<RegData> regData = mStorer.load(mRootDir, className, CLASS_EXT); isAffected = isAffected(regData); recordTestAffectedOutcome(fullMethodName, isAffected); return isAffected; }
java
public synchronized boolean isClassAffected(String className) { if (isOnMustRunList(className)) { return true; } boolean isAffected = true; String fullMethodName = className + "." + CLASS_EXT; Set<RegData> regData = mStorer.load(mRootDir, className, CLASS_EXT); isAffected = isAffected(regData); recordTestAffectedOutcome(fullMethodName, isAffected); return isAffected; }
[ "public", "synchronized", "boolean", "isClassAffected", "(", "String", "className", ")", "{", "if", "(", "isOnMustRunList", "(", "className", ")", ")", "{", "return", "true", ";", "}", "boolean", "isAffected", "=", "true", ";", "String", "fullMethodName", "=",...
Checks if class is affected since the last run. @param className Name of the class. @return True if class if affected, false otherwise. TODO: this method and starting coverage do some duplicate work
[ "Checks", "if", "class", "is", "affected", "since", "the", "last", "run", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java#L144-L154
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java
DependencyAnalyzer.isExcluded
private boolean isExcluded(String fullMethodName) { if (mExcludes != null) { for (String s : mExcludes) { if (fullMethodName.startsWith(s)) { return true; } } } return false; }
java
private boolean isExcluded(String fullMethodName) { if (mExcludes != null) { for (String s : mExcludes) { if (fullMethodName.startsWith(s)) { return true; } } } return false; }
[ "private", "boolean", "isExcluded", "(", "String", "fullMethodName", ")", "{", "if", "(", "mExcludes", "!=", "null", ")", "{", "for", "(", "String", "s", ":", "mExcludes", ")", "{", "if", "(", "fullMethodName", ".", "startsWith", "(", "s", ")", ")", "{...
Checks if user requested that the given name is always run. True if this name has to be always run, false otherwise.
[ "Checks", "if", "user", "requested", "that", "the", "given", "name", "is", "always", "run", ".", "True", "if", "this", "name", "has", "to", "be", "always", "run", "false", "otherwise", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java#L249-L258
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java
DependencyAnalyzer.hasHashChanged
private boolean hasHashChanged(Set<RegData> regData) { for (RegData el : regData) { if (hasHashChanged(mHasher, el)) { Log.d("CHANGED", el.getURLExternalForm()); return true; } } return false; }
java
private boolean hasHashChanged(Set<RegData> regData) { for (RegData el : regData) { if (hasHashChanged(mHasher, el)) { Log.d("CHANGED", el.getURLExternalForm()); return true; } } return false; }
[ "private", "boolean", "hasHashChanged", "(", "Set", "<", "RegData", ">", "regData", ")", "{", "for", "(", "RegData", "el", ":", "regData", ")", "{", "if", "(", "hasHashChanged", "(", "mHasher", ",", "el", ")", ")", "{", "Log", ".", "d", "(", "\"CHANG...
Hashes files and compares with the old hashes. If any hash is different, returns true; false otherwise.
[ "Hashes", "files", "and", "compares", "with", "the", "old", "hashes", ".", "If", "any", "hash", "is", "different", "returns", "true", ";", "false", "otherwise", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java#L293-L301
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java
DependencyAnalyzer.hasHashChanged
private boolean hasHashChanged(Hasher hasher, RegData regDatum) { String urlExternalForm = regDatum.getURLExternalForm(); Boolean modified = mUrlExternalForm2Modified.get(urlExternalForm); if (modified != null) { return modified; } // Check hash String newHash = hasher.hashURL(urlExternalForm); modified = !newHash.equals(regDatum.getHash()); mUrlExternalForm2Modified.put(urlExternalForm, modified); return modified; }
java
private boolean hasHashChanged(Hasher hasher, RegData regDatum) { String urlExternalForm = regDatum.getURLExternalForm(); Boolean modified = mUrlExternalForm2Modified.get(urlExternalForm); if (modified != null) { return modified; } // Check hash String newHash = hasher.hashURL(urlExternalForm); modified = !newHash.equals(regDatum.getHash()); mUrlExternalForm2Modified.put(urlExternalForm, modified); return modified; }
[ "private", "boolean", "hasHashChanged", "(", "Hasher", "hasher", ",", "RegData", "regDatum", ")", "{", "String", "urlExternalForm", "=", "regDatum", ".", "getURLExternalForm", "(", ")", ";", "Boolean", "modified", "=", "mUrlExternalForm2Modified", ".", "get", "(",...
Hashes file and compares with the old hash. If hashes are different, return true; false otherwise
[ "Hashes", "file", "and", "compares", "with", "the", "old", "hash", ".", "If", "hashes", "are", "different", "return", "true", ";", "false", "otherwise" ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/DependencyAnalyzer.java#L307-L318
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Blobs.java
FineUploader5Blobs.setDefaultName
@Nonnull public FineUploader5Blobs setDefaultName (@Nonnull @Nonempty final String sDefaultName) { ValueEnforcer.notEmpty (sDefaultName, "DefaultName"); m_sBlobsDefaultName = sDefaultName; return this; }
java
@Nonnull public FineUploader5Blobs setDefaultName (@Nonnull @Nonempty final String sDefaultName) { ValueEnforcer.notEmpty (sDefaultName, "DefaultName"); m_sBlobsDefaultName = sDefaultName; return this; }
[ "@", "Nonnull", "public", "FineUploader5Blobs", "setDefaultName", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sDefaultName", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sDefaultName", ",", "\"DefaultName\"", ")", ";", "m_sBlobsDefaultName", "=", ...
The default name to be used for nameless Blobs. @param sDefaultName New value. May neither be <code>null</code> nor empty. @return this for chaining
[ "The", "default", "name", "to", "be", "used", "for", "nameless", "Blobs", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Blobs.java#L52-L58
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageSimpleForm.java
AbstractWebPageSimpleForm.getObjectDisplayName
@Nullable @OverrideOnDemand protected String getObjectDisplayName (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aObject) { return null; }
java
@Nullable @OverrideOnDemand protected String getObjectDisplayName (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aObject) { return null; }
[ "@", "Nullable", "@", "OverrideOnDemand", "protected", "String", "getObjectDisplayName", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ",", "@", "Nonnull", "final", "DATATYPE", "aObject", ")", "{", "return", "null", ";", "}" ]
Get the display name of the passed object. @param aWPEC The current web page execution context. Never <code>null</code>. @param aObject The object to get the display name from. Never <code>null</code>. @return <code>null</code> to indicate that no display name is available
[ "Get", "the", "display", "name", "of", "the", "passed", "object", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageSimpleForm.java#L105-L110
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/icon/DefaultIcons.java
DefaultIcons.get
@Nullable public static IIcon get (@Nullable final EDefaultIcon eDefaultIcon) { if (eDefaultIcon == null) return null; return s_aMap.get (eDefaultIcon); }
java
@Nullable public static IIcon get (@Nullable final EDefaultIcon eDefaultIcon) { if (eDefaultIcon == null) return null; return s_aMap.get (eDefaultIcon); }
[ "@", "Nullable", "public", "static", "IIcon", "get", "(", "@", "Nullable", "final", "EDefaultIcon", "eDefaultIcon", ")", "{", "if", "(", "eDefaultIcon", "==", "null", ")", "return", "null", ";", "return", "s_aMap", ".", "get", "(", "eDefaultIcon", ")", ";"...
Get the icon assigned to the passed default icon. @param eDefaultIcon The default icon to query. May be <code>null</code>. @return <code>null</code> if no icon was found.
[ "Get", "the", "icon", "assigned", "to", "the", "passed", "default", "icon", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/icon/DefaultIcons.java#L57-L63
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/icon/DefaultIcons.java
DefaultIcons.set
public static void set (@Nonnull final EDefaultIcon eDefaultIcon, @Nullable final IIcon aIcon) { ValueEnforcer.notNull (eDefaultIcon, "DefaultIcon"); if (aIcon != null) s_aMap.put (eDefaultIcon, aIcon); else s_aMap.remove (eDefaultIcon); }
java
public static void set (@Nonnull final EDefaultIcon eDefaultIcon, @Nullable final IIcon aIcon) { ValueEnforcer.notNull (eDefaultIcon, "DefaultIcon"); if (aIcon != null) s_aMap.put (eDefaultIcon, aIcon); else s_aMap.remove (eDefaultIcon); }
[ "public", "static", "void", "set", "(", "@", "Nonnull", "final", "EDefaultIcon", "eDefaultIcon", ",", "@", "Nullable", "final", "IIcon", "aIcon", ")", "{", "ValueEnforcer", ".", "notNull", "(", "eDefaultIcon", ",", "\"DefaultIcon\"", ")", ";", "if", "(", "aI...
Set the icon to be used for the specified default icon. Existing definitions are simply overwritten. @param eDefaultIcon The default icon to use. May not be <code>null</code>. @param aIcon The icon to set. May be <code>null</code> in which case the assignment is removed.
[ "Set", "the", "icon", "to", "be", "used", "for", "the", "specified", "default", "icon", ".", "Existing", "definitions", "are", "simply", "overwritten", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/icon/DefaultIcons.java#L86-L93
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Session.java
FineUploader5Session.setEndpoint
@Nonnull public FineUploader5Session setEndpoint (@Nullable final ISimpleURL aEndpoint) { ValueEnforcer.notNull (aEndpoint, "Endpoint"); m_aSessionEndpoint = aEndpoint; return this; }
java
@Nonnull public FineUploader5Session setEndpoint (@Nullable final ISimpleURL aEndpoint) { ValueEnforcer.notNull (aEndpoint, "Endpoint"); m_aSessionEndpoint = aEndpoint; return this; }
[ "@", "Nonnull", "public", "FineUploader5Session", "setEndpoint", "(", "@", "Nullable", "final", "ISimpleURL", "aEndpoint", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aEndpoint", ",", "\"Endpoint\"", ")", ";", "m_aSessionEndpoint", "=", "aEndpoint", ";", "ret...
If non-null, Fine Uploader will send a GET request on startup to this endpoint, expecting a JSON response containing data about the initial file list to populate. @param aEndpoint New value. May be <code>null</code>. @return this for chaining
[ "If", "non", "-", "null", "Fine", "Uploader", "will", "send", "a", "GET", "request", "on", "startup", "to", "this", "endpoint", "expecting", "a", "JSON", "response", "containing", "data", "about", "the", "initial", "file", "list", "to", "populate", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Session.java#L121-L127
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataDeliveryHttpHandler.java
UserDataDeliveryHttpHandler.getUserDataObject
@Nonnull @OverrideOnDemand protected UserDataObject getUserDataObject (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final String sFilename) { // URL decode is required because requests contain e.g. "%20" final String sFilename1 = URLHelper.urlDecode (sFilename); return new UserDataObject (sFilename1); }
java
@Nonnull @OverrideOnDemand protected UserDataObject getUserDataObject (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final String sFilename) { // URL decode is required because requests contain e.g. "%20" final String sFilename1 = URLHelper.urlDecode (sFilename); return new UserDataObject (sFilename1); }
[ "@", "Nonnull", "@", "OverrideOnDemand", "protected", "UserDataObject", "getUserDataObject", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ",", "@", "Nonnull", "final", "String", "sFilename", ")", "{", "// URL decode is required because r...
Get the user data object matching the passed request and filename @param aRequestScope HTTP request @param sFilename Filename as extracted from the URL @return Never <code>null</code>.
[ "Get", "the", "user", "data", "object", "matching", "the", "passed", "request", "and", "filename" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataDeliveryHttpHandler.java#L38-L47
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java
UserDataManager.setUserDataPath
public static void setUserDataPath (@Nonnull @Nonempty final String sUserDataPath) { ValueEnforcer.isTrue (StringHelper.getLength (sUserDataPath) >= 2, "userDataPath is too short"); ValueEnforcer.isTrue (StringHelper.startsWith (sUserDataPath, '/'), "userDataPath must start with a slash"); s_aRWLock.writeLocked ( () -> s_sUserDataPath = sUserDataPath); }
java
public static void setUserDataPath (@Nonnull @Nonempty final String sUserDataPath) { ValueEnforcer.isTrue (StringHelper.getLength (sUserDataPath) >= 2, "userDataPath is too short"); ValueEnforcer.isTrue (StringHelper.startsWith (sUserDataPath, '/'), "userDataPath must start with a slash"); s_aRWLock.writeLocked ( () -> s_sUserDataPath = sUserDataPath); }
[ "public", "static", "void", "setUserDataPath", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sUserDataPath", ")", "{", "ValueEnforcer", ".", "isTrue", "(", "StringHelper", ".", "getLength", "(", "sUserDataPath", ")", ">=", "2", ",", "\"userDataPath i...
Set the user data path, relative to the URL context and relative to the servlet context directory. @param sUserDataPath The path to be set. May neither be <code>null</code> nor empty and must start with a "/" character.
[ "Set", "the", "user", "data", "path", "relative", "to", "the", "URL", "context", "and", "relative", "to", "the", "servlet", "context", "directory", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java#L61-L67
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java
UserDataManager.getResource
@Nonnull public static FileSystemResource getResource (@Nonnull final IUserDataObject aUDO) { ValueEnforcer.notNull (aUDO, "UDO"); return _getFileIO ().getResource (getUserDataPath () + aUDO.getPath ()); }
java
@Nonnull public static FileSystemResource getResource (@Nonnull final IUserDataObject aUDO) { ValueEnforcer.notNull (aUDO, "UDO"); return _getFileIO ().getResource (getUserDataPath () + aUDO.getPath ()); }
[ "@", "Nonnull", "public", "static", "FileSystemResource", "getResource", "(", "@", "Nonnull", "final", "IUserDataObject", "aUDO", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aUDO", ",", "\"UDO\"", ")", ";", "return", "_getFileIO", "(", ")", ".", "getResou...
Get the file system resource of the passed UDO object. @param aUDO The UDO object to get the resource from. @return The matching file system resource. No check is performed, whether the resource exists or not!
[ "Get", "the", "file", "system", "resource", "of", "the", "passed", "UDO", "object", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java#L166-L172
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java
UserDataManager.getFile
@Nonnull public static File getFile (@Nonnull final IUserDataObject aUDO) { ValueEnforcer.notNull (aUDO, "UDO"); return _getFileIO ().getFile (getUserDataPath () + aUDO.getPath ()); }
java
@Nonnull public static File getFile (@Nonnull final IUserDataObject aUDO) { ValueEnforcer.notNull (aUDO, "UDO"); return _getFileIO ().getFile (getUserDataPath () + aUDO.getPath ()); }
[ "@", "Nonnull", "public", "static", "File", "getFile", "(", "@", "Nonnull", "final", "IUserDataObject", "aUDO", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aUDO", ",", "\"UDO\"", ")", ";", "return", "_getFileIO", "(", ")", ".", "getFile", "(", "getUse...
Get the File of the passed UDO object. @param aUDO The UDO object to get the resource from. @return The matching File. No check is performed, whether the file exists or not!
[ "Get", "the", "File", "of", "the", "passed", "UDO", "object", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java#L182-L188
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/root/HCHtml.java
HCHtml.addAllOutOfBandNodesToHead
public void addAllOutOfBandNodesToHead (@Nonnull final List <IHCNode> aAllOOBNodes) { ValueEnforcer.notNull (aAllOOBNodes, "AllOOBNodes"); // And now add all to head in the correct order for (final IHCNode aNode : aAllOOBNodes) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); // Node for the body? if (HCJSNodeDetector.isDirectJSNode (aUnwrappedNode)) m_aHead.addJS (aNode); else if (HCCSSNodeDetector.isDirectCSSNode (aUnwrappedNode)) m_aHead.addCSS (aNode); else throw new IllegalStateException ("Found illegal out-of-band head node: " + aNode); } }
java
public void addAllOutOfBandNodesToHead (@Nonnull final List <IHCNode> aAllOOBNodes) { ValueEnforcer.notNull (aAllOOBNodes, "AllOOBNodes"); // And now add all to head in the correct order for (final IHCNode aNode : aAllOOBNodes) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); // Node for the body? if (HCJSNodeDetector.isDirectJSNode (aUnwrappedNode)) m_aHead.addJS (aNode); else if (HCCSSNodeDetector.isDirectCSSNode (aUnwrappedNode)) m_aHead.addCSS (aNode); else throw new IllegalStateException ("Found illegal out-of-band head node: " + aNode); } }
[ "public", "void", "addAllOutOfBandNodesToHead", "(", "@", "Nonnull", "final", "List", "<", "IHCNode", ">", "aAllOOBNodes", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aAllOOBNodes", ",", "\"AllOOBNodes\"", ")", ";", "// And now add all to head in the correct order"...
Add the passed OOB nodes to the head. @param aAllOOBNodes The out-of-band node list. Usually retrieved from {@link #getAllOutOfBandNodesWithMergedInlineNodes()}. May not be <code>null</code>.
[ "Add", "the", "passed", "OOB", "nodes", "to", "the", "head", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/root/HCHtml.java#L199-L216
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/root/HCHtml.java
HCHtml.moveScriptElementsToBody
public void moveScriptElementsToBody () { // Move all JS from head to body final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> (); m_aHead.getAllAndRemoveAllJSNodes (aJSNodes); // Find index of first script in body int nFirstScriptIndex = 0; if (m_aBody.hasChildren ()) for (final IHCNode aChild : m_aBody.getAllChildren ()) { if (aChild instanceof IHCScript <?>) { // Check if this is a special inline script to be emitted before files final boolean bIsInlineBeforeFiles = (aChild instanceof IHCScriptInline <?>) && !((IHCScriptInline <?>) aChild).isEmitAfterFiles (); if (!bIsInlineBeforeFiles) { // Remember index to insert before break; } } nFirstScriptIndex++; } m_aBody.addChildrenAt (nFirstScriptIndex, aJSNodes); }
java
public void moveScriptElementsToBody () { // Move all JS from head to body final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> (); m_aHead.getAllAndRemoveAllJSNodes (aJSNodes); // Find index of first script in body int nFirstScriptIndex = 0; if (m_aBody.hasChildren ()) for (final IHCNode aChild : m_aBody.getAllChildren ()) { if (aChild instanceof IHCScript <?>) { // Check if this is a special inline script to be emitted before files final boolean bIsInlineBeforeFiles = (aChild instanceof IHCScriptInline <?>) && !((IHCScriptInline <?>) aChild).isEmitAfterFiles (); if (!bIsInlineBeforeFiles) { // Remember index to insert before break; } } nFirstScriptIndex++; } m_aBody.addChildrenAt (nFirstScriptIndex, aJSNodes); }
[ "public", "void", "moveScriptElementsToBody", "(", ")", "{", "// Move all JS from head to body", "final", "ICommonsList", "<", "IHCNode", ">", "aJSNodes", "=", "new", "CommonsArrayList", "<>", "(", ")", ";", "m_aHead", ".", "getAllAndRemoveAllJSNodes", "(", "aJSNodes"...
Move all JS nodes from the head to the body.
[ "Move", "all", "JS", "nodes", "from", "the", "head", "to", "the", "body", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/root/HCHtml.java#L221-L247
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResource.java
WebSiteResource._readAndParseCSS
@Nonnull private String _readAndParseCSS (@Nonnull final IHasInputStream aISP, @Nonnull @Nonempty final String sBasePath, final boolean bRegular) { final CascadingStyleSheet aCSS = CSSReader.readFromStream (aISP, m_aCharset, ECSSVersion.CSS30); if (aCSS == null) { LOGGER.error ("Failed to parse CSS. Returning 'as-is'"); return StreamHelper.getAllBytesAsString (aISP, m_aCharset); } CSSVisitor.visitCSSUrl (aCSS, new AbstractModifyingCSSUrlVisitor () { @Override protected String getModifiedURI (@Nonnull final String sURI) { if (LinkHelper.hasKnownProtocol (sURI)) { // If e.g. an external resource is includes. // Example: https://fonts.googleapis.com/css return sURI; } return FilenameHelper.getCleanConcatenatedUrlPath (sBasePath, sURI); } }); // Write again after modification return new CSSWriter (ECSSVersion.CSS30, !bRegular).setWriteHeaderText (false) .setWriteFooterText (false) .getCSSAsString (aCSS); }
java
@Nonnull private String _readAndParseCSS (@Nonnull final IHasInputStream aISP, @Nonnull @Nonempty final String sBasePath, final boolean bRegular) { final CascadingStyleSheet aCSS = CSSReader.readFromStream (aISP, m_aCharset, ECSSVersion.CSS30); if (aCSS == null) { LOGGER.error ("Failed to parse CSS. Returning 'as-is'"); return StreamHelper.getAllBytesAsString (aISP, m_aCharset); } CSSVisitor.visitCSSUrl (aCSS, new AbstractModifyingCSSUrlVisitor () { @Override protected String getModifiedURI (@Nonnull final String sURI) { if (LinkHelper.hasKnownProtocol (sURI)) { // If e.g. an external resource is includes. // Example: https://fonts.googleapis.com/css return sURI; } return FilenameHelper.getCleanConcatenatedUrlPath (sBasePath, sURI); } }); // Write again after modification return new CSSWriter (ECSSVersion.CSS30, !bRegular).setWriteHeaderText (false) .setWriteFooterText (false) .getCSSAsString (aCSS); }
[ "@", "Nonnull", "private", "String", "_readAndParseCSS", "(", "@", "Nonnull", "final", "IHasInputStream", "aISP", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sBasePath", ",", "final", "boolean", "bRegular", ")", "{", "final", "CascadingStyleSheet", ...
Unify all paths in a CSS relative to the passed base path. @param aISP Input stream provider. @param sBasePath The base path, where the source CSS is read from. @param bRegular <code>true</code> for normal output, <code>false</code> for minified output. @return The modified String.
[ "Unify", "all", "paths", "in", "a", "CSS", "relative", "to", "the", "passed", "base", "path", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResource.java#L160-L190
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java
HCCSSNodeDetector.isCSSNode
public static boolean isCSSNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSNode (aUnwrappedNode); }
java
public static boolean isCSSNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSNode (aUnwrappedNode); }
[ "public", "static", "boolean", "isCSSNode", "(", "@", "Nullable", "final", "IHCNode", "aNode", ")", "{", "final", "IHCNode", "aUnwrappedNode", "=", "HCHelper", ".", "getUnwrappedNode", "(", "aNode", ")", ";", "return", "isDirectCSSNode", "(", "aUnwrappedNode", "...
Check if the passed node is a CSS node after unwrapping. @param aNode The node to be checked - may be <code>null</code>. @return <code>true</code> if the node implements {@link HCStyle} or {@link HCLink} (and not a special case).
[ "Check", "if", "the", "passed", "node", "is", "a", "CSS", "node", "after", "unwrapping", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java#L49-L53
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java
HCCSSNodeDetector.isCSSInlineNode
public static boolean isCSSInlineNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSInlineNode (aUnwrappedNode); }
java
public static boolean isCSSInlineNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSInlineNode (aUnwrappedNode); }
[ "public", "static", "boolean", "isCSSInlineNode", "(", "@", "Nullable", "final", "IHCNode", "aNode", ")", "{", "final", "IHCNode", "aUnwrappedNode", "=", "HCHelper", ".", "getUnwrappedNode", "(", "aNode", ")", ";", "return", "isDirectCSSInlineNode", "(", "aUnwrapp...
Check if the passed node is an inline CSS node after unwrapping. @param aNode The node to be checked - may be <code>null</code>. @return <code>true</code> if the node implements {@link HCStyle}.
[ "Check", "if", "the", "passed", "node", "is", "an", "inline", "CSS", "node", "after", "unwrapping", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java#L75-L79
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java
HCCSSNodeDetector.isCSSFileNode
public static boolean isCSSFileNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSFileNode (aUnwrappedNode); }
java
public static boolean isCSSFileNode (@Nullable final IHCNode aNode) { final IHCNode aUnwrappedNode = HCHelper.getUnwrappedNode (aNode); return isDirectCSSFileNode (aUnwrappedNode); }
[ "public", "static", "boolean", "isCSSFileNode", "(", "@", "Nullable", "final", "IHCNode", "aNode", ")", "{", "final", "IHCNode", "aUnwrappedNode", "=", "HCHelper", ".", "getUnwrappedNode", "(", "aNode", ")", ";", "return", "isDirectCSSFileNode", "(", "aUnwrappedNo...
Check if the passed node is a file CSS node after unwrapping. @param aNode The node to be checked - may be <code>null</code>. @return <code>true</code> if the node implements {@link HCLink}.
[ "Check", "if", "the", "passed", "node", "is", "a", "file", "CSS", "node", "after", "unwrapping", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/metadata/HCCSSNodeDetector.java#L101-L105
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/config/HCSettings.java
HCSettings.setConversionSettings
public static void setConversionSettings (@Nonnull final HCConversionSettings aConversionSettings) { ValueEnforcer.notNull (aConversionSettings, "ConversionSettings"); s_aRWLock.writeLocked ( () -> s_aConversionSettings = aConversionSettings); }
java
public static void setConversionSettings (@Nonnull final HCConversionSettings aConversionSettings) { ValueEnforcer.notNull (aConversionSettings, "ConversionSettings"); s_aRWLock.writeLocked ( () -> s_aConversionSettings = aConversionSettings); }
[ "public", "static", "void", "setConversionSettings", "(", "@", "Nonnull", "final", "HCConversionSettings", "aConversionSettings", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aConversionSettings", ",", "\"ConversionSettings\"", ")", ";", "s_aRWLock", ".", "writeLock...
Set the global conversion settings. @param aConversionSettings The object to be used. May not be <code>null</code>.
[ "Set", "the", "global", "conversion", "settings", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/config/HCSettings.java#L132-L137
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserStorage.java
LoggedInUserStorage.setBaseDirectory
public static void setBaseDirectory (@Nonnull final String sBaseDirectory) { ValueEnforcer.notNull (sBaseDirectory, "BaseDirectory"); s_aRWLock.writeLocked ( () -> { s_sBaseDirectory = sBaseDirectory; }); }
java
public static void setBaseDirectory (@Nonnull final String sBaseDirectory) { ValueEnforcer.notNull (sBaseDirectory, "BaseDirectory"); s_aRWLock.writeLocked ( () -> { s_sBaseDirectory = sBaseDirectory; }); }
[ "public", "static", "void", "setBaseDirectory", "(", "@", "Nonnull", "final", "String", "sBaseDirectory", ")", "{", "ValueEnforcer", ".", "notNull", "(", "sBaseDirectory", ",", "\"BaseDirectory\"", ")", ";", "s_aRWLock", ".", "writeLocked", "(", "(", ")", "->", ...
Set the base directory to be used. @param sBaseDirectory The new base directory. May not be <code>null</code> but maybe empty.
[ "Set", "the", "base", "directory", "to", "be", "used", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserStorage.java#L76-L83
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java
FineUploaderBasic.setMaxConnections
@Nonnull public FineUploaderBasic setMaxConnections (@Nonnegative final int nMaxConnections) { ValueEnforcer.isGT0 (nMaxConnections, "MaxConnections"); m_nMaxConnections = nMaxConnections; return this; }
java
@Nonnull public FineUploaderBasic setMaxConnections (@Nonnegative final int nMaxConnections) { ValueEnforcer.isGT0 (nMaxConnections, "MaxConnections"); m_nMaxConnections = nMaxConnections; return this; }
[ "@", "Nonnull", "public", "FineUploaderBasic", "setMaxConnections", "(", "@", "Nonnegative", "final", "int", "nMaxConnections", ")", "{", "ValueEnforcer", ".", "isGT0", "(", "nMaxConnections", ",", "\"MaxConnections\"", ")", ";", "m_nMaxConnections", "=", "nMaxConnect...
Maximum allowable concurrent uploads. @param nMaxConnections Maximum number. Must be &gt; 0. @return this
[ "Maximum", "allowable", "concurrent", "uploads", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L365-L371
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java
FineUploaderBasic.setSizeLimit
@Nonnull public FineUploaderBasic setSizeLimit (@Nonnegative final int nSizeLimit) { ValueEnforcer.isGE0 (nSizeLimit, "SizeLimit"); m_nValidationSizeLimit = nSizeLimit; return this; }
java
@Nonnull public FineUploaderBasic setSizeLimit (@Nonnegative final int nSizeLimit) { ValueEnforcer.isGE0 (nSizeLimit, "SizeLimit"); m_nValidationSizeLimit = nSizeLimit; return this; }
[ "@", "Nonnull", "public", "FineUploaderBasic", "setSizeLimit", "(", "@", "Nonnegative", "final", "int", "nSizeLimit", ")", "{", "ValueEnforcer", ".", "isGE0", "(", "nSizeLimit", ",", "\"SizeLimit\"", ")", ";", "m_nValidationSizeLimit", "=", "nSizeLimit", ";", "ret...
Maximum allowable size, in bytes, for a file. @param nSizeLimit Size limit. 0 == unlimited @return this
[ "Maximum", "allowable", "size", "in", "bytes", "for", "a", "file", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L493-L499
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java
FineUploaderBasic.setMinSizeLimit
@Nonnull public FineUploaderBasic setMinSizeLimit (@Nonnegative final int nMinSizeLimit) { ValueEnforcer.isGE0 (nMinSizeLimit, "MinSizeLimit"); m_nValidationMinSizeLimit = nMinSizeLimit; return this; }
java
@Nonnull public FineUploaderBasic setMinSizeLimit (@Nonnegative final int nMinSizeLimit) { ValueEnforcer.isGE0 (nMinSizeLimit, "MinSizeLimit"); m_nValidationMinSizeLimit = nMinSizeLimit; return this; }
[ "@", "Nonnull", "public", "FineUploaderBasic", "setMinSizeLimit", "(", "@", "Nonnegative", "final", "int", "nMinSizeLimit", ")", "{", "ValueEnforcer", ".", "isGE0", "(", "nMinSizeLimit", ",", "\"MinSizeLimit\"", ")", ";", "m_nValidationMinSizeLimit", "=", "nMinSizeLim...
Minimum allowable size, in bytes, for a file. @param nMinSizeLimit Minimum size limit. 0 == unlimited @return this
[ "Minimum", "allowable", "size", "in", "bytes", "for", "a", "file", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L514-L520
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java
FineUploaderBasic.setInputName
@Nonnull public FineUploaderBasic setInputName (@Nonnull @Nonempty final String sInputName) { ValueEnforcer.notEmpty (sInputName, "InputName"); m_sRequestInputName = sInputName; return this; }
java
@Nonnull public FineUploaderBasic setInputName (@Nonnull @Nonempty final String sInputName) { ValueEnforcer.notEmpty (sInputName, "InputName"); m_sRequestInputName = sInputName; return this; }
[ "@", "Nonnull", "public", "FineUploaderBasic", "setInputName", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sInputName", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sInputName", ",", "\"InputName\"", ")", ";", "m_sRequestInputName", "=", "sInput...
This usually only useful with the ajax uploader, which sends the name of the file as a parameter, using a key name equal to the value of this options. In the case of the form uploader, this is simply the value of the name attribute of the file's associated input element. @param sInputName The input name @return this
[ "This", "usually", "only", "useful", "with", "the", "ajax", "uploader", "which", "sends", "the", "name", "of", "the", "file", "as", "a", "parameter", "using", "a", "key", "name", "equal", "to", "the", "value", "of", "this", "options", ".", "In", "the", ...
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L565-L572
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/AbstractHCElement.java
AbstractHCElement.fillMicroElement
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected void fillMicroElement (@Nonnull final IMicroElement aElement, @Nonnull final IHCConversionSettingsToNode aConversionSettings) { final boolean bHTML5 = aConversionSettings.getHTMLVersion ().isAtLeastHTML5 (); if (StringHelper.hasText (m_sID)) aElement.setAttribute (CHTMLAttributes.ID, m_sID); if (StringHelper.hasText (m_sTitle)) aElement.setAttribute (CHTMLAttributes.TITLE, m_sTitle); if (StringHelper.hasText (m_sLanguage)) { // Both "xml:lang" and "lang" aElement.setAttribute (new MicroQName (XMLConstants.XML_NS_URI, CHTMLAttributes.LANG.getName ()), m_sLanguage); aElement.setAttribute (CHTMLAttributes.LANG, m_sLanguage); } if (m_eDirection != null) aElement.setAttribute (CHTMLAttributes.DIR, m_eDirection); aElement.setAttribute (CHTMLAttributes.CLASS, getAllClassesAsString ()); aElement.setAttribute (CHTMLAttributes.STYLE, getAllStylesAsString (aConversionSettings.getCSSWriterSettings ())); // Emit all JS events if (m_aJSHandler != null) { final IJSWriterSettings aJSWriterSettings = aConversionSettings.getJSWriterSettings (); // Loop over all events in the defined order for consistent results for (final EJSEvent eEvent : EJSEvent.values ()) { final CollectingJSCodeProvider aProvider = m_aJSHandler.getHandler (eEvent); if (aProvider != null) { final String sJSCode = aProvider.getJSCode (aJSWriterSettings); aElement.setAttribute (eEvent.getHTMLEventName (), CJS.JS_PREFIX + sJSCode); } } } // unfocusable is handled by the customizer as it is non-standard // Global attributes if (m_nTabIndex != DEFAULT_TABINDEX) aElement.setAttribute (CHTMLAttributes.TABINDEX, m_nTabIndex); if (StringHelper.hasText (m_sAccessKey)) aElement.setAttribute (CHTMLAttributes.ACCESSKEY, m_sAccessKey); // Global HTML5 attributes if (bHTML5) { if (m_eTranslate.isDefined ()) aElement.setAttribute (CHTMLAttributes.TRANSLATE, m_eTranslate.isTrue () ? CHTMLAttributeValues.YES : CHTMLAttributeValues.NO); if (m_eContentEditable != null) aElement.setAttribute (CHTMLAttributes.CONTENTEDITABLE, m_eContentEditable); if (StringHelper.hasText (m_sContextMenuID)) aElement.setAttribute (CHTMLAttributes.CONTEXTMENU, m_sContextMenuID); if (m_eDraggable != null) aElement.setAttribute (CHTMLAttributes.DRAGGABLE, m_eDraggable); if (m_eDropZone != null) aElement.setAttribute (CHTMLAttributes.DROPZONE, m_eDropZone); if (m_bHidden) aElement.setAttribute (CHTMLAttributes.HIDDEN, CHTMLAttributeValues.HIDDEN); if (m_bSpellCheck) aElement.setAttribute (CHTMLAttributes.SPELLCHECK, CHTMLAttributeValues.SPELLCHECK); } if (m_eRole != null) aElement.setAttribute (CHTMLAttributes.ROLE, m_eRole.getID ()); if (m_aCustomAttrs != null) for (final Map.Entry <IMicroQName, String> aEntry : m_aCustomAttrs.entrySet ()) aElement.setAttribute (aEntry.getKey (), aEntry.getValue ()); }
java
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected void fillMicroElement (@Nonnull final IMicroElement aElement, @Nonnull final IHCConversionSettingsToNode aConversionSettings) { final boolean bHTML5 = aConversionSettings.getHTMLVersion ().isAtLeastHTML5 (); if (StringHelper.hasText (m_sID)) aElement.setAttribute (CHTMLAttributes.ID, m_sID); if (StringHelper.hasText (m_sTitle)) aElement.setAttribute (CHTMLAttributes.TITLE, m_sTitle); if (StringHelper.hasText (m_sLanguage)) { // Both "xml:lang" and "lang" aElement.setAttribute (new MicroQName (XMLConstants.XML_NS_URI, CHTMLAttributes.LANG.getName ()), m_sLanguage); aElement.setAttribute (CHTMLAttributes.LANG, m_sLanguage); } if (m_eDirection != null) aElement.setAttribute (CHTMLAttributes.DIR, m_eDirection); aElement.setAttribute (CHTMLAttributes.CLASS, getAllClassesAsString ()); aElement.setAttribute (CHTMLAttributes.STYLE, getAllStylesAsString (aConversionSettings.getCSSWriterSettings ())); // Emit all JS events if (m_aJSHandler != null) { final IJSWriterSettings aJSWriterSettings = aConversionSettings.getJSWriterSettings (); // Loop over all events in the defined order for consistent results for (final EJSEvent eEvent : EJSEvent.values ()) { final CollectingJSCodeProvider aProvider = m_aJSHandler.getHandler (eEvent); if (aProvider != null) { final String sJSCode = aProvider.getJSCode (aJSWriterSettings); aElement.setAttribute (eEvent.getHTMLEventName (), CJS.JS_PREFIX + sJSCode); } } } // unfocusable is handled by the customizer as it is non-standard // Global attributes if (m_nTabIndex != DEFAULT_TABINDEX) aElement.setAttribute (CHTMLAttributes.TABINDEX, m_nTabIndex); if (StringHelper.hasText (m_sAccessKey)) aElement.setAttribute (CHTMLAttributes.ACCESSKEY, m_sAccessKey); // Global HTML5 attributes if (bHTML5) { if (m_eTranslate.isDefined ()) aElement.setAttribute (CHTMLAttributes.TRANSLATE, m_eTranslate.isTrue () ? CHTMLAttributeValues.YES : CHTMLAttributeValues.NO); if (m_eContentEditable != null) aElement.setAttribute (CHTMLAttributes.CONTENTEDITABLE, m_eContentEditable); if (StringHelper.hasText (m_sContextMenuID)) aElement.setAttribute (CHTMLAttributes.CONTEXTMENU, m_sContextMenuID); if (m_eDraggable != null) aElement.setAttribute (CHTMLAttributes.DRAGGABLE, m_eDraggable); if (m_eDropZone != null) aElement.setAttribute (CHTMLAttributes.DROPZONE, m_eDropZone); if (m_bHidden) aElement.setAttribute (CHTMLAttributes.HIDDEN, CHTMLAttributeValues.HIDDEN); if (m_bSpellCheck) aElement.setAttribute (CHTMLAttributes.SPELLCHECK, CHTMLAttributeValues.SPELLCHECK); } if (m_eRole != null) aElement.setAttribute (CHTMLAttributes.ROLE, m_eRole.getID ()); if (m_aCustomAttrs != null) for (final Map.Entry <IMicroQName, String> aEntry : m_aCustomAttrs.entrySet ()) aElement.setAttribute (aEntry.getKey (), aEntry.getValue ()); }
[ "@", "OverrideOnDemand", "@", "OverridingMethodsMustInvokeSuper", "protected", "void", "fillMicroElement", "(", "@", "Nonnull", "final", "IMicroElement", "aElement", ",", "@", "Nonnull", "final", "IHCConversionSettingsToNode", "aConversionSettings", ")", "{", "final", "bo...
Set all attributes and child elements of this object @param aElement The current micro element to be filled. Never <code>null</code>. @param aConversionSettings The conversion settings to be used. Never <code>null</code>.
[ "Set", "all", "attributes", "and", "child", "elements", "of", "this", "object" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/AbstractHCElement.java#L731-L809
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/JSRegExLiteral.java
JSRegExLiteral.gim
@Nonnull public JSRegExLiteral gim (final boolean bGlobal, final boolean bCaseInsensitive, final boolean bMultiLine) { return global (bGlobal).caseInsensitive (bCaseInsensitive).multiLine (bMultiLine); }
java
@Nonnull public JSRegExLiteral gim (final boolean bGlobal, final boolean bCaseInsensitive, final boolean bMultiLine) { return global (bGlobal).caseInsensitive (bCaseInsensitive).multiLine (bMultiLine); }
[ "@", "Nonnull", "public", "JSRegExLiteral", "gim", "(", "final", "boolean", "bGlobal", ",", "final", "boolean", "bCaseInsensitive", ",", "final", "boolean", "bMultiLine", ")", "{", "return", "global", "(", "bGlobal", ")", ".", "caseInsensitive", "(", "bCaseInsen...
Set global, case insensitive and multi line at once @param bGlobal value for global @param bCaseInsensitive value for case insensitive @param bMultiLine value for multi line @return this
[ "Set", "global", "case", "insensitive", "and", "multi", "line", "at", "once" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/JSRegExLiteral.java#L93-L97
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/csrf/CSRFSessionManager.java
CSRFSessionManager.isExpectedNonce
public boolean isExpectedNonce (@Nullable final String sNonceToCheck) { final String sThisNonce = getNonce (); return StringHelper.hasText (sThisNonce) && sThisNonce.equals (sNonceToCheck) && CSRFManager.getInstance ().isValidNonce (sNonceToCheck); }
java
public boolean isExpectedNonce (@Nullable final String sNonceToCheck) { final String sThisNonce = getNonce (); return StringHelper.hasText (sThisNonce) && sThisNonce.equals (sNonceToCheck) && CSRFManager.getInstance ().isValidNonce (sNonceToCheck); }
[ "public", "boolean", "isExpectedNonce", "(", "@", "Nullable", "final", "String", "sNonceToCheck", ")", "{", "final", "String", "sThisNonce", "=", "getNonce", "(", ")", ";", "return", "StringHelper", ".", "hasText", "(", "sThisNonce", ")", "&&", "sThisNonce", "...
Check if the passed nonce is the expected one for this session. @param sNonceToCheck The nonce to be checked. May be <code>null</code>. @return <code>true</code> if the nonce is as expected, <code>false</code> otherwise.
[ "Check", "if", "the", "passed", "nonce", "is", "the", "expected", "one", "for", "this", "session", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/csrf/CSRFSessionManager.java#L87-L93
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/csrf/CSRFSessionManager.java
CSRFSessionManager.generateNewNonce
public void generateNewNonce () { final CSRFManager aCSRFMgr = CSRFManager.getInstance (); m_aRWLock.writeLocked ( () -> { aCSRFMgr.removeNonce (m_sNonce); m_sNonce = aCSRFMgr.createNewNonce (); }); }
java
public void generateNewNonce () { final CSRFManager aCSRFMgr = CSRFManager.getInstance (); m_aRWLock.writeLocked ( () -> { aCSRFMgr.removeNonce (m_sNonce); m_sNonce = aCSRFMgr.createNewNonce (); }); }
[ "public", "void", "generateNewNonce", "(", ")", "{", "final", "CSRFManager", "aCSRFMgr", "=", "CSRFManager", ".", "getInstance", "(", ")", ";", "m_aRWLock", ".", "writeLocked", "(", "(", ")", "->", "{", "aCSRFMgr", ".", "removeNonce", "(", "m_sNonce", ")", ...
Generate a new nonce for this session.
[ "Generate", "a", "new", "nonce", "for", "this", "session", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/csrf/CSRFSessionManager.java#L98-L105
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java
AbstractWebPageForm.getSelectedObjectID
@Nullable protected final String getSelectedObjectID (@Nonnull final WPECTYPE aWPEC) { return aWPEC.params ().getAsString (CPageParam.PARAM_OBJECT); }
java
@Nullable protected final String getSelectedObjectID (@Nonnull final WPECTYPE aWPEC) { return aWPEC.params ().getAsString (CPageParam.PARAM_OBJECT); }
[ "@", "Nullable", "protected", "final", "String", "getSelectedObjectID", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ")", "{", "return", "aWPEC", ".", "params", "(", ")", ".", "getAsString", "(", "CPageParam", ".", "PARAM_OBJECT", ")", ";", "}" ]
Get the ID of the selected object from the passed execution context. @param aWPEC The current web page execution context. Never <code>null</code>. @return <code>null</code> if no selected object is present.
[ "Get", "the", "ID", "of", "the", "selected", "object", "from", "the", "passed", "execution", "context", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L192-L196
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java
AbstractWebPageForm.createEditToolbar
@Nonnull @OverrideOnDemand protected TOOLBAR_TYPE createEditToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final FORM_TYPE aForm, @Nonnull final DATATYPE aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final TOOLBAR_TYPE aToolbar = createNewEditToolbar (aWPEC); aToolbar.addHiddenField (CPageParam.PARAM_ACTION, CPageParam.ACTION_EDIT); aToolbar.addHiddenField (CPageParam.PARAM_OBJECT, aSelectedObject.getID ()); aToolbar.addHiddenField (CPageParam.PARAM_SUBACTION, CPageParam.ACTION_SAVE); // Save button aToolbar.addSubmitButton (getEditToolbarSubmitButtonText (aDisplayLocale), getEditToolbarSubmitButtonIcon ()); // Cancel button aToolbar.addButtonCancel (aDisplayLocale); // Callback modifyEditToolbar (aWPEC, aSelectedObject, aToolbar); return aToolbar; }
java
@Nonnull @OverrideOnDemand protected TOOLBAR_TYPE createEditToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final FORM_TYPE aForm, @Nonnull final DATATYPE aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final TOOLBAR_TYPE aToolbar = createNewEditToolbar (aWPEC); aToolbar.addHiddenField (CPageParam.PARAM_ACTION, CPageParam.ACTION_EDIT); aToolbar.addHiddenField (CPageParam.PARAM_OBJECT, aSelectedObject.getID ()); aToolbar.addHiddenField (CPageParam.PARAM_SUBACTION, CPageParam.ACTION_SAVE); // Save button aToolbar.addSubmitButton (getEditToolbarSubmitButtonText (aDisplayLocale), getEditToolbarSubmitButtonIcon ()); // Cancel button aToolbar.addButtonCancel (aDisplayLocale); // Callback modifyEditToolbar (aWPEC, aSelectedObject, aToolbar); return aToolbar; }
[ "@", "Nonnull", "@", "OverrideOnDemand", "protected", "TOOLBAR_TYPE", "createEditToolbar", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ",", "@", "Nonnull", "final", "FORM_TYPE", "aForm", ",", "@", "Nonnull", "final", "DATATYPE", "aSelectedObject", ")", "{",...
Create toolbar for editing an existing object @param aWPEC The web page execution context. Never <code>null</code>. @param aForm The handled form. Never <code>null</code>. @param aSelectedObject The selected object. Never <code>null</code>. @return Never <code>null</code>.
[ "Create", "toolbar", "for", "editing", "an", "existing", "object" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L747-L767
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java
AbstractWebPageForm.createCreateToolbar
@Nonnull @OverrideOnDemand protected TOOLBAR_TYPE createCreateToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final FORM_TYPE aForm, @Nullable final DATATYPE aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final TOOLBAR_TYPE aToolbar = createNewCreateToolbar (aWPEC); aToolbar.addHiddenField (CPageParam.PARAM_ACTION, CPageParam.ACTION_CREATE); if (aSelectedObject != null) aToolbar.addHiddenField (CPageParam.PARAM_OBJECT, aSelectedObject.getID ()); aToolbar.addHiddenField (CPageParam.PARAM_SUBACTION, CPageParam.ACTION_SAVE); // Save button aToolbar.addSubmitButton (getCreateToolbarSubmitButtonText (aDisplayLocale), getCreateToolbarSubmitButtonIcon ()); // Cancel button aToolbar.addButtonCancel (aDisplayLocale); // Callback modifyCreateToolbar (aWPEC, aToolbar); return aToolbar; }
java
@Nonnull @OverrideOnDemand protected TOOLBAR_TYPE createCreateToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final FORM_TYPE aForm, @Nullable final DATATYPE aSelectedObject) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final TOOLBAR_TYPE aToolbar = createNewCreateToolbar (aWPEC); aToolbar.addHiddenField (CPageParam.PARAM_ACTION, CPageParam.ACTION_CREATE); if (aSelectedObject != null) aToolbar.addHiddenField (CPageParam.PARAM_OBJECT, aSelectedObject.getID ()); aToolbar.addHiddenField (CPageParam.PARAM_SUBACTION, CPageParam.ACTION_SAVE); // Save button aToolbar.addSubmitButton (getCreateToolbarSubmitButtonText (aDisplayLocale), getCreateToolbarSubmitButtonIcon ()); // Cancel button aToolbar.addButtonCancel (aDisplayLocale); // Callback modifyCreateToolbar (aWPEC, aToolbar); return aToolbar; }
[ "@", "Nonnull", "@", "OverrideOnDemand", "protected", "TOOLBAR_TYPE", "createCreateToolbar", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ",", "@", "Nonnull", "final", "FORM_TYPE", "aForm", ",", "@", "Nullable", "final", "DATATYPE", "aSelectedObject", ")", "...
Create toolbar for creating a new object @param aWPEC The web page execution context @param aForm The handled form. Never <code>null</code>. @param aSelectedObject Optional selected object. May be <code>null</code>. @return Never <code>null</code>.
[ "Create", "toolbar", "for", "creating", "a", "new", "object" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L833-L854
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java
AbstractWebPageForm.performLocking
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected boolean performLocking (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aSelectedObject, @Nonnull final EWebPageFormAction eFormAction) { // Lock EDIT and DELETE if an object is present // Also lock custom actions if an object is selected return eFormAction.isModifying () || eFormAction.isCustom (); }
java
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected boolean performLocking (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aSelectedObject, @Nonnull final EWebPageFormAction eFormAction) { // Lock EDIT and DELETE if an object is present // Also lock custom actions if an object is selected return eFormAction.isModifying () || eFormAction.isCustom (); }
[ "@", "OverrideOnDemand", "@", "OverridingMethodsMustInvokeSuper", "protected", "boolean", "performLocking", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ",", "@", "Nonnull", "final", "DATATYPE", "aSelectedObject", ",", "@", "Nonnull", "final", "EWebPageFormAction"...
Check if locking should be performed on the current request or not. Override with care! @param aWPEC The current web page execution context. Never <code>null</code>. @param aSelectedObject The currently selected object. Never <code>null</code>. @param eFormAction The current form action. Never <code>null</code>. @return <code>true</code> if locking for the current request should be performed, <code>false</code> otherwise.
[ "Check", "if", "locking", "should", "be", "performed", "on", "the", "current", "request", "or", "not", ".", "Override", "with", "care!" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L902-L911
train
gdx-libs/gdx-kiwi
src/com/github/czyzby/kiwi/util/common/Comparables.java
Comparables.nullSafeCompare
public static <Value extends Comparable<Value>> int nullSafeCompare(final Value first, final Value second) { if (first == null) { return second == null ? EQUAL_COMPARE_RESULT : LOWER_THAN_COMPARE_RESULT; } return second == null ? GREATER_THAN_COMPARE_RESULT : first.compareTo(second); }
java
public static <Value extends Comparable<Value>> int nullSafeCompare(final Value first, final Value second) { if (first == null) { return second == null ? EQUAL_COMPARE_RESULT : LOWER_THAN_COMPARE_RESULT; } return second == null ? GREATER_THAN_COMPARE_RESULT : first.compareTo(second); }
[ "public", "static", "<", "Value", "extends", "Comparable", "<", "Value", ">", ">", "int", "nullSafeCompare", "(", "final", "Value", "first", ",", "final", "Value", "second", ")", "{", "if", "(", "first", "==", "null", ")", "{", "return", "second", "==", ...
Safely compares two values that might be null. Null value is considered lower than non-null, even if the non-null value is minimal in its range. @return comparison result of first and second value.
[ "Safely", "compares", "two", "values", "that", "might", "be", "null", ".", "Null", "value", "is", "considered", "lower", "than", "non", "-", "null", "even", "if", "the", "non", "-", "null", "value", "is", "minimal", "in", "its", "range", "." ]
0172ee7534162f33b939bcdc4de089bc9579dd62
https://github.com/gdx-libs/gdx-kiwi/blob/0172ee7534162f33b939bcdc4de089bc9579dd62/src/com/github/czyzby/kiwi/util/common/Comparables.java#L72-L77
train
NICTA/t3as-snomedct-service
snomed-coder-client/src/main/java/org/t3as/snomedct/client/SnomedClient.java
SnomedClient.call
public Collection<Utterance> call(final AnalysisRequest request) { ClientResponse response = null; try { response = service.type(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .post(ClientResponse.class, request); return response.getEntity(new GenericType<Collection<Utterance>>() {}); } finally { // belt and braces if (response != null) { //noinspection OverlyBroadCatchBlock try { response.close(); } catch (final Throwable ignored) { /* do nothing */ } } } }
java
public Collection<Utterance> call(final AnalysisRequest request) { ClientResponse response = null; try { response = service.type(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .post(ClientResponse.class, request); return response.getEntity(new GenericType<Collection<Utterance>>() {}); } finally { // belt and braces if (response != null) { //noinspection OverlyBroadCatchBlock try { response.close(); } catch (final Throwable ignored) { /* do nothing */ } } } }
[ "public", "Collection", "<", "Utterance", ">", "call", "(", "final", "AnalysisRequest", "request", ")", "{", "ClientResponse", "response", "=", "null", ";", "try", "{", "response", "=", "service", ".", "type", "(", "MediaType", ".", "APPLICATION_JSON", ")", ...
Call the webservice with some request to analyse for SNOMED CT codes - this method can be used repeatedly on the same SnomedClient instance. @param request request to analyse @return object graph containing all the analysis output
[ "Call", "the", "webservice", "with", "some", "request", "to", "analyse", "for", "SNOMED", "CT", "codes", "-", "this", "method", "can", "be", "used", "repeatedly", "on", "the", "same", "SnomedClient", "instance", "." ]
70a82d5c889f97eef2d17a648970575c152983e9
https://github.com/NICTA/t3as-snomedct-service/blob/70a82d5c889f97eef2d17a648970575c152983e9/snomed-coder-client/src/main/java/org/t3as/snomedct/client/SnomedClient.java#L86-L102
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/go/GoXServletHandler.java
GoXServletHandler.getURLForNonExistingItem
@Nonnull @OverrideOnDemand protected SimpleURL getURLForNonExistingItem (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final String sKey) { return new SimpleURL (aRequestScope.getFullContextPath ()); }
java
@Nonnull @OverrideOnDemand protected SimpleURL getURLForNonExistingItem (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final String sKey) { return new SimpleURL (aRequestScope.getFullContextPath ()); }
[ "@", "Nonnull", "@", "OverrideOnDemand", "protected", "SimpleURL", "getURLForNonExistingItem", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ",", "@", "Nonnull", "final", "String", "sKey", ")", "{", "return", "new", "SimpleURL", "("...
Get the URL to redirect in case an invalid go mapping key was provided. @param aRequestScope The current request scope. @param sKey The key that was searched. @return Never <code>null</code>.
[ "Get", "the", "URL", "to", "redirect", "in", "case", "an", "invalid", "go", "mapping", "key", "was", "provided", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/go/GoXServletHandler.java#L87-L93
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/appid/PhotonSessionState.java
PhotonSessionState.state
@Nonnull public PhotonSessionStatePerApp state (@Nonnull @Nonempty final String sAppID) { ValueEnforcer.notEmpty (sAppID, "AppID"); return m_aStateMap.computeIfAbsent (sAppID, k -> new PhotonSessionStatePerApp ()); }
java
@Nonnull public PhotonSessionStatePerApp state (@Nonnull @Nonempty final String sAppID) { ValueEnforcer.notEmpty (sAppID, "AppID"); return m_aStateMap.computeIfAbsent (sAppID, k -> new PhotonSessionStatePerApp ()); }
[ "@", "Nonnull", "public", "PhotonSessionStatePerApp", "state", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sAppID", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sAppID", ",", "\"AppID\"", ")", ";", "return", "m_aStateMap", ".", "computeIfAbsen...
Get or create a new state for the provided app ID. @param sAppID The app ID to get the state for. May neither be <code>null</code> nor empty. @return Never <code>null</code>.
[ "Get", "or", "create", "a", "new", "state", "for", "the", "provided", "app", "ID", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/appid/PhotonSessionState.java#L99-L104
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/script/AbstractHCScriptInline.java
AbstractHCScriptInline.setMode
@Nonnull public final IMPLTYPE setMode (@Nonnull final EHCScriptInlineMode eMode) { m_eScriptMode = ValueEnforcer.notNull (eMode, "Mode"); return thisAsT (); }
java
@Nonnull public final IMPLTYPE setMode (@Nonnull final EHCScriptInlineMode eMode) { m_eScriptMode = ValueEnforcer.notNull (eMode, "Mode"); return thisAsT (); }
[ "@", "Nonnull", "public", "final", "IMPLTYPE", "setMode", "(", "@", "Nonnull", "final", "EHCScriptInlineMode", "eMode", ")", "{", "m_eScriptMode", "=", "ValueEnforcer", ".", "notNull", "(", "eMode", ",", "\"Mode\"", ")", ";", "return", "thisAsT", "(", ")", "...
Set the masking mode. @param eMode The mode to use. MAy not be <code>null</code>. @return this
[ "Set", "the", "masking", "mode", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/script/AbstractHCScriptInline.java#L118-L123
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/JSCommentPart.java
JSCommentPart.format
protected void format (@Nonnull final JSFormatter aFormatter, @Nonnull final String sIndent) { if (!isEmpty ()) aFormatter.plain (sIndent); final Iterator <Object> aIter = iterator (); while (aIter.hasNext ()) { final Object aValue = aIter.next (); if (aValue instanceof String) { int nIdx; String sValue = (String) aValue; while ((nIdx = sValue.indexOf ('\n')) != -1) { final String sLine = sValue.substring (0, nIdx); if (sLine.length () > 0) aFormatter.plain (_escape (sLine)); sValue = sValue.substring (nIdx + 1); aFormatter.nlFix ().plain (sIndent); } if (sValue.length () != 0) aFormatter.plain (_escape (sValue)); } else if (aValue instanceof AbstractJSClass) { ((AbstractJSClass) aValue).printLink (aFormatter); } else if (aValue instanceof AbstractJSType) { aFormatter.generatable ((AbstractJSType) aValue); } else throw new IllegalStateException ("Unsupported value: " + aValue); } if (!isEmpty ()) aFormatter.nlFix (); }
java
protected void format (@Nonnull final JSFormatter aFormatter, @Nonnull final String sIndent) { if (!isEmpty ()) aFormatter.plain (sIndent); final Iterator <Object> aIter = iterator (); while (aIter.hasNext ()) { final Object aValue = aIter.next (); if (aValue instanceof String) { int nIdx; String sValue = (String) aValue; while ((nIdx = sValue.indexOf ('\n')) != -1) { final String sLine = sValue.substring (0, nIdx); if (sLine.length () > 0) aFormatter.plain (_escape (sLine)); sValue = sValue.substring (nIdx + 1); aFormatter.nlFix ().plain (sIndent); } if (sValue.length () != 0) aFormatter.plain (_escape (sValue)); } else if (aValue instanceof AbstractJSClass) { ((AbstractJSClass) aValue).printLink (aFormatter); } else if (aValue instanceof AbstractJSType) { aFormatter.generatable ((AbstractJSType) aValue); } else throw new IllegalStateException ("Unsupported value: " + aValue); } if (!isEmpty ()) aFormatter.nlFix (); }
[ "protected", "void", "format", "(", "@", "Nonnull", "final", "JSFormatter", "aFormatter", ",", "@", "Nonnull", "final", "String", "sIndent", ")", "{", "if", "(", "!", "isEmpty", "(", ")", ")", "aFormatter", ".", "plain", "(", "sIndent", ")", ";", "final"...
Writes this part into the formatter by using the specified indentation. @param aFormatter Formatter to use. May not be <code>null</code>. @param sIndent Indentation string to use. May not be <code>null</code>.
[ "Writes", "this", "part", "into", "the", "formatter", "by", "using", "the", "specified", "indentation", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/JSCommentPart.java#L84-L125
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/JSCommentPart.java
JSCommentPart._escape
@Nonnull private static String _escape (@Nonnull final String sStr) { String ret = sStr; while (true) { final int idx = ret.indexOf ("*/"); if (idx < 0) return ret; ret = ret.substring (0, idx + 1) + "<!-- -->" + ret.substring (idx + 1); } }
java
@Nonnull private static String _escape (@Nonnull final String sStr) { String ret = sStr; while (true) { final int idx = ret.indexOf ("*/"); if (idx < 0) return ret; ret = ret.substring (0, idx + 1) + "<!-- -->" + ret.substring (idx + 1); } }
[ "@", "Nonnull", "private", "static", "String", "_escape", "(", "@", "Nonnull", "final", "String", "sStr", ")", "{", "String", "ret", "=", "sStr", ";", "while", "(", "true", ")", "{", "final", "int", "idx", "=", "ret", ".", "indexOf", "(", "\"*/\"", "...
Escapes the appearance of the comment terminator.
[ "Escapes", "the", "appearance", "of", "the", "comment", "terminator", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/JSCommentPart.java#L130-L142
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/markdown/Line.java
Line.skipSpaces
public boolean skipSpaces () { while (m_nPos < m_sValue.length () && m_sValue.charAt (m_nPos) == ' ') m_nPos++; return m_nPos < m_sValue.length (); }
java
public boolean skipSpaces () { while (m_nPos < m_sValue.length () && m_sValue.charAt (m_nPos) == ' ') m_nPos++; return m_nPos < m_sValue.length (); }
[ "public", "boolean", "skipSpaces", "(", ")", "{", "while", "(", "m_nPos", "<", "m_sValue", ".", "length", "(", ")", "&&", "m_sValue", ".", "charAt", "(", "m_nPos", ")", "==", "'", "'", ")", "m_nPos", "++", ";", "return", "m_nPos", "<", "m_sValue", "....
Skips spaces. @return <code>false</code> if end of line is reached
[ "Skips", "spaces", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/Line.java#L100-L105
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/markdown/Line.java
Line.readUntil
public String readUntil (final char... aEndChars) { final StringBuilder aSB = new StringBuilder (); int nPos = m_nPos; while (nPos < m_sValue.length ()) { final char ch = m_sValue.charAt (nPos); if (ch == '\\' && nPos + 1 < m_sValue.length ()) { final char c = m_sValue.charAt (nPos + 1); if (MarkdownHelper.isEscapeChar (c)) { aSB.append (c); nPos++; } else aSB.append (ch); } else { boolean bEndReached = false; for (final char cElement : aEndChars) if (ch == cElement) { bEndReached = true; break; } if (bEndReached) break; aSB.append (ch); } nPos++; } final char ch = nPos < m_sValue.length () ? m_sValue.charAt (nPos) : '\n'; for (final char cElement : aEndChars) if (ch == cElement) { m_nPos = nPos; return aSB.toString (); } return null; }
java
public String readUntil (final char... aEndChars) { final StringBuilder aSB = new StringBuilder (); int nPos = m_nPos; while (nPos < m_sValue.length ()) { final char ch = m_sValue.charAt (nPos); if (ch == '\\' && nPos + 1 < m_sValue.length ()) { final char c = m_sValue.charAt (nPos + 1); if (MarkdownHelper.isEscapeChar (c)) { aSB.append (c); nPos++; } else aSB.append (ch); } else { boolean bEndReached = false; for (final char cElement : aEndChars) if (ch == cElement) { bEndReached = true; break; } if (bEndReached) break; aSB.append (ch); } nPos++; } final char ch = nPos < m_sValue.length () ? m_sValue.charAt (nPos) : '\n'; for (final char cElement : aEndChars) if (ch == cElement) { m_nPos = nPos; return aSB.toString (); } return null; }
[ "public", "String", "readUntil", "(", "final", "char", "...", "aEndChars", ")", "{", "final", "StringBuilder", "aSB", "=", "new", "StringBuilder", "(", ")", ";", "int", "nPos", "=", "m_nPos", ";", "while", "(", "nPos", "<", "m_sValue", ".", "length", "("...
Reads chars from this line until any 'end' char is reached. @param aEndChars Delimiting character(s) @return The read String or <code>null</code> if no 'end' char was reached.
[ "Reads", "chars", "from", "this", "line", "until", "any", "end", "char", "is", "reached", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/Line.java#L114-L156
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/markdown/Line.java
Line._countCharsStart
private int _countCharsStart (final char ch) { int nCount = 0; for (int i = 0; i < m_sValue.length (); i++) { final char c = m_sValue.charAt (i); if (c == ' ') continue; if (c != ch) break; nCount++; } return nCount; }
java
private int _countCharsStart (final char ch) { int nCount = 0; for (int i = 0; i < m_sValue.length (); i++) { final char c = m_sValue.charAt (i); if (c == ' ') continue; if (c != ch) break; nCount++; } return nCount; }
[ "private", "int", "_countCharsStart", "(", "final", "char", "ch", ")", "{", "int", "nCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "m_sValue", ".", "length", "(", ")", ";", "i", "++", ")", "{", "final", "char", "c", "=...
Counts the amount of 'ch' at the start of this line ignoring spaces. @param ch The char to count. @return Number of characters found. @since 0.7
[ "Counts", "the", "amount", "of", "ch", "at", "the", "start", "of", "this", "line", "ignoring", "spaces", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/Line.java#L202-L215
train
c0stra/fluent-api-end-check
src/main/java/fluent/api/processors/EndProcessor.java
EndProcessor.assertThatEndMethodCheckFileExists
public static void assertThatEndMethodCheckFileExists(String uniqueFileName) throws IOException { Enumeration<URL> resources = ClassLoader.getSystemResources(uniqueFileName); if(!resources.hasMoreElements()) { throw new AssertionError("End method check uniqueFileName named: " + uniqueFileName + " doesn't exist.\n" + "Either you didn't use anywhere the annotation @EndMethodCheckFile(\"" + uniqueFileName + "\")\n" + "or the annotation processor wasn't invoked by the compiler and you have to check it's configuration.\n" + "For more about annotation processor configuration and possible issues see:\n" + "https://github.com/c0stra/fluent-api-end-check"); } URL url = resources.nextElement(); if(resources.hasMoreElements()) { throw new IllegalArgumentException("Too many files with the same name: " + uniqueFileName + " found on class-path.\n" + "Chosen end method check file name is not unique.\n" + "Files found:\n" + url + "\n" + resources.nextElement()); } }
java
public static void assertThatEndMethodCheckFileExists(String uniqueFileName) throws IOException { Enumeration<URL> resources = ClassLoader.getSystemResources(uniqueFileName); if(!resources.hasMoreElements()) { throw new AssertionError("End method check uniqueFileName named: " + uniqueFileName + " doesn't exist.\n" + "Either you didn't use anywhere the annotation @EndMethodCheckFile(\"" + uniqueFileName + "\")\n" + "or the annotation processor wasn't invoked by the compiler and you have to check it's configuration.\n" + "For more about annotation processor configuration and possible issues see:\n" + "https://github.com/c0stra/fluent-api-end-check"); } URL url = resources.nextElement(); if(resources.hasMoreElements()) { throw new IllegalArgumentException("Too many files with the same name: " + uniqueFileName + " found on class-path.\n" + "Chosen end method check file name is not unique.\n" + "Files found:\n" + url + "\n" + resources.nextElement()); } }
[ "public", "static", "void", "assertThatEndMethodCheckFileExists", "(", "String", "uniqueFileName", ")", "throws", "IOException", "{", "Enumeration", "<", "URL", ">", "resources", "=", "ClassLoader", ".", "getSystemResources", "(", "uniqueFileName", ")", ";", "if", "...
Assertion method to check, that requested EndMethodCheckFile got created. @param uniqueFileName Unique file name to be checked, which should have been previously requested to generate using the annotation EndMethodCheckFile(uniqueFileName) @throws IOException in case of any unexpected IO problems while accessing the file (not that it doesn't exist).
[ "Assertion", "method", "to", "check", "that", "requested", "EndMethodCheckFile", "got", "created", "." ]
d487820e6a7fb871d94c931676c6c779d6d3727f
https://github.com/c0stra/fluent-api-end-check/blob/d487820e6a7fb871d94c931676c6c779d6d3727f/src/main/java/fluent/api/processors/EndProcessor.java#L134-L150
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Resume.java
FineUploader5Resume.setRecordsExpireIn
@Nonnull public FineUploader5Resume setRecordsExpireIn (@Nonnegative final int nRecordsExpireIn) { ValueEnforcer.isGE0 (nRecordsExpireIn, "RecordsExpireIn"); m_nResumeRecordsExpireIn = nRecordsExpireIn; return this; }
java
@Nonnull public FineUploader5Resume setRecordsExpireIn (@Nonnegative final int nRecordsExpireIn) { ValueEnforcer.isGE0 (nRecordsExpireIn, "RecordsExpireIn"); m_nResumeRecordsExpireIn = nRecordsExpireIn; return this; }
[ "@", "Nonnull", "public", "FineUploader5Resume", "setRecordsExpireIn", "(", "@", "Nonnegative", "final", "int", "nRecordsExpireIn", ")", "{", "ValueEnforcer", ".", "isGE0", "(", "nRecordsExpireIn", ",", "\"RecordsExpireIn\"", ")", ";", "m_nResumeRecordsExpireIn", "=", ...
The number of days before a persistent resume record will expire. @param nRecordsExpireIn New value. Must be &ge; 0. @return this for chaining
[ "The", "number", "of", "days", "before", "a", "persistent", "resume", "record", "will", "expire", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Resume.java#L57-L63
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Resume.java
FineUploader5Resume.setParamNameResuming
@Nonnull public FineUploader5Resume setParamNameResuming (@Nonnull @Nonempty final String sParamNameResuming) { ValueEnforcer.notEmpty (sParamNameResuming, "ParamNameResuming"); m_sResumeParamNamesResuming = sParamNameResuming; return this; }
java
@Nonnull public FineUploader5Resume setParamNameResuming (@Nonnull @Nonempty final String sParamNameResuming) { ValueEnforcer.notEmpty (sParamNameResuming, "ParamNameResuming"); m_sResumeParamNamesResuming = sParamNameResuming; return this; }
[ "@", "Nonnull", "public", "FineUploader5Resume", "setParamNameResuming", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sParamNameResuming", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sParamNameResuming", ",", "\"ParamNameResuming\"", ")", ";", "m_sR...
Sent with the first request of the resume with a value of true. @param sParamNameResuming New value. May neither be <code>null</code> nor empty. @return this for chaining
[ "Sent", "with", "the", "first", "request", "of", "the", "resume", "with", "a", "value", "of", "true", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Resume.java#L98-L104
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java
JavaCCParserImpl.badIdentifier
@Override protected String badIdentifier(String expected) { error(expected); final String id = "@" + (nextId++); if (!peekPunctuation()) { final Token token = getNextToken(); return "BAD_IDENTIFIER" + "_" + friendlyName(token) + id; } else { return "NO_IDENTIFIER" + id; } }
java
@Override protected String badIdentifier(String expected) { error(expected); final String id = "@" + (nextId++); if (!peekPunctuation()) { final Token token = getNextToken(); return "BAD_IDENTIFIER" + "_" + friendlyName(token) + id; } else { return "NO_IDENTIFIER" + id; } }
[ "@", "Override", "protected", "String", "badIdentifier", "(", "String", "expected", ")", "{", "error", "(", "expected", ")", ";", "final", "String", "id", "=", "\"@\"", "+", "(", "nextId", "++", ")", ";", "if", "(", "!", "peekPunctuation", "(", ")", ")...
Called by the parser whenever a required identifier is missing. It always records a syntax error and then creates a fake identifier. If the next token token isn't punctuation then get it and turn it into a fake identifier. Otherwise create a new fake identifier and leave the punctuation for somebody else to process
[ "Called", "by", "the", "parser", "whenever", "a", "required", "identifier", "is", "missing", "." ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java#L116-L127
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java
JavaCCParserImpl.error
private void error(String expected, String actual) { if (!recovering) { recovering = true; final String outputString = (EOF_STRING.equals(actual) || UNTERMINATED_COMMENT_STRING.equals(actual) || COMMENT_NOT_ALLOWED.equals(actual)) ? actual : "'" + actual + "'"; errors.add(SyntaxError._UnexpectedToken(expected, outputString, lookahead(1).beginLine)); } }
java
private void error(String expected, String actual) { if (!recovering) { recovering = true; final String outputString = (EOF_STRING.equals(actual) || UNTERMINATED_COMMENT_STRING.equals(actual) || COMMENT_NOT_ALLOWED.equals(actual)) ? actual : "'" + actual + "'"; errors.add(SyntaxError._UnexpectedToken(expected, outputString, lookahead(1).beginLine)); } }
[ "private", "void", "error", "(", "String", "expected", ",", "String", "actual", ")", "{", "if", "(", "!", "recovering", ")", "{", "recovering", "=", "true", ";", "final", "String", "outputString", "=", "(", "EOF_STRING", ".", "equals", "(", "actual", ")"...
If not currently recovering, adds an error to the errors list and sets recovering to true @param expected the kind of thing expected
[ "If", "not", "currently", "recovering", "adds", "an", "error", "to", "the", "errors", "list", "and", "sets", "recovering", "to", "true" ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java#L170-L178
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java
JavaCCParserImpl.friendlyName
private String friendlyName(Token token) { return token.kind == EOF ? EOF_STRING : token.kind == UNTERMINATED_COMMENT ? UNTERMINATED_COMMENT_STRING : token.image; }
java
private String friendlyName(Token token) { return token.kind == EOF ? EOF_STRING : token.kind == UNTERMINATED_COMMENT ? UNTERMINATED_COMMENT_STRING : token.image; }
[ "private", "String", "friendlyName", "(", "Token", "token", ")", "{", "return", "token", ".", "kind", "==", "EOF", "?", "EOF_STRING", ":", "token", ".", "kind", "==", "UNTERMINATED_COMMENT", "?", "UNTERMINATED_COMMENT_STRING", ":", "token", ".", "image", ";", ...
Turn a token into a user readable name
[ "Turn", "a", "token", "into", "a", "user", "readable", "name" ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java#L183-L185
train
JamesIry/jADT
jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java
JavaCCParserImpl.lookahead
private Token lookahead(int n) { Token current = token; for (int i = 0; i < n; i++) { if (current.next == null) { current.next = token_source.getNextToken(); } current = current.next; } return current; }
java
private Token lookahead(int n) { Token current = token; for (int i = 0; i < n; i++) { if (current.next == null) { current.next = token_source.getNextToken(); } current = current.next; } return current; }
[ "private", "Token", "lookahead", "(", "int", "n", ")", "{", "Token", "current", "=", "token", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ")", "{", "if", "(", "current", ".", "next", "==", "null", ")", "{", "cur...
look ahead n tokens. 0 is the current token, 1 is the next token, 2 the one after that, etc @param n @return
[ "look", "ahead", "n", "tokens", ".", "0", "is", "the", "current", "token", "1", "is", "the", "next", "token", "2", "the", "one", "after", "that", "etc" ]
92ee94b6624cd673851497d78c218837dcf02b8a
https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/parser/javacc/JavaCCParserImpl.java#L194-L203
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java
RoleManager.createNewRole
@Nonnull public IRole createNewRole (@Nonnull @Nonempty final String sName, @Nullable final String sDescription, @Nullable final Map <String, String> aCustomAttrs) { // Create role final Role aRole = new Role (sName, sDescription, aCustomAttrs); m_aRWLock.writeLocked ( () -> { // Store internalCreateItem (aRole); }); AuditHelper.onAuditCreateSuccess (Role.OT, aRole.getID (), sName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleCreated (aRole, false)); return aRole; }
java
@Nonnull public IRole createNewRole (@Nonnull @Nonempty final String sName, @Nullable final String sDescription, @Nullable final Map <String, String> aCustomAttrs) { // Create role final Role aRole = new Role (sName, sDescription, aCustomAttrs); m_aRWLock.writeLocked ( () -> { // Store internalCreateItem (aRole); }); AuditHelper.onAuditCreateSuccess (Role.OT, aRole.getID (), sName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleCreated (aRole, false)); return aRole; }
[ "@", "Nonnull", "public", "IRole", "createNewRole", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sName", ",", "@", "Nullable", "final", "String", "sDescription", ",", "@", "Nullable", "final", "Map", "<", "String", ",", "String", ">", "aCustomAt...
Create a new role. @param sName The name of the new role. May neither be <code>null</code> nor empty. @param sDescription Optional description text. May be <code>null</code>. @param aCustomAttrs A set of custom attributes. May be <code>null</code>. @return The created role and never <code>null</code>.
[ "Create", "a", "new", "role", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java#L85-L103
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java
RoleManager.createPredefinedRole
@Nonnull public IRole createPredefinedRole (@Nonnull @Nonempty final String sID, @Nonnull @Nonempty final String sName, @Nullable final String sDescription, @Nullable final Map <String, String> aCustomAttrs) { // Create role final Role aRole = new Role (StubObject.createForCurrentUserAndID (sID, aCustomAttrs), sName, sDescription); m_aRWLock.writeLocked ( () -> { // Store internalCreateItem (aRole); }); AuditHelper.onAuditCreateSuccess (Role.OT, aRole.getID (), "predefind-role", sName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleCreated (aRole, true)); return aRole; }
java
@Nonnull public IRole createPredefinedRole (@Nonnull @Nonempty final String sID, @Nonnull @Nonempty final String sName, @Nullable final String sDescription, @Nullable final Map <String, String> aCustomAttrs) { // Create role final Role aRole = new Role (StubObject.createForCurrentUserAndID (sID, aCustomAttrs), sName, sDescription); m_aRWLock.writeLocked ( () -> { // Store internalCreateItem (aRole); }); AuditHelper.onAuditCreateSuccess (Role.OT, aRole.getID (), "predefind-role", sName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleCreated (aRole, true)); return aRole; }
[ "@", "Nonnull", "public", "IRole", "createPredefinedRole", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sID", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sName", ",", "@", "Nullable", "final", "String", "sDescription", ",", "@", "N...
Create a predefined role. @param sID The ID of the new role @param sName The name of the new role @param sDescription Optional description text. May be <code>null</code>. @param aCustomAttrs A set of custom attributes. May be <code>null</code>. @return The created role and never <code>null</code>.
[ "Create", "a", "predefined", "role", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java#L118-L137
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java
RoleManager.deleteRole
@Nonnull public EChange deleteRole (@Nullable final String sRoleID) { Role aDeletedRole; m_aRWLock.writeLock ().lock (); try { aDeletedRole = internalDeleteItem (sRoleID); if (aDeletedRole == null) { AuditHelper.onAuditDeleteFailure (Role.OT, "no-such-role-id", sRoleID); return EChange.UNCHANGED; } BusinessObjectHelper.setDeletionNow (aDeletedRole); } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditDeleteSuccess (Role.OT, sRoleID); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleDeleted (aDeletedRole)); return EChange.CHANGED; }
java
@Nonnull public EChange deleteRole (@Nullable final String sRoleID) { Role aDeletedRole; m_aRWLock.writeLock ().lock (); try { aDeletedRole = internalDeleteItem (sRoleID); if (aDeletedRole == null) { AuditHelper.onAuditDeleteFailure (Role.OT, "no-such-role-id", sRoleID); return EChange.UNCHANGED; } BusinessObjectHelper.setDeletionNow (aDeletedRole); } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditDeleteSuccess (Role.OT, sRoleID); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleDeleted (aDeletedRole)); return EChange.CHANGED; }
[ "@", "Nonnull", "public", "EChange", "deleteRole", "(", "@", "Nullable", "final", "String", "sRoleID", ")", "{", "Role", "aDeletedRole", ";", "m_aRWLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "aDeletedRole", "=", "internalDel...
Delete the role with the passed ID @param sRoleID The role ID to be deleted @return {@link EChange#CHANGED} if the passed role ID was found and deleted
[ "Delete", "the", "role", "with", "the", "passed", "ID" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java#L146-L171
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java
RoleManager.renameRole
@Nonnull public EChange renameRole (@Nullable final String sRoleID, @Nonnull @Nonempty final String sNewName) { // Resolve user group final Role aRole = getOfID (sRoleID); if (aRole == null) { AuditHelper.onAuditModifyFailure (Role.OT, sRoleID, "no-such-id"); return EChange.UNCHANGED; } m_aRWLock.writeLock ().lock (); try { if (aRole.setName (sNewName).isUnchanged ()) return EChange.UNCHANGED; BusinessObjectHelper.setLastModificationNow (aRole); internalUpdateItem (aRole); } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditModifySuccess (Role.OT, "name", sRoleID, sNewName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleRenamed (aRole)); return EChange.CHANGED; }
java
@Nonnull public EChange renameRole (@Nullable final String sRoleID, @Nonnull @Nonempty final String sNewName) { // Resolve user group final Role aRole = getOfID (sRoleID); if (aRole == null) { AuditHelper.onAuditModifyFailure (Role.OT, sRoleID, "no-such-id"); return EChange.UNCHANGED; } m_aRWLock.writeLock ().lock (); try { if (aRole.setName (sNewName).isUnchanged ()) return EChange.UNCHANGED; BusinessObjectHelper.setLastModificationNow (aRole); internalUpdateItem (aRole); } finally { m_aRWLock.writeLock ().unlock (); } AuditHelper.onAuditModifySuccess (Role.OT, "name", sRoleID, sNewName); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onRoleRenamed (aRole)); return EChange.CHANGED; }
[ "@", "Nonnull", "public", "EChange", "renameRole", "(", "@", "Nullable", "final", "String", "sRoleID", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sNewName", ")", "{", "// Resolve user group", "final", "Role", "aRole", "=", "getOfID", "(", "sRole...
Rename the role with the passed ID @param sRoleID The ID of the role to be renamed. May be <code>null</code>. @param sNewName The new name of the role. May neither be <code>null</code> nor empty. @return {@link EChange#CHANGED} if the passed role ID was found, and the new name is different from the old name of he role
[ "Rename", "the", "role", "with", "the", "passed", "ID" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/role/RoleManager.java#L197-L227
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/asm/FieldVisitor.java
FieldVisitor.visitAnnotation
public AnnotationVisitor visitAnnotation(String desc, boolean visible) { if (fv != null) { return fv.visitAnnotation(desc, visible); } return null; }
java
public AnnotationVisitor visitAnnotation(String desc, boolean visible) { if (fv != null) { return fv.visitAnnotation(desc, visible); } return null; }
[ "public", "AnnotationVisitor", "visitAnnotation", "(", "String", "desc", ",", "boolean", "visible", ")", "{", "if", "(", "fv", "!=", "null", ")", "{", "return", "fv", ".", "visitAnnotation", "(", "desc", ",", "visible", ")", ";", "}", "return", "null", "...
Visits an annotation of the field. @param desc the class descriptor of the annotation class. @param visible <tt>true</tt> if the annotation is visible at runtime. @return a visitor to visit the annotation values, or <tt>null</tt> if this visitor is not interested in visiting this annotation.
[ "Visits", "an", "annotation", "of", "the", "field", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/asm/FieldVisitor.java#L92-L97
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java
HCHelper.getFirstChildElement
@Nullable public static IMicroElement getFirstChildElement (@Nonnull final IMicroElement aElement, @Nonnull final EHTMLElement eHTMLElement) { ValueEnforcer.notNull (aElement, "element"); ValueEnforcer.notNull (eHTMLElement, "HTMLElement"); // First try with lower case name IMicroElement aChild = aElement.getFirstChildElement (eHTMLElement.getElementName ()); if (aChild == null) { // Fallback: try with upper case name aChild = aElement.getFirstChildElement (eHTMLElement.getElementNameUpperCase ()); } return aChild; }
java
@Nullable public static IMicroElement getFirstChildElement (@Nonnull final IMicroElement aElement, @Nonnull final EHTMLElement eHTMLElement) { ValueEnforcer.notNull (aElement, "element"); ValueEnforcer.notNull (eHTMLElement, "HTMLElement"); // First try with lower case name IMicroElement aChild = aElement.getFirstChildElement (eHTMLElement.getElementName ()); if (aChild == null) { // Fallback: try with upper case name aChild = aElement.getFirstChildElement (eHTMLElement.getElementNameUpperCase ()); } return aChild; }
[ "@", "Nullable", "public", "static", "IMicroElement", "getFirstChildElement", "(", "@", "Nonnull", "final", "IMicroElement", "aElement", ",", "@", "Nonnull", "final", "EHTMLElement", "eHTMLElement", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aElement", ",", ...
Find the first HTML child element within a start element. This check considers both lower- and upper-case element names. Mixed case is not supported! @param aElement The element to search in @param eHTMLElement The HTML element to search. @return <code>null</code> if no such child element is present.
[ "Find", "the", "first", "HTML", "child", "element", "within", "a", "start", "element", ".", "This", "check", "considers", "both", "lower", "-", "and", "upper", "-", "case", "element", "names", ".", "Mixed", "case", "is", "not", "supported!" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java#L270-L285
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java
HCHelper.getChildElements
@Nonnull @ReturnsMutableCopy public static ICommonsList <IMicroElement> getChildElements (@Nonnull final IMicroElement aElement, @Nonnull final EHTMLElement eHTMLElement) { ValueEnforcer.notNull (aElement, "element"); ValueEnforcer.notNull (eHTMLElement, "HTMLElement"); final ICommonsList <IMicroElement> ret = new CommonsArrayList <> (); ret.addAll (aElement.getAllChildElements (eHTMLElement.getElementName ())); ret.addAll (aElement.getAllChildElements (eHTMLElement.getElementNameUpperCase ())); return ret; }
java
@Nonnull @ReturnsMutableCopy public static ICommonsList <IMicroElement> getChildElements (@Nonnull final IMicroElement aElement, @Nonnull final EHTMLElement eHTMLElement) { ValueEnforcer.notNull (aElement, "element"); ValueEnforcer.notNull (eHTMLElement, "HTMLElement"); final ICommonsList <IMicroElement> ret = new CommonsArrayList <> (); ret.addAll (aElement.getAllChildElements (eHTMLElement.getElementName ())); ret.addAll (aElement.getAllChildElements (eHTMLElement.getElementNameUpperCase ())); return ret; }
[ "@", "Nonnull", "@", "ReturnsMutableCopy", "public", "static", "ICommonsList", "<", "IMicroElement", ">", "getChildElements", "(", "@", "Nonnull", "final", "IMicroElement", "aElement", ",", "@", "Nonnull", "final", "EHTMLElement", "eHTMLElement", ")", "{", "ValueEnf...
Get a list of all HTML child elements of the given element. This methods handles lower- and upper-cased elements. @param aElement The element to search in @param eHTMLElement The HTML element to search @return A non-<code>null</code> list where the lower-case elements are listed before the upper-case elements.
[ "Get", "a", "list", "of", "all", "HTML", "child", "elements", "of", "the", "given", "element", ".", "This", "methods", "handles", "lower", "-", "and", "upper", "-", "cased", "elements", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java#L298-L310
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java
HCHelper.getAsHTMLID
@Nonnull public static String getAsHTMLID (@Nullable final String sSrc) { String ret = StringHelper.getNotNull (sSrc, "").trim (); ret = StringHelper.removeMultiple (ret, ID_REMOVE_CHARS); return ret.isEmpty () ? "_" : ret; }
java
@Nonnull public static String getAsHTMLID (@Nullable final String sSrc) { String ret = StringHelper.getNotNull (sSrc, "").trim (); ret = StringHelper.removeMultiple (ret, ID_REMOVE_CHARS); return ret.isEmpty () ? "_" : ret; }
[ "@", "Nonnull", "public", "static", "String", "getAsHTMLID", "(", "@", "Nullable", "final", "String", "sSrc", ")", "{", "String", "ret", "=", "StringHelper", ".", "getNotNull", "(", "sSrc", ",", "\"\"", ")", ".", "trim", "(", ")", ";", "ret", "=", "Str...
Convert the passed ID string to a valid HTML ID. @param sSrc The source string. May be <code>null</code>. @return An underscore instead of an empty string. The string cleaned from the malicious characters.
[ "Convert", "the", "passed", "ID", "string", "to", "a", "valid", "HTML", "ID", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java#L416-L422
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java
Hasher.hashSystemEnv
public String hashSystemEnv() { List<String> system = new ArrayList<String>(); for (Entry<Object, Object> el : System.getProperties().entrySet()) { system.add(el.getKey() + " " + el.getValue()); } Map<String, String> env = System.getenv(); for (Entry<String, String> el : env.entrySet()) { system.add(el.getKey() + " " + el.getValue()); } Collections.sort(system); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { DataOutputStream dos = new DataOutputStream(baos); for (String s : system) { dos.write(s.getBytes()); } } catch (IOException ex) { // never } return hashByteArray(baos.toByteArray()); }
java
public String hashSystemEnv() { List<String> system = new ArrayList<String>(); for (Entry<Object, Object> el : System.getProperties().entrySet()) { system.add(el.getKey() + " " + el.getValue()); } Map<String, String> env = System.getenv(); for (Entry<String, String> el : env.entrySet()) { system.add(el.getKey() + " " + el.getValue()); } Collections.sort(system); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { DataOutputStream dos = new DataOutputStream(baos); for (String s : system) { dos.write(s.getBytes()); } } catch (IOException ex) { // never } return hashByteArray(baos.toByteArray()); }
[ "public", "String", "hashSystemEnv", "(", ")", "{", "List", "<", "String", ">", "system", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Entry", "<", "Object", ",", "Object", ">", "el", ":", "System", ".", "getProperties", "...
Hashes system environment. http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
[ "Hashes", "system", "environment", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java#L130-L152
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java
Hasher.hashURL
protected String hashURL(URL url, String externalForm) { if (url == null) return ERR_HASH; String hash = path2Hash.get(externalForm); if (hash != null) { return hash; } if (mIsSemanticHashing) { byte[] bytes = FileUtil.loadBytes(url); if (bytes == null) return ERR_HASH; // Remove debug info from classfiles. bytes = BytecodeCleaner.removeDebugInfo(bytes); hash = hashByteArray(bytes); } else { // http://www.oracle.com/technetwork/articles/java/compress-1565076.html Checksum cksum = new Adler32(); byte[] bytes = FileUtil.loadBytes(url, cksum); if (bytes == null) return ERR_HASH; hash = Long.toString(cksum.getValue()); } path2Hash.put(externalForm, hash); return hash; }
java
protected String hashURL(URL url, String externalForm) { if (url == null) return ERR_HASH; String hash = path2Hash.get(externalForm); if (hash != null) { return hash; } if (mIsSemanticHashing) { byte[] bytes = FileUtil.loadBytes(url); if (bytes == null) return ERR_HASH; // Remove debug info from classfiles. bytes = BytecodeCleaner.removeDebugInfo(bytes); hash = hashByteArray(bytes); } else { // http://www.oracle.com/technetwork/articles/java/compress-1565076.html Checksum cksum = new Adler32(); byte[] bytes = FileUtil.loadBytes(url, cksum); if (bytes == null) return ERR_HASH; hash = Long.toString(cksum.getValue()); } path2Hash.put(externalForm, hash); return hash; }
[ "protected", "String", "hashURL", "(", "URL", "url", ",", "String", "externalForm", ")", "{", "if", "(", "url", "==", "null", ")", "return", "ERR_HASH", ";", "String", "hash", "=", "path2Hash", ".", "get", "(", "externalForm", ")", ";", "if", "(", "has...
Hash resource at the given URL.
[ "Hash", "resource", "at", "the", "given", "URL", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java#L207-L230
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java
Hasher.hashByteArray
protected String hashByteArray(byte[] data) { if (mCRC32 != null) { return hashCRC32(data); } else if (mHashAlgorithm != null) { return messageDigest(data); } else { // Default. return hashCRC32(data); } }
java
protected String hashByteArray(byte[] data) { if (mCRC32 != null) { return hashCRC32(data); } else if (mHashAlgorithm != null) { return messageDigest(data); } else { // Default. return hashCRC32(data); } }
[ "protected", "String", "hashByteArray", "(", "byte", "[", "]", "data", ")", "{", "if", "(", "mCRC32", "!=", "null", ")", "{", "return", "hashCRC32", "(", "data", ")", ";", "}", "else", "if", "(", "mHashAlgorithm", "!=", "null", ")", "{", "return", "m...
Hashes byte array. @return Hash of the given byte array.
[ "Hashes", "byte", "array", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/hash/Hasher.java#L251-L260
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java
Types.isIgnorable
public static boolean isIgnorable(Class<?> clz) { return clz.isArray() || clz.isPrimitive() || isIgnorableBinName(clz.getName()); }
java
public static boolean isIgnorable(Class<?> clz) { return clz.isArray() || clz.isPrimitive() || isIgnorableBinName(clz.getName()); }
[ "public", "static", "boolean", "isIgnorable", "(", "Class", "<", "?", ">", "clz", ")", "{", "return", "clz", ".", "isArray", "(", ")", "||", "clz", ".", "isPrimitive", "(", ")", "||", "isIgnorableBinName", "(", "clz", ".", "getName", "(", ")", ")", "...
Checks if class should be ignored when collecting dependencies.
[ "Checks", "if", "class", "should", "be", "ignored", "when", "collecting", "dependencies", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java#L72-L74
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java
Types.isRetransformIgnorable
@Research public static boolean isRetransformIgnorable(Class<?> clz) { String className = clz.getName(); return (isIgnorableBinName(className) || className.startsWith(Names.ORG_APACHE_MAVEN_BIN, 0) || className.startsWith(Names.ORG_JUNIT_PACKAGE_BIN, 0) || className.startsWith(Names.JUNIT_FRAMEWORK_PACKAGE_BIN, 0)); }
java
@Research public static boolean isRetransformIgnorable(Class<?> clz) { String className = clz.getName(); return (isIgnorableBinName(className) || className.startsWith(Names.ORG_APACHE_MAVEN_BIN, 0) || className.startsWith(Names.ORG_JUNIT_PACKAGE_BIN, 0) || className.startsWith(Names.JUNIT_FRAMEWORK_PACKAGE_BIN, 0)); }
[ "@", "Research", "public", "static", "boolean", "isRetransformIgnorable", "(", "Class", "<", "?", ">", "clz", ")", "{", "String", "className", "=", "clz", ".", "getName", "(", ")", ";", "return", "(", "isIgnorableBinName", "(", "className", ")", "||", "cla...
Checks if the given class should be instrumented. Returns true if the class should not be instrumented, false otherwise.
[ "Checks", "if", "the", "given", "class", "should", "be", "instrumented", ".", "Returns", "true", "if", "the", "class", "should", "not", "be", "instrumented", "false", "otherwise", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java#L120-L127
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java
Types.extractJarURL
public static URL extractJarURL(URL url) throws IOException { JarURLConnection connection = (JarURLConnection) url.openConnection(); return connection.getJarFileURL(); }
java
public static URL extractJarURL(URL url) throws IOException { JarURLConnection connection = (JarURLConnection) url.openConnection(); return connection.getJarFileURL(); }
[ "public", "static", "URL", "extractJarURL", "(", "URL", "url", ")", "throws", "IOException", "{", "JarURLConnection", "connection", "=", "(", "JarURLConnection", ")", "url", ".", "openConnection", "(", ")", ";", "return", "connection", ".", "getJarFileURL", "(",...
Extract URL part that corresponds to jar portion of the given url.
[ "Extract", "URL", "part", "that", "corresponds", "to", "jar", "portion", "of", "the", "given", "url", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java#L200-L203
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java
Types.isPrimitiveDesc
public static boolean isPrimitiveDesc(String desc) { if (desc.length() > 1) return false; char c = desc.charAt(0); return c == 'Z' || c == 'B' || c == 'C' || c == 'D' || c == 'F' || c == 'I' || c == 'J' || c == 'S'; }
java
public static boolean isPrimitiveDesc(String desc) { if (desc.length() > 1) return false; char c = desc.charAt(0); return c == 'Z' || c == 'B' || c == 'C' || c == 'D' || c == 'F' || c == 'I' || c == 'J' || c == 'S'; }
[ "public", "static", "boolean", "isPrimitiveDesc", "(", "String", "desc", ")", "{", "if", "(", "desc", ".", "length", "(", ")", ">", "1", ")", "return", "false", ";", "char", "c", "=", "desc", ".", "charAt", "(", "0", ")", ";", "return", "c", "==", ...
Returns true if descriptor describes one of the primitive types.
[ "Returns", "true", "if", "descriptor", "describes", "one", "of", "the", "primitive", "types", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/util/Types.java#L216-L227
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java
BasePageShowChildrenRenderer.beforeAddRenderedMenuItem
@OverrideOnDemand public void beforeAddRenderedMenuItem (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuObject aMenuObj, @Nullable final IHCElement <?> aPreviousLI) { if (aMenuObj.getMenuObjectType () == EMenuObjectType.SEPARATOR && aPreviousLI != null) aPreviousLI.addStyle (CCSSProperties.MARGIN_BOTTOM.newValue ("1em")); }
java
@OverrideOnDemand public void beforeAddRenderedMenuItem (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuObject aMenuObj, @Nullable final IHCElement <?> aPreviousLI) { if (aMenuObj.getMenuObjectType () == EMenuObjectType.SEPARATOR && aPreviousLI != null) aPreviousLI.addStyle (CCSSProperties.MARGIN_BOTTOM.newValue ("1em")); }
[ "@", "OverrideOnDemand", "public", "void", "beforeAddRenderedMenuItem", "(", "@", "Nonnull", "final", "IWebPageExecutionContext", "aWPEC", ",", "@", "Nonnull", "final", "IMenuObject", "aMenuObj", ",", "@", "Nullable", "final", "IHCElement", "<", "?", ">", "aPrevious...
Called before a menu item is rendered. @param aWPEC Web page execution context. May not be <code>null</code>. @param aMenuObj The menu object about to be rendered. Never <code>null</code>. @param aPreviousLI The previous element from the last call. May be <code>null</code>.
[ "Called", "before", "a", "menu", "item", "is", "rendered", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java#L58-L65
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java
BasePageShowChildrenRenderer.renderMenuSeparator
@Nullable @OverrideOnDemand public IHCNode renderMenuSeparator (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuSeparator aMenuSeparator) { return null; }
java
@Nullable @OverrideOnDemand public IHCNode renderMenuSeparator (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuSeparator aMenuSeparator) { return null; }
[ "@", "Nullable", "@", "OverrideOnDemand", "public", "IHCNode", "renderMenuSeparator", "(", "@", "Nonnull", "final", "IWebPageExecutionContext", "aWPEC", ",", "@", "Nonnull", "final", "IMenuSeparator", "aMenuSeparator", ")", "{", "return", "null", ";", "}" ]
Render a menu separator @param aWPEC Web page execution context. May not be <code>null</code>. @param aMenuSeparator The menu separator. Never <code>null</code>. @return The rendered representation or <code>null</code>
[ "Render", "a", "menu", "separator" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java#L76-L82
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java
BasePageShowChildrenRenderer.renderMenuItemPage
@Nullable @OverrideOnDemand public IHCNode renderMenuItemPage (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuItemPage aMenuItemPage) { if (!aMenuItemPage.matchesDisplayFilter ()) return null; final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final HCA ret = new HCA (aWPEC.getLinkToMenuItem (aMenuItemPage.getID ())); // Set window target (if defined) if (aMenuItemPage.hasTarget ()) ret.setTarget (new HC_Target (aMenuItemPage.getTarget ())); ret.addChild (aMenuItemPage.getDisplayText (aDisplayLocale)); return ret; }
java
@Nullable @OverrideOnDemand public IHCNode renderMenuItemPage (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuItemPage aMenuItemPage) { if (!aMenuItemPage.matchesDisplayFilter ()) return null; final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final HCA ret = new HCA (aWPEC.getLinkToMenuItem (aMenuItemPage.getID ())); // Set window target (if defined) if (aMenuItemPage.hasTarget ()) ret.setTarget (new HC_Target (aMenuItemPage.getTarget ())); ret.addChild (aMenuItemPage.getDisplayText (aDisplayLocale)); return ret; }
[ "@", "Nullable", "@", "OverrideOnDemand", "public", "IHCNode", "renderMenuItemPage", "(", "@", "Nonnull", "final", "IWebPageExecutionContext", "aWPEC", ",", "@", "Nonnull", "final", "IMenuItemPage", "aMenuItemPage", ")", "{", "if", "(", "!", "aMenuItemPage", ".", ...
Render a menu item to an internal page @param aWPEC Web page execution context. May not be <code>null</code>. @param aMenuItemPage The menu item. Never <code>null</code>. @return The rendered representation or <code>null</code>
[ "Render", "a", "menu", "item", "to", "an", "internal", "page" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java#L93-L108
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java
BasePageShowChildrenRenderer.renderMenuItemExternal
@Nullable @OverrideOnDemand public IHCNode renderMenuItemExternal (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuItemExternal aMenuItemExternal) { if (!aMenuItemExternal.matchesDisplayFilter ()) return null; final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final HCA ret = new HCA (aMenuItemExternal.getURL ()); // Set window target (if defined) if (aMenuItemExternal.hasTarget ()) ret.setTarget (new HC_Target (aMenuItemExternal.getTarget ())); ret.addChild (aMenuItemExternal.getDisplayText (aDisplayLocale)); return ret; }
java
@Nullable @OverrideOnDemand public IHCNode renderMenuItemExternal (@Nonnull final IWebPageExecutionContext aWPEC, @Nonnull final IMenuItemExternal aMenuItemExternal) { if (!aMenuItemExternal.matchesDisplayFilter ()) return null; final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final HCA ret = new HCA (aMenuItemExternal.getURL ()); // Set window target (if defined) if (aMenuItemExternal.hasTarget ()) ret.setTarget (new HC_Target (aMenuItemExternal.getTarget ())); ret.addChild (aMenuItemExternal.getDisplayText (aDisplayLocale)); return ret; }
[ "@", "Nullable", "@", "OverrideOnDemand", "public", "IHCNode", "renderMenuItemExternal", "(", "@", "Nonnull", "final", "IWebPageExecutionContext", "aWPEC", ",", "@", "Nonnull", "final", "IMenuItemExternal", "aMenuItemExternal", ")", "{", "if", "(", "!", "aMenuItemExte...
Render a menu item to an external page @param aWPEC Web page execution context. May not be <code>null</code>. @param aMenuItemExternal The menu item. Never <code>null</code>. @return The rendered representation or <code>null</code>
[ "Render", "a", "menu", "item", "to", "an", "external", "page" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/system/BasePageShowChildrenRenderer.java#L119-L134
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock.removeByName
@Nonnull public EChange removeByName (final String sName) { final IJSDeclaration aDecl = m_aDecls.remove (sName); if (aDecl == null) return EChange.UNCHANGED; m_aObjs.remove (aDecl); return EChange.CHANGED; }
java
@Nonnull public EChange removeByName (final String sName) { final IJSDeclaration aDecl = m_aDecls.remove (sName); if (aDecl == null) return EChange.UNCHANGED; m_aObjs.remove (aDecl); return EChange.CHANGED; }
[ "@", "Nonnull", "public", "EChange", "removeByName", "(", "final", "String", "sName", ")", "{", "final", "IJSDeclaration", "aDecl", "=", "m_aDecls", ".", "remove", "(", "sName", ")", ";", "if", "(", "aDecl", "==", "null", ")", "return", "EChange", ".", "...
Removes a declaration from this package. @param sName Name to remove @return Never <code>null</code>.
[ "Removes", "a", "declaration", "from", "this", "package", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L92-L100
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock.pos
@Nonnegative public int pos (@Nonnegative final int nNewPos) { ValueEnforcer.isBetweenInclusive (nNewPos, "NewPos", 0, m_aObjs.size ()); final int nOldPos = m_nPos; m_nPos = nNewPos; return nOldPos; }
java
@Nonnegative public int pos (@Nonnegative final int nNewPos) { ValueEnforcer.isBetweenInclusive (nNewPos, "NewPos", 0, m_aObjs.size ()); final int nOldPos = m_nPos; m_nPos = nNewPos; return nOldPos; }
[ "@", "Nonnegative", "public", "int", "pos", "(", "@", "Nonnegative", "final", "int", "nNewPos", ")", "{", "ValueEnforcer", ".", "isBetweenInclusive", "(", "nNewPos", ",", "\"NewPos\"", ",", "0", ",", "m_aObjs", ".", "size", "(", ")", ")", ";", "final", "...
Sets the current position. @param nNewPos New position to use @return the old value of the current position. @throws IllegalArgumentException if the new position value is illegal. @see #pos()
[ "Sets", "the", "current", "position", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L244-L251
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock._class
@Nonnull public JSDefinedClass _class (@Nonnull @Nonempty final String sName) throws JSNameAlreadyExistsException { final JSDefinedClass aDefinedClass = new JSDefinedClass (sName); return addDeclaration (aDefinedClass); }
java
@Nonnull public JSDefinedClass _class (@Nonnull @Nonempty final String sName) throws JSNameAlreadyExistsException { final JSDefinedClass aDefinedClass = new JSDefinedClass (sName); return addDeclaration (aDefinedClass); }
[ "@", "Nonnull", "public", "JSDefinedClass", "_class", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sName", ")", "throws", "JSNameAlreadyExistsException", "{", "final", "JSDefinedClass", "aDefinedClass", "=", "new", "JSDefinedClass", "(", "sName", ")", ...
Add a class to this package. @param sName Name of class to be added to this package @return Newly generated class @exception JSNameAlreadyExistsException When the specified class/interface was already created.
[ "Add", "a", "class", "to", "this", "package", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L274-L279
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock._throw
@Nonnull public IMPLTYPE _throw (@Nonnull final IJSExpression aExpr) { addStatement (new JSThrow (aExpr)); return thisAsT (); }
java
@Nonnull public IMPLTYPE _throw (@Nonnull final IJSExpression aExpr) { addStatement (new JSThrow (aExpr)); return thisAsT (); }
[ "@", "Nonnull", "public", "IMPLTYPE", "_throw", "(", "@", "Nonnull", "final", "IJSExpression", "aExpr", ")", "{", "addStatement", "(", "new", "JSThrow", "(", "aExpr", ")", ")", ";", "return", "thisAsT", "(", ")", ";", "}" ]
Create a throw statement and add it to this block @param aExpr Throwing expression @return this
[ "Create", "a", "throw", "statement", "and", "add", "it", "to", "this", "block" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L946-L951
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock._if
@Nonnull public JSConditional _if (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen) { return addStatement (new JSConditional (aTest, aThen)); }
java
@Nonnull public JSConditional _if (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen) { return addStatement (new JSConditional (aTest, aThen)); }
[ "@", "Nonnull", "public", "JSConditional", "_if", "(", "@", "Nonnull", "final", "IJSExpression", "aTest", ",", "@", "Nullable", "final", "IHasJSCode", "aThen", ")", "{", "return", "addStatement", "(", "new", "JSConditional", "(", "aTest", ",", "aThen", ")", ...
Create an If statement and add it to this block @param aTest {@link IJSExpression} to be tested to determine branching @param aThen "then" block content. May be <code>null</code>. @return Newly generated conditional statement
[ "Create", "an", "If", "statement", "and", "add", "it", "to", "this", "block" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L999-L1003
train
phax/ph-oton
ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java
AbstractJSBlock._return
@Nonnull public IMPLTYPE _return (@Nullable final IJSExpression aExpr) { addStatement (new JSReturn (aExpr)); return thisAsT (); }
java
@Nonnull public IMPLTYPE _return (@Nullable final IJSExpression aExpr) { addStatement (new JSReturn (aExpr)); return thisAsT (); }
[ "@", "Nonnull", "public", "IMPLTYPE", "_return", "(", "@", "Nullable", "final", "IJSExpression", "aExpr", ")", "{", "addStatement", "(", "new", "JSReturn", "(", "aExpr", ")", ")", ";", "return", "thisAsT", "(", ")", ";", "}" ]
Create a return statement and add it to this block @param aExpr Expression to return @return this
[ "Create", "a", "return", "statement", "and", "add", "it", "to", "this", "block" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/AbstractJSBlock.java#L1090-L1095
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java
InternalErrorBuilder.setDuplicateEliminiationCounter
@Nonnull public final InternalErrorBuilder setDuplicateEliminiationCounter (@Nonnegative final int nDuplicateEliminiationCounter) { ValueEnforcer.isGE0 (nDuplicateEliminiationCounter, "DuplicateEliminiationCounter"); m_nDuplicateEliminiationCounter = nDuplicateEliminiationCounter; return this; }
java
@Nonnull public final InternalErrorBuilder setDuplicateEliminiationCounter (@Nonnegative final int nDuplicateEliminiationCounter) { ValueEnforcer.isGE0 (nDuplicateEliminiationCounter, "DuplicateEliminiationCounter"); m_nDuplicateEliminiationCounter = nDuplicateEliminiationCounter; return this; }
[ "@", "Nonnull", "public", "final", "InternalErrorBuilder", "setDuplicateEliminiationCounter", "(", "@", "Nonnegative", "final", "int", "nDuplicateEliminiationCounter", ")", "{", "ValueEnforcer", ".", "isGE0", "(", "nDuplicateEliminiationCounter", ",", "\"DuplicateEliminiation...
Set the duplicate elimination counter. @param nDuplicateEliminiationCounter The value to set. Must be &ge; 0. Pass 0 to disable any duplicate elimination and send all errors by email. @return this for chaining @since 7.0.6
[ "Set", "the", "duplicate", "elimination", "counter", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java#L376-L382
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java
InternalErrorBuilder.setFromWebExecutionContext
@Nonnull public final InternalErrorBuilder setFromWebExecutionContext (@Nonnull final ISimpleWebExecutionContext aSWEC) { setDisplayLocale (aSWEC.getDisplayLocale ()); setRequestScope (aSWEC.getRequestScope ()); return this; }
java
@Nonnull public final InternalErrorBuilder setFromWebExecutionContext (@Nonnull final ISimpleWebExecutionContext aSWEC) { setDisplayLocale (aSWEC.getDisplayLocale ()); setRequestScope (aSWEC.getRequestScope ()); return this; }
[ "@", "Nonnull", "public", "final", "InternalErrorBuilder", "setFromWebExecutionContext", "(", "@", "Nonnull", "final", "ISimpleWebExecutionContext", "aSWEC", ")", "{", "setDisplayLocale", "(", "aSWEC", ".", "getDisplayLocale", "(", ")", ")", ";", "setRequestScope", "(...
Shortcut for setting display locale and request scope at once from a web execution context @param aSWEC The web execution context to use. May not be <code>null</code>. @return this
[ "Shortcut", "for", "setting", "display", "locale", "and", "request", "scope", "at", "once", "from", "a", "web", "execution", "context" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java#L403-L409
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java
InternalErrorBuilder.handle
@Nonnull @Nonempty public String handle () { return InternalErrorHandler.handleInternalError (m_bSendEmail, m_bSaveAsXML, m_aUIErrorHandler, m_aThrowable, m_aRequestScope, m_aCustomData, m_aEmailAttachments, m_aDisplayLocale, m_bInvokeCustomExceptionHandler, m_bAddClassPath, m_nDuplicateEliminiationCounter); }
java
@Nonnull @Nonempty public String handle () { return InternalErrorHandler.handleInternalError (m_bSendEmail, m_bSaveAsXML, m_aUIErrorHandler, m_aThrowable, m_aRequestScope, m_aCustomData, m_aEmailAttachments, m_aDisplayLocale, m_bInvokeCustomExceptionHandler, m_bAddClassPath, m_nDuplicateEliminiationCounter); }
[ "@", "Nonnull", "@", "Nonempty", "public", "String", "handle", "(", ")", "{", "return", "InternalErrorHandler", ".", "handleInternalError", "(", "m_bSendEmail", ",", "m_bSaveAsXML", ",", "m_aUIErrorHandler", ",", "m_aThrowable", ",", "m_aRequestScope", ",", "m_aCust...
The main handling routine @return The created error ID. Neither <code>null</code> nor empty.
[ "The", "main", "handling", "routine" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/interror/InternalErrorBuilder.java#L416-L431
train
phax/ph-oton
ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/utils/BootstrapBorderBuilder.java
BootstrapBorderBuilder.type
@Nonnull public BootstrapBorderBuilder type (@Nonnull final EBootstrapBorderType eType) { ValueEnforcer.notNull (eType, "Type"); m_eType = eType; return this; }
java
@Nonnull public BootstrapBorderBuilder type (@Nonnull final EBootstrapBorderType eType) { ValueEnforcer.notNull (eType, "Type"); m_eType = eType; return this; }
[ "@", "Nonnull", "public", "BootstrapBorderBuilder", "type", "(", "@", "Nonnull", "final", "EBootstrapBorderType", "eType", ")", "{", "ValueEnforcer", ".", "notNull", "(", "eType", ",", "\"Type\"", ")", ";", "m_eType", "=", "eType", ";", "return", "this", ";", ...
Set the border type. Default is no border. @param eType Border type. May not be <code>null</code>. @return this for chaining
[ "Set", "the", "border", "type", ".", "Default", "is", "no", "border", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/utils/BootstrapBorderBuilder.java#L48-L54
train
phax/ph-oton
ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/utils/BootstrapBorderBuilder.java
BootstrapBorderBuilder.radius
@Nonnull public BootstrapBorderBuilder radius (@Nonnull final EBootstrapBorderRadiusType eRadius) { ValueEnforcer.notNull (eRadius, "Radius"); m_eRadius = eRadius; return this; }
java
@Nonnull public BootstrapBorderBuilder radius (@Nonnull final EBootstrapBorderRadiusType eRadius) { ValueEnforcer.notNull (eRadius, "Radius"); m_eRadius = eRadius; return this; }
[ "@", "Nonnull", "public", "BootstrapBorderBuilder", "radius", "(", "@", "Nonnull", "final", "EBootstrapBorderRadiusType", "eRadius", ")", "{", "ValueEnforcer", ".", "notNull", "(", "eRadius", ",", "\"Radius\"", ")", ";", "m_eRadius", "=", "eRadius", ";", "return",...
Set the border radius. Default is no radius. @param eRadius Border type. May not be <code>null</code>. @return this for chaining
[ "Set", "the", "border", "radius", ".", "Default", "is", "no", "radius", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/utils/BootstrapBorderBuilder.java#L77-L83
train
phax/ph-oton
ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/DataTablesHelper.java
DataTablesHelper.createFunctionPrintSum
@Nonnull public static JSAnonymousFunction createFunctionPrintSum (@Nullable final String sPrefix, @Nullable final String sSuffix, @Nullable final String sBothPrefix, @Nullable final String sBothSep, @Nullable final String sBothSuffix) { final JSAnonymousFunction aFuncPrintSum = new JSAnonymousFunction (); IJSExpression aTotal = aFuncPrintSum.param ("t"); IJSExpression aPageTotal = aFuncPrintSum.param ("pt"); if (StringHelper.hasText (sPrefix)) { aTotal = JSExpr.lit (sPrefix).plus (aTotal); aPageTotal = JSExpr.lit (sPrefix).plus (aPageTotal); } if (StringHelper.hasText (sSuffix)) { aTotal = aTotal.plus (sSuffix); aPageTotal = aPageTotal.plus (sSuffix); } IJSExpression aBoth; if (StringHelper.hasText (sBothPrefix)) aBoth = JSExpr.lit (sBothPrefix).plus (aPageTotal); else aBoth = aPageTotal; if (StringHelper.hasText (sBothSep)) aBoth = aBoth.plus (sBothSep); aBoth = aBoth.plus (aTotal); if (StringHelper.hasText (sBothSuffix)) aBoth = aBoth.plus (sBothSuffix); aFuncPrintSum.body ()._return (JSOp.cond (aTotal.eq (aPageTotal), aTotal, aBoth)); return aFuncPrintSum; }
java
@Nonnull public static JSAnonymousFunction createFunctionPrintSum (@Nullable final String sPrefix, @Nullable final String sSuffix, @Nullable final String sBothPrefix, @Nullable final String sBothSep, @Nullable final String sBothSuffix) { final JSAnonymousFunction aFuncPrintSum = new JSAnonymousFunction (); IJSExpression aTotal = aFuncPrintSum.param ("t"); IJSExpression aPageTotal = aFuncPrintSum.param ("pt"); if (StringHelper.hasText (sPrefix)) { aTotal = JSExpr.lit (sPrefix).plus (aTotal); aPageTotal = JSExpr.lit (sPrefix).plus (aPageTotal); } if (StringHelper.hasText (sSuffix)) { aTotal = aTotal.plus (sSuffix); aPageTotal = aPageTotal.plus (sSuffix); } IJSExpression aBoth; if (StringHelper.hasText (sBothPrefix)) aBoth = JSExpr.lit (sBothPrefix).plus (aPageTotal); else aBoth = aPageTotal; if (StringHelper.hasText (sBothSep)) aBoth = aBoth.plus (sBothSep); aBoth = aBoth.plus (aTotal); if (StringHelper.hasText (sBothSuffix)) aBoth = aBoth.plus (sBothSuffix); aFuncPrintSum.body ()._return (JSOp.cond (aTotal.eq (aPageTotal), aTotal, aBoth)); return aFuncPrintSum; }
[ "@", "Nonnull", "public", "static", "JSAnonymousFunction", "createFunctionPrintSum", "(", "@", "Nullable", "final", "String", "sPrefix", ",", "@", "Nullable", "final", "String", "sSuffix", ",", "@", "Nullable", "final", "String", "sBothPrefix", ",", "@", "Nullable...
Create the JS function to print the sum in the footer @param sPrefix The prefix to be prepended. May be <code>null</code> or empty. @param sSuffix The string suffix to be appended. May be <code>null</code> or empty. @param sBothPrefix The prefix to be printed if page total and overall total are displayed. May be <code>null</code>. @param sBothSep The separator to be printed if page total and overall total are displayed. May be <code>null</code>. @param sBothSuffix The suffix to be printed if page total and overall total are displayed. May be <code>null</code>. @return Never <code>null</code>.
[ "Create", "the", "JS", "function", "to", "print", "the", "sum", "in", "the", "footer" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/DataTablesHelper.java#L96-L131
train
phax/ph-oton
ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/DataTablesHelper.java
DataTablesHelper.createClearFilterCode
@Nonnull public static JSInvocation createClearFilterCode (@Nonnull final IJSExpression aDTSelect) { return aDTSelect.invoke ("DataTable") .invoke ("search") .arg ("") .invoke ("columns") .invoke ("search") .arg ("") .invoke ("draw"); }
java
@Nonnull public static JSInvocation createClearFilterCode (@Nonnull final IJSExpression aDTSelect) { return aDTSelect.invoke ("DataTable") .invoke ("search") .arg ("") .invoke ("columns") .invoke ("search") .arg ("") .invoke ("draw"); }
[ "@", "Nonnull", "public", "static", "JSInvocation", "createClearFilterCode", "(", "@", "Nonnull", "final", "IJSExpression", "aDTSelect", ")", "{", "return", "aDTSelect", ".", "invoke", "(", "\"DataTable\"", ")", ".", "invoke", "(", "\"search\"", ")", ".", "arg",...
Remove all filters and redraw the data table @param aDTSelect JS expression that selects 1-n datatables @return The invocation to clear the filter. Never <code>null</code>.
[ "Remove", "all", "filters", "and", "redraw", "the", "data", "table" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/DataTablesHelper.java#L204-L214
train
phax/ph-oton
ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/form/DefaultBootstrapFormGroupRenderer.java
DefaultBootstrapFormGroupRenderer.createSingleErrorNode
@Nullable @OverrideOnDemand protected IHCElement <?> createSingleErrorNode (@Nonnull final IError aError, @Nonnull final Locale aContentLocale) { return BootstrapFormHelper.createDefaultErrorNode (aError, aContentLocale); }
java
@Nullable @OverrideOnDemand protected IHCElement <?> createSingleErrorNode (@Nonnull final IError aError, @Nonnull final Locale aContentLocale) { return BootstrapFormHelper.createDefaultErrorNode (aError, aContentLocale); }
[ "@", "Nullable", "@", "OverrideOnDemand", "protected", "IHCElement", "<", "?", ">", "createSingleErrorNode", "(", "@", "Nonnull", "final", "IError", "aError", ",", "@", "Nonnull", "final", "Locale", "aContentLocale", ")", "{", "return", "BootstrapFormHelper", ".",...
Create the node for a single error. @param aError The provided error. Never <code>null</code>. @param aContentLocale Locale to be used to show error text. @return May be <code>null</code>.
[ "Create", "the", "node", "for", "a", "single", "error", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-bootstrap4/src/main/java/com/helger/photon/bootstrap4/form/DefaultBootstrapFormGroupRenderer.java#L141-L146
train
phax/ph-oton
ph-oton-api/src/main/java/com/helger/photon/api/InvokableAPIDescriptor.java
InvokableAPIDescriptor.canExecute
public boolean canExecute (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final MutableInt aStatusCode) { if (aRequestScope == null) return false; // Note: HTTP method was already checked in APIDescriptorList // Check required headers for (final String sRequiredHeader : m_aDescriptor.requiredHeaders ()) if (aRequestScope.headers ().getFirstHeaderValue (sRequiredHeader) == null) { LOGGER.warn ("Request '" + m_sPath + "' is missing required HTTP header '" + sRequiredHeader + "'"); return false; } // Check required parameters for (final String sRequiredParam : m_aDescriptor.requiredParams ()) if (!aRequestScope.params ().containsKey (sRequiredParam)) { LOGGER.warn ("Request '" + m_sPath + "' is missing required HTTP parameter '" + sRequiredParam + "'"); return false; } // Check explicit filter if (m_aDescriptor.hasExecutionFilter ()) if (!m_aDescriptor.getExecutionFilter ().canExecute (aRequestScope)) { LOGGER.warn ("Request '" + m_sPath + "' cannot be executed because of ExecutionFilter"); return false; } if (m_aDescriptor.allowedMimeTypes ().isNotEmpty ()) { final String sContentType = aRequestScope.getContentType (); // Parse to extract any parameters etc. final MimeType aMT = MimeTypeParser.safeParseMimeType (sContentType); // If parsing fails, use the provided String final String sMimeTypeToCheck = aMT == null ? sContentType : aMT.getAsStringWithoutParameters (); if (!m_aDescriptor.allowedMimeTypes ().contains (sMimeTypeToCheck) && !m_aDescriptor.allowedMimeTypes ().contains (sMimeTypeToCheck.toLowerCase (CGlobal.DEFAULT_LOCALE))) { LOGGER.warn ("Request '" + m_sPath + "' contains the Content-Type '" + sContentType + "' which is not in the allowed list of " + m_aDescriptor.allowedMimeTypes ()); // Special error code HTTP 415 aStatusCode.set (HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE); return false; } } return true; }
java
public boolean canExecute (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final MutableInt aStatusCode) { if (aRequestScope == null) return false; // Note: HTTP method was already checked in APIDescriptorList // Check required headers for (final String sRequiredHeader : m_aDescriptor.requiredHeaders ()) if (aRequestScope.headers ().getFirstHeaderValue (sRequiredHeader) == null) { LOGGER.warn ("Request '" + m_sPath + "' is missing required HTTP header '" + sRequiredHeader + "'"); return false; } // Check required parameters for (final String sRequiredParam : m_aDescriptor.requiredParams ()) if (!aRequestScope.params ().containsKey (sRequiredParam)) { LOGGER.warn ("Request '" + m_sPath + "' is missing required HTTP parameter '" + sRequiredParam + "'"); return false; } // Check explicit filter if (m_aDescriptor.hasExecutionFilter ()) if (!m_aDescriptor.getExecutionFilter ().canExecute (aRequestScope)) { LOGGER.warn ("Request '" + m_sPath + "' cannot be executed because of ExecutionFilter"); return false; } if (m_aDescriptor.allowedMimeTypes ().isNotEmpty ()) { final String sContentType = aRequestScope.getContentType (); // Parse to extract any parameters etc. final MimeType aMT = MimeTypeParser.safeParseMimeType (sContentType); // If parsing fails, use the provided String final String sMimeTypeToCheck = aMT == null ? sContentType : aMT.getAsStringWithoutParameters (); if (!m_aDescriptor.allowedMimeTypes ().contains (sMimeTypeToCheck) && !m_aDescriptor.allowedMimeTypes ().contains (sMimeTypeToCheck.toLowerCase (CGlobal.DEFAULT_LOCALE))) { LOGGER.warn ("Request '" + m_sPath + "' contains the Content-Type '" + sContentType + "' which is not in the allowed list of " + m_aDescriptor.allowedMimeTypes ()); // Special error code HTTP 415 aStatusCode.set (HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE); return false; } } return true; }
[ "public", "boolean", "canExecute", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ",", "@", "Nonnull", "final", "MutableInt", "aStatusCode", ")", "{", "if", "(", "aRequestScope", "==", "null", ")", "return", "false", ";", "// Not...
Check if all pre-requisites are handled correctly. This checks if all required headers and params are present. @param aRequestScope The request scope to validate. @param aStatusCode The mutable int to hold the status code to be returned in case of error. Default is HTTP 400, bad request. @return <code>true</code> if all prerequisites are fulfilled.
[ "Check", "if", "all", "pre", "-", "requisites", "are", "handled", "correctly", ".", "This", "checks", "if", "all", "required", "headers", "and", "params", "are", "present", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-api/src/main/java/com/helger/photon/api/InvokableAPIDescriptor.java#L120-L176
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonHTMLHelper.java
PhotonHTMLHelper.getMimeType
@Nonnull public static IMimeType getMimeType (@Nullable final IRequestWebScopeWithoutResponse aRequestScope) { // Add the charset to the MIME type return new MimeType (CMimeType.TEXT_HTML).addParameter (CMimeType.PARAMETER_NAME_CHARSET, HCSettings.getHTMLCharset ().name ()); }
java
@Nonnull public static IMimeType getMimeType (@Nullable final IRequestWebScopeWithoutResponse aRequestScope) { // Add the charset to the MIME type return new MimeType (CMimeType.TEXT_HTML).addParameter (CMimeType.PARAMETER_NAME_CHARSET, HCSettings.getHTMLCharset ().name ()); }
[ "@", "Nonnull", "public", "static", "IMimeType", "getMimeType", "(", "@", "Nullable", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ")", "{", "// Add the charset to the MIME type", "return", "new", "MimeType", "(", "CMimeType", ".", "TEXT_HTML", ")", ".",...
Get the HTML MIME type to use @param aRequestScope The request scope. May be <code>null</code>- @return Never <code>null</code>.
[ "Get", "the", "HTML", "MIME", "type", "to", "use" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonHTMLHelper.java#L72-L78
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonHTMLHelper.java
PhotonHTMLHelper.mergeExternalCSSAndJSNodes
public static void mergeExternalCSSAndJSNodes (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final HCHead aHead, final boolean bMergeCSS, final boolean bMergeJS, @Nonnull final IWebSiteResourceBundleProvider aWSRBMgr) { if (!bMergeCSS && !bMergeJS) { // Nothing to do return; } final boolean bRegular = HCSettings.isUseRegularResources (); if (bMergeCSS) { // Extract all CSS nodes for merging final ICommonsList <IHCNode> aCSSNodes = new CommonsArrayList <> (); aHead.getAllAndRemoveAllCSSNodes (aCSSNodes); final ICommonsList <WebSiteResourceWithCondition> aCSSs = new CommonsArrayList <> (); for (final IHCNode aNode : aCSSNodes) { boolean bStartMerge = true; if (HCCSSNodeDetector.isDirectCSSFileNode (aNode)) { final ICSSPathProvider aPathProvider = ((HCLink) aNode).getPathProvider (); if (aPathProvider != null) { aCSSs.add (WebSiteResourceWithCondition.createForCSS (aPathProvider, bRegular)); bStartMerge = false; } } if (bStartMerge) { if (!aCSSs.isEmpty ()) { for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular)) aHead.addCSS (aBundle.createNode (aRequestScope)); aCSSs.clear (); } // Add the current (non-mergable) node again to head after merging aHead.addCSS (aNode); } } // Add the remaining nodes (if any) if (!aCSSs.isEmpty ()) for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular)) aHead.addCSS (aBundle.createNode (aRequestScope)); } if (bMergeJS) { // Extract all JS nodes for merging final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> (); aHead.getAllAndRemoveAllJSNodes (aJSNodes); final ICommonsList <WebSiteResourceWithCondition> aJSs = new CommonsArrayList <> (); for (final IHCNode aNode : aJSNodes) { boolean bStartMerge = true; if (HCJSNodeDetector.isDirectJSFileNode (aNode)) { final IJSPathProvider aPathProvider = ((HCScriptFile) aNode).getPathProvider (); if (aPathProvider != null) { aJSs.add (WebSiteResourceWithCondition.createForJS (aPathProvider, bRegular)); bStartMerge = false; } } if (bStartMerge) { if (!aJSs.isEmpty ()) { for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular)) aHead.addJS (aBundle.createNode (aRequestScope)); aJSs.clear (); } // Add the current (non-mergable) node again to head after merging aHead.addJS (aNode); } } // Add the remaining nodes (if any) if (!aJSs.isEmpty ()) for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular)) aHead.addJS (aBundle.createNode (aRequestScope)); } }
java
public static void mergeExternalCSSAndJSNodes (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final HCHead aHead, final boolean bMergeCSS, final boolean bMergeJS, @Nonnull final IWebSiteResourceBundleProvider aWSRBMgr) { if (!bMergeCSS && !bMergeJS) { // Nothing to do return; } final boolean bRegular = HCSettings.isUseRegularResources (); if (bMergeCSS) { // Extract all CSS nodes for merging final ICommonsList <IHCNode> aCSSNodes = new CommonsArrayList <> (); aHead.getAllAndRemoveAllCSSNodes (aCSSNodes); final ICommonsList <WebSiteResourceWithCondition> aCSSs = new CommonsArrayList <> (); for (final IHCNode aNode : aCSSNodes) { boolean bStartMerge = true; if (HCCSSNodeDetector.isDirectCSSFileNode (aNode)) { final ICSSPathProvider aPathProvider = ((HCLink) aNode).getPathProvider (); if (aPathProvider != null) { aCSSs.add (WebSiteResourceWithCondition.createForCSS (aPathProvider, bRegular)); bStartMerge = false; } } if (bStartMerge) { if (!aCSSs.isEmpty ()) { for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular)) aHead.addCSS (aBundle.createNode (aRequestScope)); aCSSs.clear (); } // Add the current (non-mergable) node again to head after merging aHead.addCSS (aNode); } } // Add the remaining nodes (if any) if (!aCSSs.isEmpty ()) for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aCSSs, bRegular)) aHead.addCSS (aBundle.createNode (aRequestScope)); } if (bMergeJS) { // Extract all JS nodes for merging final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> (); aHead.getAllAndRemoveAllJSNodes (aJSNodes); final ICommonsList <WebSiteResourceWithCondition> aJSs = new CommonsArrayList <> (); for (final IHCNode aNode : aJSNodes) { boolean bStartMerge = true; if (HCJSNodeDetector.isDirectJSFileNode (aNode)) { final IJSPathProvider aPathProvider = ((HCScriptFile) aNode).getPathProvider (); if (aPathProvider != null) { aJSs.add (WebSiteResourceWithCondition.createForJS (aPathProvider, bRegular)); bStartMerge = false; } } if (bStartMerge) { if (!aJSs.isEmpty ()) { for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular)) aHead.addJS (aBundle.createNode (aRequestScope)); aJSs.clear (); } // Add the current (non-mergable) node again to head after merging aHead.addJS (aNode); } } // Add the remaining nodes (if any) if (!aJSs.isEmpty ()) for (final WebSiteResourceBundleSerialized aBundle : aWSRBMgr.getResourceBundles (aJSs, bRegular)) aHead.addJS (aBundle.createNode (aRequestScope)); } }
[ "public", "static", "void", "mergeExternalCSSAndJSNodes", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ",", "@", "Nonnull", "final", "HCHead", "aHead", ",", "final", "boolean", "bMergeCSS", ",", "final", "boolean", "bMergeJS", ",",...
Merge external CSS and JS contents to a single resource for improved browser performance. All source nodes are taken from the head and all target nodes are written to the head. @param aRequestScope Current request scope. Never <code>null</code>. @param aHead The HTML head object. Never <code>null</code>. @param bMergeCSS <code>true</code> to aggregate CSS entries. @param bMergeJS <code>true</code> to aggregate JS entries. @param aWSRBMgr The resource bundle provider. May not be <code>null</code>.
[ "Merge", "external", "CSS", "and", "JS", "contents", "to", "a", "single", "resource", "for", "improved", "browser", "performance", ".", "All", "source", "nodes", "are", "taken", "from", "the", "head", "and", "all", "target", "nodes", "are", "written", "to", ...
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonHTMLHelper.java#L157-L250
train
phax/ph-oton
ph-oton-security/src/main/java/com/helger/photon/security/token/user/UserTokenManager.java
UserTokenManager.isAccessTokenUsed
public boolean isAccessTokenUsed (@Nullable final String sTokenString) { if (StringHelper.hasNoText (sTokenString)) return false; return containsAny (x -> x.findFirstAccessToken (y -> y.getTokenString ().equals (sTokenString)) != null); }
java
public boolean isAccessTokenUsed (@Nullable final String sTokenString) { if (StringHelper.hasNoText (sTokenString)) return false; return containsAny (x -> x.findFirstAccessToken (y -> y.getTokenString ().equals (sTokenString)) != null); }
[ "public", "boolean", "isAccessTokenUsed", "(", "@", "Nullable", "final", "String", "sTokenString", ")", "{", "if", "(", "StringHelper", ".", "hasNoText", "(", "sTokenString", ")", ")", "return", "false", ";", "return", "containsAny", "(", "x", "->", "x", "."...
Check if the passed token string was already used in this application. This method considers all access token - revoked, expired or active. @param sTokenString The token string to check. May be <code>null</code>. @return <code>true</code> if the token string is already used.
[ "Check", "if", "the", "passed", "token", "string", "was", "already", "used", "in", "this", "application", ".", "This", "method", "considers", "all", "access", "token", "-", "revoked", "expired", "or", "active", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/token/user/UserTokenManager.java#L267-L273
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java
SurefireMojoInterceptor.execute
public static void execute(Object mojo) throws Exception { // Note that the object can be an instance of // AbstractSurefireMojo. if (!(isSurefirePlugin(mojo) || isFailsafePlugin(mojo))) { return; } // Check if the same object is already invoked. This may // happen (in the future) if execute method is in both // AbstractSurefire and SurefirePlugin classes. if (isAlreadyInvoked(mojo)) { return; } // Check if surefire version is supported. checkSurefireVersion(mojo); // Check surefire configuration. checkSurefireConfiguration(mojo); try { // Update argLine. updateArgLine(mojo); // Update excludes. updateExcludes(mojo); // Update parallel. updateParallel(mojo); } catch (Exception ex) { // This exception should not happen in theory. throwMojoExecutionException(mojo, "Unsupported surefire version", ex); } }
java
public static void execute(Object mojo) throws Exception { // Note that the object can be an instance of // AbstractSurefireMojo. if (!(isSurefirePlugin(mojo) || isFailsafePlugin(mojo))) { return; } // Check if the same object is already invoked. This may // happen (in the future) if execute method is in both // AbstractSurefire and SurefirePlugin classes. if (isAlreadyInvoked(mojo)) { return; } // Check if surefire version is supported. checkSurefireVersion(mojo); // Check surefire configuration. checkSurefireConfiguration(mojo); try { // Update argLine. updateArgLine(mojo); // Update excludes. updateExcludes(mojo); // Update parallel. updateParallel(mojo); } catch (Exception ex) { // This exception should not happen in theory. throwMojoExecutionException(mojo, "Unsupported surefire version", ex); } }
[ "public", "static", "void", "execute", "(", "Object", "mojo", ")", "throws", "Exception", "{", "// Note that the object can be an instance of", "// AbstractSurefireMojo.", "if", "(", "!", "(", "isSurefirePlugin", "(", "mojo", ")", "||", "isFailsafePlugin", "(", "mojo"...
This method is invoked before SurefirePlugin execute method. @param mojo Surefire plugin. @throws Exception Always MojoExecutionException.
[ "This", "method", "is", "invoked", "before", "SurefirePlugin", "execute", "method", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java#L55-L84
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java
SurefireMojoInterceptor.checkSurefireVersion
private static void checkSurefireVersion(Object mojo) throws Exception { try { // Check version specific methods/fields. // mojo.getClass().getMethod(GET_RUN_ORDER); getField(SKIP_TESTS_FIELD, mojo); getField(FORK_MODE_FIELD, mojo); // We will always require the following. getField(ARGLINE_FIELD, mojo); getField(EXCLUDES_FIELD, mojo); } catch (NoSuchMethodException ex) { throwMojoExecutionException(mojo, "Unsupported surefire version. An alternative is to use select/restore goals.", ex); } }
java
private static void checkSurefireVersion(Object mojo) throws Exception { try { // Check version specific methods/fields. // mojo.getClass().getMethod(GET_RUN_ORDER); getField(SKIP_TESTS_FIELD, mojo); getField(FORK_MODE_FIELD, mojo); // We will always require the following. getField(ARGLINE_FIELD, mojo); getField(EXCLUDES_FIELD, mojo); } catch (NoSuchMethodException ex) { throwMojoExecutionException(mojo, "Unsupported surefire version. An alternative is to use select/restore goals.", ex); } }
[ "private", "static", "void", "checkSurefireVersion", "(", "Object", "mojo", ")", "throws", "Exception", "{", "try", "{", "// Check version specific methods/fields.", "// mojo.getClass().getMethod(GET_RUN_ORDER);", "getField", "(", "SKIP_TESTS_FIELD", ",", "mojo", ")", ";", ...
Checks that Surefire has all the metohds that are needed, i.e., check Surefire version. Currently we support 2.7 and newer. @param mojo Surefire plugin @throws Exception MojoExecutionException if Surefire version is not supported
[ "Checks", "that", "Surefire", "has", "all", "the", "metohds", "that", "are", "needed", "i", ".", "e", ".", "check", "Surefire", "version", ".", "Currently", "we", "support", "2", ".", "7", "and", "newer", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java#L112-L125
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java
SurefireMojoInterceptor.checkSurefireConfiguration
private static void checkSurefireConfiguration(Object mojo) throws Exception { String forkCount = null; try { forkCount = invokeAndGetString(GET_FORK_COUNT, mojo); } catch (NoSuchMethodException ex) { // Nothing: earlier versions (before 2.14) of surefire did // not have forkCount. } String forkMode = null; try { forkMode = getStringField(FORK_MODE_FIELD, mojo); } catch (NoSuchMethodException ex) { // Nothing: earlier versions (before 2.1) of surefire did // not have forkMode. } if ((forkCount != null && forkCount.equals("0")) || (forkMode != null && (forkMode.equals("never") || forkMode.equals("none")))) { throwMojoExecutionException(mojo, "Fork has to be enabled when running tests with Ekstazi; check forkMode and forkCount parameters.", null); } }
java
private static void checkSurefireConfiguration(Object mojo) throws Exception { String forkCount = null; try { forkCount = invokeAndGetString(GET_FORK_COUNT, mojo); } catch (NoSuchMethodException ex) { // Nothing: earlier versions (before 2.14) of surefire did // not have forkCount. } String forkMode = null; try { forkMode = getStringField(FORK_MODE_FIELD, mojo); } catch (NoSuchMethodException ex) { // Nothing: earlier versions (before 2.1) of surefire did // not have forkMode. } if ((forkCount != null && forkCount.equals("0")) || (forkMode != null && (forkMode.equals("never") || forkMode.equals("none")))) { throwMojoExecutionException(mojo, "Fork has to be enabled when running tests with Ekstazi; check forkMode and forkCount parameters.", null); } }
[ "private", "static", "void", "checkSurefireConfiguration", "(", "Object", "mojo", ")", "throws", "Exception", "{", "String", "forkCount", "=", "null", ";", "try", "{", "forkCount", "=", "invokeAndGetString", "(", "GET_FORK_COUNT", ",", "mojo", ")", ";", "}", "...
Checks that surefire configuration allows integration with Ekstazi. At the moment, we check that forking is enabled.
[ "Checks", "that", "surefire", "configuration", "allows", "integration", "with", "Ekstazi", ".", "At", "the", "moment", "we", "check", "that", "forking", "is", "enabled", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java#L131-L152
train