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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ribot/easy-adapter | demo/src/main/java/uk/co/ribot/easyadapterdemo/PersonViewHolder.java | PersonViewHolder.onSetListeners | @Override
public void onSetListeners() {
imageViewPerson.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PersonHolderListener listener = getListener(PersonHolderListener.class);
if (listener != null) {
... | java | @Override
public void onSetListeners() {
imageViewPerson.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PersonHolderListener listener = getListener(PersonHolderListener.class);
if (listener != null) {
... | [
"@",
"Override",
"public",
"void",
"onSetListeners",
"(",
")",
"{",
"imageViewPerson",
".",
"setOnClickListener",
"(",
"new",
"View",
".",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"View",
"v",
")",
"{",
"PersonHold... | Optionally override onSetListeners to add listeners to the views. | [
"Optionally",
"override",
"onSetListeners",
"to",
"add",
"listeners",
"to",
"the",
"views",
"."
] | 8cf85023a79c781aa2013e9dc39fd66734fb2019 | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/demo/src/main/java/uk/co/ribot/easyadapterdemo/PersonViewHolder.java#L60-L71 | train |
ribot/easy-adapter | demo/src/main/java/uk/co/ribot/easyadapterdemo/DataProvider.java | DataProvider.getMockPeopleSet1 | public static List<Person> getMockPeopleSet1() {
List<Person> listPeople = new ArrayList<Person>();
listPeople.add(new Person("Henry Blair", "07123456789", R.drawable.male1));
listPeople.add(new Person("Jenny Curtis", "07123456789", R.drawable.female1));
listPeople.add(new Person("Vincen... | java | public static List<Person> getMockPeopleSet1() {
List<Person> listPeople = new ArrayList<Person>();
listPeople.add(new Person("Henry Blair", "07123456789", R.drawable.male1));
listPeople.add(new Person("Jenny Curtis", "07123456789", R.drawable.female1));
listPeople.add(new Person("Vincen... | [
"public",
"static",
"List",
"<",
"Person",
">",
"getMockPeopleSet1",
"(",
")",
"{",
"List",
"<",
"Person",
">",
"listPeople",
"=",
"new",
"ArrayList",
"<",
"Person",
">",
"(",
")",
";",
"listPeople",
".",
"add",
"(",
"new",
"Person",
"(",
"\"Henry Blair\... | Returns a mock List of Person objects | [
"Returns",
"a",
"mock",
"List",
"of",
"Person",
"objects"
] | 8cf85023a79c781aa2013e9dc39fd66734fb2019 | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/demo/src/main/java/uk/co/ribot/easyadapterdemo/DataProvider.java#L24-L41 | train |
ribot/easy-adapter | library/src/main/java/uk/co/ribot/easyadapter/EasyAdapterUtil.java | EasyAdapterUtil.createViewHolder | public static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) {
try {
Constructor<? extends ItemViewHolder> constructor = itemViewHolderClass.getConstructor(View.class);
return constructor.newInstance(view);
} catch (IllegalAccessEx... | java | public static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) {
try {
Constructor<? extends ItemViewHolder> constructor = itemViewHolderClass.getConstructor(View.class);
return constructor.newInstance(view);
} catch (IllegalAccessEx... | [
"public",
"static",
"ItemViewHolder",
"createViewHolder",
"(",
"View",
"view",
",",
"Class",
"<",
"?",
"extends",
"ItemViewHolder",
">",
"itemViewHolderClass",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
"extends",
"ItemViewHolder",
">",
"constructor",
"=",
"... | Create a new ItemViewHolder using Java reflection | [
"Create",
"a",
"new",
"ItemViewHolder",
"using",
"Java",
"reflection"
] | 8cf85023a79c781aa2013e9dc39fd66734fb2019 | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/library/src/main/java/uk/co/ribot/easyadapter/EasyAdapterUtil.java#L13-L27 | train |
ribot/easy-adapter | library/src/main/java/uk/co/ribot/easyadapter/EasyAdapterUtil.java | EasyAdapterUtil.parseItemLayoutId | public static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass) {
Integer itemLayoutId = ClassAnnotationParser.getLayoutId(itemViewHolderClass);
if (itemLayoutId == null) {
throw new LayoutIdMissingException();
}
return itemLayoutId;
} | java | public static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass) {
Integer itemLayoutId = ClassAnnotationParser.getLayoutId(itemViewHolderClass);
if (itemLayoutId == null) {
throw new LayoutIdMissingException();
}
return itemLayoutId;
} | [
"public",
"static",
"Integer",
"parseItemLayoutId",
"(",
"Class",
"<",
"?",
"extends",
"ItemViewHolder",
">",
"itemViewHolderClass",
")",
"{",
"Integer",
"itemLayoutId",
"=",
"ClassAnnotationParser",
".",
"getLayoutId",
"(",
"itemViewHolderClass",
")",
";",
"if",
"(... | Parses the layout ID annotation form the itemViewHolderClass | [
"Parses",
"the",
"layout",
"ID",
"annotation",
"form",
"the",
"itemViewHolderClass"
] | 8cf85023a79c781aa2013e9dc39fd66734fb2019 | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/library/src/main/java/uk/co/ribot/easyadapter/EasyAdapterUtil.java#L30-L36 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.getSingletonScopeKey | @Nonnull
public static final String getSingletonScopeKey (@Nonnull final Class <? extends AbstractSingleton> aClass)
{
ValueEnforcer.notNull (aClass, "Class");
// Preallocate some bytes
return new StringBuilder (DEFAULT_KEY_LENGTH).append ("singleton.").append (aClass.getName ()).toString ();
} | java | @Nonnull
public static final String getSingletonScopeKey (@Nonnull final Class <? extends AbstractSingleton> aClass)
{
ValueEnforcer.notNull (aClass, "Class");
// Preallocate some bytes
return new StringBuilder (DEFAULT_KEY_LENGTH).append ("singleton.").append (aClass.getName ()).toString ();
} | [
"@",
"Nonnull",
"public",
"static",
"final",
"String",
"getSingletonScopeKey",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
"extends",
"AbstractSingleton",
">",
"aClass",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aClass",
",",
"\"Class\"",
")",
";",... | Create the key which is used to reference the object within the scope.
@param aClass
The class for which the key is to be created. May not be
<code>null</code>.
@return The non-<code>null</code> key. | [
"Create",
"the",
"key",
"which",
"is",
"used",
"to",
"reference",
"the",
"object",
"within",
"the",
"scope",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L387-L394 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.isSingletonInstantiated | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass)
{
return getSingletonIfInstantiated (aScope, aClass) != null;
} | java | public static final boolean isSingletonInstantiated (@Nullable final IScope aScope,
@Nonnull final Class <? extends AbstractSingleton> aClass)
{
return getSingletonIfInstantiated (aScope, aClass) != null;
} | [
"public",
"static",
"final",
"boolean",
"isSingletonInstantiated",
"(",
"@",
"Nullable",
"final",
"IScope",
"aScope",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
"extends",
"AbstractSingleton",
">",
"aClass",
")",
"{",
"return",
"getSingletonIfInstantiated",
... | Check if a singleton is already instantiated inside a scope
@param aScope
The scope to check. May be <code>null</code> to avoid constructing a
scope.
@param aClass
The class to be checked. May not be <code>null</code>.
@return <code>true</code> if the singleton for the specified class is
already instantiated, <code>fa... | [
"Check",
"if",
"a",
"singleton",
"is",
"already",
"instantiated",
"inside",
"a",
"scope"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L447-L451 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.getSingleton | @Nonnull
public static final <T extends AbstractSingleton> T getSingleton (@Nonnull final IScope aScope,
@Nonnull final Class <T> aClass)
{
ValueEnforcer.notNull (aScope, "aScope");
ValueEnforcer.notNull (aClass, "Class");
final String... | java | @Nonnull
public static final <T extends AbstractSingleton> T getSingleton (@Nonnull final IScope aScope,
@Nonnull final Class <T> aClass)
{
ValueEnforcer.notNull (aScope, "aScope");
ValueEnforcer.notNull (aClass, "Class");
final String... | [
"@",
"Nonnull",
"public",
"static",
"final",
"<",
"T",
"extends",
"AbstractSingleton",
">",
"T",
"getSingleton",
"(",
"@",
"Nonnull",
"final",
"IScope",
"aScope",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aClass",
")",
"{",
"ValueEnforcer",
".... | Get the singleton object in the passed scope, using the passed class. If
the singleton is not yet instantiated, a new instance is created.
@param <T>
The singleton type
@param aScope
The scope to be used. May not be <code>null</code>.
@param aClass
The class to be used. May not be <code>null</code>. The class must
be ... | [
"Get",
"the",
"singleton",
"object",
"in",
"the",
"passed",
"scope",
"using",
"the",
"passed",
"class",
".",
"If",
"the",
"singleton",
"is",
"not",
"yet",
"instantiated",
"a",
"new",
"instance",
"is",
"created",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L532-L611 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java | AbstractSingleton.getAllSingletons | @Nonnull
@ReturnsMutableCopy
public static final <T extends AbstractSingleton> ICommonsList <T> getAllSingletons (@Nullable final IScope aScope,
@Nonnull final Class <T> aDesiredClass)
{
ValueEnforcer.notNull (aDesiredClass... | java | @Nonnull
@ReturnsMutableCopy
public static final <T extends AbstractSingleton> ICommonsList <T> getAllSingletons (@Nullable final IScope aScope,
@Nonnull final Class <T> aDesiredClass)
{
ValueEnforcer.notNull (aDesiredClass... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"final",
"<",
"T",
"extends",
"AbstractSingleton",
">",
"ICommonsList",
"<",
"T",
">",
"getAllSingletons",
"(",
"@",
"Nullable",
"final",
"IScope",
"aScope",
",",
"@",
"Nonnull",
"final",
"Class",
... | Get all singleton objects registered in the respective sub-class of this
class.
@param <T>
The singleton type to be retrieved
@param aScope
The scope to use. May be <code>null</code> to avoid creating a new
scope.
@param aDesiredClass
The desired sub-class of this class. May not be <code>null</code>.
@return A non-<co... | [
"Get",
"all",
"singleton",
"objects",
"registered",
"in",
"the",
"respective",
"sub",
"-",
"class",
"of",
"this",
"class",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractSingleton.java#L627-L640 | train |
phax/ph-commons | ph-tree/src/main/java/com/helger/tree/BasicTreeItem.java | BasicTreeItem.createChildItem | @Nonnull
public final ITEMTYPE createChildItem (@Nullable final DATATYPE aData)
{
// create new item
final ITEMTYPE aItem = m_aFactory.create (thisAsT ());
if (aItem == null)
throw new IllegalStateException ("null item created!");
aItem.setData (aData);
internalAddChild (aItem);
return... | java | @Nonnull
public final ITEMTYPE createChildItem (@Nullable final DATATYPE aData)
{
// create new item
final ITEMTYPE aItem = m_aFactory.create (thisAsT ());
if (aItem == null)
throw new IllegalStateException ("null item created!");
aItem.setData (aData);
internalAddChild (aItem);
return... | [
"@",
"Nonnull",
"public",
"final",
"ITEMTYPE",
"createChildItem",
"(",
"@",
"Nullable",
"final",
"DATATYPE",
"aData",
")",
"{",
"// create new item",
"final",
"ITEMTYPE",
"aItem",
"=",
"m_aFactory",
".",
"create",
"(",
"thisAsT",
"(",
")",
")",
";",
"if",
"(... | Add a child item to this item.
@param aData
the data associated with this item
@return the created TreeItem object or <code>null</code> if the ID is
already in use and bAllowOverwrite is false | [
"Add",
"a",
"child",
"item",
"to",
"this",
"item",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-tree/src/main/java/com/helger/tree/BasicTreeItem.java#L172-L182 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java | IteratorHelper.getCombinedIterator | @Nonnull
public static <ELEMENTTYPE> Iterator <ELEMENTTYPE> getCombinedIterator (@Nullable final Iterator <? extends ELEMENTTYPE> aIter1,
@Nullable final Iterator <? extends ELEMENTTYPE> aIter2)
{
return new CombinedIterator <> (aIter1, a... | java | @Nonnull
public static <ELEMENTTYPE> Iterator <ELEMENTTYPE> getCombinedIterator (@Nullable final Iterator <? extends ELEMENTTYPE> aIter1,
@Nullable final Iterator <? extends ELEMENTTYPE> aIter2)
{
return new CombinedIterator <> (aIter1, a... | [
"@",
"Nonnull",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"Iterator",
"<",
"ELEMENTTYPE",
">",
"getCombinedIterator",
"(",
"@",
"Nullable",
"final",
"Iterator",
"<",
"?",
"extends",
"ELEMENTTYPE",
">",
"aIter1",
",",
"@",
"Nullable",
"final",
"Iterator",
"<... | Get a merged iterator of both iterators. The first iterator is iterated
first, the second one afterwards.
@param <ELEMENTTYPE>
The type of elements to be enumerated.
@param aIter1
First iterator. May be <code>null</code>.
@param aIter2
Second iterator. May be <code>null</code>.
@return The merged iterator. Never <code... | [
"Get",
"a",
"merged",
"iterator",
"of",
"both",
"iterators",
".",
"The",
"first",
"iterator",
"is",
"iterated",
"first",
"the",
"second",
"one",
"afterwards",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java#L185-L190 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java | IteratorHelper.getEnumeration | @Nonnull
public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final Iterator <ELEMENTTYPE> aIter)
{
if (aIter == null)
return new EmptyEnumeration <> ();
return new EnumerationFromIterator <> (aIter);
} | java | @Nonnull
public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final Iterator <ELEMENTTYPE> aIter)
{
if (aIter == null)
return new EmptyEnumeration <> ();
return new EnumerationFromIterator <> (aIter);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"Enumeration",
"<",
"ELEMENTTYPE",
">",
"getEnumeration",
"(",
"@",
"Nullable",
"final",
"Iterator",
"<",
"ELEMENTTYPE",
">",
"aIter",
")",
"{",
"if",
"(",
"aIter",
"==",
"null",
")",
"return",
"... | Get an Enumeration object based on an Iterator object.
@param <ELEMENTTYPE>
the type of the elements in the container
@param aIter
iterator object to use
@return an Enumeration object | [
"Get",
"an",
"Enumeration",
"object",
"based",
"on",
"an",
"Iterator",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java#L232-L238 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java | IteratorHelper.getEnumeration | @Nonnull
public static <KEYTYPE, VALUETYPE> Enumeration <Map.Entry <KEYTYPE, VALUETYPE>> getEnumeration (@Nullable final Map <KEYTYPE, VALUETYPE> aMap)
{
if (aMap == null)
return new EmptyEnumeration <> ();
return getEnumeration (aMap.entrySet ());
} | java | @Nonnull
public static <KEYTYPE, VALUETYPE> Enumeration <Map.Entry <KEYTYPE, VALUETYPE>> getEnumeration (@Nullable final Map <KEYTYPE, VALUETYPE> aMap)
{
if (aMap == null)
return new EmptyEnumeration <> ();
return getEnumeration (aMap.entrySet ());
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
"Enumeration",
"<",
"Map",
".",
"Entry",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
">",
"getEnumeration",
"(",
"@",
"Nullable",
"final",
"Map",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
... | Get an Enumeration object based on a Map object.
@param <KEYTYPE>
map key type
@param <VALUETYPE>
map value type
@param aMap
map object to use
@return an Enumeration object | [
"Get",
"an",
"Enumeration",
"object",
"based",
"on",
"a",
"Map",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/IteratorHelper.java#L251-L257 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java | MapBasedXPathFunctionResolver.addAllFrom | @Nonnull
public EChange addAllFrom (@Nonnull final MapBasedXPathFunctionResolver aOther, final boolean bOverwrite)
{
ValueEnforcer.notNull (aOther, "Other");
EChange eChange = EChange.UNCHANGED;
for (final Map.Entry <XPathFunctionKey, XPathFunction> aEntry : aOther.m_aMap.entrySet ())
if (bOverwri... | java | @Nonnull
public EChange addAllFrom (@Nonnull final MapBasedXPathFunctionResolver aOther, final boolean bOverwrite)
{
ValueEnforcer.notNull (aOther, "Other");
EChange eChange = EChange.UNCHANGED;
for (final Map.Entry <XPathFunctionKey, XPathFunction> aEntry : aOther.m_aMap.entrySet ())
if (bOverwri... | [
"@",
"Nonnull",
"public",
"EChange",
"addAllFrom",
"(",
"@",
"Nonnull",
"final",
"MapBasedXPathFunctionResolver",
"aOther",
",",
"final",
"boolean",
"bOverwrite",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aOther",
",",
"\"Other\"",
")",
";",
"EChange",
"e... | Add all functions from the other function resolver into this resolver.
@param aOther
The function resolver to import the functions from. May not be
<code>null</code>.
@param bOverwrite
if <code>true</code> existing functions will be overwritten with the
new functions, otherwise the old functions are kept.
@return {@li... | [
"Add",
"all",
"functions",
"from",
"the",
"other",
"function",
"resolver",
"into",
"this",
"resolver",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java#L129-L141 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java | MapBasedXPathFunctionResolver.removeFunctionsWithName | @Nonnull
public EChange removeFunctionsWithName (@Nullable final QName aName)
{
EChange eChange = EChange.UNCHANGED;
if (aName != null)
{
// Make a copy of the key set to allow for inline modification
for (final XPathFunctionKey aKey : m_aMap.copyOfKeySet ())
if (aKey.getFunctionName... | java | @Nonnull
public EChange removeFunctionsWithName (@Nullable final QName aName)
{
EChange eChange = EChange.UNCHANGED;
if (aName != null)
{
// Make a copy of the key set to allow for inline modification
for (final XPathFunctionKey aKey : m_aMap.copyOfKeySet ())
if (aKey.getFunctionName... | [
"@",
"Nonnull",
"public",
"EChange",
"removeFunctionsWithName",
"(",
"@",
"Nullable",
"final",
"QName",
"aName",
")",
"{",
"EChange",
"eChange",
"=",
"EChange",
".",
"UNCHANGED",
";",
"if",
"(",
"aName",
"!=",
"null",
")",
"{",
"// Make a copy of the key set to ... | Remove all functions with the same name. This can be helpful when the same
function is registered for multiple parameters.
@param aName
The name to be removed. May be <code>null</code>.
@return {@link EChange#CHANGED} if at least one function was removed. | [
"Remove",
"all",
"functions",
"with",
"the",
"same",
"name",
".",
"This",
"can",
"be",
"helpful",
"when",
"the",
"same",
"function",
"is",
"registered",
"for",
"multiple",
"parameters",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java#L182-L194 | train |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.parseJson | @Nonnull
public static ESuccess parseJson (@Nonnull @WillClose final Reader aReader,
@Nonnull final IJsonParserHandler aParserHandler)
{
return parseJson (aReader, aParserHandler, (IJsonParserCustomizeCallback) null, (IJsonParseExceptionCallback) null);
} | java | @Nonnull
public static ESuccess parseJson (@Nonnull @WillClose final Reader aReader,
@Nonnull final IJsonParserHandler aParserHandler)
{
return parseJson (aReader, aParserHandler, (IJsonParserCustomizeCallback) null, (IJsonParseExceptionCallback) null);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"parseJson",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nonnull",
"final",
"IJsonParserHandler",
"aParserHandler",
")",
"{",
"return",
"parseJson",
"(",
"aReader",
",",
"aParser... | Simple JSON parse method taking only the most basic parameters.
@param aReader
The reader to read from. Should be buffered. May not be
<code>null</code>.
@param aParserHandler
The parser handler. May not be <code>null</code>.
@return {@link ESuccess} | [
"Simple",
"JSON",
"parse",
"method",
"taking",
"only",
"the",
"most",
"basic",
"parameters",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L114-L119 | train |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader._validateJson | @Nonnull
private static EValidity _validateJson (@Nonnull @WillClose final Reader aReader)
{
// Force silent parsing :)
final ESuccess eSuccess = parseJson (aReader,
new DoNothingJsonParserHandler (),
(IJsonParserCustomizeCall... | java | @Nonnull
private static EValidity _validateJson (@Nonnull @WillClose final Reader aReader)
{
// Force silent parsing :)
final ESuccess eSuccess = parseJson (aReader,
new DoNothingJsonParserHandler (),
(IJsonParserCustomizeCall... | [
"@",
"Nonnull",
"private",
"static",
"EValidity",
"_validateJson",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
")",
"{",
"// Force silent parsing :)",
"final",
"ESuccess",
"eSuccess",
"=",
"parseJson",
"(",
"aReader",
",",
"new",
"DoNothin... | Validate a JSON without building the tree in memory.
@param aReader
The reader to read from. Should be buffered. May not be
<code>null</code>.
@return {@link EValidity#VALID} if the JSON is valid,
{@link EValidity#INVALID} otherwise. | [
"Validate",
"a",
"JSON",
"without",
"building",
"the",
"tree",
"in",
"memory",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L178-L187 | train |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.readJson | @Nullable
public static IJson readJson (@Nonnull @WillClose final Reader aReader,
@Nullable final IJsonParserCustomizeCallback aCustomizeCallback,
@Nullable final IJsonParseExceptionCallback aCustomExceptionCallback)
{
final CollectingJsonParserHan... | java | @Nullable
public static IJson readJson (@Nonnull @WillClose final Reader aReader,
@Nullable final IJsonParserCustomizeCallback aCustomizeCallback,
@Nullable final IJsonParseExceptionCallback aCustomExceptionCallback)
{
final CollectingJsonParserHan... | [
"@",
"Nullable",
"public",
"static",
"IJson",
"readJson",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nullable",
"final",
"IJsonParserCustomizeCallback",
"aCustomizeCallback",
",",
"@",
"Nullable",
"final",
"IJsonParseExceptionCallb... | Main reading of the JSON
@param aReader
The reader to read from. Should be buffered. May not be
<code>null</code>.
@param aCustomizeCallback
An optional {@link JsonParser} customization callback. May be
<code>null</code>.
@param aCustomExceptionCallback
A custom handler for unrecoverable errors. May be <code>null</cod... | [
"Main",
"reading",
"of",
"the",
"JSON"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L414-L423 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/BooleanHelper.java | BooleanHelper.getBooleanValue | public static boolean getBooleanValue (@Nullable final Boolean aObj, final boolean bDefault)
{
return aObj == null ? bDefault : aObj.booleanValue ();
} | java | public static boolean getBooleanValue (@Nullable final Boolean aObj, final boolean bDefault)
{
return aObj == null ? bDefault : aObj.booleanValue ();
} | [
"public",
"static",
"boolean",
"getBooleanValue",
"(",
"@",
"Nullable",
"final",
"Boolean",
"aObj",
",",
"final",
"boolean",
"bDefault",
")",
"{",
"return",
"aObj",
"==",
"null",
"?",
"bDefault",
":",
"aObj",
".",
"booleanValue",
"(",
")",
";",
"}"
] | Get the primitive value of the passed object value.
@param aObj
The Boolean value to be converted
@param bDefault
The default value to be returned, if the passed obj is
<code>null</code>.
@return Either the primitive boolean value or the default value | [
"Get",
"the",
"primitive",
"value",
"of",
"the",
"passed",
"object",
"value",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/BooleanHelper.java#L48-L51 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/url/URLHelper.java | URLHelper.urlDecode | @Nonnull
public static String urlDecode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
boolean bNeedToChange = false;
final int nLen = sValue.length ();
final StringBuilder aSB = new StringB... | java | @Nonnull
public static String urlDecode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
boolean bNeedToChange = false;
final int nLen = sValue.length ();
final StringBuilder aSB = new StringB... | [
"@",
"Nonnull",
"public",
"static",
"String",
"urlDecode",
"(",
"@",
"Nonnull",
"final",
"String",
"sValue",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sValue",
",",
"\"Value\"",
")",
";",
"ValueEnfo... | URL-decode the passed value automatically handling charset issues. The
implementation is ripped from URLDecoder but does not throw an
UnsupportedEncodingException for nothing.
@param sValue
The value to be decoded. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>null</code>.
@return ... | [
"URL",
"-",
"decode",
"the",
"passed",
"value",
"automatically",
"handling",
"charset",
"issues",
".",
"The",
"implementation",
"is",
"ripped",
"from",
"URLDecoder",
"but",
"does",
"not",
"throw",
"an",
"UnsupportedEncodingException",
"for",
"nothing",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/url/URLHelper.java#L197-L266 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/url/URLHelper.java | URLHelper.urlEncode | @Nonnull
public static String urlEncode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
NonBlockingCharArrayWriter aCAW = null;
try
{
final int nLen = sValue.length ();
boolean bC... | java | @Nonnull
public static String urlEncode (@Nonnull final String sValue, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sValue, "Value");
ValueEnforcer.notNull (aCharset, "Charset");
NonBlockingCharArrayWriter aCAW = null;
try
{
final int nLen = sValue.length ();
boolean bC... | [
"@",
"Nonnull",
"public",
"static",
"String",
"urlEncode",
"(",
"@",
"Nonnull",
"final",
"String",
"sValue",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sValue",
",",
"\"Value\"",
")",
";",
"ValueEnfo... | URL-encode the passed value automatically handling charset issues. This is
a ripped, optimized version of URLEncoder.encode but without the
UnsupportedEncodingException.
@param sValue
The value to be encoded. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>null</code>.
@return The en... | [
"URL",
"-",
"encode",
"the",
"passed",
"value",
"automatically",
"handling",
"charset",
"issues",
".",
"This",
"is",
"a",
"ripped",
"optimized",
"version",
"of",
"URLEncoder",
".",
"encode",
"but",
"without",
"the",
"UnsupportedEncodingException",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/url/URLHelper.java#L293-L372 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/url/URLHelper.java | URLHelper.getCleanURLPartWithoutUmlauts | @Nullable
public static String getCleanURLPartWithoutUmlauts (@Nullable final String sURLPart)
{
if (s_aCleanURLOld == null)
_initCleanURL ();
final char [] ret = StringHelper.replaceMultiple (sURLPart, s_aCleanURLOld, s_aCleanURLNew);
return new String (ret);
} | java | @Nullable
public static String getCleanURLPartWithoutUmlauts (@Nullable final String sURLPart)
{
if (s_aCleanURLOld == null)
_initCleanURL ();
final char [] ret = StringHelper.replaceMultiple (sURLPart, s_aCleanURLOld, s_aCleanURLNew);
return new String (ret);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getCleanURLPartWithoutUmlauts",
"(",
"@",
"Nullable",
"final",
"String",
"sURLPart",
")",
"{",
"if",
"(",
"s_aCleanURLOld",
"==",
"null",
")",
"_initCleanURL",
"(",
")",
";",
"final",
"char",
"[",
"]",
"ret",
"... | Clean an URL part from nasty Umlauts. This mapping needs extension!
@param sURLPart
The original URL part. May be <code>null</code>.
@return The cleaned version or <code>null</code> if the input was
<code>null</code>. | [
"Clean",
"an",
"URL",
"part",
"from",
"nasty",
"Umlauts",
".",
"This",
"mapping",
"needs",
"extension!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/url/URLHelper.java#L430-L437 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/url/URLHelper.java | URLHelper.getAsURLData | @Nonnull
public static ISimpleURL getAsURLData (@Nonnull final String sHref,
@Nullable final IDecoder <String, String> aParameterDecoder)
{
ValueEnforcer.notNull (sHref, "Href");
final String sRealHref = sHref.trim ();
// Is it a protocol that does not allow fo... | java | @Nonnull
public static ISimpleURL getAsURLData (@Nonnull final String sHref,
@Nullable final IDecoder <String, String> aParameterDecoder)
{
ValueEnforcer.notNull (sHref, "Href");
final String sRealHref = sHref.trim ();
// Is it a protocol that does not allow fo... | [
"@",
"Nonnull",
"public",
"static",
"ISimpleURL",
"getAsURLData",
"(",
"@",
"Nonnull",
"final",
"String",
"sHref",
",",
"@",
"Nullable",
"final",
"IDecoder",
"<",
"String",
",",
"String",
">",
"aParameterDecoder",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"("... | Parses the passed URL into a structured form
@param sHref
The URL to be parsed
@param aParameterDecoder
The parameter decoder to use. May be <code>null</code>.
@return the corresponding {@link ISimpleURL} representation of the passed
URL | [
"Parses",
"the",
"passed",
"URL",
"into",
"a",
"structured",
"form"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/url/URLHelper.java#L455-L513 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/convert/MicroTypeConverterRegistry.java | MicroTypeConverterRegistry.iterateAllRegisteredMicroTypeConverters | public void iterateAllRegisteredMicroTypeConverters (@Nonnull final IMicroTypeConverterCallback aCallback)
{
// Create a static copy of the map (HashMap not weak!)
final ICommonsMap <Class <?>, IMicroTypeConverter <?>> aCopy = m_aRWLock.readLocked (m_aMap::getClone);
// And iterate the copy
for (fina... | java | public void iterateAllRegisteredMicroTypeConverters (@Nonnull final IMicroTypeConverterCallback aCallback)
{
// Create a static copy of the map (HashMap not weak!)
final ICommonsMap <Class <?>, IMicroTypeConverter <?>> aCopy = m_aRWLock.readLocked (m_aMap::getClone);
// And iterate the copy
for (fina... | [
"public",
"void",
"iterateAllRegisteredMicroTypeConverters",
"(",
"@",
"Nonnull",
"final",
"IMicroTypeConverterCallback",
"aCallback",
")",
"{",
"// Create a static copy of the map (HashMap not weak!)",
"final",
"ICommonsMap",
"<",
"Class",
"<",
"?",
">",
",",
"IMicroTypeConv... | Iterate all registered micro type converters. For informational purposes
only.
@param aCallback
The callback invoked for all iterations. | [
"Iterate",
"all",
"registered",
"micro",
"type",
"converters",
".",
"For",
"informational",
"purposes",
"only",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/convert/MicroTypeConverterRegistry.java#L210-L219 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.safeDecodeAsString | @Nullable
public static String safeDecodeAsString (@Nullable final String sEncoded, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (aCharset, "Charset");
if (sEncoded != null)
try
{
final byte [] aDecoded = decode (sEncoded, DONT_GUNZIP);
return new String (aDecoded, aC... | java | @Nullable
public static String safeDecodeAsString (@Nullable final String sEncoded, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (aCharset, "Charset");
if (sEncoded != null)
try
{
final byte [] aDecoded = decode (sEncoded, DONT_GUNZIP);
return new String (aDecoded, aC... | [
"@",
"Nullable",
"public",
"static",
"String",
"safeDecodeAsString",
"(",
"@",
"Nullable",
"final",
"String",
"sEncoded",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aCharset",
",",
"\"Charset\"",
")",
... | Decode the string and convert it back to a string.
@param sEncoded
The encoded string.
@param aCharset
The character set to be used.
@return <code>null</code> if decoding failed. | [
"Decode",
"the",
"string",
"and",
"convert",
"it",
"back",
"to",
"a",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2664-L2679 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingBufferedReader.java | NonBlockingBufferedReader.ready | @Override
public boolean ready () throws IOException
{
_ensureOpen ();
/*
* If newline needs to be skipped and the next char to be read is a newline
* character, then just skip it right away.
*/
if (m_bSkipLF)
{
/*
* Note that in.ready() will return true if and only if t... | java | @Override
public boolean ready () throws IOException
{
_ensureOpen ();
/*
* If newline needs to be skipped and the next char to be read is a newline
* character, then just skip it right away.
*/
if (m_bSkipLF)
{
/*
* Note that in.ready() will return true if and only if t... | [
"@",
"Override",
"public",
"boolean",
"ready",
"(",
")",
"throws",
"IOException",
"{",
"_ensureOpen",
"(",
")",
";",
"/*\n * If newline needs to be skipped and the next char to be read is a newline\n * character, then just skip it right away.\n */",
"if",
"(",
"m_bSkipL... | Tells whether this stream is ready to be read. A buffered character stream
is ready if the buffer is not empty, or if the underlying character stream
is ready.
@return <code>true</code> if the reader is ready
@exception IOException
If an I/O error occurs | [
"Tells",
"whether",
"this",
"stream",
"is",
"ready",
"to",
"be",
"read",
".",
"A",
"buffered",
"character",
"stream",
"is",
"ready",
"if",
"the",
"buffer",
"is",
"not",
"empty",
"or",
"if",
"the",
"underlying",
"character",
"stream",
"is",
"ready",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingBufferedReader.java#L440-L465 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathVariableResolverQName.java | MapBasedXPathVariableResolverQName.addAllFrom | @Nonnull
public EChange addAllFrom (@Nonnull final MapBasedXPathVariableResolver aOther, final boolean bOverwrite)
{
ValueEnforcer.notNull (aOther, "Other");
EChange eChange = EChange.UNCHANGED;
for (final Map.Entry <String, ?> aEntry : aOther.getAllVariables ().entrySet ())
{
// Local part on... | java | @Nonnull
public EChange addAllFrom (@Nonnull final MapBasedXPathVariableResolver aOther, final boolean bOverwrite)
{
ValueEnforcer.notNull (aOther, "Other");
EChange eChange = EChange.UNCHANGED;
for (final Map.Entry <String, ?> aEntry : aOther.getAllVariables ().entrySet ())
{
// Local part on... | [
"@",
"Nonnull",
"public",
"EChange",
"addAllFrom",
"(",
"@",
"Nonnull",
"final",
"MapBasedXPathVariableResolver",
"aOther",
",",
"final",
"boolean",
"bOverwrite",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aOther",
",",
"\"Other\"",
")",
";",
"EChange",
"e... | Add all variables from the other variable resolver into this resolver. This
methods creates a QName with an empty namespace URI.
@param aOther
The variable resolver to import the variable from. May not be
<code>null</code>.
@param bOverwrite
if <code>true</code> existing variables will be overwritten with the
new vari... | [
"Add",
"all",
"variables",
"from",
"the",
"other",
"variable",
"resolver",
"into",
"this",
"resolver",
".",
"This",
"methods",
"creates",
"a",
"QName",
"with",
"an",
"empty",
"namespace",
"URI",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathVariableResolverQName.java#L142-L159 | train |
phax/ph-commons | ph-less-commons/src/main/java/com/helger/lesscommons/jmx/ObjectNameHelper.java | ObjectNameHelper.setDefaultJMXDomain | public static void setDefaultJMXDomain (@Nonnull @Nonempty final String sDefaultJMXDomain)
{
ValueEnforcer.notEmpty (sDefaultJMXDomain, "DefaultJMXDomain");
if (sDefaultJMXDomain.indexOf (':') >= 0 || sDefaultJMXDomain.indexOf (' ') >= 0)
throw new IllegalArgumentException ("defaultJMXDomain contains in... | java | public static void setDefaultJMXDomain (@Nonnull @Nonempty final String sDefaultJMXDomain)
{
ValueEnforcer.notEmpty (sDefaultJMXDomain, "DefaultJMXDomain");
if (sDefaultJMXDomain.indexOf (':') >= 0 || sDefaultJMXDomain.indexOf (' ') >= 0)
throw new IllegalArgumentException ("defaultJMXDomain contains in... | [
"public",
"static",
"void",
"setDefaultJMXDomain",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sDefaultJMXDomain",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sDefaultJMXDomain",
",",
"\"DefaultJMXDomain\"",
")",
";",
"if",
"(",
"sDefaultJMXDomai... | Set the default JMX domain
@param sDefaultJMXDomain
The new JMX domain. May neither be <code>null</code> nor empty nor
may it contains ":" or " " | [
"Set",
"the",
"default",
"JMX",
"domain"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-less-commons/src/main/java/com/helger/lesscommons/jmx/ObjectNameHelper.java#L60-L67 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/callback/CallbackList.java | CallbackList.add | @Nonnull
public EChange add (@Nonnull final CALLBACKTYPE aCallback)
{
ValueEnforcer.notNull (aCallback, "Callback");
return m_aRWLock.writeLocked ( () -> m_aCallbacks.addObject (aCallback));
} | java | @Nonnull
public EChange add (@Nonnull final CALLBACKTYPE aCallback)
{
ValueEnforcer.notNull (aCallback, "Callback");
return m_aRWLock.writeLocked ( () -> m_aCallbacks.addObject (aCallback));
} | [
"@",
"Nonnull",
"public",
"EChange",
"add",
"(",
"@",
"Nonnull",
"final",
"CALLBACKTYPE",
"aCallback",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aCallback",
",",
"\"Callback\"",
")",
";",
"return",
"m_aRWLock",
".",
"writeLocked",
"(",
"(",
")",
"->",... | Add a callback.
@param aCallback
May not be <code>null</code>.
@return {@link EChange} | [
"Add",
"a",
"callback",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/callback/CallbackList.java#L94-L100 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/callback/CallbackList.java | CallbackList.removeObject | @Nonnull
public EChange removeObject (@Nullable final CALLBACKTYPE aCallback)
{
if (aCallback == null)
return EChange.UNCHANGED;
return m_aRWLock.writeLocked ( () -> m_aCallbacks.removeObject (aCallback));
} | java | @Nonnull
public EChange removeObject (@Nullable final CALLBACKTYPE aCallback)
{
if (aCallback == null)
return EChange.UNCHANGED;
return m_aRWLock.writeLocked ( () -> m_aCallbacks.removeObject (aCallback));
} | [
"@",
"Nonnull",
"public",
"EChange",
"removeObject",
"(",
"@",
"Nullable",
"final",
"CALLBACKTYPE",
"aCallback",
")",
"{",
"if",
"(",
"aCallback",
"==",
"null",
")",
"return",
"EChange",
".",
"UNCHANGED",
";",
"return",
"m_aRWLock",
".",
"writeLocked",
"(",
... | Remove the specified callback
@param aCallback
May be <code>null</code>.
@return {@link EChange} | [
"Remove",
"the",
"specified",
"callback"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/callback/CallbackList.java#L118-L125 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/XMLDebug.java | XMLDebug.debugLogDOMFeatures | public static void debugLogDOMFeatures ()
{
for (final Map.Entry <EXMLDOMFeatureVersion, ICommonsList <String>> aEntry : s_aSupportedFeatures.entrySet ())
for (final String sFeature : aEntry.getValue ())
if (LOGGER.isInfoEnabled ())
LOGGER.info ("DOM " + aEntry.getKey ().getID () + " featu... | java | public static void debugLogDOMFeatures ()
{
for (final Map.Entry <EXMLDOMFeatureVersion, ICommonsList <String>> aEntry : s_aSupportedFeatures.entrySet ())
for (final String sFeature : aEntry.getValue ())
if (LOGGER.isInfoEnabled ())
LOGGER.info ("DOM " + aEntry.getKey ().getID () + " featu... | [
"public",
"static",
"void",
"debugLogDOMFeatures",
"(",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"EXMLDOMFeatureVersion",
",",
"ICommonsList",
"<",
"String",
">",
">",
"aEntry",
":",
"s_aSupportedFeatures",
".",
"entrySet",
"(",
")",
")",
"fo... | Emit all supported features to the logger. | [
"Emit",
"all",
"supported",
"features",
"to",
"the",
"logger",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/XMLDebug.java#L108-L114 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/XMLHelper.java | XMLHelper.getOwnerDocument | @Nullable
public static Document getOwnerDocument (@Nullable final Node aNode)
{
if (aNode == null)
return null;
if (aNode instanceof Document)
return (Document) aNode;
return aNode.getOwnerDocument ();
} | java | @Nullable
public static Document getOwnerDocument (@Nullable final Node aNode)
{
if (aNode == null)
return null;
if (aNode instanceof Document)
return (Document) aNode;
return aNode.getOwnerDocument ();
} | [
"@",
"Nullable",
"public",
"static",
"Document",
"getOwnerDocument",
"(",
"@",
"Nullable",
"final",
"Node",
"aNode",
")",
"{",
"if",
"(",
"aNode",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"aNode",
"instanceof",
"Document",
")",
"return",
"(",
... | Get the owner document of the passed node. If the node itself is a
document, only a cast is performed.
@param aNode
The node to get the document from. May be <code>null</code>.
@return <code>null</code> if the passed node was <code>null</code>. | [
"Get",
"the",
"owner",
"document",
"of",
"the",
"passed",
"node",
".",
"If",
"the",
"node",
"itself",
"is",
"a",
"document",
"only",
"a",
"cast",
"is",
"performed",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/XMLHelper.java#L76-L84 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/XMLHelper.java | XMLHelper.getFirstChildElement | @Nullable
public static Element getFirstChildElement (@Nullable final Node aStartNode)
{
if (aStartNode == null)
return null;
return NodeListIterator.createChildNodeIterator (aStartNode)
.findFirstMapped (filterNodeIsElement (), x -> (Element) x);
} | java | @Nullable
public static Element getFirstChildElement (@Nullable final Node aStartNode)
{
if (aStartNode == null)
return null;
return NodeListIterator.createChildNodeIterator (aStartNode)
.findFirstMapped (filterNodeIsElement (), x -> (Element) x);
} | [
"@",
"Nullable",
"public",
"static",
"Element",
"getFirstChildElement",
"(",
"@",
"Nullable",
"final",
"Node",
"aStartNode",
")",
"{",
"if",
"(",
"aStartNode",
"==",
"null",
")",
"return",
"null",
";",
"return",
"NodeListIterator",
".",
"createChildNodeIterator",
... | Get the first direct child element of the passed element.
@param aStartNode
The element to start searching. May be <code>null</code>.
@return <code>null</code> if the passed element does not have any direct
child element. | [
"Get",
"the",
"first",
"direct",
"child",
"element",
"of",
"the",
"passed",
"element",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/XMLHelper.java#L214-L221 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/XMLHelper.java | XMLHelper.hasChildElementNodes | public static boolean hasChildElementNodes (@Nullable final Node aStartNode)
{
if (aStartNode == null)
return false;
return NodeListIterator.createChildNodeIterator (aStartNode).containsAny (filterNodeIsElement ());
} | java | public static boolean hasChildElementNodes (@Nullable final Node aStartNode)
{
if (aStartNode == null)
return false;
return NodeListIterator.createChildNodeIterator (aStartNode).containsAny (filterNodeIsElement ());
} | [
"public",
"static",
"boolean",
"hasChildElementNodes",
"(",
"@",
"Nullable",
"final",
"Node",
"aStartNode",
")",
"{",
"if",
"(",
"aStartNode",
"==",
"null",
")",
"return",
"false",
";",
"return",
"NodeListIterator",
".",
"createChildNodeIterator",
"(",
"aStartNode... | Check if the passed node has at least one direct child element or not.
@param aStartNode
The parent element to be searched. May be <code>null</code>.
@return <code>true</code> if the passed node has at least one child
element, <code>false</code> otherwise. | [
"Check",
"if",
"the",
"passed",
"node",
"has",
"at",
"least",
"one",
"direct",
"child",
"element",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/XMLHelper.java#L231-L236 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeType.java | MimeType.removeParameterWithName | @Nonnull
public EChange removeParameterWithName (@Nullable final String sParamName)
{
if (StringHelper.hasText (sParamName))
{
final int nMax = m_aParameters.size ();
for (int i = 0; i < nMax; ++i)
{
final MimeTypeParameter aParam = m_aParameters.get (i);
if (aParam.getAttr... | java | @Nonnull
public EChange removeParameterWithName (@Nullable final String sParamName)
{
if (StringHelper.hasText (sParamName))
{
final int nMax = m_aParameters.size ();
for (int i = 0; i < nMax; ++i)
{
final MimeTypeParameter aParam = m_aParameters.get (i);
if (aParam.getAttr... | [
"@",
"Nonnull",
"public",
"EChange",
"removeParameterWithName",
"(",
"@",
"Nullable",
"final",
"String",
"sParamName",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasText",
"(",
"sParamName",
")",
")",
"{",
"final",
"int",
"nMax",
"=",
"m_aParameters",
".",
"... | Remove the parameter with the specified name.
@param sParamName
The name of the parameter to remove. May be <code>null</code>.
@return {@link EChange#CHANGED} if the parameter was removed,
{@link EChange#UNCHANGED} otherwise. | [
"Remove",
"the",
"parameter",
"with",
"the",
"specified",
"name",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeType.java#L251-L268 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java | RegExHelper.getMatcher | @Nonnull
public static Matcher getMatcher (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)
{
ValueEnforcer.notNull (sValue, "Value");
return RegExCache.getPattern (sRegEx).matcher (sValue);
} | java | @Nonnull
public static Matcher getMatcher (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)
{
ValueEnforcer.notNull (sValue, "Value");
return RegExCache.getPattern (sRegEx).matcher (sValue);
} | [
"@",
"Nonnull",
"public",
"static",
"Matcher",
"getMatcher",
"(",
"@",
"Nonnull",
"@",
"RegEx",
"final",
"String",
"sRegEx",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sValue",
",",
"\"Value\"",
")",
... | Get the Java Matcher object for the passed pair of regular expression and
value.
@param sRegEx
The regular expression to use. May neither be <code>null</code> nor
empty.
@param sValue
The value to create the matcher for. May not be <code>null</code>.
@return A non-<code>null</code> matcher. | [
"Get",
"the",
"Java",
"Matcher",
"object",
"for",
"the",
"passed",
"pair",
"of",
"regular",
"expression",
"and",
"value",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java#L162-L168 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java | RegExHelper.stringMatchesPattern | public static boolean stringMatchesPattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)
{
return getMatcher (sRegEx, sValue).matches ();
} | java | public static boolean stringMatchesPattern (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue)
{
return getMatcher (sRegEx, sValue).matches ();
} | [
"public",
"static",
"boolean",
"stringMatchesPattern",
"(",
"@",
"Nonnull",
"@",
"RegEx",
"final",
"String",
"sRegEx",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"return",
"getMatcher",
"(",
"sRegEx",
",",
"sValue",
")",
".",
"matches",
"(",... | A shortcut helper method to determine whether a string matches a certain
regular expression or not.
@param sRegEx
The regular expression to be used. The compiled regular expression
pattern is cached. May neither be <code>null</code> nor empty.
@param sValue
The string value to compare against the regular expression.
@... | [
"A",
"shortcut",
"helper",
"method",
"to",
"determine",
"whether",
"a",
"string",
"matches",
"a",
"certain",
"regular",
"expression",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/regex/RegExHelper.java#L206-L209 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/country/CountryCache.java | CountryCache.containsCountry | public boolean containsCountry (@Nullable final String sCountry)
{
if (sCountry == null)
return false;
final String sValidCountry = LocaleHelper.getValidCountryCode (sCountry);
if (sValidCountry == null)
return false;
return m_aRWLock.readLocked ( () -> m_aCountries.contains (sValidCountr... | java | public boolean containsCountry (@Nullable final String sCountry)
{
if (sCountry == null)
return false;
final String sValidCountry = LocaleHelper.getValidCountryCode (sCountry);
if (sValidCountry == null)
return false;
return m_aRWLock.readLocked ( () -> m_aCountries.contains (sValidCountr... | [
"public",
"boolean",
"containsCountry",
"(",
"@",
"Nullable",
"final",
"String",
"sCountry",
")",
"{",
"if",
"(",
"sCountry",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"sValidCountry",
"=",
"LocaleHelper",
".",
"getValidCountryCode",
"(",
"... | Check if the passed country is known.
@param sCountry
The country to check. May be <code>null</code>.
@return <code>true</code> if the passed country is contained,
<code>false</code> otherwise. | [
"Check",
"if",
"the",
"passed",
"country",
"is",
"known",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/country/CountryCache.java#L165-L174 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/hashcode/HashCodeCalculator.java | HashCodeCalculator.append | public static int append (final int nPrevHashCode, @Nullable final Object x)
{
return append (nPrevHashCode, HashCodeImplementationRegistry.getHashCode (x));
} | java | public static int append (final int nPrevHashCode, @Nullable final Object x)
{
return append (nPrevHashCode, HashCodeImplementationRegistry.getHashCode (x));
} | [
"public",
"static",
"int",
"append",
"(",
"final",
"int",
"nPrevHashCode",
",",
"@",
"Nullable",
"final",
"Object",
"x",
")",
"{",
"return",
"append",
"(",
"nPrevHashCode",
",",
"HashCodeImplementationRegistry",
".",
"getHashCode",
"(",
"x",
")",
")",
";",
"... | Object hash code generation.
@param nPrevHashCode
The previous hash code used as the basis for calculation
@param x
Object to add. May be <code>null</code>.
@return The updated hash code | [
"Object",
"hash",
"code",
"generation",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/hashcode/HashCodeCalculator.java#L173-L176 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/HasInputStream.java | HasInputStream.multiple | @Nonnull
@ReturnsMutableCopy
public static HasInputStream multiple (@Nonnull final ISupplier <? extends InputStream> aISP)
{
return new HasInputStream (aISP, true);
} | java | @Nonnull
@ReturnsMutableCopy
public static HasInputStream multiple (@Nonnull final ISupplier <? extends InputStream> aISP)
{
return new HasInputStream (aISP, true);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"HasInputStream",
"multiple",
"(",
"@",
"Nonnull",
"final",
"ISupplier",
"<",
"?",
"extends",
"InputStream",
">",
"aISP",
")",
"{",
"return",
"new",
"HasInputStream",
"(",
"aISP",
",",
"true",
")",... | Create a new object with a supplier that can read multiple times.
@param aISP
{@link InputStream} provider. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"new",
"object",
"with",
"a",
"supplier",
"that",
"can",
"read",
"multiple",
"times",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/HasInputStream.java#L81-L86 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/HasInputStream.java | HasInputStream.once | @Nonnull
@ReturnsMutableCopy
public static HasInputStream once (@Nonnull final ISupplier <? extends InputStream> aISP)
{
return new HasInputStream (aISP, false);
} | java | @Nonnull
@ReturnsMutableCopy
public static HasInputStream once (@Nonnull final ISupplier <? extends InputStream> aISP)
{
return new HasInputStream (aISP, false);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"HasInputStream",
"once",
"(",
"@",
"Nonnull",
"final",
"ISupplier",
"<",
"?",
"extends",
"InputStream",
">",
"aISP",
")",
"{",
"return",
"new",
"HasInputStream",
"(",
"aISP",
",",
"false",
")",
... | Create a new object with a supplier that can be read only once.
@param aISP
{@link InputStream} provider. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"new",
"object",
"with",
"a",
"supplier",
"that",
"can",
"be",
"read",
"only",
"once",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/HasInputStream.java#L95-L100 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java | LevenshteinDistance._getDistance111 | private static int _getDistance111 (@Nonnull final char [] aStr1,
@Nonnegative final int nLen1,
@Nonnull final char [] aStr2,
@Nonnegative final int nLen2)
{
// previous cost array, horizontally
i... | java | private static int _getDistance111 (@Nonnull final char [] aStr1,
@Nonnegative final int nLen1,
@Nonnull final char [] aStr2,
@Nonnegative final int nLen2)
{
// previous cost array, horizontally
i... | [
"private",
"static",
"int",
"_getDistance111",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aStr1",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen1",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aStr2",
",",
"@",
"Nonnegative",
"final",
"int",
"n... | Main generic Levenshtein implementation that uses "1" for all costs!
@param aStr1
Not null
@param nLen1
> 0
@param aStr2
Not null
@param nLen2
> 0
@return non negative distance | [
"Main",
"generic",
"Levenshtein",
"implementation",
"that",
"uses",
"1",
"for",
"all",
"costs!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java#L55-L90 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java | LevenshteinDistance._getDistance | private static int _getDistance (@Nonnull final char [] aStr1,
@Nonnegative final int nLen1,
@Nonnull final char [] aStr2,
@Nonnegative final int nLen2,
@Nonnegative final int nCos... | java | private static int _getDistance (@Nonnull final char [] aStr1,
@Nonnegative final int nLen1,
@Nonnull final char [] aStr2,
@Nonnegative final int nLen2,
@Nonnegative final int nCos... | [
"private",
"static",
"int",
"_getDistance",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aStr1",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen1",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aStr2",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen... | Main generic Levenshtein implementation. Assume all preconditions are
checked.
@param aStr1
Not null
@param nLen1
> 0
@param aStr2
Not null
@param nLen2
> 0
@param nCostInsert
≥ 0
@param nCostDelete
≥ 0
@param nCostSubstitution
≥ 0
@return non negative distance | [
"Main",
"generic",
"Levenshtein",
"implementation",
".",
"Assume",
"all",
"preconditions",
"are",
"checked",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/util/LevenshteinDistance.java#L112-L151 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/email/EmailAddressHelper.java | EmailAddressHelper.getUnifiedEmailAddress | @Nullable
public static String getUnifiedEmailAddress (@Nullable final String sEmailAddress)
{
return sEmailAddress == null ? null : sEmailAddress.trim ().toLowerCase (Locale.US);
} | java | @Nullable
public static String getUnifiedEmailAddress (@Nullable final String sEmailAddress)
{
return sEmailAddress == null ? null : sEmailAddress.trim ().toLowerCase (Locale.US);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getUnifiedEmailAddress",
"(",
"@",
"Nullable",
"final",
"String",
"sEmailAddress",
")",
"{",
"return",
"sEmailAddress",
"==",
"null",
"?",
"null",
":",
"sEmailAddress",
".",
"trim",
"(",
")",
".",
"toLowerCase",
... | Get the unified version of an email address. It trims leading and trailing
spaces and lower-cases the email address.
@param sEmailAddress
The email address to unify. May be <code>null</code>.
@return The unified email address or <code>null</code> if the input address
is <code>null</code>. | [
"Get",
"the",
"unified",
"version",
"of",
"an",
"email",
"address",
".",
"It",
"trims",
"leading",
"and",
"trailing",
"spaces",
"and",
"lower",
"-",
"cases",
"the",
"email",
"address",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/email/EmailAddressHelper.java#L53-L57 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/email/EmailAddressHelper.java | EmailAddressHelper.isValid | public static boolean isValid (@Nullable final String sEmailAddress)
{
if (sEmailAddress == null)
return false;
// Unify (lowercase)
final String sUnifiedEmail = getUnifiedEmailAddress (sEmailAddress);
// Pattern matching
return s_aPattern.matcher (sUnifiedEmail).matches ();
} | java | public static boolean isValid (@Nullable final String sEmailAddress)
{
if (sEmailAddress == null)
return false;
// Unify (lowercase)
final String sUnifiedEmail = getUnifiedEmailAddress (sEmailAddress);
// Pattern matching
return s_aPattern.matcher (sUnifiedEmail).matches ();
} | [
"public",
"static",
"boolean",
"isValid",
"(",
"@",
"Nullable",
"final",
"String",
"sEmailAddress",
")",
"{",
"if",
"(",
"sEmailAddress",
"==",
"null",
")",
"return",
"false",
";",
"// Unify (lowercase)",
"final",
"String",
"sUnifiedEmail",
"=",
"getUnifiedEmailAd... | Checks if a value is a valid e-mail address according to a certain regular
expression.
@param sEmailAddress
The value validation is being performed on. A <code>null</code>
value is considered invalid.
@return <code>true</code> if the email address is valid, <code>false</code>
otherwise. | [
"Checks",
"if",
"a",
"value",
"is",
"a",
"valid",
"e",
"-",
"mail",
"address",
"according",
"to",
"a",
"certain",
"regular",
"expression",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/email/EmailAddressHelper.java#L69-L79 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/util/XMLMapHandler.java | XMLMapHandler.writeMap | @Nonnull
public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull @WillClose final OutputStream aOS)
{
ValueEnforcer.notNull (aMap, "Map");
ValueEnforcer.notNull (aOS, "OutputStream");
try
{
final IMicroDocument aDoc = createMapDocument (aMap);
return MicroWri... | java | @Nonnull
public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull @WillClose final OutputStream aOS)
{
ValueEnforcer.notNull (aMap, "Map");
ValueEnforcer.notNull (aOS, "OutputStream");
try
{
final IMicroDocument aDoc = createMapDocument (aMap);
return MicroWri... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeMap",
"(",
"@",
"Nonnull",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aMap",
",",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"OutputStream",
"aOS",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(... | Write the passed map to the passed output stream using the predefined XML
layout.
@param aMap
The map to be written. May not be <code>null</code>.
@param aOS
The output stream to write to. The stream is closed independent of
success or failure. May not be <code>null</code>.
@return {@link ESuccess#SUCCESS} when everyt... | [
"Write",
"the",
"passed",
"map",
"to",
"the",
"passed",
"output",
"stream",
"using",
"the",
"predefined",
"XML",
"layout",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/util/XMLMapHandler.java#L228-L243 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/transform/XMLTransformerFactory.java | XMLTransformerFactory.newTransformer | @Nullable
public static Transformer newTransformer (@Nonnull final TransformerFactory aTransformerFactory)
{
ValueEnforcer.notNull (aTransformerFactory, "TransformerFactory");
try
{
return aTransformerFactory.newTransformer ();
}
catch (final TransformerConfigurationException ex)
{
... | java | @Nullable
public static Transformer newTransformer (@Nonnull final TransformerFactory aTransformerFactory)
{
ValueEnforcer.notNull (aTransformerFactory, "TransformerFactory");
try
{
return aTransformerFactory.newTransformer ();
}
catch (final TransformerConfigurationException ex)
{
... | [
"@",
"Nullable",
"public",
"static",
"Transformer",
"newTransformer",
"(",
"@",
"Nonnull",
"final",
"TransformerFactory",
"aTransformerFactory",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aTransformerFactory",
",",
"\"TransformerFactory\"",
")",
";",
"try",
"{",... | Create a new XSLT transformer for no specific resource.
@param aTransformerFactory
The transformer factory to be used. May not be <code>null</code>.
@return <code>null</code> if something goes wrong | [
"Create",
"a",
"new",
"XSLT",
"transformer",
"for",
"no",
"specific",
"resource",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/transform/XMLTransformerFactory.java#L147-L161 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/util/StringScanner.java | StringScanner.getRest | @Nonnull
public String getRest ()
{
final String ret = m_sInput.substring (m_nCurIndex);
m_nCurIndex = m_nMaxIndex;
return ret;
} | java | @Nonnull
public String getRest ()
{
final String ret = m_sInput.substring (m_nCurIndex);
m_nCurIndex = m_nMaxIndex;
return ret;
} | [
"@",
"Nonnull",
"public",
"String",
"getRest",
"(",
")",
"{",
"final",
"String",
"ret",
"=",
"m_sInput",
".",
"substring",
"(",
"m_nCurIndex",
")",
";",
"m_nCurIndex",
"=",
"m_nMaxIndex",
";",
"return",
"ret",
";",
"}"
] | Get all remaining chars, and set the index to the end of the input string
@return The remaining string. May not be <code>null</code> but may be
empty. | [
"Get",
"all",
"remaining",
"chars",
"and",
"set",
"the",
"index",
"to",
"the",
"end",
"of",
"the",
"input",
"string"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/util/StringScanner.java#L129-L135 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/util/StringScanner.java | StringScanner.getUntil | @Nonnull
public String getUntil (final char cEndExcl)
{
final int nStart = m_nCurIndex;
while (m_nCurIndex < m_nMaxIndex && getCurrentChar () != cEndExcl)
++m_nCurIndex;
return m_sInput.substring (nStart, m_nCurIndex);
} | java | @Nonnull
public String getUntil (final char cEndExcl)
{
final int nStart = m_nCurIndex;
while (m_nCurIndex < m_nMaxIndex && getCurrentChar () != cEndExcl)
++m_nCurIndex;
return m_sInput.substring (nStart, m_nCurIndex);
} | [
"@",
"Nonnull",
"public",
"String",
"getUntil",
"(",
"final",
"char",
"cEndExcl",
")",
"{",
"final",
"int",
"nStart",
"=",
"m_nCurIndex",
";",
"while",
"(",
"m_nCurIndex",
"<",
"m_nMaxIndex",
"&&",
"getCurrentChar",
"(",
")",
"!=",
"cEndExcl",
")",
"++",
"... | Get the string until the specified end character, but excluding the end
character.
@param cEndExcl
The end character to search.
@return A non-<code>null</code> string with all characters from the current
index until the end character, but not including the end character. | [
"Get",
"the",
"string",
"until",
"the",
"specified",
"end",
"character",
"but",
"excluding",
"the",
"end",
"character",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/util/StringScanner.java#L163-L170 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java | ChangeWithValue.getIfChanged | @Nullable
public DATATYPE getIfChanged (@Nullable final DATATYPE aUnchangedValue)
{
return m_eChange.isChanged () ? m_aObj : aUnchangedValue;
} | java | @Nullable
public DATATYPE getIfChanged (@Nullable final DATATYPE aUnchangedValue)
{
return m_eChange.isChanged () ? m_aObj : aUnchangedValue;
} | [
"@",
"Nullable",
"public",
"DATATYPE",
"getIfChanged",
"(",
"@",
"Nullable",
"final",
"DATATYPE",
"aUnchangedValue",
")",
"{",
"return",
"m_eChange",
".",
"isChanged",
"(",
")",
"?",
"m_aObj",
":",
"aUnchangedValue",
";",
"}"
] | Get the store value if this is a change. Otherwise the passed unchanged
value is returned.
@param aUnchangedValue
The unchanged value to be used. May be <code>null</code>.
@return Either the stored value or the unchanged value. May be
<code>null</code>. | [
"Get",
"the",
"store",
"value",
"if",
"this",
"is",
"a",
"change",
".",
"Otherwise",
"the",
"passed",
"unchanged",
"value",
"is",
"returned",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java#L79-L83 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java | ChangeWithValue.getIfUnchanged | @Nullable
public DATATYPE getIfUnchanged (@Nullable final DATATYPE aChangedValue)
{
return m_eChange.isUnchanged () ? m_aObj : aChangedValue;
} | java | @Nullable
public DATATYPE getIfUnchanged (@Nullable final DATATYPE aChangedValue)
{
return m_eChange.isUnchanged () ? m_aObj : aChangedValue;
} | [
"@",
"Nullable",
"public",
"DATATYPE",
"getIfUnchanged",
"(",
"@",
"Nullable",
"final",
"DATATYPE",
"aChangedValue",
")",
"{",
"return",
"m_eChange",
".",
"isUnchanged",
"(",
")",
"?",
"m_aObj",
":",
"aChangedValue",
";",
"}"
] | Get the store value if this is unchanged. Otherwise the passed changed
value is returned.
@param aChangedValue
The changed value to be used. May be <code>null</code>.
@return Either the stored value or the changed value. May be
<code>null</code>. | [
"Get",
"the",
"store",
"value",
"if",
"this",
"is",
"unchanged",
".",
"Otherwise",
"the",
"passed",
"changed",
"value",
"is",
"returned",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java#L106-L110 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java | ChangeWithValue.createChanged | @Nonnull
public static <DATATYPE> ChangeWithValue <DATATYPE> createChanged (@Nullable final DATATYPE aValue)
{
return new ChangeWithValue <> (EChange.CHANGED, aValue);
} | java | @Nonnull
public static <DATATYPE> ChangeWithValue <DATATYPE> createChanged (@Nullable final DATATYPE aValue)
{
return new ChangeWithValue <> (EChange.CHANGED, aValue);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"DATATYPE",
">",
"ChangeWithValue",
"<",
"DATATYPE",
">",
"createChanged",
"(",
"@",
"Nullable",
"final",
"DATATYPE",
"aValue",
")",
"{",
"return",
"new",
"ChangeWithValue",
"<>",
"(",
"EChange",
".",
"CHANGED",
",",
... | Create a new changed object with the given value.
@param <DATATYPE>
The data type that is wrapped together with the change indicator
@param aValue
The value to be used. May be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"new",
"changed",
"object",
"with",
"the",
"given",
"value",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java#L156-L160 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java | ChangeWithValue.createUnchanged | @Nonnull
public static <DATATYPE> ChangeWithValue <DATATYPE> createUnchanged (@Nullable final DATATYPE aValue)
{
return new ChangeWithValue <> (EChange.UNCHANGED, aValue);
} | java | @Nonnull
public static <DATATYPE> ChangeWithValue <DATATYPE> createUnchanged (@Nullable final DATATYPE aValue)
{
return new ChangeWithValue <> (EChange.UNCHANGED, aValue);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"DATATYPE",
">",
"ChangeWithValue",
"<",
"DATATYPE",
">",
"createUnchanged",
"(",
"@",
"Nullable",
"final",
"DATATYPE",
"aValue",
")",
"{",
"return",
"new",
"ChangeWithValue",
"<>",
"(",
"EChange",
".",
"UNCHANGED",
","... | Create a new unchanged object with the given value.
@param <DATATYPE>
The data type that is wrapped together with the change indicator
@param aValue
The value to be used. May be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"new",
"unchanged",
"object",
"with",
"the",
"given",
"value",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/state/ChangeWithValue.java#L171-L175 | train |
phax/ph-commons | ph-security/src/main/java/com/helger/security/authentication/result/AuthTokenRegistry.java | AuthTokenRegistry.getAllTokensOfSubject | @Nonnull
public static ICommonsList <IAuthToken> getAllTokensOfSubject (@Nonnull final IAuthSubject aSubject)
{
ValueEnforcer.notNull (aSubject, "Subject");
return s_aRWLock.readLocked ( () -> CommonsArrayList.createFiltered (s_aMap.values (),
... | java | @Nonnull
public static ICommonsList <IAuthToken> getAllTokensOfSubject (@Nonnull final IAuthSubject aSubject)
{
ValueEnforcer.notNull (aSubject, "Subject");
return s_aRWLock.readLocked ( () -> CommonsArrayList.createFiltered (s_aMap.values (),
... | [
"@",
"Nonnull",
"public",
"static",
"ICommonsList",
"<",
"IAuthToken",
">",
"getAllTokensOfSubject",
"(",
"@",
"Nonnull",
"final",
"IAuthSubject",
"aSubject",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSubject",
",",
"\"Subject\"",
")",
";",
"return",
"s_... | Get all tokens of the specified auth subject. All tokens are returned, no
matter whether they are expired or not.
@param aSubject
The subject to query. May not be <code>null</code>.
@return The list and never <code>null</code>. | [
"Get",
"all",
"tokens",
"of",
"the",
"specified",
"auth",
"subject",
".",
"All",
"tokens",
"are",
"returned",
"no",
"matter",
"whether",
"they",
"are",
"expired",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/authentication/result/AuthTokenRegistry.java#L116-L124 | train |
phax/ph-commons | ph-security/src/main/java/com/helger/security/authentication/result/AuthTokenRegistry.java | AuthTokenRegistry.removeAllTokensOfSubject | @Nonnegative
public static int removeAllTokensOfSubject (@Nonnull final IAuthSubject aSubject)
{
ValueEnforcer.notNull (aSubject, "Subject");
// get all token IDs matching a given subject
// Note: required IAuthSubject to implement equals!
final ICommonsList <String> aDelTokenIDs = new CommonsArray... | java | @Nonnegative
public static int removeAllTokensOfSubject (@Nonnull final IAuthSubject aSubject)
{
ValueEnforcer.notNull (aSubject, "Subject");
// get all token IDs matching a given subject
// Note: required IAuthSubject to implement equals!
final ICommonsList <String> aDelTokenIDs = new CommonsArray... | [
"@",
"Nonnegative",
"public",
"static",
"int",
"removeAllTokensOfSubject",
"(",
"@",
"Nonnull",
"final",
"IAuthSubject",
"aSubject",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSubject",
",",
"\"Subject\"",
")",
";",
"// get all token IDs matching a given subject"... | Remove all tokens of the given subject
@param aSubject
The subject for which the tokens should be removed.
@return The number of removed tokens. Always ≥ 0. | [
"Remove",
"all",
"tokens",
"of",
"the",
"given",
"subject"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/authentication/result/AuthTokenRegistry.java#L133-L151 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java | EnumHelper.getFromNameCaseInsensitiveOrNull | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameCaseInsensitiveOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName)
{
return getFromNameCase... | java | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameCaseInsensitiveOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName)
{
return getFromNameCase... | [
"@",
"Nullable",
"public",
"static",
"<",
"ENUMTYPE",
"extends",
"Enum",
"<",
"ENUMTYPE",
">",
"&",
"IHasName",
">",
"ENUMTYPE",
"getFromNameCaseInsensitiveOrNull",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"ENUMTYPE",
">",
"aClass",
",",
"@",
"Nullable",
"f... | Get the enum value with the passed name case insensitive
@param <ENUMTYPE>
The enum type
@param aClass
The enum class
@param sName
The name to search
@return <code>null</code> if no enum item with the given ID is present. | [
"Get",
"the",
"enum",
"value",
"with",
"the",
"passed",
"name",
"case",
"insensitive"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java#L418-L423 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java | EnumHelper.getEnumID | @Nonnull
public static String getEnumID (@Nonnull final Enum <?> aEnum)
{
// No explicit null check, because this method is used heavily in
// locale resolving, so we want to spare some CPU cycles :)
return aEnum.getClass ().getName () + '.' + aEnum.name ();
} | java | @Nonnull
public static String getEnumID (@Nonnull final Enum <?> aEnum)
{
// No explicit null check, because this method is used heavily in
// locale resolving, so we want to spare some CPU cycles :)
return aEnum.getClass ().getName () + '.' + aEnum.name ();
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getEnumID",
"(",
"@",
"Nonnull",
"final",
"Enum",
"<",
"?",
">",
"aEnum",
")",
"{",
"// No explicit null check, because this method is used heavily in",
"// locale resolving, so we want to spare some CPU cycles :)",
"return",
"aE... | Get the unique name of the passed enum entry.
@param aEnum
The enum to use. May not be <code>null</code>.
@return The unique ID as a combination of the class name and the enum entry
name. Never <code>null</code>. | [
"Get",
"the",
"unique",
"name",
"of",
"the",
"passed",
"enum",
"entry",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java#L483-L489 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/ls/SimpleLSResourceResolver.java | SimpleLSResourceResolver.internalResolveResource | @OverrideOnDemand
@Nullable
protected IReadableResource internalResolveResource (@Nonnull @Nonempty final String sType,
@Nullable final String sNamespaceURI,
@Nullable final String sPublicId,
... | java | @OverrideOnDemand
@Nullable
protected IReadableResource internalResolveResource (@Nonnull @Nonempty final String sType,
@Nullable final String sNamespaceURI,
@Nullable final String sPublicId,
... | [
"@",
"OverrideOnDemand",
"@",
"Nullable",
"protected",
"IReadableResource",
"internalResolveResource",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sType",
",",
"@",
"Nullable",
"final",
"String",
"sNamespaceURI",
",",
"@",
"Nullable",
"final",
"String"... | Internal resource resolving
@param sType
The type of the resource being resolved. For XML [
<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]
resources (i.e. entities), applications must use the value <code>
"http://www.w3.org/TR/REC-xml"</code>. For XML Schema [
<a href='http://www.w3.org/TR/2001/REC-... | [
"Internal",
"resource",
"resolving"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/ls/SimpleLSResourceResolver.java#L97-L120 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/ls/SimpleLSResourceResolver.java | SimpleLSResourceResolver.mainResolveResource | @Override
@Nullable
public final LSInput mainResolveResource (@Nonnull @Nonempty final String sType,
@Nullable final String sNamespaceURI,
@Nullable final String sPublicId,
@Nullable f... | java | @Override
@Nullable
public final LSInput mainResolveResource (@Nonnull @Nonempty final String sType,
@Nullable final String sNamespaceURI,
@Nullable final String sPublicId,
@Nullable f... | [
"@",
"Override",
"@",
"Nullable",
"public",
"final",
"LSInput",
"mainResolveResource",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sType",
",",
"@",
"Nullable",
"final",
"String",
"sNamespaceURI",
",",
"@",
"Nullable",
"final",
"String",
"sPublicId... | Resolve a resource with the passed parameters
@param sType
The type of the resource being resolved. For XML [
<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]
resources (i.e. entities), applications must use the value <code>
"http://www.w3.org/TR/REC-xml"</code>. For XML Schema [
<a href='http://www.w... | [
"Resolve",
"a",
"resource",
"with",
"the",
"passed",
"parameters"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/ls/SimpleLSResourceResolver.java#L155-L188 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java | StackHelper.newStack | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final ELEMENTTYPE aValue)
{
final NonBlockingStack <ELEMENTTYPE> ret = newStack ();
ret.push (aValue);
return ret;
} | java | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final ELEMENTTYPE aValue)
{
final NonBlockingStack <ELEMENTTYPE> ret = newStack ();
ret.push (aValue);
return ret;
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"NonBlockingStack",
"<",
"ELEMENTTYPE",
">",
"newStack",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"aValue",
")",
"{",
"final",
"NonBlockingStack",
"<",
"ELEMENTTYPE",
">",... | Create a new stack with a single element.
@param <ELEMENTTYPE>
The type of elements contained in the stack.
@param aValue
The value to push. Maybe <code>null</code>.
@return A non-<code>null</code> stack. | [
"Create",
"a",
"new",
"stack",
"with",
"a",
"single",
"element",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java#L85-L92 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java | StackHelper.newStack | @Nonnull
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final ELEMENTTYPE... aValues)
{
return new NonBlockingStack <> (aValues);
} | java | @Nonnull
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final ELEMENTTYPE... aValues)
{
return new NonBlockingStack <> (aValues);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"@",
"SafeVarargs",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"NonBlockingStack",
"<",
"ELEMENTTYPE",
">",
"newStack",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"...",
"aValues",
")",
"{",
"return",
"new",
"NonBl... | Create a new stack from the given array.
@param <ELEMENTTYPE>
The type of elements contained in the stack.
@param aValues
The values that are to be pushed on the stack. The last element will
be the top element on the stack. May not be <code>null</code> .
@return A non-<code>null</code> stack object. | [
"Create",
"a",
"new",
"stack",
"from",
"the",
"given",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java#L104-L110 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java | StackHelper.newStack | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final Collection <? extends ELEMENTTYPE> aValues)
{
return new NonBlockingStack <> (aValues);
} | java | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> NonBlockingStack <ELEMENTTYPE> newStack (@Nullable final Collection <? extends ELEMENTTYPE> aValues)
{
return new NonBlockingStack <> (aValues);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"NonBlockingStack",
"<",
"ELEMENTTYPE",
">",
"newStack",
"(",
"@",
"Nullable",
"final",
"Collection",
"<",
"?",
"extends",
"ELEMENTTYPE",
">",
"aValues",
")",
"{",
"return",
... | Create a new stack from the given collection.
@param <ELEMENTTYPE>
The type of elements contained in the stack.
@param aValues
The values that are to be pushed on the stack. The last element will
be the top element on the stack. May not be <code>null</code> .
@return A non-<code>null</code> stack object. | [
"Create",
"a",
"new",
"stack",
"from",
"the",
"given",
"collection",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/StackHelper.java#L134-L139 | train |
phax/as2-peppol-client | src/main/java/com/helger/peppol/as2client/AS2ClientBuilder.java | AS2ClientBuilder.validateOutgoingBusinessDocument | @OverrideOnDemand
protected void validateOutgoingBusinessDocument (@Nonnull final Element aXML) throws AS2ClientBuilderException
{
if (m_aVESRegistry == null)
{
// Create lazily
m_aVESRegistry = createValidationRegistry ();
}
final IValidationExecutorSet aVES = m_aVESRegistry.getOfID (m_... | java | @OverrideOnDemand
protected void validateOutgoingBusinessDocument (@Nonnull final Element aXML) throws AS2ClientBuilderException
{
if (m_aVESRegistry == null)
{
// Create lazily
m_aVESRegistry = createValidationRegistry ();
}
final IValidationExecutorSet aVES = m_aVESRegistry.getOfID (m_... | [
"@",
"OverrideOnDemand",
"protected",
"void",
"validateOutgoingBusinessDocument",
"(",
"@",
"Nonnull",
"final",
"Element",
"aXML",
")",
"throws",
"AS2ClientBuilderException",
"{",
"if",
"(",
"m_aVESRegistry",
"==",
"null",
")",
"{",
"// Create lazily",
"m_aVESRegistry",... | Perform the standard PEPPOL validation of the outgoing business document
before sending takes place. In case validation fails, an exception is
thrown. The validation is configured using the validation key. This method
is only called, when a validation key was set.
@param aXML
The DOM Element with the business document... | [
"Perform",
"the",
"standard",
"PEPPOL",
"validation",
"of",
"the",
"outgoing",
"business",
"document",
"before",
"sending",
"takes",
"place",
".",
"In",
"case",
"validation",
"fails",
"an",
"exception",
"is",
"thrown",
".",
"The",
"validation",
"is",
"configured... | 499fea5938df1a3c69aade5bf8be26b6e261988f | https://github.com/phax/as2-peppol-client/blob/499fea5938df1a3c69aade5bf8be26b6e261988f/src/main/java/com/helger/peppol/as2client/AS2ClientBuilder.java#L1029-L1048 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java | ScopeSessionManager.getSessionScopeOfID | @Nullable
public ISessionScope getSessionScopeOfID (@Nullable final String sScopeID)
{
if (StringHelper.hasNoText (sScopeID))
return null;
return m_aRWLock.readLocked ( () -> m_aSessionScopes.get (sScopeID));
} | java | @Nullable
public ISessionScope getSessionScopeOfID (@Nullable final String sScopeID)
{
if (StringHelper.hasNoText (sScopeID))
return null;
return m_aRWLock.readLocked ( () -> m_aSessionScopes.get (sScopeID));
} | [
"@",
"Nullable",
"public",
"ISessionScope",
"getSessionScopeOfID",
"(",
"@",
"Nullable",
"final",
"String",
"sScopeID",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sScopeID",
")",
")",
"return",
"null",
";",
"return",
"m_aRWLock",
".",
"readLo... | Get the session scope with the specified ID. If no such scope exists, no
further actions are taken.
@param sScopeID
The ID to be resolved. May be <code>null</code>.
@return <code>null</code> if no such scope exists. | [
"Get",
"the",
"session",
"scope",
"with",
"the",
"specified",
"ID",
".",
"If",
"no",
"such",
"scope",
"exists",
"no",
"further",
"actions",
"are",
"taken",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java#L104-L111 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java | ScopeSessionManager.onScopeEnd | public void onScopeEnd (@Nonnull final ISessionScope aSessionScope)
{
ValueEnforcer.notNull (aSessionScope, "SessionScope");
// Only handle scopes that are not yet destructed
if (aSessionScope.isValid ())
{
final String sSessionID = aSessionScope.getID ();
final boolean bCanDestroyScope ... | java | public void onScopeEnd (@Nonnull final ISessionScope aSessionScope)
{
ValueEnforcer.notNull (aSessionScope, "SessionScope");
// Only handle scopes that are not yet destructed
if (aSessionScope.isValid ())
{
final String sSessionID = aSessionScope.getID ();
final boolean bCanDestroyScope ... | [
"public",
"void",
"onScopeEnd",
"(",
"@",
"Nonnull",
"final",
"ISessionScope",
"aSessionScope",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSessionScope",
",",
"\"SessionScope\"",
")",
";",
"// Only handle scopes that are not yet destructed",
"if",
"(",
"aSessionS... | Close the passed session scope gracefully. Each managed scope is guaranteed
to be destroyed only once. First the SPI manager is invoked, and afterwards
the scope is destroyed.
@param aSessionScope
The session scope to be ended. May not be <code>null</code>. | [
"Close",
"the",
"passed",
"session",
"scope",
"gracefully",
".",
"Each",
"managed",
"scope",
"is",
"guaranteed",
"to",
"be",
"destroyed",
"only",
"once",
".",
"First",
"the",
"SPI",
"manager",
"is",
"invoked",
"and",
"afterwards",
"the",
"scope",
"is",
"dest... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java#L150-L197 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java | ScopeSessionManager.destroyAllSessions | public void destroyAllSessions ()
{
// destroy all session scopes (use a copy, because we're invalidating
// the sessions internally!)
for (final ISessionScope aSessionScope : getAllSessionScopes ())
{
// Unfortunately we need a special handling here
if (aSessionScope.selfDestruct ().isCon... | java | public void destroyAllSessions ()
{
// destroy all session scopes (use a copy, because we're invalidating
// the sessions internally!)
for (final ISessionScope aSessionScope : getAllSessionScopes ())
{
// Unfortunately we need a special handling here
if (aSessionScope.selfDestruct ().isCon... | [
"public",
"void",
"destroyAllSessions",
"(",
")",
"{",
"// destroy all session scopes (use a copy, because we're invalidating",
"// the sessions internally!)",
"for",
"(",
"final",
"ISessionScope",
"aSessionScope",
":",
"getAllSessionScopes",
"(",
")",
")",
"{",
"// Unfortunate... | Destroy all known session scopes. After this method it is ensured that the
internal session map is empty. | [
"Destroy",
"all",
"known",
"session",
"scopes",
".",
"After",
"this",
"method",
"it",
"is",
"ensured",
"that",
"the",
"internal",
"session",
"map",
"is",
"empty",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeSessionManager.java#L246-L263 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java | ScopeManager.onGlobalBegin | @Nonnull
public static IGlobalScope onGlobalBegin (@Nonnull @Nonempty final String sScopeID)
{
return onGlobalBegin (sScopeID, GlobalScope::new);
} | java | @Nonnull
public static IGlobalScope onGlobalBegin (@Nonnull @Nonempty final String sScopeID)
{
return onGlobalBegin (sScopeID, GlobalScope::new);
} | [
"@",
"Nonnull",
"public",
"static",
"IGlobalScope",
"onGlobalBegin",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sScopeID",
")",
"{",
"return",
"onGlobalBegin",
"(",
"sScopeID",
",",
"GlobalScope",
"::",
"new",
")",
";",
"}"
] | This method is used to set the initial global scope.
@param sScopeID
The scope ID to use
@return The created global scope object. Never <code>null</code>. | [
"This",
"method",
"is",
"used",
"to",
"set",
"the",
"initial",
"global",
"scope",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java#L123-L127 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java | ScopeManager.onGlobalEnd | public static void onGlobalEnd ()
{
s_aGlobalLock.locked ( () -> {
/**
* This code removes all attributes set for the global context. This is
* necessary, since the attributes would survive a Tomcat servlet context
* reload if we don't kill them manually.<br>
* Global scope varia... | java | public static void onGlobalEnd ()
{
s_aGlobalLock.locked ( () -> {
/**
* This code removes all attributes set for the global context. This is
* necessary, since the attributes would survive a Tomcat servlet context
* reload if we don't kill them manually.<br>
* Global scope varia... | [
"public",
"static",
"void",
"onGlobalEnd",
"(",
")",
"{",
"s_aGlobalLock",
".",
"locked",
"(",
"(",
")",
"->",
"{",
"/**\n * This code removes all attributes set for the global context. This is\n * necessary, since the attributes would survive a Tomcat servlet context\n ... | To be called when the singleton global context is to be destroyed. | [
"To",
"be",
"called",
"when",
"the",
"singleton",
"global",
"context",
"is",
"to",
"be",
"destroyed",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java#L165-L191 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java | ScopeManager.destroySessionScope | public static void destroySessionScope (@Nonnull final ISessionScope aSessionScope)
{
ValueEnforcer.notNull (aSessionScope, "SessionScope");
ScopeSessionManager.getInstance ().onScopeEnd (aSessionScope);
} | java | public static void destroySessionScope (@Nonnull final ISessionScope aSessionScope)
{
ValueEnforcer.notNull (aSessionScope, "SessionScope");
ScopeSessionManager.getInstance ().onScopeEnd (aSessionScope);
} | [
"public",
"static",
"void",
"destroySessionScope",
"(",
"@",
"Nonnull",
"final",
"ISessionScope",
"aSessionScope",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSessionScope",
",",
"\"SessionScope\"",
")",
";",
"ScopeSessionManager",
".",
"getInstance",
"(",
")"... | Manually destroy the passed session scope.
@param aSessionScope
The session scope to be destroyed. May not be <code>null</code>. | [
"Manually",
"destroy",
"the",
"passed",
"session",
"scope",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java#L274-L279 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java | ScopeManager.onRequestEnd | public static void onRequestEnd ()
{
final IRequestScope aRequestScope = getRequestScopeOrNull ();
try
{
// Do we have something to destroy?
if (aRequestScope != null)
{
_destroyRequestScope (aRequestScope);
}
else
{
// Happens after an internal redirect... | java | public static void onRequestEnd ()
{
final IRequestScope aRequestScope = getRequestScopeOrNull ();
try
{
// Do we have something to destroy?
if (aRequestScope != null)
{
_destroyRequestScope (aRequestScope);
}
else
{
// Happens after an internal redirect... | [
"public",
"static",
"void",
"onRequestEnd",
"(",
")",
"{",
"final",
"IRequestScope",
"aRequestScope",
"=",
"getRequestScopeOrNull",
"(",
")",
";",
"try",
"{",
"// Do we have something to destroy?",
"if",
"(",
"aRequestScope",
"!=",
"null",
")",
"{",
"_destroyRequest... | To be called after a request finished. | [
"To",
"be",
"called",
"after",
"a",
"request",
"finished",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/mgr/ScopeManager.java#L394-L416 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onDocumentType | public void onDocumentType (@Nonnull final String sQualifiedElementName,
@Nullable final String sPublicID,
@Nullable final String sSystemID)
{
ValueEnforcer.notNull (sQualifiedElementName, "QualifiedElementName");
final String sDocType = getDocTypeX... | java | public void onDocumentType (@Nonnull final String sQualifiedElementName,
@Nullable final String sPublicID,
@Nullable final String sSystemID)
{
ValueEnforcer.notNull (sQualifiedElementName, "QualifiedElementName");
final String sDocType = getDocTypeX... | [
"public",
"void",
"onDocumentType",
"(",
"@",
"Nonnull",
"final",
"String",
"sQualifiedElementName",
",",
"@",
"Nullable",
"final",
"String",
"sPublicID",
",",
"@",
"Nullable",
"final",
"String",
"sSystemID",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sQua... | On XML document type.
@param sQualifiedElementName
Qualified name of the root element.
@param sPublicID
Document type public ID
@param sSystemID
Document type system ID | [
"On",
"XML",
"document",
"type",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L369-L382 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onProcessingInstruction | public void onProcessingInstruction (@Nonnull final String sTarget, @Nullable final String sData)
{
_append (PI_START)._append (sTarget);
if (StringHelper.hasText (sData))
_append (' ')._append (sData);
_append (PI_END);
newLine ();
} | java | public void onProcessingInstruction (@Nonnull final String sTarget, @Nullable final String sData)
{
_append (PI_START)._append (sTarget);
if (StringHelper.hasText (sData))
_append (' ')._append (sData);
_append (PI_END);
newLine ();
} | [
"public",
"void",
"onProcessingInstruction",
"(",
"@",
"Nonnull",
"final",
"String",
"sTarget",
",",
"@",
"Nullable",
"final",
"String",
"sData",
")",
"{",
"_append",
"(",
"PI_START",
")",
".",
"_append",
"(",
"sTarget",
")",
";",
"if",
"(",
"StringHelper",
... | On processing instruction
@param sTarget
The target
@param sData
The data (attributes as a string) | [
"On",
"processing",
"instruction"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L392-L399 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onEntityReference | public void onEntityReference (@Nonnull final String sEntityRef)
{
_append (ER_START)._append (sEntityRef)._append (ER_END);
} | java | public void onEntityReference (@Nonnull final String sEntityRef)
{
_append (ER_START)._append (sEntityRef)._append (ER_END);
} | [
"public",
"void",
"onEntityReference",
"(",
"@",
"Nonnull",
"final",
"String",
"sEntityRef",
")",
"{",
"_append",
"(",
"ER_START",
")",
".",
"_append",
"(",
"sEntityRef",
")",
".",
"_append",
"(",
"ER_END",
")",
";",
"}"
] | On entity reference.
@param sEntityRef
The reference (without '&' and ';' !!) | [
"On",
"entity",
"reference",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L407-L410 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onContentElementWhitespace | public void onContentElementWhitespace (@Nullable final CharSequence aWhitespaces)
{
if (StringHelper.hasText (aWhitespaces))
_append (aWhitespaces.toString ());
} | java | public void onContentElementWhitespace (@Nullable final CharSequence aWhitespaces)
{
if (StringHelper.hasText (aWhitespaces))
_append (aWhitespaces.toString ());
} | [
"public",
"void",
"onContentElementWhitespace",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"aWhitespaces",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasText",
"(",
"aWhitespaces",
")",
")",
"_append",
"(",
"aWhitespaces",
".",
"toString",
"(",
")",
")",
"... | Ignorable whitespace characters.
@param aWhitespaces
The whitespace character sequence | [
"Ignorable",
"whitespace",
"characters",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L418-L422 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onComment | public void onComment (@Nullable final String sComment)
{
if (StringHelper.hasText (sComment))
{
if (isThrowExceptionOnNestedComments ())
if (sComment.contains (COMMENT_START) || sComment.contains (COMMENT_END))
throw new IllegalArgumentException ("XML comment contains nested XML comme... | java | public void onComment (@Nullable final String sComment)
{
if (StringHelper.hasText (sComment))
{
if (isThrowExceptionOnNestedComments ())
if (sComment.contains (COMMENT_START) || sComment.contains (COMMENT_END))
throw new IllegalArgumentException ("XML comment contains nested XML comme... | [
"public",
"void",
"onComment",
"(",
"@",
"Nullable",
"final",
"String",
"sComment",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasText",
"(",
"sComment",
")",
")",
"{",
"if",
"(",
"isThrowExceptionOnNestedComments",
"(",
")",
")",
"if",
"(",
"sComment",
".... | Comment node.
@param sComment
The comment text | [
"Comment",
"node",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L430-L440 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onText | public void onText (@Nonnull final char [] aText, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
onText (aText, nOfs, nLen, true);
} | java | public void onText (@Nonnull final char [] aText, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
onText (aText, nOfs, nLen, true);
} | [
"public",
"void",
"onText",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aText",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen",
")",
"{",
"onText",
"(",
"aText",
",",
"nOfs",
",",
"nLen",
",",
"t... | XML text node.
@param aText
The contained text array
@param nOfs
Offset into the array where to start
@param nLen
Number of chars to use, starting from the provided offset. | [
"XML",
"text",
"node",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L463-L466 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onCDATA | public void onCDATA (@Nullable final String sText)
{
if (StringHelper.hasText (sText))
{
if (sText.indexOf (CDATA_END) >= 0)
{
// Split CDATA sections if they contain the illegal "]]>" marker
final ICommonsList <String> aParts = StringHelper.getExploded (CDATA_END, sText);
... | java | public void onCDATA (@Nullable final String sText)
{
if (StringHelper.hasText (sText))
{
if (sText.indexOf (CDATA_END) >= 0)
{
// Split CDATA sections if they contain the illegal "]]>" marker
final ICommonsList <String> aParts = StringHelper.getExploded (CDATA_END, sText);
... | [
"public",
"void",
"onCDATA",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasText",
"(",
"sText",
")",
")",
"{",
"if",
"(",
"sText",
".",
"indexOf",
"(",
"CDATA_END",
")",
">=",
"0",
")",
"{",
"// Split... | CDATA node.
@param sText
The contained text | [
"CDATA",
"node",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L517-L543 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onElementStart | public void onElementStart (@Nullable final String sNamespacePrefix,
@Nonnull final String sTagName,
@Nullable final Map <QName, String> aAttrs,
@Nonnull final EXMLSerializeBracketMode eBracketMode)
{
elementStartOpen (sName... | java | public void onElementStart (@Nullable final String sNamespacePrefix,
@Nonnull final String sTagName,
@Nullable final Map <QName, String> aAttrs,
@Nonnull final EXMLSerializeBracketMode eBracketMode)
{
elementStartOpen (sName... | [
"public",
"void",
"onElementStart",
"(",
"@",
"Nullable",
"final",
"String",
"sNamespacePrefix",
",",
"@",
"Nonnull",
"final",
"String",
"sTagName",
",",
"@",
"Nullable",
"final",
"Map",
"<",
"QName",
",",
"String",
">",
"aAttrs",
",",
"@",
"Nonnull",
"final... | Start of an element.
@param sNamespacePrefix
Optional namespace prefix. May be <code>null</code>.
@param sTagName
Tag name
@param aAttrs
Optional set of attributes.
@param eBracketMode
Bracket mode to use. Never <code>null</code>. | [
"Start",
"of",
"an",
"element",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L596-L645 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onElementEnd | public void onElementEnd (@Nullable final String sNamespacePrefix,
@Nonnull final String sTagName,
@Nonnull final EXMLSerializeBracketMode eBracketMode)
{
if (eBracketMode.isOpenClose ())
{
_append ("</");
if (StringHelper.hasText (sNamespace... | java | public void onElementEnd (@Nullable final String sNamespacePrefix,
@Nonnull final String sTagName,
@Nonnull final EXMLSerializeBracketMode eBracketMode)
{
if (eBracketMode.isOpenClose ())
{
_append ("</");
if (StringHelper.hasText (sNamespace... | [
"public",
"void",
"onElementEnd",
"(",
"@",
"Nullable",
"final",
"String",
"sNamespacePrefix",
",",
"@",
"Nonnull",
"final",
"String",
"sTagName",
",",
"@",
"Nonnull",
"final",
"EXMLSerializeBracketMode",
"eBracketMode",
")",
"{",
"if",
"(",
"eBracketMode",
".",
... | End of an element.
@param sNamespacePrefix
Optional namespace prefix. May be <code>null</code>.
@param sTagName
Tag name
@param eBracketMode
Bracket mode to use. Never <code>null</code>. | [
"End",
"of",
"an",
"element",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L657-L668 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java | TypeConverterRegistry._registerTypeConverter | private void _registerTypeConverter (@Nonnull final Class <?> aSrcClass,
@Nonnull final Class <?> aDstClass,
@Nonnull final ITypeConverter <?, ?> aConverter)
{
ValueEnforcer.notNull (aSrcClass, "SrcClass");
ValueEnforcer.isTrue (Cla... | java | private void _registerTypeConverter (@Nonnull final Class <?> aSrcClass,
@Nonnull final Class <?> aDstClass,
@Nonnull final ITypeConverter <?, ?> aConverter)
{
ValueEnforcer.notNull (aSrcClass, "SrcClass");
ValueEnforcer.isTrue (Cla... | [
"private",
"void",
"_registerTypeConverter",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
">",
"aSrcClass",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
">",
"aDstClass",
",",
"@",
"Nonnull",
"final",
"ITypeConverter",
"<",
"?",
",",
"?",
">",
"a... | Register a default type converter.
@param aSrcClass
A non-<code>null</code> source class to convert from. Must be an
instancable class.
@param aDstClass
A non-<code>null</code> destination class to convert to. Must be an
instancable class. May not equal the source class.
@param aConverter
The convert to use. May not b... | [
"Register",
"a",
"default",
"type",
"converter",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java#L122-L174 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java | TypeConverterRegistry._iterateFuzzyConverters | private void _iterateFuzzyConverters (@Nonnull final Class <?> aSrcClass,
@Nonnull final Class <?> aDstClass,
@Nonnull final ITypeConverterCallback aCallback)
{
// For all possible source classes
for (final WeakReference <Class <?... | java | private void _iterateFuzzyConverters (@Nonnull final Class <?> aSrcClass,
@Nonnull final Class <?> aDstClass,
@Nonnull final ITypeConverterCallback aCallback)
{
// For all possible source classes
for (final WeakReference <Class <?... | [
"private",
"void",
"_iterateFuzzyConverters",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
">",
"aSrcClass",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
">",
"aDstClass",
",",
"@",
"Nonnull",
"final",
"ITypeConverterCallback",
"aCallback",
")",
"{",
... | Iterate all possible fuzzy converters from source class to destination
class.
@param aSrcClass
Source class.
@param aDstClass
Destination class.
@param aCallback
The callback to be invoked once a converter was found. Must return
either {@link EContinue#CONTINUE} to continue iteration or
{@link EContinue#BREAK} to brea... | [
"Iterate",
"all",
"possible",
"fuzzy",
"converters",
"from",
"source",
"class",
"to",
"destination",
"class",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java#L252-L277 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java | TypeConverterRegistry.iterateAllRegisteredTypeConverters | public void iterateAllRegisteredTypeConverters (@Nonnull final ITypeConverterCallback aCallback)
{
// Create a copy of the map
final Map <Class <?>, Map <Class <?>, ITypeConverter <?, ?>>> aCopy = m_aRWLock.readLocked ( () -> new CommonsHashMap <> (m_aConverter));
// And iterate the copy
outer: for (... | java | public void iterateAllRegisteredTypeConverters (@Nonnull final ITypeConverterCallback aCallback)
{
// Create a copy of the map
final Map <Class <?>, Map <Class <?>, ITypeConverter <?, ?>>> aCopy = m_aRWLock.readLocked ( () -> new CommonsHashMap <> (m_aConverter));
// And iterate the copy
outer: for (... | [
"public",
"void",
"iterateAllRegisteredTypeConverters",
"(",
"@",
"Nonnull",
"final",
"ITypeConverterCallback",
"aCallback",
")",
"{",
"// Create a copy of the map",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"ITyp... | Iterate all registered type converters. For informational purposes only.
@param aCallback
The callback invoked for all iterations. | [
"Iterate",
"all",
"registered",
"type",
"converters",
".",
"For",
"informational",
"purposes",
"only",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverterRegistry.java#L334-L347 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java | GenericReflection.getClassArray | @Nonnull
public static Class <?> [] getClassArray (@Nullable final Object... aObjs)
{
if (ArrayHelper.isEmpty (aObjs))
return EMPTY_CLASS_ARRAY;
final Class <?> [] ret = new Class <?> [aObjs.length];
for (int i = 0; i < aObjs.length; ++i)
ret[i] = aObjs[i].getClass ();
return ret;
} | java | @Nonnull
public static Class <?> [] getClassArray (@Nullable final Object... aObjs)
{
if (ArrayHelper.isEmpty (aObjs))
return EMPTY_CLASS_ARRAY;
final Class <?> [] ret = new Class <?> [aObjs.length];
for (int i = 0; i < aObjs.length; ++i)
ret[i] = aObjs[i].getClass ();
return ret;
} | [
"@",
"Nonnull",
"public",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"getClassArray",
"(",
"@",
"Nullable",
"final",
"Object",
"...",
"aObjs",
")",
"{",
"if",
"(",
"ArrayHelper",
".",
"isEmpty",
"(",
"aObjs",
")",
")",
"return",
"EMPTY_CLASS_ARRAY",
";"... | Get an array with all the classes of the passed object array.
@param aObjs
The object array. May be <code>null</code>. No contained element may
be <code>null</code>.
@return A non-<code>null</code> array of classes. | [
"Get",
"an",
"array",
"with",
"all",
"the",
"classes",
"of",
"the",
"passed",
"object",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java#L129-L139 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java | GenericReflection.invokeMethod | @Nullable
public static <RETURNTYPE> RETURNTYPE invokeMethod (@Nonnull final Object aSrcObj,
@Nonnull final String sMethodName,
@Nullable final Object... aArgs) throws NoSuchMethodException,
... | java | @Nullable
public static <RETURNTYPE> RETURNTYPE invokeMethod (@Nonnull final Object aSrcObj,
@Nonnull final String sMethodName,
@Nullable final Object... aArgs) throws NoSuchMethodException,
... | [
"@",
"Nullable",
"public",
"static",
"<",
"RETURNTYPE",
">",
"RETURNTYPE",
"invokeMethod",
"(",
"@",
"Nonnull",
"final",
"Object",
"aSrcObj",
",",
"@",
"Nonnull",
"final",
"String",
"sMethodName",
",",
"@",
"Nullable",
"final",
"Object",
"...",
"aArgs",
")",
... | This method dynamically invokes the method with the given name on the given
object.
@param <RETURNTYPE>
The method return type
@param aSrcObj
The source object on which the method is to be invoked. May not be
<code>null</code>.
@param sMethodName
The method to be invoked.
@param aArgs
The arguments to be passed into t... | [
"This",
"method",
"dynamically",
"invokes",
"the",
"method",
"with",
"the",
"given",
"name",
"on",
"the",
"given",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java#L166-L174 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java | GenericReflection.newInstance | @Nonnull
public static <DATATYPE> DATATYPE newInstance (@Nonnull final DATATYPE aObj) throws IllegalAccessException,
NoSuchMethodException,
InvocationTargetExce... | java | @Nonnull
public static <DATATYPE> DATATYPE newInstance (@Nonnull final DATATYPE aObj) throws IllegalAccessException,
NoSuchMethodException,
InvocationTargetExce... | [
"@",
"Nonnull",
"public",
"static",
"<",
"DATATYPE",
">",
"DATATYPE",
"newInstance",
"(",
"@",
"Nonnull",
"final",
"DATATYPE",
"aObj",
")",
"throws",
"IllegalAccessException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"InstantiationException",... | Create a new instance of the class identified by the passed object. The
default constructor will be invoked.
@param <DATATYPE>
The type of object to be created.
@param aObj
The object from which the class should be used.
@return A new instance of the object or an exception is thrown.
@throws IllegalAccessException
Ref... | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"class",
"identified",
"by",
"the",
"passed",
"object",
".",
"The",
"default",
"constructor",
"will",
"be",
"invoked",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/GenericReflection.java#L263-L270 | train |
phax/ph-commons | ph-scopes/src/main/java/com/helger/scope/singleton/AbstractRequestSingleton.java | AbstractRequestSingleton.getRequestSingleton | @Nonnull
public static final <T extends AbstractRequestSingleton> T getRequestSingleton (@Nonnull final Class <T> aClass)
{
return getSingleton (_getStaticScope (true), aClass);
} | java | @Nonnull
public static final <T extends AbstractRequestSingleton> T getRequestSingleton (@Nonnull final Class <T> aClass)
{
return getSingleton (_getStaticScope (true), aClass);
} | [
"@",
"Nonnull",
"public",
"static",
"final",
"<",
"T",
"extends",
"AbstractRequestSingleton",
">",
"T",
"getRequestSingleton",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aClass",
")",
"{",
"return",
"getSingleton",
"(",
"_getStaticScope",
"(",
"tru... | Get the singleton object in the current request scope, using the passed
class. If the singleton is not yet instantiated, a new instance is created.
@param <T>
The type to be returned
@param aClass
The class to be used. May not be <code>null</code>. The class must
be public as needs to have a public no-argument constru... | [
"Get",
"the",
"singleton",
"object",
"in",
"the",
"current",
"request",
"scope",
"using",
"the",
"passed",
"class",
".",
"If",
"the",
"singleton",
"is",
"not",
"yet",
"instantiated",
"a",
"new",
"instance",
"is",
"created",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-scopes/src/main/java/com/helger/scope/singleton/AbstractRequestSingleton.java#L63-L67 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java | ClassPathHelper.forAllClassPathEntries | public static void forAllClassPathEntries (@Nonnull final Consumer <? super String> aConsumer)
{
StringHelper.explode (SystemProperties.getPathSeparator (), SystemProperties.getJavaClassPath (), aConsumer);
} | java | public static void forAllClassPathEntries (@Nonnull final Consumer <? super String> aConsumer)
{
StringHelper.explode (SystemProperties.getPathSeparator (), SystemProperties.getJavaClassPath (), aConsumer);
} | [
"public",
"static",
"void",
"forAllClassPathEntries",
"(",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"String",
">",
"aConsumer",
")",
"{",
"StringHelper",
".",
"explode",
"(",
"SystemProperties",
".",
"getPathSeparator",
"(",
")",
",",
"SystemPrope... | Add all class path entries into the provided target list.
@param aConsumer
The target consumer invoked for all entries. May not be
<code>null</code>. | [
"Add",
"all",
"class",
"path",
"entries",
"into",
"the",
"provided",
"target",
"list",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java#L67-L70 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java | ClassPathHelper.printClassPathEntries | public static void printClassPathEntries (@Nonnull final PrintStream aPS, @Nonnull final String sItemSeparator)
{
forAllClassPathEntries (x -> {
aPS.print (x);
aPS.print (sItemSeparator);
});
} | java | public static void printClassPathEntries (@Nonnull final PrintStream aPS, @Nonnull final String sItemSeparator)
{
forAllClassPathEntries (x -> {
aPS.print (x);
aPS.print (sItemSeparator);
});
} | [
"public",
"static",
"void",
"printClassPathEntries",
"(",
"@",
"Nonnull",
"final",
"PrintStream",
"aPS",
",",
"@",
"Nonnull",
"final",
"String",
"sItemSeparator",
")",
"{",
"forAllClassPathEntries",
"(",
"x",
"->",
"{",
"aPS",
".",
"print",
"(",
"x",
")",
";... | Print all class path entries on the passed print stream, using the passed
separator
@param aPS
The print stream to print to. May not be <code>null</code>.
@param sItemSeparator
The separator to be printed between each item. | [
"Print",
"all",
"class",
"path",
"entries",
"on",
"the",
"passed",
"print",
"stream",
"using",
"the",
"passed",
"separator"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ClassPathHelper.java#L93-L99 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.writeToStream | @Nonnull
public static ESuccess writeToStream (@Nonnull final IMicroNode aNode, @Nonnull @WillClose final OutputStream aOS)
{
return writeToStream (aNode, aOS, XMLWriterSettings.DEFAULT_XML_SETTINGS);
} | java | @Nonnull
public static ESuccess writeToStream (@Nonnull final IMicroNode aNode, @Nonnull @WillClose final OutputStream aOS)
{
return writeToStream (aNode, aOS, XMLWriterSettings.DEFAULT_XML_SETTINGS);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeToStream",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"OutputStream",
"aOS",
")",
"{",
"return",
"writeToStream",
"(",
"aNode",
",",
"aOS",
",",
"... | Write a Micro Node to an output stream using the default settings.
@param aNode
The node to be serialized. May be any kind of node (incl.
documents). May not be <code>null</code>.
@param aOS
The output stream to write to. May not be <code>null</code>. The
output stream is closed anyway directly after the operation fin... | [
"Write",
"a",
"Micro",
"Node",
"to",
"an",
"output",
"stream",
"using",
"the",
"default",
"settings",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L155-L159 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.getNodeAsString | @Nullable
public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aNode, "Node");
ValueEnforcer.notNull (aSettings, "Settings");
try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BY... | java | @Nullable
public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aNode, "Node");
ValueEnforcer.notNull (aSettings, "Settings");
try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BY... | [
"@",
"Nullable",
"public",
"static",
"String",
"getNodeAsString",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"IXMLWriterSettings",
"aSettings",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aNode",
",",
"\"Node\"",
")",... | Convert the passed micro node to an XML string using the provided settings.
@param aNode
The node to be converted to a string. May not be <code>null</code> .
@param aSettings
The XML writer settings to use. May not be <code>null</code>.
@return The string representation of the passed node. | [
"Convert",
"the",
"passed",
"micro",
"node",
"to",
"an",
"XML",
"string",
"using",
"the",
"provided",
"settings",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L262-L280 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.getNodeAsBytes | @Nullable
public static byte [] getNodeAsBytes (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aNode, "Node");
ValueEnforcer.notNull (aSettings, "Settings");
try (
final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutp... | java | @Nullable
public static byte [] getNodeAsBytes (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aNode, "Node");
ValueEnforcer.notNull (aSettings, "Settings");
try (
final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutp... | [
"@",
"Nullable",
"public",
"static",
"byte",
"[",
"]",
"getNodeAsBytes",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"IXMLWriterSettings",
"aSettings",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aNode",
",",
"\"Node... | Convert the passed micro node to an XML byte array using the provided
settings.
@param aNode
The node to be converted to a byte array. May not be
<code>null</code> .
@param aSettings
The XML writer settings to use. May not be <code>null</code>.
@return The byte array representation of the passed node.
@since 8.6.3 | [
"Convert",
"the",
"passed",
"micro",
"node",
"to",
"an",
"XML",
"byte",
"array",
"using",
"the",
"provided",
"settings",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L310-L330 | train |
phax/ph-commons | ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java | TreeWithIDSorter.sortByID | public static <KEYTYPE, DATATYPE, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByID (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree,
@Nonnull final Comparator <? super KEY... | java | public static <KEYTYPE, DATATYPE, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByID (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree,
@Nonnull final Comparator <? super KEY... | [
"public",
"static",
"<",
"KEYTYPE",
",",
"DATATYPE",
",",
"ITEMTYPE",
"extends",
"ITreeItemWithID",
"<",
"KEYTYPE",
",",
"DATATYPE",
",",
"ITEMTYPE",
">",
">",
"void",
"sortByID",
"(",
"@",
"Nonnull",
"final",
"IBasicTree",
"<",
"DATATYPE",
",",
"ITEMTYPE",
... | Sort each level of the passed tree on the ID with the specified comparator.
@param <KEYTYPE>
Tree item key type
@param <DATATYPE>
Tree item data type
@param <ITEMTYPE>
Tree item type
@param aTree
The tree to be sorted.
@param aKeyComparator
The comparator to be used for sorting the tree item keys on each
level. | [
"Sort",
"each",
"level",
"of",
"the",
"passed",
"tree",
"on",
"the",
"ID",
"with",
"the",
"specified",
"comparator",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java#L87-L91 | train |
phax/ph-commons | ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java | TreeWithIDSorter.sortByValue | public static <KEYTYPE, DATATYPE, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByValue (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree,
@Nonnull final Comparator <? sup... | java | public static <KEYTYPE, DATATYPE, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByValue (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree,
@Nonnull final Comparator <? sup... | [
"public",
"static",
"<",
"KEYTYPE",
",",
"DATATYPE",
",",
"ITEMTYPE",
"extends",
"ITreeItemWithID",
"<",
"KEYTYPE",
",",
"DATATYPE",
",",
"ITEMTYPE",
">",
">",
"void",
"sortByValue",
"(",
"@",
"Nonnull",
"final",
"IBasicTree",
"<",
"DATATYPE",
",",
"ITEMTYPE",... | Sort each level of the passed tree on the value with the specified
comparator.
@param <KEYTYPE>
Tree item key type
@param <DATATYPE>
Tree item data type
@param <ITEMTYPE>
Tree item type
@param aTree
The tree to be sorted.
@param aValueComparator
The comparator to be used for sorting the tree item keys on each
level. | [
"Sort",
"each",
"level",
"of",
"the",
"passed",
"tree",
"on",
"the",
"value",
"with",
"the",
"specified",
"comparator",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java#L128-L132 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java | StopWatch.start | @Nonnull
public final EChange start ()
{
// Already started?
if (m_nStartDT > 0)
return EChange.UNCHANGED;
m_nStartDT = getCurrentNanoTime ();
return EChange.CHANGED;
} | java | @Nonnull
public final EChange start ()
{
// Already started?
if (m_nStartDT > 0)
return EChange.UNCHANGED;
m_nStartDT = getCurrentNanoTime ();
return EChange.CHANGED;
} | [
"@",
"Nonnull",
"public",
"final",
"EChange",
"start",
"(",
")",
"{",
"// Already started?",
"if",
"(",
"m_nStartDT",
">",
"0",
")",
"return",
"EChange",
".",
"UNCHANGED",
";",
"m_nStartDT",
"=",
"getCurrentNanoTime",
"(",
")",
";",
"return",
"EChange",
".",... | Start the stop watch.
@return {@link EChange}. | [
"Start",
"the",
"stop",
"watch",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java#L86-L94 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java | StopWatch.stop | @Nonnull
public EChange stop ()
{
// Already stopped?
if (m_nStartDT == 0)
return EChange.UNCHANGED;
final long nCurrentNanoTime = getCurrentNanoTime ();
m_nDurationNanos += (nCurrentNanoTime - m_nStartDT);
m_nStartDT = 0;
return EChange.CHANGED;
} | java | @Nonnull
public EChange stop ()
{
// Already stopped?
if (m_nStartDT == 0)
return EChange.UNCHANGED;
final long nCurrentNanoTime = getCurrentNanoTime ();
m_nDurationNanos += (nCurrentNanoTime - m_nStartDT);
m_nStartDT = 0;
return EChange.CHANGED;
} | [
"@",
"Nonnull",
"public",
"EChange",
"stop",
"(",
")",
"{",
"// Already stopped?",
"if",
"(",
"m_nStartDT",
"==",
"0",
")",
"return",
"EChange",
".",
"UNCHANGED",
";",
"final",
"long",
"nCurrentNanoTime",
"=",
"getCurrentNanoTime",
"(",
")",
";",
"m_nDurationN... | Stop the stop watch.
@return {@link EChange#CHANGED} if the stop watch was previously running
and is now stopped, and {@link EChange#UNCHANGED} if the stop watch
was already stopped. | [
"Stop",
"the",
"stop",
"watch",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java#L103-L114 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java | StopWatch.runMeasured | @Nonnull
public static TimeValue runMeasured (@Nonnull final Runnable aRunnable)
{
final StopWatch aSW = createdStarted ();
aRunnable.run ();
final long nNanos = aSW.stopAndGetNanos ();
return new TimeValue (TimeUnit.NANOSECONDS, nNanos);
} | java | @Nonnull
public static TimeValue runMeasured (@Nonnull final Runnable aRunnable)
{
final StopWatch aSW = createdStarted ();
aRunnable.run ();
final long nNanos = aSW.stopAndGetNanos ();
return new TimeValue (TimeUnit.NANOSECONDS, nNanos);
} | [
"@",
"Nonnull",
"public",
"static",
"TimeValue",
"runMeasured",
"(",
"@",
"Nonnull",
"final",
"Runnable",
"aRunnable",
")",
"{",
"final",
"StopWatch",
"aSW",
"=",
"createdStarted",
"(",
")",
";",
"aRunnable",
".",
"run",
"(",
")",
";",
"final",
"long",
"nN... | Run the passed runnable and measure the time.
@param aRunnable
The runnable to be executed. May not be <code>null</code>.
@return The elapsed time. Never <code>null</code>. | [
"Run",
"the",
"passed",
"runnable",
"and",
"measure",
"the",
"time",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/timing/StopWatch.java#L274-L281 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/error/ErrorTextProvider.java | ErrorTextProvider.addItem | @Nonnull
public ErrorTextProvider addItem (@Nonnull final EField eField, @Nonnull @Nonempty final String sText)
{
return addItem (new FormattableItem (eField, sText));
} | java | @Nonnull
public ErrorTextProvider addItem (@Nonnull final EField eField, @Nonnull @Nonempty final String sText)
{
return addItem (new FormattableItem (eField, sText));
} | [
"@",
"Nonnull",
"public",
"ErrorTextProvider",
"addItem",
"(",
"@",
"Nonnull",
"final",
"EField",
"eField",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sText",
")",
"{",
"return",
"addItem",
"(",
"new",
"FormattableItem",
"(",
"eField",
",",
"s... | Add an error item to be disabled.
@param eField
The field to be used. May not be <code>null</code>.
@param sText
The text that should contain the placeholder ({@value #PLACEHOLDER})
that will be replaced
@return this for chaining | [
"Add",
"an",
"error",
"item",
"to",
"be",
"disabled",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/error/ErrorTextProvider.java#L205-L209 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/version/Version.java | Version.compareTo | public int compareTo (@Nonnull final Version rhs)
{
ValueEnforcer.notNull (rhs, "Rhs");
// compare major version
int ret = m_nMajor - rhs.m_nMajor;
if (ret == 0)
{
// compare minor version
ret = m_nMinor - rhs.m_nMinor;
if (ret == 0)
{
// compare micro version
... | java | public int compareTo (@Nonnull final Version rhs)
{
ValueEnforcer.notNull (rhs, "Rhs");
// compare major version
int ret = m_nMajor - rhs.m_nMajor;
if (ret == 0)
{
// compare minor version
ret = m_nMinor - rhs.m_nMinor;
if (ret == 0)
{
// compare micro version
... | [
"public",
"int",
"compareTo",
"(",
"@",
"Nonnull",
"final",
"Version",
"rhs",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"rhs",
",",
"\"Rhs\"",
")",
";",
"// compare major version",
"int",
"ret",
"=",
"m_nMajor",
"-",
"rhs",
".",
"m_nMajor",
";",
"if"... | Compares two Version objects.
@param rhs
the version to compare to
@return < 0 if this is less than rhs; > 0 if this is greater than
rhs, and 0 if they are equal.
@throws IllegalArgumentException
if the parameter is null | [
"Compares",
"two",
"Version",
"objects",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/version/Version.java#L176-L224 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/version/Version.java | Version.getAsString | @Nonnull
public String getAsString (final boolean bPrintZeroElements, final boolean bPrintAtLeastMajorAndMinor)
{
// Build from back to front
final StringBuilder aSB = new StringBuilder (m_sQualifier != null ? m_sQualifier : "");
if (m_nMicro > 0 || aSB.length () > 0 || bPrintZeroElements)
{
/... | java | @Nonnull
public String getAsString (final boolean bPrintZeroElements, final boolean bPrintAtLeastMajorAndMinor)
{
// Build from back to front
final StringBuilder aSB = new StringBuilder (m_sQualifier != null ? m_sQualifier : "");
if (m_nMicro > 0 || aSB.length () > 0 || bPrintZeroElements)
{
/... | [
"@",
"Nonnull",
"public",
"String",
"getAsString",
"(",
"final",
"boolean",
"bPrintZeroElements",
",",
"final",
"boolean",
"bPrintAtLeastMajorAndMinor",
")",
"{",
"// Build from back to front",
"final",
"StringBuilder",
"aSB",
"=",
"new",
"StringBuilder",
"(",
"m_sQuali... | Get the string representation of the version number.
@param bPrintZeroElements
If <code>true</code> than trailing zeroes are printed, otherwise
printed zeroes are not printed.
@param bPrintAtLeastMajorAndMinor
<code>true</code> if major and minor part should always be printed,
independent of their value
@return Never ... | [
"Get",
"the",
"string",
"representation",
"of",
"the",
"version",
"number",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/version/Version.java#L257-L284 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/version/Version.java | Version.parse | @Nonnull
public static Version parse (@Nullable final String sVersionString, final boolean bOldVersion)
{
final String s = sVersionString == null ? "" : sVersionString.trim ();
if (s.length () == 0)
return DEFAULT_VERSION;
int nMajor;
int nMinor;
int nMicro;
String sQualifier;
if... | java | @Nonnull
public static Version parse (@Nullable final String sVersionString, final boolean bOldVersion)
{
final String s = sVersionString == null ? "" : sVersionString.trim ();
if (s.length () == 0)
return DEFAULT_VERSION;
int nMajor;
int nMinor;
int nMicro;
String sQualifier;
if... | [
"@",
"Nonnull",
"public",
"static",
"Version",
"parse",
"(",
"@",
"Nullable",
"final",
"String",
"sVersionString",
",",
"final",
"boolean",
"bOldVersion",
")",
"{",
"final",
"String",
"s",
"=",
"sVersionString",
"==",
"null",
"?",
"\"\"",
":",
"sVersionString"... | Construct a version object from a string.
@param sVersionString
the version string to be interpreted as a version
@param bOldVersion
<code>true</code> to use the old version to parse a string, meaning
splitting only by dot; or <code>false</code> to indicate that the
more complex parsing should be used.
@return The par... | [
"Construct",
"a",
"version",
"object",
"from",
"a",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/version/Version.java#L410-L506 | train |
phax/ph-commons | ph-cli/src/main/java/com/helger/cli/HelpFormatter.java | HelpFormatter._appendOptionGroup | private void _appendOptionGroup (final StringBuilder aSB, final OptionGroup aGroup)
{
if (!aGroup.isRequired ())
aSB.append ('[');
final ICommonsList <Option> optList = aGroup.getAllOptions ();
if (m_aOptionComparator != null)
optList.sort (m_aOptionComparator);
// for each option in the... | java | private void _appendOptionGroup (final StringBuilder aSB, final OptionGroup aGroup)
{
if (!aGroup.isRequired ())
aSB.append ('[');
final ICommonsList <Option> optList = aGroup.getAllOptions ();
if (m_aOptionComparator != null)
optList.sort (m_aOptionComparator);
// for each option in the... | [
"private",
"void",
"_appendOptionGroup",
"(",
"final",
"StringBuilder",
"aSB",
",",
"final",
"OptionGroup",
"aGroup",
")",
"{",
"if",
"(",
"!",
"aGroup",
".",
"isRequired",
"(",
")",
")",
"aSB",
".",
"append",
"(",
"'",
"'",
")",
";",
"final",
"ICommonsL... | Appends the usage clause for an OptionGroup to a StringBuilder. The clause
is wrapped in square brackets if the group is required. The display of the
options is handled by appendOption
@param aSB
the StringBuilder to append to
@param aGroup
the group to append
@see #_appendOption(StringBuilder,Option,boolean) | [
"Appends",
"the",
"usage",
"clause",
"for",
"an",
"OptionGroup",
"to",
"a",
"StringBuilder",
".",
"The",
"clause",
"is",
"wrapped",
"in",
"square",
"brackets",
"if",
"the",
"group",
"is",
"required",
".",
"The",
"display",
"of",
"the",
"options",
"is",
"ha... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-cli/src/main/java/com/helger/cli/HelpFormatter.java#L688-L710 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.