id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
32,400
mikepenz/FastAdapter
app/src/main/java/com/mikepenz/fastadapter/app/items/RealmSampleUserItem.java
RealmSampleUserItem.generateView
@Override public View generateView(Context ctx, ViewGroup parent) { ViewHolder viewHolder = getViewHolder(LayoutInflater.from(ctx).inflate(getLayoutRes(), parent, false)); //as we already know the type of our ViewHolder cast it to our type bindView(viewHolder, Collections.EMPTY_LIST); ...
java
@Override public View generateView(Context ctx, ViewGroup parent) { ViewHolder viewHolder = getViewHolder(LayoutInflater.from(ctx).inflate(getLayoutRes(), parent, false)); //as we already know the type of our ViewHolder cast it to our type bindView(viewHolder, Collections.EMPTY_LIST); ...
[ "@", "Override", "public", "View", "generateView", "(", "Context", "ctx", ",", "ViewGroup", "parent", ")", "{", "ViewHolder", "viewHolder", "=", "getViewHolder", "(", "LayoutInflater", ".", "from", "(", "ctx", ")", ".", "inflate", "(", "getLayoutRes", "(", "...
generates a view by the defined LayoutRes and pass the LayoutParams from the parent @param ctx @param parent @return
[ "generates", "a", "view", "by", "the", "defined", "LayoutRes", "and", "pass", "the", "LayoutParams", "from", "the", "parent" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/RealmSampleUserItem.java#L202-L210
32,401
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java
ActionModeHelper.onClick
public Boolean onClick(AppCompatActivity act, IItem item) { //if we are current in CAB mode, and we remove the last selection, we want to finish the actionMode if (mActionMode != null && (mSelectExtension.getSelectedItems().size() == 1) && item.isSelected()) { mActionMode.finish(); ...
java
public Boolean onClick(AppCompatActivity act, IItem item) { //if we are current in CAB mode, and we remove the last selection, we want to finish the actionMode if (mActionMode != null && (mSelectExtension.getSelectedItems().size() == 1) && item.isSelected()) { mActionMode.finish(); ...
[ "public", "Boolean", "onClick", "(", "AppCompatActivity", "act", ",", "IItem", "item", ")", "{", "//if we are current in CAB mode, and we remove the last selection, we want to finish the actionMode", "if", "(", "mActionMode", "!=", "null", "&&", "(", "mSelectExtension", ".", ...
implements the basic behavior of a CAB and multi select behavior, including logics if the clicked item is collapsible @param act the current Activity @param item the current item @return null if nothing was done, or a boolean to inform if the event was consumed
[ "implements", "the", "basic", "behavior", "of", "a", "CAB", "and", "multi", "select", "behavior", "including", "logics", "if", "the", "clicked", "item", "is", "collapsible" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L117-L137
32,402
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java
ActionModeHelper.onLongClick
public ActionMode onLongClick(AppCompatActivity act, int position) { if (mActionMode == null && mFastAdapter.getItem(position).isSelectable()) { //may check if actionMode is already displayed mActionMode = act.startSupportActionMode(mInternalCallback); //we have to select thi...
java
public ActionMode onLongClick(AppCompatActivity act, int position) { if (mActionMode == null && mFastAdapter.getItem(position).isSelectable()) { //may check if actionMode is already displayed mActionMode = act.startSupportActionMode(mInternalCallback); //we have to select thi...
[ "public", "ActionMode", "onLongClick", "(", "AppCompatActivity", "act", ",", "int", "position", ")", "{", "if", "(", "mActionMode", "==", "null", "&&", "mFastAdapter", ".", "getItem", "(", "position", ")", ".", "isSelectable", "(", ")", ")", "{", "//may chec...
implements the basic behavior of a CAB and multi select behavior onLongClick @param act the current Activity @param position the position of the clicked item @return the initialized ActionMode or null if nothing was done
[ "implements", "the", "basic", "behavior", "of", "a", "CAB", "and", "multi", "select", "behavior", "onLongClick" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L146-L158
32,403
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java
ActionModeHelper.checkActionMode
public ActionMode checkActionMode(AppCompatActivity act) { int selected = mSelectExtension.getSelectedItems().size(); return checkActionMode(act, selected); }
java
public ActionMode checkActionMode(AppCompatActivity act) { int selected = mSelectExtension.getSelectedItems().size(); return checkActionMode(act, selected); }
[ "public", "ActionMode", "checkActionMode", "(", "AppCompatActivity", "act", ")", "{", "int", "selected", "=", "mSelectExtension", ".", "getSelectedItems", "(", ")", ".", "size", "(", ")", ";", "return", "checkActionMode", "(", "act", ",", "selected", ")", ";",...
check if the ActionMode should be shown or not depending on the currently selected items Additionally, it will also update the title in the CAB for you @param act the current Activity @return the initialized ActionMode or null if no ActionMode is active after calling this function
[ "check", "if", "the", "ActionMode", "should", "be", "shown", "or", "not", "depending", "on", "the", "currently", "selected", "items", "Additionally", "it", "will", "also", "update", "the", "title", "in", "the", "CAB", "for", "you" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L167-L170
32,404
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java
ActionModeHelper.updateTitle
private void updateTitle(int selected) { if (mActionMode != null) { if (mTitleProvider != null) mActionMode.setTitle(mTitleProvider.getTitle(selected)); else mActionMode.setTitle(String.valueOf(selected)); } }
java
private void updateTitle(int selected) { if (mActionMode != null) { if (mTitleProvider != null) mActionMode.setTitle(mTitleProvider.getTitle(selected)); else mActionMode.setTitle(String.valueOf(selected)); } }
[ "private", "void", "updateTitle", "(", "int", "selected", ")", "{", "if", "(", "mActionMode", "!=", "null", ")", "{", "if", "(", "mTitleProvider", "!=", "null", ")", "mActionMode", ".", "setTitle", "(", "mTitleProvider", ".", "getTitle", "(", "selected", "...
updates the title to reflect the current selected items or to show a user defined title @param selected number of selected items
[ "updates", "the", "title", "to", "reflect", "the", "current", "selected", "items", "or", "to", "show", "a", "user", "defined", "title" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L201-L208
32,405
mikepenz/FastAdapter
library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java
AdapterUtil.restoreSubItemSelectionStatesForAlternativeStateManagement
public static <Item extends IItem> void restoreSubItemSelectionStatesForAlternativeStateManagement(Item item, List<String> selectedItems) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExp...
java
public static <Item extends IItem> void restoreSubItemSelectionStatesForAlternativeStateManagement(Item item, List<String> selectedItems) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExp...
[ "public", "static", "<", "Item", "extends", "IItem", ">", "void", "restoreSubItemSelectionStatesForAlternativeStateManagement", "(", "Item", "item", ",", "List", "<", "String", ">", "selectedItems", ")", "{", "if", "(", "item", "instanceof", "IExpandable", "&&", "...
internal method to restore the selection state of subItems @param item the parent item @param selectedItems the list of selectedItems from the savedInstanceState
[ "internal", "method", "to", "restore", "the", "selection", "state", "of", "subItems" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java#L20-L32
32,406
mikepenz/FastAdapter
library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java
AdapterUtil.findSubItemSelections
public static <Item extends IItem> void findSubItemSelections(Item item, List<String> selections) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems(); ...
java
public static <Item extends IItem> void findSubItemSelections(Item item, List<String> selections) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems(); ...
[ "public", "static", "<", "Item", "extends", "IItem", ">", "void", "findSubItemSelections", "(", "Item", "item", ",", "List", "<", "String", ">", "selections", ")", "{", "if", "(", "item", "instanceof", "IExpandable", "&&", "!", "(", "(", "IExpandable", ")"...
internal method to find all selections from subItems and sub sub items so we can save those inside our savedInstanceState @param item the parent item @param selections the ArrayList which will be stored in the savedInstanceState
[ "internal", "method", "to", "find", "all", "selections", "from", "subItems", "and", "sub", "sub", "items", "so", "we", "can", "save", "those", "inside", "our", "savedInstanceState" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java#L40-L52
32,407
mikepenz/FastAdapter
library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java
AdapterUtil.addAllSubItems
public static <Item extends IItem> void addAllSubItems(Item item, List<Item> items) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems(); Ite...
java
public static <Item extends IItem> void addAllSubItems(Item item, List<Item> items) { if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) { List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems(); Ite...
[ "public", "static", "<", "Item", "extends", "IItem", ">", "void", "addAllSubItems", "(", "Item", "item", ",", "List", "<", "Item", ">", "items", ")", "{", "if", "(", "item", "instanceof", "IExpandable", "&&", "!", "(", "(", "IExpandable", ")", "item", ...
Gets all subItems from a given parent item @param item the parent from which we add all items @param items the list in which we add the subItems
[ "Gets", "all", "subItems", "from", "a", "given", "parent", "item" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java#L77-L87
32,408
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.addAdapter
public <A extends IAdapter<Item>> FastAdapter<Item> addAdapter(int index, A adapter) { mAdapters.add(index, adapter); adapter.withFastAdapter(this); adapter.mapPossibleTypes(adapter.getAdapterItems()); for (int i = 0; i < mAdapters.size(); i++) { mAdapters.get(i).setOrder(i);...
java
public <A extends IAdapter<Item>> FastAdapter<Item> addAdapter(int index, A adapter) { mAdapters.add(index, adapter); adapter.withFastAdapter(this); adapter.mapPossibleTypes(adapter.getAdapterItems()); for (int i = 0; i < mAdapters.size(); i++) { mAdapters.get(i).setOrder(i);...
[ "public", "<", "A", "extends", "IAdapter", "<", "Item", ">", ">", "FastAdapter", "<", "Item", ">", "addAdapter", "(", "int", "index", ",", "A", "adapter", ")", "{", "mAdapters", ".", "add", "(", "index", ",", "adapter", ")", ";", "adapter", ".", "wit...
add's a new adapter at the specific position @param index the index where the new adapter should be added @param adapter the new adapter to be added @return this
[ "add", "s", "a", "new", "adapter", "at", "the", "specific", "position" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L202-L211
32,409
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.adapter
@Nullable public IAdapter<Item> adapter(int order) { if (mAdapters.size() <= order) { return null; } return mAdapters.get(order); }
java
@Nullable public IAdapter<Item> adapter(int order) { if (mAdapters.size() <= order) { return null; } return mAdapters.get(order); }
[ "@", "Nullable", "public", "IAdapter", "<", "Item", ">", "adapter", "(", "int", "order", ")", "{", "if", "(", "mAdapters", ".", "size", "(", ")", "<=", "order", ")", "{", "return", "null", ";", "}", "return", "mAdapters", ".", "get", "(", "order", ...
Tries to get an adapter by a specific order @param order the order (position) to search the adapter at @return the IAdapter if found
[ "Tries", "to", "get", "an", "adapter", "by", "a", "specific", "order" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L219-L225
32,410
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.withSelectable
public FastAdapter<Item> withSelectable(boolean selectable) { if (selectable) { addExtension(mSelectExtension); } else { mExtensions.remove(mSelectExtension.getClass()); } //TODO revisit this --> false means anyways that it is not in the extension list! mS...
java
public FastAdapter<Item> withSelectable(boolean selectable) { if (selectable) { addExtension(mSelectExtension); } else { mExtensions.remove(mSelectExtension.getClass()); } //TODO revisit this --> false means anyways that it is not in the extension list! mS...
[ "public", "FastAdapter", "<", "Item", ">", "withSelectable", "(", "boolean", "selectable", ")", "{", "if", "(", "selectable", ")", "{", "addExtension", "(", "mSelectExtension", ")", ";", "}", "else", "{", "mExtensions", ".", "remove", "(", "mSelectExtension", ...
Set to true if you want the items to be selectable. By default, no items are selectable @param selectable true if items are selectable @return this
[ "Set", "to", "true", "if", "you", "want", "the", "items", "to", "be", "selectable", ".", "By", "default", "no", "items", "are", "selectable" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L448-L457
32,411
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.registerTypeInstance
@SuppressWarnings("unchecked") public void registerTypeInstance(Item item) { if (getTypeInstanceCache().register(item)) { //check if the item implements hookable when its added for the first time if (item instanceof IHookable) { withEventHooks(((IHookable<Item>) item)...
java
@SuppressWarnings("unchecked") public void registerTypeInstance(Item item) { if (getTypeInstanceCache().register(item)) { //check if the item implements hookable when its added for the first time if (item instanceof IHookable) { withEventHooks(((IHookable<Item>) item)...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "registerTypeInstance", "(", "Item", "item", ")", "{", "if", "(", "getTypeInstanceCache", "(", ")", ".", "register", "(", "item", ")", ")", "{", "//check if the item implements hookable when its a...
register a new type into the TypeInstances to be able to efficiently create thew ViewHolders @param item an IItem which will be shown in the list
[ "register", "a", "new", "type", "into", "the", "TypeInstances", "to", "be", "able", "to", "efficiently", "create", "thew", "ViewHolders" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L537-L545
32,412
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.onCreateViewHolder
@Override @SuppressWarnings("unchecked") public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (mVerbose) Log.v(TAG, "onCreateViewHolder: " + viewType); final RecyclerView.ViewHolder holder = mOnCreateViewHolderListener.onPreCreateViewHolder(this, parent, viewTy...
java
@Override @SuppressWarnings("unchecked") public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (mVerbose) Log.v(TAG, "onCreateViewHolder: " + viewType); final RecyclerView.ViewHolder holder = mOnCreateViewHolderListener.onPreCreateViewHolder(this, parent, viewTy...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "RecyclerView", ".", "ViewHolder", "onCreateViewHolder", "(", "ViewGroup", "parent", ",", "int", "viewType", ")", "{", "if", "(", "mVerbose", ")", "Log", ".", "v", "(", "TAG", ","...
Creates the ViewHolder by the viewType @param parent the parent view (the RecyclerView) @param viewType the current viewType which is bound @return the ViewHolder with the bound data
[ "Creates", "the", "ViewHolder", "by", "the", "viewType" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L680-L702
32,413
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.onBindViewHolder
@Override @SuppressWarnings("unchecked") public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { if (mLegacyBindViewMode) { if (mVerbose) { Log.v(TAG, "onBindViewHolderLegacy: " + position + "/" + holder.getItemViewType() + " isLegacy: true"); ...
java
@Override @SuppressWarnings("unchecked") public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { if (mLegacyBindViewMode) { if (mVerbose) { Log.v(TAG, "onBindViewHolderLegacy: " + position + "/" + holder.getItemViewType() + " isLegacy: true"); ...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "onBindViewHolder", "(", "final", "RecyclerView", ".", "ViewHolder", "holder", ",", "int", "position", ")", "{", "if", "(", "mLegacyBindViewMode", ")", "{", "if", "(", "mVer...
Binds the data to the created ViewHolder and sets the listeners to the holder.itemView Note that you should use the `onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads` as it allows you to implement a more efficient adapter implementation @param holder the viewHolder we bind the data on @pa...
[ "Binds", "the", "data", "to", "the", "created", "ViewHolder", "and", "sets", "the", "listeners", "to", "the", "holder", ".", "itemView", "Note", "that", "you", "should", "use", "the", "onBindViewHolder", "(", "RecyclerView", ".", "ViewHolder", "holder", "int",...
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L712-L724
32,414
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.onBindViewHolder
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) { //we do not want the binding to happen twice (the legacyBindViewMode if (!mLegacyBindViewMode) { if (mVerbose) Log.v(TAG, "onBindViewHolder: " + position + "/" + ...
java
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) { //we do not want the binding to happen twice (the legacyBindViewMode if (!mLegacyBindViewMode) { if (mVerbose) Log.v(TAG, "onBindViewHolder: " + position + "/" + ...
[ "@", "Override", "public", "void", "onBindViewHolder", "(", "RecyclerView", ".", "ViewHolder", "holder", ",", "int", "position", ",", "List", "<", "Object", ">", "payloads", ")", "{", "//we do not want the binding to happen twice (the legacyBindViewMode", "if", "(", "...
Binds the data to the created ViewHolder and sets the listeners to the holder.itemView @param holder the viewHolder we bind the data on @param position the global position @param payloads the payloads for the bindViewHolder event containing data which allows to improve view animating
[ "Binds", "the", "data", "to", "the", "created", "ViewHolder", "and", "sets", "the", "listeners", "to", "the", "holder", ".", "itemView" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L733-L745
32,415
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.onViewRecycled
@Override public void onViewRecycled(RecyclerView.ViewHolder holder) { if (mVerbose) Log.v(TAG, "onViewRecycled: " + holder.getItemViewType()); super.onViewRecycled(holder); mOnBindViewHolderListener.unBindViewHolder(holder, holder.getAdapterPosition()); }
java
@Override public void onViewRecycled(RecyclerView.ViewHolder holder) { if (mVerbose) Log.v(TAG, "onViewRecycled: " + holder.getItemViewType()); super.onViewRecycled(holder); mOnBindViewHolderListener.unBindViewHolder(holder, holder.getAdapterPosition()); }
[ "@", "Override", "public", "void", "onViewRecycled", "(", "RecyclerView", ".", "ViewHolder", "holder", ")", "{", "if", "(", "mVerbose", ")", "Log", ".", "v", "(", "TAG", ",", "\"onViewRecycled: \"", "+", "holder", ".", "getItemViewType", "(", ")", ")", ";"...
Unbinds the data to the already existing ViewHolder and removes the listeners from the holder.itemView @param holder the viewHolder we unbind the data from
[ "Unbinds", "the", "data", "to", "the", "already", "existing", "ViewHolder", "and", "removes", "the", "listeners", "from", "the", "holder", ".", "itemView" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L752-L757
32,416
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.getItem
public Item getItem(int position) { //if we are out of range just return null if (position < 0 || position >= mGlobalSize) { return null; } //now get the adapter which is responsible for the given position int index = floorIndex(mAdapterSizes, position); retur...
java
public Item getItem(int position) { //if we are out of range just return null if (position < 0 || position >= mGlobalSize) { return null; } //now get the adapter which is responsible for the given position int index = floorIndex(mAdapterSizes, position); retur...
[ "public", "Item", "getItem", "(", "int", "position", ")", "{", "//if we are out of range just return null", "if", "(", "position", "<", "0", "||", "position", ">=", "mGlobalSize", ")", "{", "return", "null", ";", "}", "//now get the adapter which is responsible for th...
gets the IItem by a position, from all registered adapters @param position the global position @return the found IItem or null
[ "gets", "the", "IItem", "by", "a", "position", "from", "all", "registered", "adapters" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L851-L859
32,417
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.getRelativeInfo
public RelativeInfo<Item> getRelativeInfo(int position) { if (position < 0 || position >= getItemCount()) { return new RelativeInfo<>(); } RelativeInfo<Item> relativeInfo = new RelativeInfo<>(); int index = floorIndex(mAdapterSizes, position); if (index != -1) { ...
java
public RelativeInfo<Item> getRelativeInfo(int position) { if (position < 0 || position >= getItemCount()) { return new RelativeInfo<>(); } RelativeInfo<Item> relativeInfo = new RelativeInfo<>(); int index = floorIndex(mAdapterSizes, position); if (index != -1) { ...
[ "public", "RelativeInfo", "<", "Item", ">", "getRelativeInfo", "(", "int", "position", ")", "{", "if", "(", "position", "<", "0", "||", "position", ">=", "getItemCount", "(", ")", ")", "{", "return", "new", "RelativeInfo", "<>", "(", ")", ";", "}", "Re...
Internal method to get the Item as ItemHolder which comes with the relative position within its adapter Finds the responsible adapter for the given position @param position the global position @return the adapter which is responsible for this position
[ "Internal", "method", "to", "get", "the", "Item", "as", "ItemHolder", "which", "comes", "with", "the", "relative", "position", "within", "its", "adapter", "Finds", "the", "responsible", "adapter", "for", "the", "given", "position" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L892-L905
32,418
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.getAdapter
@Nullable public IAdapter<Item> getAdapter(int position) { //if we are out of range just return null if (position < 0 || position >= mGlobalSize) { return null; } if (mVerbose) Log.v(TAG, "getAdapter"); //now get the adapter which is responsible for the given posi...
java
@Nullable public IAdapter<Item> getAdapter(int position) { //if we are out of range just return null if (position < 0 || position >= mGlobalSize) { return null; } if (mVerbose) Log.v(TAG, "getAdapter"); //now get the adapter which is responsible for the given posi...
[ "@", "Nullable", "public", "IAdapter", "<", "Item", ">", "getAdapter", "(", "int", "position", ")", "{", "//if we are out of range just return null", "if", "(", "position", "<", "0", "||", "position", ">=", "mGlobalSize", ")", "{", "return", "null", ";", "}", ...
Gets the adapter for the given position @param position the global position @return the adapter responsible for this global position
[ "Gets", "the", "adapter", "for", "the", "given", "position" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L913-L922
32,419
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.cacheSizes
protected void cacheSizes() { mAdapterSizes.clear(); int size = 0; for (IAdapter<Item> adapter : mAdapters) { if (adapter.getAdapterItemCount() > 0) { mAdapterSizes.append(size, adapter); size = size + adapter.getAdapterItemCount(); } ...
java
protected void cacheSizes() { mAdapterSizes.clear(); int size = 0; for (IAdapter<Item> adapter : mAdapters) { if (adapter.getAdapterItemCount() > 0) { mAdapterSizes.append(size, adapter); size = size + adapter.getAdapterItemCount(); } ...
[ "protected", "void", "cacheSizes", "(", ")", "{", "mAdapterSizes", ".", "clear", "(", ")", ";", "int", "size", "=", "0", ";", "for", "(", "IAdapter", "<", "Item", ">", "adapter", ":", "mAdapters", ")", "{", "if", "(", "adapter", ".", "getAdapterItemCou...
we cache the sizes of our adapters so get accesses are faster
[ "we", "cache", "the", "sizes", "of", "our", "adapters", "so", "get", "accesses", "are", "faster" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L1028-L1045
32,420
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java
FastAdapter.recursiveSub
@SuppressWarnings("unchecked") public static <Item extends IItem> Triple<Boolean, Item, Integer> recursiveSub(IAdapter<Item> lastParentAdapter, int lastParentPosition, IExpandable parent, AdapterPredicate<Item> predicate, boolean stopOnMatch) { //in case it's expanded it can be selected via the normal way ...
java
@SuppressWarnings("unchecked") public static <Item extends IItem> Triple<Boolean, Item, Integer> recursiveSub(IAdapter<Item> lastParentAdapter, int lastParentPosition, IExpandable parent, AdapterPredicate<Item> predicate, boolean stopOnMatch) { //in case it's expanded it can be selected via the normal way ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "Item", "extends", "IItem", ">", "Triple", "<", "Boolean", ",", "Item", ",", "Integer", ">", "recursiveSub", "(", "IAdapter", "<", "Item", ">", "lastParentAdapter", ",", "int", "las...
Util function which recursively iterates over all items of a `IExpandable` parent if and only if it is `expanded` and has `subItems` This is usually only used in @param lastParentAdapter the last `IAdapter` managing the last (visible) parent item (that might also be a parent of a parent, ..) @param lastParentPosition...
[ "Util", "function", "which", "recursively", "iterates", "over", "all", "items", "of", "a", "IExpandable", "parent", "if", "and", "only", "if", "it", "is", "expanded", "and", "has", "subItems", "This", "is", "usually", "only", "used", "in" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L1487-L1507
32,421
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/listeners/CustomEventHook.java
CustomEventHook.getFastAdapter
@Nullable public FastAdapter<Item> getFastAdapter(RecyclerView.ViewHolder viewHolder) { Object tag = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter); if (tag instanceof FastAdapter) { return (FastAdapter<Item>) tag; } return null; }
java
@Nullable public FastAdapter<Item> getFastAdapter(RecyclerView.ViewHolder viewHolder) { Object tag = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter); if (tag instanceof FastAdapter) { return (FastAdapter<Item>) tag; } return null; }
[ "@", "Nullable", "public", "FastAdapter", "<", "Item", ">", "getFastAdapter", "(", "RecyclerView", ".", "ViewHolder", "viewHolder", ")", "{", "Object", "tag", "=", "viewHolder", ".", "itemView", ".", "getTag", "(", "R", ".", "id", ".", "fastadapter_item_adapte...
Helper method to get the FastAdapter from this ViewHolder @param viewHolder @return
[ "Helper", "method", "to", "get", "the", "FastAdapter", "from", "this", "ViewHolder" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/CustomEventHook.java#L29-L36
32,422
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/listeners/CustomEventHook.java
CustomEventHook.getItem
@Nullable public Item getItem(RecyclerView.ViewHolder viewHolder) { FastAdapter<Item> adapter = getFastAdapter(viewHolder); if (adapter == null) { return null; } //we get the adapterPosition from the viewHolder int pos = adapter.getHolderAdapterPosition(viewHolder...
java
@Nullable public Item getItem(RecyclerView.ViewHolder viewHolder) { FastAdapter<Item> adapter = getFastAdapter(viewHolder); if (adapter == null) { return null; } //we get the adapterPosition from the viewHolder int pos = adapter.getHolderAdapterPosition(viewHolder...
[ "@", "Nullable", "public", "Item", "getItem", "(", "RecyclerView", ".", "ViewHolder", "viewHolder", ")", "{", "FastAdapter", "<", "Item", ">", "adapter", "=", "getFastAdapter", "(", "viewHolder", ")", ";", "if", "(", "adapter", "==", "null", ")", "{", "ret...
helper method to get the item for this ViewHolder @param viewHolder @return
[ "helper", "method", "to", "get", "the", "item", "for", "this", "ViewHolder" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/CustomEventHook.java#L44-L58
32,423
mikepenz/FastAdapter
library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java
FastAdapterUIUtils.getRippleMask
private static Drawable getRippleMask(int color, int radius) { float[] outerRadius = new float[8]; Arrays.fill(outerRadius, radius); RoundRectShape r = new RoundRectShape(outerRadius, null, null); ShapeDrawable shapeDrawable = new ShapeDrawable(r); shapeDrawable.getPaint().setCol...
java
private static Drawable getRippleMask(int color, int radius) { float[] outerRadius = new float[8]; Arrays.fill(outerRadius, radius); RoundRectShape r = new RoundRectShape(outerRadius, null, null); ShapeDrawable shapeDrawable = new ShapeDrawable(r); shapeDrawable.getPaint().setCol...
[ "private", "static", "Drawable", "getRippleMask", "(", "int", "color", ",", "int", "radius", ")", "{", "float", "[", "]", "outerRadius", "=", "new", "float", "[", "8", "]", ";", "Arrays", ".", "fill", "(", "outerRadius", ",", "radius", ")", ";", "Round...
helper to create an ripple mask with the given color and radius @param color the color @param radius the radius @return the mask drawable
[ "helper", "to", "create", "an", "ripple", "mask", "with", "the", "given", "color", "and", "radius" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java#L117-L124
32,424
mikepenz/FastAdapter
library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java
FastAdapterUIUtils.getStateListDrawable
private static StateListDrawable getStateListDrawable( int normalColor, int pressedColor) { StateListDrawable states = new StateListDrawable(); states.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(pressedColor)); states.addState(new int[]{android...
java
private static StateListDrawable getStateListDrawable( int normalColor, int pressedColor) { StateListDrawable states = new StateListDrawable(); states.addState(new int[]{android.R.attr.state_pressed}, new ColorDrawable(pressedColor)); states.addState(new int[]{android...
[ "private", "static", "StateListDrawable", "getStateListDrawable", "(", "int", "normalColor", ",", "int", "pressedColor", ")", "{", "StateListDrawable", "states", "=", "new", "StateListDrawable", "(", ")", ";", "states", ".", "addState", "(", "new", "int", "[", "...
helper to create an StateListDrawable for the given normal and pressed color @param normalColor the normal color @param pressedColor the pressed color @return the StateListDrawable
[ "helper", "to", "create", "an", "StateListDrawable", "for", "the", "given", "normal", "and", "pressed", "color" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java#L133-L145
32,425
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.getSelectedItems
@Deprecated public static Set<IItem> getSelectedItems(FastAdapter adapter) { Set<IItem> selections = new HashSet<>(); int length = adapter.getItemCount(); List<IItem> items = new ArrayList<>(); for (int i = 0; i < length; i++) { items.add(adapter.getItem(i)); } ...
java
@Deprecated public static Set<IItem> getSelectedItems(FastAdapter adapter) { Set<IItem> selections = new HashSet<>(); int length = adapter.getItemCount(); List<IItem> items = new ArrayList<>(); for (int i = 0; i < length; i++) { items.add(adapter.getItem(i)); } ...
[ "@", "Deprecated", "public", "static", "Set", "<", "IItem", ">", "getSelectedItems", "(", "FastAdapter", "adapter", ")", "{", "Set", "<", "IItem", ">", "selections", "=", "new", "HashSet", "<>", "(", ")", ";", "int", "length", "=", "adapter", ".", "getIt...
returns a set of selected items, regardless of their visibility @param adapter the adapter instance @return a set of all selected items and subitems @deprecated See {@link FastAdapter#getSelectedItems()} ()} ()}
[ "returns", "a", "set", "of", "selected", "items", "regardless", "of", "their", "visibility" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L36-L46
32,426
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.getAllItems
public static List<IItem> getAllItems(List<IItem> items, boolean countHeaders, IPredicate predicate) { return getAllItems(items, countHeaders, false, predicate); }
java
public static List<IItem> getAllItems(List<IItem> items, boolean countHeaders, IPredicate predicate) { return getAllItems(items, countHeaders, false, predicate); }
[ "public", "static", "List", "<", "IItem", ">", "getAllItems", "(", "List", "<", "IItem", ">", "items", ",", "boolean", "countHeaders", ",", "IPredicate", "predicate", ")", "{", "return", "getAllItems", "(", "items", ",", "countHeaders", ",", "false", ",", ...
retrieves a flat list of the items in the provided list, respecting subitems regardless of there current visibility @param items the list of items to process @param countHeaders if true, headers will be counted as well @return list of items in the adapter
[ "retrieves", "a", "flat", "list", "of", "the", "items", "in", "the", "provided", "list", "respecting", "subitems", "regardless", "of", "there", "current", "visibility" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L115-L117
32,427
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.countSelectedSubItems
public static <T extends IItem & IExpandable> int countSelectedSubItems(final FastAdapter adapter, T header) { SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class); if (extension != null) { Set<IItem> selections = extension.getSelectedItems(); ...
java
public static <T extends IItem & IExpandable> int countSelectedSubItems(final FastAdapter adapter, T header) { SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class); if (extension != null) { Set<IItem> selections = extension.getSelectedItems(); ...
[ "public", "static", "<", "T", "extends", "IItem", "&", "IExpandable", ">", "int", "countSelectedSubItems", "(", "final", "FastAdapter", "adapter", ",", "T", "header", ")", "{", "SelectExtension", "extension", "=", "(", "SelectExtension", ")", "adapter", ".", "...
counts the selected items in the adapter underneath an expandable item, recursively @param adapter the adapter instance @param header the header who's selected children should be counted @return number of selected items underneath the header
[ "counts", "the", "selected", "items", "in", "the", "adapter", "underneath", "an", "expandable", "item", "recursively" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L179-L186
32,428
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.deleteSelected
public static List<IItem> deleteSelected(final FastAdapter fastAdapter, final ExpandableExtension expandableExtension, boolean notifyParent, boolean deleteEmptyHeaders) { List<IItem> deleted = new ArrayList<>(); // we use a LinkedList, because this has performance advantages when modifying the listIter...
java
public static List<IItem> deleteSelected(final FastAdapter fastAdapter, final ExpandableExtension expandableExtension, boolean notifyParent, boolean deleteEmptyHeaders) { List<IItem> deleted = new ArrayList<>(); // we use a LinkedList, because this has performance advantages when modifying the listIter...
[ "public", "static", "List", "<", "IItem", ">", "deleteSelected", "(", "final", "FastAdapter", "fastAdapter", ",", "final", "ExpandableExtension", "expandableExtension", ",", "boolean", "notifyParent", ",", "boolean", "deleteEmptyHeaders", ")", "{", "List", "<", "IIt...
deletes all selected items from the adapter respecting if the are sub items or not subitems are removed from their parents sublists, main items are directly removed Alternatively you might consider also looking at: {@link SelectExtension#deleteAllSelectedItems()} @param deleteEmptyHeaders if true, empty headers will ...
[ "deletes", "all", "selected", "items", "from", "the", "adapter", "respecting", "if", "the", "are", "sub", "items", "or", "not", "subitems", "are", "removed", "from", "their", "parents", "sublists", "main", "items", "are", "directly", "removed" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L335-L399
32,429
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.delete
public static List<IItem> delete(final FastAdapter fastAdapter, final ExpandableExtension expandableExtension, Collection<Long> identifiersToDelete, boolean notifyParent, boolean deleteEmptyHeaders) { List<IItem> deleted = new ArrayList<>(); if (identifiersToDelete == null || identifiersToDelete.size() ...
java
public static List<IItem> delete(final FastAdapter fastAdapter, final ExpandableExtension expandableExtension, Collection<Long> identifiersToDelete, boolean notifyParent, boolean deleteEmptyHeaders) { List<IItem> deleted = new ArrayList<>(); if (identifiersToDelete == null || identifiersToDelete.size() ...
[ "public", "static", "List", "<", "IItem", ">", "delete", "(", "final", "FastAdapter", "fastAdapter", ",", "final", "ExpandableExtension", "expandableExtension", ",", "Collection", "<", "Long", ">", "identifiersToDelete", ",", "boolean", "notifyParent", ",", "boolean...
deletes all items in identifiersToDelete collection from the adapter respecting if there are sub items or not subitems are removed from their parents sublists, main items are directly removed @param fastAdapter the adapter to remove the items from @param identifiersToDelete ids of items to remove @param notify...
[ "deletes", "all", "items", "in", "identifiersToDelete", "collection", "from", "the", "adapter", "respecting", "if", "there", "are", "sub", "items", "or", "not", "subitems", "are", "removed", "from", "their", "parents", "sublists", "main", "items", "are", "direct...
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L411-L481
32,430
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java
FastAdapterBottomSheetDialog.createRecyclerView
private RecyclerView createRecyclerView() { RecyclerView recyclerView = new RecyclerView(getContext()); RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); recyclerView.setLayoutParams(params)...
java
private RecyclerView createRecyclerView() { RecyclerView recyclerView = new RecyclerView(getContext()); RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); recyclerView.setLayoutParams(params)...
[ "private", "RecyclerView", "createRecyclerView", "(", ")", "{", "RecyclerView", "recyclerView", "=", "new", "RecyclerView", "(", "getContext", "(", ")", ")", ";", "RecyclerView", ".", "LayoutParams", "params", "=", "new", "RecyclerView", ".", "LayoutParams", "(", ...
Create the RecyclerView and set it as the dialog view. @return the created RecyclerView
[ "Create", "the", "RecyclerView", "and", "set", "it", "as", "the", "dialog", "view", "." ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java#L44-L51
32,431
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java
FastAdapterBottomSheetDialog.withOnPreClickListener
public FastAdapterBottomSheetDialog<Item> withOnPreClickListener(com.mikepenz.fastadapter.listeners.OnClickListener<Item> onPreClickListener) { this.mFastAdapter.withOnPreClickListener(onPreClickListener); return this; }
java
public FastAdapterBottomSheetDialog<Item> withOnPreClickListener(com.mikepenz.fastadapter.listeners.OnClickListener<Item> onPreClickListener) { this.mFastAdapter.withOnPreClickListener(onPreClickListener); return this; }
[ "public", "FastAdapterBottomSheetDialog", "<", "Item", ">", "withOnPreClickListener", "(", "com", ".", "mikepenz", ".", "fastadapter", ".", "listeners", ".", "OnClickListener", "<", "Item", ">", "onPreClickListener", ")", "{", "this", ".", "mFastAdapter", ".", "wi...
Define the OnPreClickListener which will be used for a single item and is called after all internal methods are done @param onPreClickListener the OnPreClickListener which will be called after a single item was clicked and all internal methods are done @return this
[ "Define", "the", "OnPreClickListener", "which", "will", "be", "used", "for", "a", "single", "item", "and", "is", "called", "after", "all", "internal", "methods", "are", "done" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterBottomSheetDialog.java#L142-L145
32,432
mikepenz/FastAdapter
app/src/main/java/com/mikepenz/fastadapter/app/helpers/HeaderPositionCalculator.java
HeaderPositionCalculator.getFirstViewUnobscuredByHeader
private View getFirstViewUnobscuredByHeader(RecyclerView parent, View firstHeader) { boolean isReverseLayout = mOrientationProvider.isReverseLayout(parent); int step = isReverseLayout ? -1 : 1; int from = isReverseLayout ? parent.getChildCount() - 1 : 0; for (int i = from; i >= 0 && i <=...
java
private View getFirstViewUnobscuredByHeader(RecyclerView parent, View firstHeader) { boolean isReverseLayout = mOrientationProvider.isReverseLayout(parent); int step = isReverseLayout ? -1 : 1; int from = isReverseLayout ? parent.getChildCount() - 1 : 0; for (int i = from; i >= 0 && i <=...
[ "private", "View", "getFirstViewUnobscuredByHeader", "(", "RecyclerView", "parent", ",", "View", "firstHeader", ")", "{", "boolean", "isReverseLayout", "=", "mOrientationProvider", ".", "isReverseLayout", "(", "parent", ")", ";", "int", "step", "=", "isReverseLayout",...
Returns the first item currently in the RecyclerView that is not obscured by a header. @param parent Recyclerview containing all the list items @return first item that is fully beneath a header
[ "Returns", "the", "first", "item", "currently", "in", "the", "RecyclerView", "that", "is", "not", "obscured", "by", "a", "header", "." ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/helpers/HeaderPositionCalculator.java#L209-L220
32,433
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/utils/DefaultIdDistributor.java
DefaultIdDistributor.checkId
@Override public Identifiable checkId(Identifiable item) { if (item.getIdentifier() == -1) { item.withIdentifier(nextId(item)); } return item; }
java
@Override public Identifiable checkId(Identifiable item) { if (item.getIdentifier() == -1) { item.withIdentifier(nextId(item)); } return item; }
[ "@", "Override", "public", "Identifiable", "checkId", "(", "Identifiable", "item", ")", "{", "if", "(", "item", ".", "getIdentifier", "(", ")", "==", "-", "1", ")", "{", "item", ".", "withIdentifier", "(", "nextId", "(", "item", ")", ")", ";", "}", "...
set an unique identifier for the item which do not have one set already @param item @return
[ "set", "an", "unique", "identifier", "for", "the", "item", "which", "do", "not", "have", "one", "set", "already" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/utils/DefaultIdDistributor.java#L47-L53
32,434
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java
SelectExtension.toggleSelection
public void toggleSelection(int position) { if (mFastAdapter.getItem(position).isSelected()) { deselect(position); } else { select(position); } }
java
public void toggleSelection(int position) { if (mFastAdapter.getItem(position).isSelected()) { deselect(position); } else { select(position); } }
[ "public", "void", "toggleSelection", "(", "int", "position", ")", "{", "if", "(", "mFastAdapter", ".", "getItem", "(", "position", ")", ".", "isSelected", "(", ")", ")", "{", "deselect", "(", "position", ")", ";", "}", "else", "{", "select", "(", "posi...
toggles the selection of the item at the given position @param position the global position
[ "toggles", "the", "selection", "of", "the", "item", "at", "the", "given", "position" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java#L259-L265
32,435
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java
SelectExtension.select
public void select(Item item, boolean considerSelectableFlag) { if (considerSelectableFlag && !item.isSelectable()) { return; } item.withSetSelected(true); if (mSelectionListener != null) { mSelectionListener.onSelectionChanged(item, true); } }
java
public void select(Item item, boolean considerSelectableFlag) { if (considerSelectableFlag && !item.isSelectable()) { return; } item.withSetSelected(true); if (mSelectionListener != null) { mSelectionListener.onSelectionChanged(item, true); } }
[ "public", "void", "select", "(", "Item", "item", ",", "boolean", "considerSelectableFlag", ")", "{", "if", "(", "considerSelectableFlag", "&&", "!", "item", ".", "isSelectable", "(", ")", ")", "{", "return", ";", "}", "item", ".", "withSetSelected", "(", "...
select's a provided item, this won't notify the adapter @param item the item to select @param considerSelectableFlag true if the select method should not select an item if its not selectable
[ "select", "s", "a", "provided", "item", "this", "won", "t", "notify", "the", "adapter" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java#L342-L350
32,436
mikepenz/FastAdapter
library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java
SelectExtension.deselect
public void deselect(Iterable<Integer> positions) { Iterator<Integer> entries = positions.iterator(); while (entries.hasNext()) { deselect(entries.next(), entries); } }
java
public void deselect(Iterable<Integer> positions) { Iterator<Integer> entries = positions.iterator(); while (entries.hasNext()) { deselect(entries.next(), entries); } }
[ "public", "void", "deselect", "(", "Iterable", "<", "Integer", ">", "positions", ")", "{", "Iterator", "<", "Integer", ">", "entries", "=", "positions", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "desel...
deselects all items at the positions in the iteratable @param positions the global positions to deselect
[ "deselects", "all", "items", "at", "the", "positions", "in", "the", "iteratable" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/select/SelectExtension.java#L488-L493
32,437
mikepenz/FastAdapter
app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java
ImageItem.style
private void style(View view, int value) { view.setScaleX(value); view.setScaleY(value); view.setAlpha(value); }
java
private void style(View view, int value) { view.setScaleX(value); view.setScaleY(value); view.setAlpha(value); }
[ "private", "void", "style", "(", "View", "view", ",", "int", "value", ")", "{", "view", ".", "setScaleX", "(", "value", ")", ";", "view", ".", "setScaleY", "(", "value", ")", ";", "view", ".", "setAlpha", "(", "value", ")", ";", "}" ]
helper method to style the heart view @param view @param value
[ "helper", "method", "to", "style", "the", "heart", "view" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java#L123-L127
32,438
mikepenz/FastAdapter
app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java
ImageItem.animateHeart
public void animateHeart(View imageLovedOn, View imageLovedOff, boolean on) { imageLovedOn.setVisibility(View.VISIBLE); imageLovedOff.setVisibility(View.VISIBLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { viewPropertyStartCompat(imageLovedOff.animate().scaleX...
java
public void animateHeart(View imageLovedOn, View imageLovedOff, boolean on) { imageLovedOn.setVisibility(View.VISIBLE); imageLovedOff.setVisibility(View.VISIBLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { viewPropertyStartCompat(imageLovedOff.animate().scaleX...
[ "public", "void", "animateHeart", "(", "View", "imageLovedOn", ",", "View", "imageLovedOff", ",", "boolean", "on", ")", "{", "imageLovedOn", ".", "setVisibility", "(", "View", ".", "VISIBLE", ")", ";", "imageLovedOff", ".", "setVisibility", "(", "View", ".", ...
helper method to animate the heart view @param imageLovedOn @param imageLovedOff @param on
[ "helper", "method", "to", "animate", "the", "heart", "view" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java#L136-L144
32,439
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/HeaderHelper.java
HeaderHelper.apply
public void apply(List items) { //If the list is empty avoid sorting and adding headers. int size = items.size(); if (size > 0) { //sort beforehand if (comparator != null) { Collections.sort(items, comparator); } //we have to get t...
java
public void apply(List items) { //If the list is empty avoid sorting and adding headers. int size = items.size(); if (size > 0) { //sort beforehand if (comparator != null) { Collections.sort(items, comparator); } //we have to get t...
[ "public", "void", "apply", "(", "List", "items", ")", "{", "//If the list is empty avoid sorting and adding headers.", "int", "size", "=", "items", ".", "size", "(", ")", ";", "if", "(", "size", ">", "0", ")", "{", "//sort beforehand", "if", "(", "comparator",...
call this when your list order has changed or was updated, and you have to readd the headres @param items the list which will get the headers added inbetween
[ "call", "this", "when", "your", "list", "order", "has", "changed", "or", "was", "updated", "and", "you", "have", "to", "readd", "the", "headres" ]
3b2412abe001ba58422e0125846b704d4dba4ae9
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/HeaderHelper.java#L39-L73
32,440
aaberg/sql2o
core/src/main/java/org/sql2o/ArrayParameters.java
ArrayParameters.updateQueryAndParametersIndexes
static String updateQueryAndParametersIndexes(String parsedQuery, Map<String, List<Integer>> parameterNamesToIndexes, Map<String, Query.ParameterSetter> parameters, boole...
java
static String updateQueryAndParametersIndexes(String parsedQuery, Map<String, List<Integer>> parameterNamesToIndexes, Map<String, Query.ParameterSetter> parameters, boole...
[ "static", "String", "updateQueryAndParametersIndexes", "(", "String", "parsedQuery", ",", "Map", "<", "String", ",", "List", "<", "Integer", ">", ">", "parameterNamesToIndexes", ",", "Map", "<", "String", ",", "Query", ".", "ParameterSetter", ">", "parameters", ...
Update both the query and the parameter indexes to include the array parameters.
[ "Update", "both", "the", "query", "and", "the", "parameter", "indexes", "to", "include", "the", "array", "parameters", "." ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L32-L44
32,441
aaberg/sql2o
core/src/main/java/org/sql2o/ArrayParameters.java
ArrayParameters.updateParameterNamesToIndexes
static Map<String, List<Integer>> updateParameterNamesToIndexes(Map<String, List<Integer>> parametersNameToIndex, List<ArrayParameter> arrayParametersSortedAsc) { for(Map.Entry<String, List<Integer>> parameterNameToIndexes : parametersNameToInd...
java
static Map<String, List<Integer>> updateParameterNamesToIndexes(Map<String, List<Integer>> parametersNameToIndex, List<ArrayParameter> arrayParametersSortedAsc) { for(Map.Entry<String, List<Integer>> parameterNameToIndexes : parametersNameToInd...
[ "static", "Map", "<", "String", ",", "List", "<", "Integer", ">", ">", "updateParameterNamesToIndexes", "(", "Map", "<", "String", ",", "List", "<", "Integer", ">", ">", "parametersNameToIndex", ",", "List", "<", "ArrayParameter", ">", "arrayParametersSortedAsc"...
Update the indexes of each query parameter
[ "Update", "the", "indexes", "of", "each", "query", "parameter" ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L49-L60
32,442
aaberg/sql2o
core/src/main/java/org/sql2o/ArrayParameters.java
ArrayParameters.computeNewIndex
static int computeNewIndex(int index, List<ArrayParameter> arrayParametersSortedAsc) { int newIndex = index; for(ArrayParameter arrayParameter : arrayParametersSortedAsc) { if(index > arrayParameter.parameterIndex) { newIndex = newIndex + arrayParameter.parameterCount - 1; ...
java
static int computeNewIndex(int index, List<ArrayParameter> arrayParametersSortedAsc) { int newIndex = index; for(ArrayParameter arrayParameter : arrayParametersSortedAsc) { if(index > arrayParameter.parameterIndex) { newIndex = newIndex + arrayParameter.parameterCount - 1; ...
[ "static", "int", "computeNewIndex", "(", "int", "index", ",", "List", "<", "ArrayParameter", ">", "arrayParametersSortedAsc", ")", "{", "int", "newIndex", "=", "index", ";", "for", "(", "ArrayParameter", "arrayParameter", ":", "arrayParametersSortedAsc", ")", "{",...
Compute the new index of a parameter given the index positions of the array parameters.
[ "Compute", "the", "new", "index", "of", "a", "parameter", "given", "the", "index", "positions", "of", "the", "array", "parameters", "." ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L66-L76
32,443
aaberg/sql2o
core/src/main/java/org/sql2o/ArrayParameters.java
ArrayParameters.arrayParametersSortedAsc
private static List<ArrayParameter> arrayParametersSortedAsc(Map<String, List<Integer>> parameterNamesToIndexes, Map<String, Query.ParameterSetter> parameters, boolean allowArrayParameters) ...
java
private static List<ArrayParameter> arrayParametersSortedAsc(Map<String, List<Integer>> parameterNamesToIndexes, Map<String, Query.ParameterSetter> parameters, boolean allowArrayParameters) ...
[ "private", "static", "List", "<", "ArrayParameter", ">", "arrayParametersSortedAsc", "(", "Map", "<", "String", ",", "List", "<", "Integer", ">", ">", "parameterNamesToIndexes", ",", "Map", "<", "String", ",", "Query", ".", "ParameterSetter", ">", "parameters", ...
List all the array parameters that contains more that 1 parameters. Indeed, array parameter below 1 parameter will not change the text query nor the parameter indexes.
[ "List", "all", "the", "array", "parameters", "that", "contains", "more", "that", "1", "parameters", ".", "Indeed", "array", "parameter", "below", "1", "parameter", "will", "not", "change", "the", "text", "query", "nor", "the", "parameter", "indexes", "." ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L82-L99
32,444
aaberg/sql2o
core/src/main/java/org/sql2o/ArrayParameters.java
ArrayParameters.updateQueryWithArrayParameters
static String updateQueryWithArrayParameters(String parsedQuery, List<ArrayParameter> arrayParametersSortedAsc) { if(arrayParametersSortedAsc.isEmpty()) { return parsedQuery; } StringBuilder sb = new StringBuilder(); Iterator<ArrayParameter> parameterToReplaceIt = arrayPara...
java
static String updateQueryWithArrayParameters(String parsedQuery, List<ArrayParameter> arrayParametersSortedAsc) { if(arrayParametersSortedAsc.isEmpty()) { return parsedQuery; } StringBuilder sb = new StringBuilder(); Iterator<ArrayParameter> parameterToReplaceIt = arrayPara...
[ "static", "String", "updateQueryWithArrayParameters", "(", "String", "parsedQuery", ",", "List", "<", "ArrayParameter", ">", "arrayParametersSortedAsc", ")", "{", "if", "(", "arrayParametersSortedAsc", ".", "isEmpty", "(", ")", ")", "{", "return", "parsedQuery", ";"...
Change the query to replace ? at each arrayParametersSortedAsc.parameterIndex with ?,?,?.. multiple arrayParametersSortedAsc.parameterCount
[ "Change", "the", "query", "to", "replace", "?", "at", "each", "arrayParametersSortedAsc", ".", "parameterIndex", "with", "?", "?", "?", "..", "multiple", "arrayParametersSortedAsc", ".", "parameterCount" ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L105-L139
32,445
aaberg/sql2o
core/src/main/java/org/sql2o/ResultSetIteratorBase.java
ResultSetIteratorBase.hasNext
public boolean hasNext() { // check if we already fetched next item if (next != null) { return true; } // check if result set already finished if (resultSetFinished) { return false; } // now fetch next item next = safeReadNext(); ...
java
public boolean hasNext() { // check if we already fetched next item if (next != null) { return true; } // check if result set already finished if (resultSetFinished) { return false; } // now fetch next item next = safeReadNext(); ...
[ "public", "boolean", "hasNext", "(", ")", "{", "// check if we already fetched next item", "if", "(", "next", "!=", "null", ")", "{", "return", "true", ";", "}", "// check if result set already finished", "if", "(", "resultSetFinished", ")", "{", "return", "false", ...
used to note when result set exhausted
[ "used", "to", "note", "when", "result", "set", "exhausted" ]
01d3490a6d2440cf60f973d23508ac4ed57a8e20
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ResultSetIteratorBase.java#L40-L63
32,446
grails/grails-core
grails-core/src/main/groovy/grails/beans/util/LazyMetaPropertyMap.java
LazyMetaPropertyMap.get
public Object get(Object propertyName) { if (propertyName instanceof CharSequence) { propertyName = propertyName.toString(); } if (propertyName instanceof List) { Map submap = new HashMap(); List propertyNames = (List)propertyName; for (Object cur...
java
public Object get(Object propertyName) { if (propertyName instanceof CharSequence) { propertyName = propertyName.toString(); } if (propertyName instanceof List) { Map submap = new HashMap(); List propertyNames = (List)propertyName; for (Object cur...
[ "public", "Object", "get", "(", "Object", "propertyName", ")", "{", "if", "(", "propertyName", "instanceof", "CharSequence", ")", "{", "propertyName", "=", "propertyName", ".", "toString", "(", ")", ";", "}", "if", "(", "propertyName", "instanceof", "List", ...
Obtains the value of an object's properties on demand using Groovy's MOP. @param propertyName The name of the property @return The property value or null
[ "Obtains", "the", "value", "of", "an", "object", "s", "properties", "on", "demand", "using", "Groovy", "s", "MOP", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/beans/util/LazyMetaPropertyMap.java#L100-L129
32,447
grails/grails-core
grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
DefaultRuntimeSpringConfiguration.createApplicationContext
protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) { if (parentCtx != null && beanFactory != null) { Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory, "ListableBeanFactory set must be a subclass of DefaultListableBeanFac...
java
protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) { if (parentCtx != null && beanFactory != null) { Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory, "ListableBeanFactory set must be a subclass of DefaultListableBeanFac...
[ "protected", "GenericApplicationContext", "createApplicationContext", "(", "ApplicationContext", "parentCtx", ")", "{", "if", "(", "parentCtx", "!=", "null", "&&", "beanFactory", "!=", "null", ")", "{", "Assert", ".", "isInstanceOf", "(", "DefaultListableBeanFactory", ...
Creates the ApplicationContext instance. Subclasses can override to customise the used ApplicationContext @param parentCtx The parent ApplicationContext instance. Can be null. @return An instance of GenericApplicationContext
[ "Creates", "the", "ApplicationContext", "instance", ".", "Subclasses", "can", "override", "to", "customise", "the", "used", "ApplicationContext" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java#L72-L92
32,448
grails/grails-core
grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
DefaultRuntimeSpringConfiguration.initialiseApplicationContext
protected void initialiseApplicationContext() { if (context != null) { return; } context = createApplicationContext(parent); if (parent != null && classLoader == null) { trySettingClassLoaderOnContextIfFoundInParent(parent); } else if (...
java
protected void initialiseApplicationContext() { if (context != null) { return; } context = createApplicationContext(parent); if (parent != null && classLoader == null) { trySettingClassLoaderOnContextIfFoundInParent(parent); } else if (...
[ "protected", "void", "initialiseApplicationContext", "(", ")", "{", "if", "(", "context", "!=", "null", ")", "{", "return", ";", "}", "context", "=", "createApplicationContext", "(", "parent", ")", ";", "if", "(", "parent", "!=", "null", "&&", "classLoader",...
Initialises the ApplicationContext instance.
[ "Initialises", "the", "ApplicationContext", "instance", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java#L124-L139
32,449
grails/grails-core
grails-web-common/src/main/groovy/grails/util/GrailsWebUtil.java
GrailsWebUtil.lookupApplication
public static GrailsApplication lookupApplication(ServletContext servletContext) { if (servletContext == null) { return null; } GrailsApplication grailsApplication = (GrailsApplication)servletContext.getAttribute(ApplicationAttributes.APPLICATION); if(grailsApplication != nu...
java
public static GrailsApplication lookupApplication(ServletContext servletContext) { if (servletContext == null) { return null; } GrailsApplication grailsApplication = (GrailsApplication)servletContext.getAttribute(ApplicationAttributes.APPLICATION); if(grailsApplication != nu...
[ "public", "static", "GrailsApplication", "lookupApplication", "(", "ServletContext", "servletContext", ")", "{", "if", "(", "servletContext", "==", "null", ")", "{", "return", "null", ";", "}", "GrailsApplication", "grailsApplication", "=", "(", "GrailsApplication", ...
Looks up a GrailsApplication instance from the ServletContext. @param servletContext The ServletContext @return A GrailsApplication or null if there isn't one
[ "Looks", "up", "a", "GrailsApplication", "instance", "from", "the", "ServletContext", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/grails/util/GrailsWebUtil.java#L59-L75
32,450
grails/grails-core
grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java
ShutdownOperations.runOperations
public static synchronized void runOperations() { try { for (Runnable shutdownOperation : shutdownOperations) { try { shutdownOperation.run(); } catch (Exception e) { LOG.warn("Error occurred running shutdown operation: " + e.ge...
java
public static synchronized void runOperations() { try { for (Runnable shutdownOperation : shutdownOperations) { try { shutdownOperation.run(); } catch (Exception e) { LOG.warn("Error occurred running shutdown operation: " + e.ge...
[ "public", "static", "synchronized", "void", "runOperations", "(", ")", "{", "try", "{", "for", "(", "Runnable", "shutdownOperation", ":", "shutdownOperations", ")", "{", "try", "{", "shutdownOperation", ".", "run", "(", ")", ";", "}", "catch", "(", "Exceptio...
Runs the shutdown operations
[ "Runs", "the", "shutdown", "operations" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java#L45-L58
32,451
grails/grails-core
grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java
ShutdownOperations.addOperation
public static synchronized void addOperation(Runnable runnable, boolean preserveForNextShutdown) { shutdownOperations.add(runnable); if(preserveForNextShutdown) { preservedShutdownOperations.add(runnable); } }
java
public static synchronized void addOperation(Runnable runnable, boolean preserveForNextShutdown) { shutdownOperations.add(runnable); if(preserveForNextShutdown) { preservedShutdownOperations.add(runnable); } }
[ "public", "static", "synchronized", "void", "addOperation", "(", "Runnable", "runnable", ",", "boolean", "preserveForNextShutdown", ")", "{", "shutdownOperations", ".", "add", "(", "runnable", ")", ";", "if", "(", "preserveForNextShutdown", ")", "{", "preservedShutd...
Adds a shutdown operation @param runnable The runnable operation @param preserveForNextShutdown should preserve the operation for subsequent shutdowns, useful in tests
[ "Adds", "a", "shutdown", "operation" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java#L73-L78
32,452
grails/grails-core
grails-core/src/main/groovy/org/grails/core/AbstractGrailsClass.java
AbstractGrailsClass.getStaticPropertyValue
public <T> T getStaticPropertyValue(String propName, Class<T> type) { return ClassPropertyFetcher.getStaticPropertyValue(getClazz(), propName, type); }
java
public <T> T getStaticPropertyValue(String propName, Class<T> type) { return ClassPropertyFetcher.getStaticPropertyValue(getClazz(), propName, type); }
[ "public", "<", "T", ">", "T", "getStaticPropertyValue", "(", "String", "propName", ",", "Class", "<", "T", ">", "type", ")", "{", "return", "ClassPropertyFetcher", ".", "getStaticPropertyValue", "(", "getClazz", "(", ")", ",", "propName", ",", "type", ")", ...
Get the value of the named static property. @param propName @param type @return The property value or null
[ "Get", "the", "value", "of", "the", "named", "static", "property", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/AbstractGrailsClass.java#L238-L240
32,453
grails/grails-core
grails-plugin-controllers/src/main/groovy/org/grails/plugins/web/controllers/api/ControllersDomainBindingApi.java
ControllersDomainBindingApi.initialize
public static void initialize(Object instance, Map namedArgs) { PersistentEntity dc = getDomainClass(instance); if (dc == null) { DataBindingUtils.bindObjectToInstance(instance, namedArgs); } else { DataBindingUtils.bindObjectToDomainInstance(dc, instance, namedAr...
java
public static void initialize(Object instance, Map namedArgs) { PersistentEntity dc = getDomainClass(instance); if (dc == null) { DataBindingUtils.bindObjectToInstance(instance, namedArgs); } else { DataBindingUtils.bindObjectToDomainInstance(dc, instance, namedAr...
[ "public", "static", "void", "initialize", "(", "Object", "instance", ",", "Map", "namedArgs", ")", "{", "PersistentEntity", "dc", "=", "getDomainClass", "(", "instance", ")", ";", "if", "(", "dc", "==", "null", ")", "{", "DataBindingUtils", ".", "bindObjectT...
A map based constructor that binds the named arguments to the target instance @param instance The target instance @param namedArgs The named arguments
[ "A", "map", "based", "constructor", "that", "binds", "the", "named", "arguments", "to", "the", "target", "instance" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-plugin-controllers/src/main/groovy/org/grails/plugins/web/controllers/api/ControllersDomainBindingApi.java#L58-L68
32,454
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsUtil.java
GrailsUtil.deprecated
public static void deprecated(Class<?> clazz, String methodOrPropName, String version) { if (LOG_DEPRECATED) { deprecated("Property or method [" + methodOrPropName + "] of class [" + clazz.getName() + "] is deprecated in [" + version + "] and will be removed i...
java
public static void deprecated(Class<?> clazz, String methodOrPropName, String version) { if (LOG_DEPRECATED) { deprecated("Property or method [" + methodOrPropName + "] of class [" + clazz.getName() + "] is deprecated in [" + version + "] and will be removed i...
[ "public", "static", "void", "deprecated", "(", "Class", "<", "?", ">", "clazz", ",", "String", "methodOrPropName", ",", "String", "version", ")", "{", "if", "(", "LOG_DEPRECATED", ")", "{", "deprecated", "(", "\"Property or method [\"", "+", "methodOrPropName", ...
Logs warning message about deprecation of specified property or method of some class. @param clazz A class @param methodOrPropName Name of deprecated property or method @param version Version of Grails release in which property or method were deprecated
[ "Logs", "warning", "message", "about", "deprecation", "of", "specified", "property", "or", "method", "of", "some", "class", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsUtil.java#L89-L95
32,455
grails/grails-core
buildSrc/src/main/groovy/JavadocFixTool.java
JavadocFixTool.main
public static void main(String[] args) { System.out.println(version); if (args.length < 1) { // No arguments - lazily initialize readme, print readme and usage initReadme(); if (readme != null) { System.out.println(readme); } p...
java
public static void main(String[] args) { System.out.println(version); if (args.length < 1) { // No arguments - lazily initialize readme, print readme and usage initReadme(); if (readme != null) { System.out.println(readme); } p...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "System", ".", "out", ".", "println", "(", "version", ")", ";", "if", "(", "args", ".", "length", "<", "1", ")", "{", "// No arguments - lazily initialize readme, print readme and...
By default only look in the folder in parameter
[ "By", "default", "only", "look", "in", "the", "folder", "in", "parameter" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/buildSrc/src/main/groovy/JavadocFixTool.java#L151-L180
32,456
grails/grails-core
grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java
AbstractEncodedAppender.shouldEncode
public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState) { return ignoreEncodingState || (encoderToApply != null && (encodingState == null || shouldEncodeWith(encoderToApply, encodingState))); }
java
public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState) { return ignoreEncodingState || (encoderToApply != null && (encodingState == null || shouldEncodeWith(encoderToApply, encodingState))); }
[ "public", "boolean", "shouldEncode", "(", "Encoder", "encoderToApply", ",", "EncodingState", "encodingState", ")", "{", "return", "ignoreEncodingState", "||", "(", "encoderToApply", "!=", "null", "&&", "(", "encodingState", "==", "null", "||", "shouldEncodeWith", "(...
Check if the encoder should be used to a input with certain encodingState @param encoderToApply the encoder to apply @param encodingState the current encoding state @return true, if should encode
[ "Check", "if", "the", "encoder", "should", "be", "used", "to", "a", "input", "with", "certain", "encodingState" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java#L170-L173
32,457
grails/grails-core
grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java
AbstractEncodedAppender.encodeAndWrite
protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input) throws IOException { Object encoded = encoder.encode(input); if (encoded != null) { String encodedStr = String.valueOf(encoded); write(newEncodingState, encodedStr, 0, e...
java
protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, CharSequence input) throws IOException { Object encoded = encoder.encode(input); if (encoded != null) { String encodedStr = String.valueOf(encoded); write(newEncodingState, encodedStr, 0, e...
[ "protected", "void", "encodeAndWrite", "(", "Encoder", "encoder", ",", "EncodingState", "newEncodingState", ",", "CharSequence", "input", ")", "throws", "IOException", "{", "Object", "encoded", "=", "encoder", ".", "encode", "(", "input", ")", ";", "if", "(", ...
Encode and write input to buffer using a non-streaming encoder @param encoder the encoder to use @param newEncodingState the new encoding state after encoder has been applied @param input the input CharSequence @throws IOException Signals that an I/O exception has occurred.
[ "Encode", "and", "write", "input", "to", "buffer", "using", "a", "non", "-", "streaming", "encoder" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java#L192-L199
32,458
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
GrailsWebRequest.getContextPath
@Override public String getContextPath() { final HttpServletRequest request = getCurrentRequest(); String appUri = (String) request.getAttribute(GrailsApplicationAttributes.APP_URI_ATTRIBUTE); if (appUri == null) { appUri = urlHelper.getContextPath(request); } ret...
java
@Override public String getContextPath() { final HttpServletRequest request = getCurrentRequest(); String appUri = (String) request.getAttribute(GrailsApplicationAttributes.APP_URI_ATTRIBUTE); if (appUri == null) { appUri = urlHelper.getContextPath(request); } ret...
[ "@", "Override", "public", "String", "getContextPath", "(", ")", "{", "final", "HttpServletRequest", "request", "=", "getCurrentRequest", "(", ")", ";", "String", "appUri", "=", "(", "String", ")", "request", ".", "getAttribute", "(", "GrailsApplicationAttributes"...
Returns the context path of the request. @return the path
[ "Returns", "the", "context", "path", "of", "the", "request", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L195-L203
32,459
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
GrailsWebRequest.isFlowRequest
public boolean isFlowRequest() { GrailsApplication application = getAttributes().getGrailsApplication(); Object controllerClassObject = getControllerClass(); GrailsControllerClass controllerClass = null; if(controllerClassObject instanceof GrailsControllerClass) { controllerC...
java
public boolean isFlowRequest() { GrailsApplication application = getAttributes().getGrailsApplication(); Object controllerClassObject = getControllerClass(); GrailsControllerClass controllerClass = null; if(controllerClassObject instanceof GrailsControllerClass) { controllerC...
[ "public", "boolean", "isFlowRequest", "(", ")", "{", "GrailsApplication", "application", "=", "getAttributes", "(", ")", ".", "getGrailsApplication", "(", ")", ";", "Object", "controllerClassObject", "=", "getControllerClass", "(", ")", ";", "GrailsControllerClass", ...
Returns true if the current executing request is a flow request @return true if it is a flow request
[ "Returns", "true", "if", "the", "current", "executing", "request", "is", "a", "flow", "request" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L385-L400
32,460
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
GrailsWebRequest.getPropertyEditorRegistry
public PropertyEditorRegistry getPropertyEditorRegistry() { final HttpServletRequest servletRequest = getCurrentRequest(); PropertyEditorRegistry registry = (PropertyEditorRegistry) servletRequest.getAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY); if (registry == null) { re...
java
public PropertyEditorRegistry getPropertyEditorRegistry() { final HttpServletRequest servletRequest = getCurrentRequest(); PropertyEditorRegistry registry = (PropertyEditorRegistry) servletRequest.getAttribute(GrailsApplicationAttributes.PROPERTY_REGISTRY); if (registry == null) { re...
[ "public", "PropertyEditorRegistry", "getPropertyEditorRegistry", "(", ")", "{", "final", "HttpServletRequest", "servletRequest", "=", "getCurrentRequest", "(", ")", ";", "PropertyEditorRegistry", "registry", "=", "(", "PropertyEditorRegistry", ")", "servletRequest", ".", ...
Obtains the PropertyEditorRegistry instance. @return The PropertyEditorRegistry
[ "Obtains", "the", "PropertyEditorRegistry", "instance", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L419-L428
32,461
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
GrailsWebRequest.lookup
public static @Nullable GrailsWebRequest lookup(HttpServletRequest request) { GrailsWebRequest webRequest = (GrailsWebRequest) request.getAttribute(GrailsApplicationAttributes.WEB_REQUEST); return webRequest == null ? lookup() : webRequest; }
java
public static @Nullable GrailsWebRequest lookup(HttpServletRequest request) { GrailsWebRequest webRequest = (GrailsWebRequest) request.getAttribute(GrailsApplicationAttributes.WEB_REQUEST); return webRequest == null ? lookup() : webRequest; }
[ "public", "static", "@", "Nullable", "GrailsWebRequest", "lookup", "(", "HttpServletRequest", "request", ")", "{", "GrailsWebRequest", "webRequest", "=", "(", "GrailsWebRequest", ")", "request", ".", "getAttribute", "(", "GrailsApplicationAttributes", ".", "WEB_REQUEST"...
Looks up the GrailsWebRequest from the current request. @param request The current request @return The GrailsWebRequest
[ "Looks", "up", "the", "GrailsWebRequest", "from", "the", "current", "request", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L435-L438
32,462
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java
GrailsWebRequest.lookup
public static @Nullable GrailsWebRequest lookup() { GrailsWebRequest webRequest = null; RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); if (requestAttributes instanceof GrailsWebRequest) { webRequest = (GrailsWebRequest) requestAttributes; }...
java
public static @Nullable GrailsWebRequest lookup() { GrailsWebRequest webRequest = null; RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); if (requestAttributes instanceof GrailsWebRequest) { webRequest = (GrailsWebRequest) requestAttributes; }...
[ "public", "static", "@", "Nullable", "GrailsWebRequest", "lookup", "(", ")", "{", "GrailsWebRequest", "webRequest", "=", "null", ";", "RequestAttributes", "requestAttributes", "=", "RequestContextHolder", ".", "getRequestAttributes", "(", ")", ";", "if", "(", "reque...
Looks up the current Grails WebRequest instance @return The GrailsWebRequest instance
[ "Looks", "up", "the", "current", "Grails", "WebRequest", "instance" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequest.java#L444-L451
32,463
grails/grails-core
grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/DefaultStackTraceFilterer.java
DefaultStackTraceFilterer.isApplicationClass
protected boolean isApplicationClass(String className) { for (String packageName : packagesToFilter) { if (className.startsWith(packageName)) return false; } return true; }
java
protected boolean isApplicationClass(String className) { for (String packageName : packagesToFilter) { if (className.startsWith(packageName)) return false; } return true; }
[ "protected", "boolean", "isApplicationClass", "(", "String", "className", ")", "{", "for", "(", "String", "packageName", ":", "packagesToFilter", ")", "{", "if", "(", "className", ".", "startsWith", "(", "packageName", ")", ")", "return", "false", ";", "}", ...
Whether the given class name is an internal class and should be filtered @param className The class name @return true if is internal
[ "Whether", "the", "given", "class", "name", "is", "an", "internal", "class", "and", "should", "be", "filtered" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/DefaultStackTraceFilterer.java#L134-L139
32,464
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.registerPrimitiveClassPair
private static final void registerPrimitiveClassPair(Class<?> left, Class<?> right) { PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(left, right); PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(right, left); }
java
private static final void registerPrimitiveClassPair(Class<?> left, Class<?> right) { PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(left, right); PRIMITIVE_TYPE_COMPATIBLE_CLASSES.put(right, left); }
[ "private", "static", "final", "void", "registerPrimitiveClassPair", "(", "Class", "<", "?", ">", "left", ",", "Class", "<", "?", ">", "right", ")", "{", "PRIMITIVE_TYPE_COMPATIBLE_CLASSES", ".", "put", "(", "left", ",", "right", ")", ";", "PRIMITIVE_TYPE_COMPA...
Just add two entries to the class compatibility map @param left @param right
[ "Just", "add", "two", "entries", "to", "the", "class", "compatibility", "map" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L73-L76
32,465
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getAllInterfaces
public static Class[] getAllInterfaces(Object instance) { Assert.notNull(instance, "Instance must not be null"); return getAllInterfacesForClass(instance.getClass()); }
java
public static Class[] getAllInterfaces(Object instance) { Assert.notNull(instance, "Instance must not be null"); return getAllInterfacesForClass(instance.getClass()); }
[ "public", "static", "Class", "[", "]", "getAllInterfaces", "(", "Object", "instance", ")", "{", "Assert", ".", "notNull", "(", "instance", ",", "\"Instance must not be null\"", ")", ";", "return", "getAllInterfacesForClass", "(", "instance", ".", "getClass", "(", ...
Return all interfaces that the given instance implements as array, including ones implemented by superclasses. @param instance the instance to analyze for interfaces @return all interfaces that the given instance implements as array
[ "Return", "all", "interfaces", "that", "the", "given", "instance", "implements", "as", "array", "including", "ones", "implemented", "by", "superclasses", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L95-L98
32,466
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPropertyOfType
public static boolean isPropertyOfType(Class<?> clazz, String propertyName, Class<?> type) { try { Class<?> propType = getPropertyType(clazz, propertyName); return propType != null && propType.equals(type); } catch (Exception e) { return false; } }
java
public static boolean isPropertyOfType(Class<?> clazz, String propertyName, Class<?> type) { try { Class<?> propType = getPropertyType(clazz, propertyName); return propType != null && propType.equals(type); } catch (Exception e) { return false; } }
[ "public", "static", "boolean", "isPropertyOfType", "(", "Class", "<", "?", ">", "clazz", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "type", ")", "{", "try", "{", "Class", "<", "?", ">", "propType", "=", "getPropertyType", "(", "clazz", ...
Returns true if the specified property in the specified class is of the specified type @param clazz The class which contains the property @param propertyName The property name @param type The type to check @return A boolean value
[ "Returns", "true", "if", "the", "specified", "property", "in", "the", "specified", "class", "is", "of", "the", "specified", "type" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L201-L209
32,467
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getPropertyValueOfNewInstance
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Object getPropertyValueOfNewInstance(Class clazz, String propertyName, Class<?> propertyType) { // validate if (clazz == null || !StringUtils.hasText(propertyName)) { return null; } try { return get...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Object getPropertyValueOfNewInstance(Class clazz, String propertyName, Class<?> propertyType) { // validate if (clazz == null || !StringUtils.hasText(propertyName)) { return null; } try { return get...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "Object", "getPropertyValueOfNewInstance", "(", "Class", "clazz", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "propertyType", ")", "{", "// val...
Returns the value of the specified property and type from an instance of the specified Grails class @param clazz The name of the class which contains the property @param propertyName The property name @param propertyType The property type @return The value of the property or null if none exists
[ "Returns", "the", "value", "of", "the", "specified", "property", "and", "type", "from", "an", "instance", "of", "the", "specified", "Grails", "class" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L220-L233
32,468
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getPropertyDescriptorForValue
public static PropertyDescriptor getPropertyDescriptorForValue(Object instance, Object propertyValue) { if (instance == null || propertyValue == null) { return null; } PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(instance.getClass()); for (PropertyDesc...
java
public static PropertyDescriptor getPropertyDescriptorForValue(Object instance, Object propertyValue) { if (instance == null || propertyValue == null) { return null; } PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(instance.getClass()); for (PropertyDesc...
[ "public", "static", "PropertyDescriptor", "getPropertyDescriptorForValue", "(", "Object", "instance", ",", "Object", "propertyValue", ")", "{", "if", "(", "instance", "==", "null", "||", "propertyValue", "==", "null", ")", "{", "return", "null", ";", "}", "Prope...
Retrieves a PropertyDescriptor for the specified instance and property value @param instance The instance @param propertyValue The value of the property @return The PropertyDescriptor
[ "Retrieves", "a", "PropertyDescriptor", "for", "the", "specified", "instance", "and", "property", "value" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L264-L286
32,469
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getPropertyType
public static Class<?> getPropertyType(Class<?> clazz, String propertyName) { if (clazz == null || !StringUtils.hasText(propertyName)) { return null; } try { PropertyDescriptor desc=BeanUtils.getPropertyDescriptor(clazz, propertyName); if (desc != null) { ...
java
public static Class<?> getPropertyType(Class<?> clazz, String propertyName) { if (clazz == null || !StringUtils.hasText(propertyName)) { return null; } try { PropertyDescriptor desc=BeanUtils.getPropertyDescriptor(clazz, propertyName); if (desc != null) { ...
[ "public", "static", "Class", "<", "?", ">", "getPropertyType", "(", "Class", "<", "?", ">", "clazz", ",", "String", "propertyName", ")", "{", "if", "(", "clazz", "==", "null", "||", "!", "StringUtils", ".", "hasText", "(", "propertyName", ")", ")", "{"...
Returns the type of the given property contained within the specified class @param clazz The class which contains the property @param propertyName The name of the property @return The property type or null if none exists
[ "Returns", "the", "type", "of", "the", "given", "property", "contained", "within", "the", "specified", "class" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L296-L312
32,470
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getPropertiesAssignableToType
public static PropertyDescriptor[] getPropertiesAssignableToType(Class<?> clazz, Class<?> propertySuperType) { if (clazz == null || propertySuperType == null) return new PropertyDescriptor[0]; Set<PropertyDescriptor> properties = new HashSet<PropertyDescriptor>(); PropertyDescriptor descriptor ...
java
public static PropertyDescriptor[] getPropertiesAssignableToType(Class<?> clazz, Class<?> propertySuperType) { if (clazz == null || propertySuperType == null) return new PropertyDescriptor[0]; Set<PropertyDescriptor> properties = new HashSet<PropertyDescriptor>(); PropertyDescriptor descriptor ...
[ "public", "static", "PropertyDescriptor", "[", "]", "getPropertiesAssignableToType", "(", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", ">", "propertySuperType", ")", "{", "if", "(", "clazz", "==", "null", "||", "propertySuperType", "==", "null", ...
Retrieves all the properties of the given class which are assignable to the given type @param clazz The class to retrieve the properties from @param propertySuperType The type of the properties you wish to retrieve @return An array of PropertyDescriptor instances
[ "Retrieves", "all", "the", "properties", "of", "the", "given", "class", "which", "are", "assignable", "to", "the", "given", "type" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L362-L386
32,471
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isMatchBetweenPrimativeAndWrapperTypes
@SuppressWarnings("rawtypes") public static boolean isMatchBetweenPrimativeAndWrapperTypes(Class leftType, Class rightType) { if (leftType == null) { throw new NullPointerException("Left type is null!"); } if (rightType == null) { throw new NullPointerException("Right...
java
@SuppressWarnings("rawtypes") public static boolean isMatchBetweenPrimativeAndWrapperTypes(Class leftType, Class rightType) { if (leftType == null) { throw new NullPointerException("Left type is null!"); } if (rightType == null) { throw new NullPointerException("Right...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "boolean", "isMatchBetweenPrimativeAndWrapperTypes", "(", "Class", "leftType", ",", "Class", "rightType", ")", "{", "if", "(", "leftType", "==", "null", ")", "{", "throw", "new", "NullPointerEx...
Detect if left and right types are matching types. In particular, test if one is a primitive type and the other is the corresponding Java wrapper type. Primitive and wrapper classes may be passed to either arguments. @param leftType @param rightType @return true if one of the classes is a native type and the other the...
[ "Detect", "if", "left", "and", "right", "types", "are", "matching", "types", ".", "In", "particular", "test", "if", "one", "is", "a", "primitive", "type", "and", "the", "other", "is", "the", "corresponding", "Java", "wrapper", "type", ".", "Primitive", "an...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L457-L467
32,472
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPublicStatic
public static boolean isPublicStatic(Method m) { final int modifiers = m.getModifiers(); return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers); }
java
public static boolean isPublicStatic(Method m) { final int modifiers = m.getModifiers(); return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers); }
[ "public", "static", "boolean", "isPublicStatic", "(", "Method", "m", ")", "{", "final", "int", "modifiers", "=", "m", ".", "getModifiers", "(", ")", ";", "return", "Modifier", ".", "isPublic", "(", "modifiers", ")", "&&", "Modifier", ".", "isStatic", "(", ...
Determine whether the method is declared public static @param m @return true if the method is declared public static
[ "Determine", "whether", "the", "method", "is", "declared", "public", "static" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L549-L552
32,473
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPublicStatic
public static boolean isPublicStatic(Field f) { final int modifiers = f.getModifiers(); return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers); }
java
public static boolean isPublicStatic(Field f) { final int modifiers = f.getModifiers(); return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers); }
[ "public", "static", "boolean", "isPublicStatic", "(", "Field", "f", ")", "{", "final", "int", "modifiers", "=", "f", ".", "getModifiers", "(", ")", ";", "return", "Modifier", ".", "isPublic", "(", "modifiers", ")", "&&", "Modifier", ".", "isStatic", "(", ...
Determine whether the field is declared public static @param f @return true if the field is declared public static
[ "Determine", "whether", "the", "field", "is", "declared", "public", "static" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L559-L562
32,474
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.getFieldValue
public static Object getFieldValue(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return f.get(obj); } catch (Exception e) { return null; } }
java
public static Object getFieldValue(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return f.get(obj); } catch (Exception e) { return null; } }
[ "public", "static", "Object", "getFieldValue", "(", "Object", "obj", ",", "String", "name", ")", "{", "Class", "<", "?", ">", "clazz", "=", "obj", ".", "getClass", "(", ")", ";", "try", "{", "Field", "f", "=", "clazz", ".", "getDeclaredField", "(", "...
Get the value of a declared field on an object @param obj @param name @return The object value or null if there is no such field or access problems
[ "Get", "the", "value", "of", "a", "declared", "field", "on", "an", "object" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L655-L664
32,475
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPublicField
public static boolean isPublicField(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return Modifier.isPublic(f.getModifiers()); } catch (NoSuchFieldException e) { return false; } }
java
public static boolean isPublicField(Object obj, String name) { Class<?> clazz = obj.getClass(); try { Field f = clazz.getDeclaredField(name); return Modifier.isPublic(f.getModifiers()); } catch (NoSuchFieldException e) { return false; } }
[ "public", "static", "boolean", "isPublicField", "(", "Object", "obj", ",", "String", "name", ")", "{", "Class", "<", "?", ">", "clazz", "=", "obj", ".", "getClass", "(", ")", ";", "try", "{", "Field", "f", "=", "clazz", ".", "getDeclaredField", "(", ...
Work out if the specified object has a public field with the name supplied. @param obj @param name @return true if a public field with the name exists
[ "Work", "out", "if", "the", "specified", "object", "has", "a", "public", "field", "with", "the", "name", "supplied", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L673-L682
32,476
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPropertyInherited
@SuppressWarnings("rawtypes") public static boolean isPropertyInherited(Class clz, String propertyName) { if (clz == null) return false; Assert.isTrue(StringUtils.hasText(propertyName), "Argument [propertyName] cannot be null or blank"); Class<?> superClass = clz.getSuperclass(); P...
java
@SuppressWarnings("rawtypes") public static boolean isPropertyInherited(Class clz, String propertyName) { if (clz == null) return false; Assert.isTrue(StringUtils.hasText(propertyName), "Argument [propertyName] cannot be null or blank"); Class<?> superClass = clz.getSuperclass(); P...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "boolean", "isPropertyInherited", "(", "Class", "clz", ",", "String", "propertyName", ")", "{", "if", "(", "clz", "==", "null", ")", "return", "false", ";", "Assert", ".", "isTrue", "(", ...
Checks whether the specified property is inherited from a super class @param clz The class to check @param propertyName The property name @return true if the property is inherited
[ "Checks", "whether", "the", "specified", "property", "is", "inherited", "from", "a", "super", "class" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L691-L703
32,477
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isPropertyGetter
public static boolean isPropertyGetter(Method method) { return !Modifier.isStatic(method.getModifiers()) && Modifier.isPublic(method.getModifiers()) && GrailsNameUtils.isGetter(method.getName(), method.getReturnType(), method.getParameterTypes()); }
java
public static boolean isPropertyGetter(Method method) { return !Modifier.isStatic(method.getModifiers()) && Modifier.isPublic(method.getModifiers()) && GrailsNameUtils.isGetter(method.getName(), method.getReturnType(), method.getParameterTypes()); }
[ "public", "static", "boolean", "isPropertyGetter", "(", "Method", "method", ")", "{", "return", "!", "Modifier", ".", "isStatic", "(", "method", ".", "getModifiers", "(", ")", ")", "&&", "Modifier", ".", "isPublic", "(", "method", ".", "getModifiers", "(", ...
Check whether the specified method is a property getter @param method The method @return true if the method is a property getter
[ "Check", "whether", "the", "specified", "method", "is", "a", "property", "getter" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L711-L713
32,478
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.createConcreteCollection
@SuppressWarnings("rawtypes") public static Collection createConcreteCollection(Class interfaceType) { Collection elements; if (interfaceType.equals(List.class) || interfaceType.equals(Collection.class)) { elements = new ArrayList(); } else if (interfaceType.equals(Sorted...
java
@SuppressWarnings("rawtypes") public static Collection createConcreteCollection(Class interfaceType) { Collection elements; if (interfaceType.equals(List.class) || interfaceType.equals(Collection.class)) { elements = new ArrayList(); } else if (interfaceType.equals(Sorted...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "Collection", "createConcreteCollection", "(", "Class", "interfaceType", ")", "{", "Collection", "elements", ";", "if", "(", "interfaceType", ".", "equals", "(", "List", ".", "class", ")", "|...
Creates a concrete collection for the suppied interface @param interfaceType The interface @return ArrayList for List, TreeSet for SortedSet, HashSet for Set etc.
[ "Creates", "a", "concrete", "collection", "for", "the", "suppied", "interface" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L720-L733
32,479
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isSetter
@SuppressWarnings("rawtypes") public static boolean isSetter(String name, Class[] args) { if (!StringUtils.hasText(name) || args == null)return false; if (name.startsWith("set")) { if (args.length != 1) return false; return GrailsNameUtils.isPropertyMethodSuffix(name.substri...
java
@SuppressWarnings("rawtypes") public static boolean isSetter(String name, Class[] args) { if (!StringUtils.hasText(name) || args == null)return false; if (name.startsWith("set")) { if (args.length != 1) return false; return GrailsNameUtils.isPropertyMethodSuffix(name.substri...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "boolean", "isSetter", "(", "String", "name", ",", "Class", "[", "]", "args", ")", "{", "if", "(", "!", "StringUtils", ".", "hasText", "(", "name", ")", "||", "args", "==", "null", ...
Returns true if the name of the method specified and the number of arguments make it a javabean property setter. The name is assumed to be a valid Java method name, that is not verified. @param name The name of the method @param args The arguments @return true if it is a javabean property setter
[ "Returns", "true", "if", "the", "name", "of", "the", "method", "specified", "and", "the", "number", "of", "arguments", "make", "it", "a", "javabean", "property", "setter", ".", "The", "name", "is", "assumed", "to", "be", "a", "valid", "Java", "method", "...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L743-L753
32,480
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isAssignableOrConvertibleFrom
public static boolean isAssignableOrConvertibleFrom(Class<?> clazz, Class<?> type) { if (type == null || clazz == null) { return false; } if (type.isPrimitive()) { // convert primitive type to compatible class Class<?> primitiveClass = GrailsClassUtils.PRIMITI...
java
public static boolean isAssignableOrConvertibleFrom(Class<?> clazz, Class<?> type) { if (type == null || clazz == null) { return false; } if (type.isPrimitive()) { // convert primitive type to compatible class Class<?> primitiveClass = GrailsClassUtils.PRIMITI...
[ "public", "static", "boolean", "isAssignableOrConvertibleFrom", "(", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", ">", "type", ")", "{", "if", "(", "type", "==", "null", "||", "clazz", "==", "null", ")", "{", "return", "false", ";", "}", ...
Returns true if the specified clazz parameter is either the same as, or is a superclass or superinterface of, the specified type parameter. Converts primitive types to compatible class automatically. @param clazz @param type @return true if the class is a taglib @see java.lang.Class#isAssignableFrom(Class)
[ "Returns", "true", "if", "the", "specified", "clazz", "parameter", "is", "either", "the", "same", "as", "or", "is", "a", "superclass", "or", "superinterface", "of", "the", "specified", "type", "parameter", ".", "Converts", "primitive", "types", "to", "compatib...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L789-L803
32,481
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.findPropertyNameForValue
public static String findPropertyNameForValue(Object target, Object obj) { MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(target.getClass()); List<MetaProperty> metaProperties = mc.getProperties(); for (MetaProperty metaProperty : metaProperties) { if (isAssignableOr...
java
public static String findPropertyNameForValue(Object target, Object obj) { MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(target.getClass()); List<MetaProperty> metaProperties = mc.getProperties(); for (MetaProperty metaProperty : metaProperties) { if (isAssignableOr...
[ "public", "static", "String", "findPropertyNameForValue", "(", "Object", "target", ",", "Object", "obj", ")", "{", "MetaClass", "mc", "=", "GroovySystem", ".", "getMetaClassRegistry", "(", ")", ".", "getMetaClass", "(", "target", ".", "getClass", "(", ")", ")"...
Locates the name of a property for the given value on the target object using Groovy's meta APIs. Note that this method uses the reference so the incorrect result could be returned for two properties that refer to the same reference. Use with caution. @param target The target @param obj The property value @return The ...
[ "Locates", "the", "name", "of", "a", "property", "for", "the", "given", "value", "on", "the", "target", "object", "using", "Groovy", "s", "meta", "APIs", ".", "Note", "that", "this", "method", "uses", "the", "reference", "so", "the", "incorrect", "result",...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L848-L860
32,482
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isClassBelowPackage
public static boolean isClassBelowPackage(Class<?> theClass, List<?> packageList) { String classPackage = theClass.getPackage().getName(); for (Object packageName : packageList) { if (packageName != null) { if (classPackage.startsWith(packageName.toString())) { ...
java
public static boolean isClassBelowPackage(Class<?> theClass, List<?> packageList) { String classPackage = theClass.getPackage().getName(); for (Object packageName : packageList) { if (packageName != null) { if (classPackage.startsWith(packageName.toString())) { ...
[ "public", "static", "boolean", "isClassBelowPackage", "(", "Class", "<", "?", ">", "theClass", ",", "List", "<", "?", ">", "packageList", ")", "{", "String", "classPackage", "=", "theClass", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ";", "fo...
Returns whether the specified class is either within one of the specified packages or within a subpackage of one of the packages @param theClass The class @param packageList The list of packages @return true if it is within the list of specified packages
[ "Returns", "whether", "the", "specified", "class", "is", "either", "within", "one", "of", "the", "specified", "packages", "or", "within", "a", "subpackage", "of", "one", "of", "the", "packages" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L952-L962
32,483
grails/grails-core
grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/AbstractUrlMappingInfo.java
AbstractUrlMappingInfo.populateParamsForMapping
protected void populateParamsForMapping(GrailsWebRequest webRequest) { Map dispatchParams = webRequest.getParams(); String encoding = webRequest.getRequest().getCharacterEncoding(); if (encoding == null) encoding = "UTF-8"; for (Map.Entry<String, Object> entry : params.entrySet()) { ...
java
protected void populateParamsForMapping(GrailsWebRequest webRequest) { Map dispatchParams = webRequest.getParams(); String encoding = webRequest.getRequest().getCharacterEncoding(); if (encoding == null) encoding = "UTF-8"; for (Map.Entry<String, Object> entry : params.entrySet()) { ...
[ "protected", "void", "populateParamsForMapping", "(", "GrailsWebRequest", "webRequest", ")", "{", "Map", "dispatchParams", "=", "webRequest", ".", "getParams", "(", ")", ";", "String", "encoding", "=", "webRequest", ".", "getRequest", "(", ")", ".", "getCharacterE...
Populates request parameters for the given UrlMappingInfo instance using the GrailsWebRequest @param webRequest The Map instance @see org.grails.web.servlet.mvc.GrailsWebRequest
[ "Populates", "request", "parameters", "for", "the", "given", "UrlMappingInfo", "instance", "using", "the", "GrailsWebRequest" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/AbstractUrlMappingInfo.java#L77-L108
32,484
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsMetaClassUtils.java
GrailsMetaClassUtils.copyExpandoMetaClass
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void copyExpandoMetaClass(Class<?> fromClass, Class<?> toClass, boolean removeSource) { MetaClassRegistry registry = getRegistry(); MetaClass oldMetaClass = registry.getMetaClass(fromClass); AdaptingMetaClass adapter = null; ...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void copyExpandoMetaClass(Class<?> fromClass, Class<?> toClass, boolean removeSource) { MetaClassRegistry registry = getRegistry(); MetaClass oldMetaClass = registry.getMetaClass(fromClass); AdaptingMetaClass adapter = null; ...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "void", "copyExpandoMetaClass", "(", "Class", "<", "?", ">", "fromClass", ",", "Class", "<", "?", ">", "toClass", ",", "boolean", "removeSource", ")", "{",...
Copies the ExpandoMetaClass dynamic methods and properties from one Class to another. @param fromClass The source class @param toClass The destination class @param removeSource Whether to remove the source class after completion. True if yes
[ "Copies", "the", "ExpandoMetaClass", "dynamic", "methods", "and", "properties", "from", "one", "Class", "to", "another", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsMetaClassUtils.java#L66-L139
32,485
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java
JSONTokener.skipPast
public void skipPast(String to) { this.myIndex = this.mySource.indexOf(to, this.myIndex); if (this.myIndex < 0) { this.myIndex = this.mySource.length(); } else { this.myIndex += to.length(); } }
java
public void skipPast(String to) { this.myIndex = this.mySource.indexOf(to, this.myIndex); if (this.myIndex < 0) { this.myIndex = this.mySource.length(); } else { this.myIndex += to.length(); } }
[ "public", "void", "skipPast", "(", "String", "to", ")", "{", "this", ".", "myIndex", "=", "this", ".", "mySource", ".", "indexOf", "(", "to", ",", "this", ".", "myIndex", ")", ";", "if", "(", "this", ".", "myIndex", "<", "0", ")", "{", "this", "....
Skip characters until past the requested string. If it is not found, we are left at the end of the source. @param to A string to skip past.
[ "Skip", "characters", "until", "past", "the", "requested", "string", ".", "If", "it", "is", "not", "found", "we", "are", "left", "at", "the", "end", "of", "the", "source", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java#L453-L460
32,486
grails/grails-core
grails-core/src/main/groovy/grails/util/CacheEntry.java
CacheEntry.getValue
@SuppressWarnings({ "unchecked", "rawtypes" }) public static <K, V> V getValue(ConcurrentMap<K, CacheEntry<V>> map, K key, long timeoutMillis, Callable<V> updater, Callable<? extends CacheEntry> cacheEntryFactory, boolean returnExpiredWhileUpdating, Object cacheRequestObject) { CacheEntry<V> cacheEntry = ma...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static <K, V> V getValue(ConcurrentMap<K, CacheEntry<V>> map, K key, long timeoutMillis, Callable<V> updater, Callable<? extends CacheEntry> cacheEntryFactory, boolean returnExpiredWhileUpdating, Object cacheRequestObject) { CacheEntry<V> cacheEntry = ma...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "<", "K", ",", "V", ">", "V", "getValue", "(", "ConcurrentMap", "<", "K", ",", "CacheEntry", "<", "V", ">", ">", "map", ",", "K", "key", ",", "long...
Gets a value from cache. If the key doesn't exist, it will create the value using the updater callback Prevents cache storms with a lock The key is always added to the cache. Null return values will also be cached. You can use this together with ConcurrentLinkedHashMap to create a bounded LRU cache @param map the cac...
[ "Gets", "a", "value", "from", "cache", ".", "If", "the", "key", "doesn", "t", "exist", "it", "will", "create", "the", "value", "using", "the", "updater", "callback", "Prevents", "cache", "storms", "with", "a", "lock" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/CacheEntry.java#L72-L95
32,487
grails/grails-core
grails-core/src/main/groovy/grails/util/CacheEntry.java
CacheEntry.getValue
public V getValue(long timeout, Callable<V> updater, boolean returnExpiredWhileUpdating, Object cacheRequestObject) { if (!isInitialized() || hasExpired(timeout, cacheRequestObject)) { boolean lockAcquired = false; try { long beforeLockingCreatedMillis = createdMillis; ...
java
public V getValue(long timeout, Callable<V> updater, boolean returnExpiredWhileUpdating, Object cacheRequestObject) { if (!isInitialized() || hasExpired(timeout, cacheRequestObject)) { boolean lockAcquired = false; try { long beforeLockingCreatedMillis = createdMillis; ...
[ "public", "V", "getValue", "(", "long", "timeout", ",", "Callable", "<", "V", ">", "updater", ",", "boolean", "returnExpiredWhileUpdating", ",", "Object", "cacheRequestObject", ")", "{", "if", "(", "!", "isInitialized", "(", ")", "||", "hasExpired", "(", "ti...
gets the current value from the entry and updates it if it's older than timeout updater is a callback for creating an updated value. @param timeout @param updater @param returnExpiredWhileUpdating @param cacheRequestObject @return the current value
[ "gets", "the", "current", "value", "from", "the", "entry", "and", "updates", "it", "if", "it", "s", "older", "than", "timeout" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/CacheEntry.java#L128-L177
32,488
grails/grails-core
grails-encoder/src/main/groovy/org/grails/encoder/CodecLookupHelper.java
CodecLookupHelper.lookupEncoder
public static Encoder lookupEncoder(GrailsApplication grailsApplication, String codecName) { ApplicationContext ctx = grailsApplication != null ? grailsApplication.getMainContext() : null; if(ctx != null) { try { CodecLookup codecLookup = ctx.getBean("codecLookup", CodecLooku...
java
public static Encoder lookupEncoder(GrailsApplication grailsApplication, String codecName) { ApplicationContext ctx = grailsApplication != null ? grailsApplication.getMainContext() : null; if(ctx != null) { try { CodecLookup codecLookup = ctx.getBean("codecLookup", CodecLooku...
[ "public", "static", "Encoder", "lookupEncoder", "(", "GrailsApplication", "grailsApplication", ",", "String", "codecName", ")", "{", "ApplicationContext", "ctx", "=", "grailsApplication", "!=", "null", "?", "grailsApplication", ".", "getMainContext", "(", ")", ":", ...
Lookup encoder. @param grailsApplication the grailsApplication instance @param codecName the codec name @return the encoder instance
[ "Lookup", "encoder", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/CodecLookupHelper.java#L37-L49
32,489
grails/grails-core
grails-core/src/main/groovy/org/grails/core/support/internal/tools/MetaClassChangeReporter.java
MetaClassChangeReporter.updateConstantMetaClass
public void updateConstantMetaClass(MetaClassRegistryChangeEvent cmcu) { Class<?> classToUpdate = cmcu.getClassToUpdate(); MetaClass newMetaClass = cmcu.getNewMetaClass(); System.out.println("Class ["+classToUpdate+"] updated MetaClass to ["+newMetaClass+"]"); Thread.dumpStack(); }
java
public void updateConstantMetaClass(MetaClassRegistryChangeEvent cmcu) { Class<?> classToUpdate = cmcu.getClassToUpdate(); MetaClass newMetaClass = cmcu.getNewMetaClass(); System.out.println("Class ["+classToUpdate+"] updated MetaClass to ["+newMetaClass+"]"); Thread.dumpStack(); }
[ "public", "void", "updateConstantMetaClass", "(", "MetaClassRegistryChangeEvent", "cmcu", ")", "{", "Class", "<", "?", ">", "classToUpdate", "=", "cmcu", ".", "getClassToUpdate", "(", ")", ";", "MetaClass", "newMetaClass", "=", "cmcu", ".", "getNewMetaClass", "(",...
Called when the a constant MetaClass is updated. If the new MetaClass is null, then the MetaClass is removed. Be careful, while this method is executed other updates may happen. If you want this method thread safe, you have to take care of that by yourself. @param cmcu - the change event
[ "Called", "when", "the", "a", "constant", "MetaClass", "is", "updated", ".", "If", "the", "new", "MetaClass", "is", "null", "then", "the", "MetaClass", "is", "removed", ".", "Be", "careful", "while", "this", "method", "is", "executed", "other", "updates", ...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/support/internal/tools/MetaClassChangeReporter.java#L36-L42
32,490
grails/grails-core
grails-bootstrap/src/main/groovy/grails/util/GrailsNameUtils.java
GrailsNameUtils.getPropertyForSetter
public static String getPropertyForSetter(String setterName) { if (setterName == null || setterName.length() == 0) return null; if (setterName.startsWith("set")) { String prop = setterName.substring(3); return convertValidPropertyMethodSuffix(prop); } return null...
java
public static String getPropertyForSetter(String setterName) { if (setterName == null || setterName.length() == 0) return null; if (setterName.startsWith("set")) { String prop = setterName.substring(3); return convertValidPropertyMethodSuffix(prop); } return null...
[ "public", "static", "String", "getPropertyForSetter", "(", "String", "setterName", ")", "{", "if", "(", "setterName", "==", "null", "||", "setterName", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "if", "(", "setterName", ".", "startsWit...
Returns a property name equivalent for the given setter name or null if it is not a valid setter. If not null or empty the setter name is assumed to be a valid identifier. @param setterName The setter name, must be null or empty or a valid identifier name @return The property name equivalent
[ "Returns", "a", "property", "name", "equivalent", "for", "the", "given", "setter", "name", "or", "null", "if", "it", "is", "not", "a", "valid", "setter", ".", "If", "not", "null", "or", "empty", "the", "setter", "name", "is", "assumed", "to", "be", "a"...
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/grails/util/GrailsNameUtils.java#L712-L720
32,491
grails/grails-core
grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
ControllerActionTransformer.convertToMethodAction
private MethodNode convertToMethodAction(ClassNode classNode, MethodNode methodNode, SourceUnit source, GeneratorContext context) { final ClassNode returnType = methodNode.getReturnType(); Parameter[] parameters = methodNode.getParameters(); for (Parameter param : parameters) { ...
java
private MethodNode convertToMethodAction(ClassNode classNode, MethodNode methodNode, SourceUnit source, GeneratorContext context) { final ClassNode returnType = methodNode.getReturnType(); Parameter[] parameters = methodNode.getParameters(); for (Parameter param : parameters) { ...
[ "private", "MethodNode", "convertToMethodAction", "(", "ClassNode", "classNode", ",", "MethodNode", "methodNode", ",", "SourceUnit", "source", ",", "GeneratorContext", "context", ")", "{", "final", "ClassNode", "returnType", "=", "methodNode", ".", "getReturnType", "(...
Converts a method into a controller action. If the method accepts parameters, a no-arg counterpart is created which delegates to the original. @param classNode The controller class @param methodNode The method to be converted @return The no-arg wrapper method, or null if none was created.
[ "Converts", "a", "method", "into", "a", "controller", "action", ".", "If", "the", "method", "accepts", "parameters", "a", "no", "-", "arg", "counterpart", "is", "created", "which", "delegates", "to", "the", "original", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java#L356-L407
32,492
grails/grails-core
grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
ControllerActionTransformer.doesModulePathIncludeSubstring
private boolean doesModulePathIncludeSubstring(ModuleNode moduleNode, final String substring) { if (moduleNode == null) { return false; } boolean substringFoundInDescription = false; String commandObjectModuleDescription = moduleNode.getDescription(); if (commandObj...
java
private boolean doesModulePathIncludeSubstring(ModuleNode moduleNode, final String substring) { if (moduleNode == null) { return false; } boolean substringFoundInDescription = false; String commandObjectModuleDescription = moduleNode.getDescription(); if (commandObj...
[ "private", "boolean", "doesModulePathIncludeSubstring", "(", "ModuleNode", "moduleNode", ",", "final", "String", "substring", ")", "{", "if", "(", "moduleNode", "==", "null", ")", "{", "return", "false", ";", "}", "boolean", "substringFoundInDescription", "=", "fa...
Checks to see if a Module is defined at a path which includes the specified substring @param moduleNode a ModuleNode @param substring The substring to search for @return true if moduleNode is defined at a path which includes the specified substring
[ "Checks", "to", "see", "if", "a", "Module", "is", "defined", "at", "a", "path", "which", "includes", "the", "specified", "substring" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java#L855-L867
32,493
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getViewURI
public String getViewURI(GroovyObject controller, String viewName) { return getViewURI(getLogicalControllerName(controller), viewName); }
java
public String getViewURI(GroovyObject controller, String viewName) { return getViewURI(getLogicalControllerName(controller), viewName); }
[ "public", "String", "getViewURI", "(", "GroovyObject", "controller", ",", "String", "viewName", ")", "{", "return", "getViewURI", "(", "getLogicalControllerName", "(", "controller", ")", ",", "viewName", ")", ";", "}" ]
Obtains a view URI of the given controller and view name @param controller The name of the controller @param viewName The name of the view @return The view URI
[ "Obtains", "a", "view", "URI", "of", "the", "given", "controller", "and", "view", "name" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L69-L71
32,494
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getNoSuffixViewURI
public String getNoSuffixViewURI(GroovyObject controller, String viewName) { return getNoSuffixViewURI(getLogicalControllerName(controller), viewName); }
java
public String getNoSuffixViewURI(GroovyObject controller, String viewName) { return getNoSuffixViewURI(getLogicalControllerName(controller), viewName); }
[ "public", "String", "getNoSuffixViewURI", "(", "GroovyObject", "controller", ",", "String", "viewName", ")", "{", "return", "getNoSuffixViewURI", "(", "getLogicalControllerName", "(", "controller", ")", ",", "viewName", ")", ";", "}" ]
Obtains a view URI of the given controller and view name without the suffix @param controller The name of the controller @param viewName The name of the view @return The view URI
[ "Obtains", "a", "view", "URI", "of", "the", "given", "controller", "and", "view", "name", "without", "the", "suffix" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L79-L81
32,495
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getAbsoluteTemplateURI
public String getAbsoluteTemplateURI(String templateName, boolean includeExtension) { FastStringWriter buf = new FastStringWriter(); String tmp = templateName.substring(1,templateName.length()); if (tmp.indexOf(SLASH) > -1) { buf.append(SLASH); int i = tmp.lastIndexOf(SLA...
java
public String getAbsoluteTemplateURI(String templateName, boolean includeExtension) { FastStringWriter buf = new FastStringWriter(); String tmp = templateName.substring(1,templateName.length()); if (tmp.indexOf(SLASH) > -1) { buf.append(SLASH); int i = tmp.lastIndexOf(SLA...
[ "public", "String", "getAbsoluteTemplateURI", "(", "String", "templateName", ",", "boolean", "includeExtension", ")", "{", "FastStringWriter", "buf", "=", "new", "FastStringWriter", "(", ")", ";", "String", "tmp", "=", "templateName", ".", "substring", "(", "1", ...
Used to resolve template names that are not relative to a controller. @param templateName The template name normally beginning with / @param includeExtension The flag to include the template extension @return The template URI
[ "Used", "to", "resolve", "template", "names", "that", "are", "not", "relative", "to", "a", "controller", "." ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L157-L177
32,496
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getViewURI
public String getViewURI(String controllerName, String viewName) { FastStringWriter buf = new FastStringWriter(); return getViewURIInternal(controllerName, viewName, buf, true); }
java
public String getViewURI(String controllerName, String viewName) { FastStringWriter buf = new FastStringWriter(); return getViewURIInternal(controllerName, viewName, buf, true); }
[ "public", "String", "getViewURI", "(", "String", "controllerName", ",", "String", "viewName", ")", "{", "FastStringWriter", "buf", "=", "new", "FastStringWriter", "(", ")", ";", "return", "getViewURIInternal", "(", "controllerName", ",", "viewName", ",", "buf", ...
Obtains a view URI of the given controller name and view name @param controllerName The name of the controller @param viewName The name of the view @return The view URI
[ "Obtains", "a", "view", "URI", "of", "the", "given", "controller", "name", "and", "view", "name" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L186-L190
32,497
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getAbsoluteViewURI
public String getAbsoluteViewURI(String viewName) { FastStringWriter buf = new FastStringWriter(); return getAbsoluteViewURIInternal(viewName, buf, true); }
java
public String getAbsoluteViewURI(String viewName) { FastStringWriter buf = new FastStringWriter(); return getAbsoluteViewURIInternal(viewName, buf, true); }
[ "public", "String", "getAbsoluteViewURI", "(", "String", "viewName", ")", "{", "FastStringWriter", "buf", "=", "new", "FastStringWriter", "(", ")", ";", "return", "getAbsoluteViewURIInternal", "(", "viewName", ",", "buf", ",", "true", ")", ";", "}" ]
Obtains a view URI that is not relative to any given controller @param viewName The name of the view @return The view URI
[ "Obtains", "a", "view", "URI", "that", "is", "not", "relative", "to", "any", "given", "controller" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L198-L201
32,498
grails/grails-core
grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java
GroovyPagesUriSupport.getNoSuffixViewURI
public String getNoSuffixViewURI(String controllerName, String viewName) { FastStringWriter buf = new FastStringWriter(); return getViewURIInternal(controllerName, viewName, buf, false); }
java
public String getNoSuffixViewURI(String controllerName, String viewName) { FastStringWriter buf = new FastStringWriter(); return getViewURIInternal(controllerName, viewName, buf, false); }
[ "public", "String", "getNoSuffixViewURI", "(", "String", "controllerName", ",", "String", "viewName", ")", "{", "FastStringWriter", "buf", "=", "new", "FastStringWriter", "(", ")", ";", "return", "getViewURIInternal", "(", "controllerName", ",", "viewName", ",", "...
Obtains a view URI of the given controller name and view name without the suffix @param controllerName The name of the controller @param viewName The name of the view @return The view URI
[ "Obtains", "a", "view", "URI", "of", "the", "given", "controller", "name", "and", "view", "name", "without", "the", "suffix" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L209-L213
32,499
grails/grails-core
grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java
DefaultEncodingStateRegistry.shouldEncodeWith
public static boolean shouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState) { if(isNoneEncoder(encoderToApply)) return false; if (currentEncodingState != null && currentEncodingState.getEncoders() != null) { for (Encoder encoder : currentEncodingState.getEncoders()) { ...
java
public static boolean shouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState) { if(isNoneEncoder(encoderToApply)) return false; if (currentEncodingState != null && currentEncodingState.getEncoders() != null) { for (Encoder encoder : currentEncodingState.getEncoders()) { ...
[ "public", "static", "boolean", "shouldEncodeWith", "(", "Encoder", "encoderToApply", ",", "EncodingState", "currentEncodingState", ")", "{", "if", "(", "isNoneEncoder", "(", "encoderToApply", ")", ")", "return", "false", ";", "if", "(", "currentEncodingState", "!=",...
Checks if encoder should be applied to a input with given encoding state @param encoderToApply the encoder to apply @param currentEncodingState the current encoding state @return true, if should encode
[ "Checks", "if", "encoder", "should", "be", "applied", "to", "a", "input", "with", "given", "encoding", "state" ]
c0b08aa995b0297143b75d05642abba8cb7b4122
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/DefaultEncodingStateRegistry.java#L100-L110