code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public static void clear()
{
if (Session.exists())
{
Session.get().setMetaData(key, null);
}
} | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | clear | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
static void continueToOriginalDestination()
{
InterceptData data = InterceptData.get();
if (data != null)
{
String url = RequestCycle.get().getUrlRenderer().renderUrl(data.originalUrl);
Url parsedUrl = Url.parse(url);
// Fix issue ##1301
parsedUrl.getQueryParameters().removeIf(it -> it.getName().cont... | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | continueToOriginalDestination | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
static void clearOriginalDestination()
{
InterceptData.clear();
} | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | clearOriginalDestination | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
@Override
public int getCompatibilityScore(Request request)
{
return matchedData(request) != null ? Integer.MAX_VALUE : 0;
} | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | getCompatibilityScore | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
@Override
public Url mapHandler(IRequestHandler requestHandler)
{
return null;
} | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | mapHandler | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
@Override
public IRequestHandler mapRequest(Request request)
{
InterceptData data = matchedData(request);
if (data != null)
{
if (data.postParameters.isEmpty() == false &&
request.getPostParameters() instanceof IWritableRequestParameters)
{
IWritableRequestParameters parameters = (IWritab... | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | mapRequest | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
private InterceptData matchedData(Request request)
{
InterceptData data = InterceptData.get();
if (data != null && data.originalUrl.equals(request.getOriginalUrl()))
{
return data;
}
return null;
} | INTERNAL CLASS, DO NOT USE
@author igor.vaynberg | matchedData | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java | MIT |
@Override
public final Class<?> resolveClass(final String className) throws ClassNotFoundException
{
if (className.equals(FieldUtils.FIELD_BEAN_CLASS_NAME))
return FieldUtils.getFieldBeanClass();
Class<?> clazz = ParamUtils.loadBeanClass(className);
if (clazz != null)
return clazz;
WeakReferen... | Usually class loaders implement more efficient caching strategies than we could possibly do,
but we experienced synchronization issue resulting in stack traces like:
java.lang.LinkageError: duplicate class definition:
<pre>
wicket/examples/repeater/RepeatingPage at java.lang.ClassLoader.defineClass1(Native Method)
... | resolveClass | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/application/AbstractClassResolver.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/application/AbstractClassResolver.java | MIT |
@Override
public Iterator<URL> getResources(final String name)
{
Set<URL> resultSet = new TreeSet<>(new UrlExternalFormComparator());
try
{
// Try the classloader for the wicket jar/bundle
Enumeration<URL> resources = Application.class.getClassLoader().getResources(name);
loadResources(resources, resu... | Usually class loaders implement more efficient caching strategies than we could possibly do,
but we experienced synchronization issue resulting in stack traces like:
java.lang.LinkageError: duplicate class definition:
<pre>
wicket/examples/repeater/RepeatingPage at java.lang.ClassLoader.defineClass1(Native Method)
... | getResources | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/application/AbstractClassResolver.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/application/AbstractClassResolver.java | MIT |
protected boolean canBeHandled(final Url url)
{
List<String> segments = url.getSegments();
return (segments.size() >= 4 &&
urlStartsWith(url, getContext().getNamespace(), getContext().getResourceIdentifier()) &&
Strings.isEmpty(segments.get(3)) == false
);
} | Checks whether the passed Url can be handled by this mapper
@param url
the Url to check
@return {@code true} - if the Url can be handled, {@code false} - otherwise | canBeHandled | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/core/request/mapper/BasicResourceReferenceMapper.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/core/request/mapper/BasicResourceReferenceMapper.java | MIT |
@Override
protected final void onRequest(final String val, final RequestCycle requestCycle)
{
IRequestHandler target = new IRequestHandler()
{
@Override
public void respond(final IRequestCycle requestCycle)
{
ComponentContext.push(new ComponentContext(getComponent()));
try {
WebResponse ... | Constructor
@param renderer
renderer that will be used to generate output
@param settings
settings for the autocomplete list | onRequest | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | MIT |
@Override
public void respond(final IRequestCycle requestCycle)
{
ComponentContext.push(new ComponentContext(getComponent()));
try {
WebResponse r = (WebResponse)requestCycle.getResponse();
// Determine encoding
final String encoding = Application.get()
.getRequestCycleSettings(... | Constructor
@param renderer
renderer that will be used to generate output
@param settings
settings for the autocomplete list | respond | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | MIT |
@Override
public void detach(final IRequestCycle requestCycle)
{
} | Constructor
@param renderer
renderer that will be used to generate output
@param settings
settings for the autocomplete list | detach | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/AutoCompleteBehavior.java | MIT |
@Override
protected void onBeforeRender() {
addOrReplace(newPagingNavigator("navigator", table));
super.onBeforeRender();
} | Constructor
@param table
data table this toolbar will be attached to | onBeforeRender | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | MIT |
@Override
public String getObject()
{
return String.valueOf(table.getColumns().size()).intern();
} | Constructor
@param table
data table this toolbar will be attached to | getObject | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | MIT |
protected PagingNavigator newPagingNavigator(final String navigatorId,
final DataTable<?, ?> table)
{
return new PagingNavigator(navigatorId, table);
} | Factory method used to create the paging navigator that will be used by the datatable
@param navigatorId
component id the navigator should be created with
@param table
dataview used by datatable
@return paging navigator that will be used to navigate the data table | newPagingNavigator | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | MIT |
protected WebComponent newNavigatorLabel(final String navigatorId, final DataTable<?, ?> table)
{
return new NavigatorLabel(navigatorId, table);
} | Factory method used to create the navigator label that will be used by the datatable
@param navigatorId
component id navigator label should be created with
@param table
dataview used by datatable
@return navigator label that will be used to navigate the data table | newNavigatorLabel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/NavigationToolbar.java | MIT |
private String getString(Localizer localizer, String key, Component component)
{
triedKeys.add(key);
// Note: It is important that the default value of "" is
// provided to getString() not to throw a MissingResourceException or to
// return a default string like "[Warning: String ..."
return localizer... | @param localizer
@param key
@param component
@return string | getString | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
private String substitute(String string, final Map<String, Object> vars)
throws IllegalStateException
{
return new VariableInterpolator(string, Application.get()
.getResourceSettings()
.getThrowExceptionOnMissingResource())
{
private static final long serialVersionUID = 1L;
@SuppressWarnings... | @param localizer
@param key
@param component
@return string | substitute | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected String getValue(String variableName)
{
Object value = vars.get(variableName);
if (value == null ||value instanceof String)
{
return String.valueOf(value);
}
IConverter converter = getConverter(value... | @param localizer
@param key
@param component
@return string | getValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
private Map<String, Object> addDefaultVars(Map<String, Object> params)
{
// create and fill the new params map
final HashMap<String, Object> fullParams;
if (params == null)
{
fullParams = new HashMap<>(6);
}
else
{
fullParams = new HashMap<>(params.size() + 6);
fullParams.putAll(param... | Creates a new params map that additionally contains the default input, name, label
parameters
@param params
original params map
@return new params map | addDefaultVars | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
private String getLabel()
{
final FormComponent<T> fc = FormComponent.this;
String label = null;
// first try the label model ...
if (fc.getLabel() != null)
{
label = fc.getLabel().getObject();
}
// ... then try a resource of format [form-component-id] with
// default of '[form-component-... | @return value of label param for this form component | getLabel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public static <R> R visitFormComponentsPostOrder(Component component,
final IVisitor<? extends FormComponent<?>, R> visitor)
{
return Visits.visitPostOrder(component, visitor, new IVisitFilter()
{
@Override
public boolean visitChildren(Object object)
{
if (object instanceof IFormVisitorParticipant)... | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitFormComponentsPostOrder | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public boolean visitChildren(Object object)
{
if (object instanceof IFormVisitorParticipant)
{
return ((IFormVisitorParticipant)object).processChildren();
}
return true;
} | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitChildren | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public boolean visitObject(Object object)
{
return (object instanceof FormComponent<?>);
} | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitObject | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public static <R> R visitComponentsPostOrder(Component component,
final org.apache.wicket.util.visit.IVisitor<Component, R> visitor)
{
Args.notNull(visitor, "visitor");
return Visits.visitPostOrder(component, visitor, new IVisitFilter()
{
@Override
public boolean visitObject(Object object)
{
retu... | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitComponentsPostOrder | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public boolean visitObject(Object object)
{
return true;
} | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitObject | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public boolean visitChildren(Object object)
{
if (object instanceof IFormVisitorParticipant)
{
return ((IFormVisitorParticipant)object).processChildren();
}
return true;
} | Visits any form components inside component if it is a container, or component itself if it
is itself a form component
@param <R>
the type of the visitor's result
@param component
starting point of the traversal
@param visitor
The visitor to call
@return the visitor's result | visitChildren | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final String getDefaultLabel()
{
return getDefaultLabel(getId());
} | Gets the string the component would use as a label when one was requested but no label model
was set via {@link #getLabel()}. The value of this string is usually set in a property file;
if the value is not set the default value equivalent to component id will be returned.
@return localized label | getDefaultLabel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final String getDefaultLabel(String defaultValue)
{
return getLocalizer().getString(getId(), getParent(), defaultValue);
} | Gets the string the component would use as a label when one was requested but no label model
was set via {@link #getLabel()}. The value of this string is usually set in a property file;
if the value is not set the {@code defaultValue} will be returned.
@param defaultValue
@return localized label | getDefaultLabel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings({ "rawtypes", "unchecked" })
public final FormComponent<T> add(final IValidator<? super T> validator)
{
Args.notNull(validator, "validator");
if (validator instanceof Behavior)
{
add((Behavior)validator);
}
else
{
add((Behavior)new ValidatorAdapter(validator));
}
return this;
... | Adds a validator to this form component
@param validator
validator to be added
@return <code>this</code> for chaining
@throws IllegalArgumentException
if validator is null
@see IValidator | add | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unlikely-arg-type")
public final FormComponent<T> remove(final IValidator<? super T> validator)
{
Args.notNull(validator, "validator");
Behavior match = null;
for (Behavior behavior : getBehaviors())
{
if (behavior.equals(validator))
{
match = behavior;
break;
}
else if ... | Removes a validator from the form component.
@param validator
validator
@throws IllegalArgumentException
if validator is null or not found
@see IValidator
@see #add(IValidator)
@return form component for chaining | remove | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SafeVarargs
public final FormComponent<T> add(final IValidator<? super T>... validators)
{
Args.notNull(validators, "validators");
for (IValidator<? super T> validator : validators)
{
add(validator);
}
// return this for chaining
return this;
} | Adds a validator to this form component.
@param validators
The validator(s) to be added
@return This
@throws IllegalArgumentException
if validator is null
@see IValidator | add | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public boolean checkRequired()
{
if (isRequired())
{
final String input = getInput();
// when null, check whether this is natural for that component, or
// whether - as is the case with text fields - this can only happen
// when the component was disabled
if (input == null && !isInputNullable() && ... | Checks if the form component's 'required' requirement is met by first checking
{@link #isRequired()} to see if it has to check for requirement. If that is true then by
default it checks if the input is null or an empty String
{@link Strings#isEmpty(CharSequence)}
<p>
Subclasses that overwrite this method should also ca... | checkRequired | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public void error(IValidationError error)
{
Args.notNull(error, "error");
MessageSource source = new MessageSource();
Serializable message = error.getErrorMessage(source);
if (message == null)
{
StringBuilder buffer = new StringBuilder();
buffer.append("Could not locate error message for component: "... | Reports a validation error against this form component.
The actual error is reported by creating a {@link ValidationErrorFeedback} object that holds
both the validation error and the generated error message - so a custom feedback panel can
have access to both.
@param error
validation error | error | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final T getConvertedInput()
{
return convertedInput;
} | Gets the converted input. The converted input is set earlier though the implementation of
{@link #convertInput()}.
{@link FormComponentPanel} often access this method when constructing their converted input
value which is often the combination of converted values of the embedded FormComponents
To access the model obj... | getConvertedInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void setConvertedInput(T convertedInput)
{
this.convertedInput = convertedInput;
} | Sets the converted input. This method is typically not called by clients, unless they
override {@link #convertInput()}, in which case they should call this method to update the
input for this component instance.
@param convertedInput
the converted input | setConvertedInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public Form<?> getForm()
{
Form<?> form = Form.findForm(this);
if (form == null)
{
throw new WicketRuntimeException("Could not find Form parent for " + this);
}
return form;
} | @return The parent form for this form component | getForm | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public String getInput()
{
String[] input = getInputAsArray();
if (input == null || input.length == 0)
{
return null;
}
else
{
return trim(input[0]);
}
} | Gets the request parameter for this component as a string.
@return The value in the request for this component | getInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public String[] getInputAsArray()
{
List<StringValue> list = getParameterValues(getInputName());
String[] values = null;
if (list != null)
{
values = new String[list.size()];
for (int i = 0; i < list.size(); ++i)
{
values[i] = list.get(i).toString();
}
}
if (!isInputNullable())
{
if ... | Gets the request parameters for this component as strings.
@return The values in the request for this component | getInputAsArray | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected List<StringValue> getParameterValues(String inputName)
{
String method = Form.METHOD_POST;
final Request request = getRequest();
if (getRequest().getContainerRequest() instanceof HttpServletRequest)
{
method = ((HttpServletRequest)getRequest().getContainerRequest()).getMethod();
}
else
{
... | Reads the value(s) of the request parameter with name <em>inputName</em>
from either the query parameters for <em>GET</em> method or the request body
for <em>POST</em> method.
@param inputName
The name of the request parameter
@return The parameter's value(s) | getParameterValues | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public String getInputName()
{
String inputName = Form.getRootFormRelativeId(this);
Form<?> form = findParent(Form.class);
if (form != null)
{
return form.getInputNamePrefix() + inputName;
}
else
{
return inputName;
}
} | Gets the string to be used for the <tt>name</tt> attribute of the form element. Generated
using the path from the form to the component, excluding the form itself. Override it if you
want even a smaller name. E.g. if you know for sure that the id is unique within a form.
@return The string to use as the form element's... | getInputName | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final String getRawInput()
{
return NO_RAW_INPUT.equals(rawInput) ? null : rawInput;
} | Use hasRawInput() to check if this component has raw input because null can mean 2 things: It
doesn't have rawinput or the rawinput is really null.
@return The raw form input that is stored for this formcomponent | getRawInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unchecked")
public final Class<T> getType()
{
return typeName == null ? null : (Class<T>)WicketObjects.resolveClass(typeName);
} | @return the type to use when updating the model for this form component | getType | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public String getValidatorKeyPrefix()
{
Form<?> form = findParent(Form.class);
if (form != null)
{
return getForm().getValidatorKeyPrefix();
}
return null;
} | @see Form#getValidatorKeyPrefix()
@return prefix used when constructing validator key messages | getValidatorKeyPrefix | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unchecked")
public final List<IValidator<? super T>> getValidators()
{
final List<IValidator<? super T>> list = new ArrayList<>();
for (Behavior behavior : getBehaviors())
{
if (behavior instanceof IValidator)
{
list.add((IValidator<? super T>)behavior);
}
}
return Collecti... | Gets an unmodifiable list of validators for this FormComponent.
@return List of validators | getValidators | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final String getValue()
{
if (NO_RAW_INPUT.equals(rawInput))
{
return getModelValue();
}
else
{
if (getEscapeModelStrings() && rawInput != null)
{
return Strings.escapeMarkup(rawInput).toString();
}
return rawInput;
}
} | Gets current value for a form component, which can be either input data entered by the user,
or the component's model object if no input was provided.
@return The value | getValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final boolean hasRawInput()
{
return !NO_RAW_INPUT.equals(rawInput);
} | Returns whether this component has raw input. Raw input is unconverted input straight from
the client.
@return boolean whether this component has raw input. | hasRawInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void inputChanged()
{
if (isVisibleInHierarchy() && isEnabledInHierarchy())
{
// Get input as String array
final String[] input = getInputAsArray();
// If there is any input
if (input != null && input.length > 0 && input[0] != null)
{
// join the values together with ";", for examp... | Used by Form to tell the FormComponent that a new user input is available | inputChanged | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void invalid()
{
onInvalid();
} | Indicate that validation of this form component failed. | invalid | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public boolean isInputNullable()
{
return true;
} | Gets whether this component's input can be null. By default, components that do not get input
will have null values passed in for input. However, component TextField is an example
(possibly the only one) that never gets a null passed in, even if the field is left empty
UNLESS it had attribute <code>disabled="disabled"<... | isInputNullable | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public boolean isRequired()
{
return getFlag(FLAG_REQUIRED);
} | @return whether or not this component's value is required | isRequired | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final boolean isValid()
{
class IsValidVisitor implements IVisitor<Component, Boolean>
{
@Override
public void component(final Component component, final IVisit<Boolean> visit)
{
if (component.hasErrorMessage())
{
visit.stop(Boolean.FALSE);
}
}
}
IsValidVisitor tmp = new IsV... | Gets whether this component is 'valid'. Valid in this context means that no validation errors
were reported the last time the form component was processed. This variable not only is
convenient for 'business' use, but is also necessary as we don't want the form component
models updated with invalid input.
@return valid... | isValid | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public void component(final Component component, final IVisit<Boolean> visit)
{
if (component.hasErrorMessage())
{
visit.stop(Boolean.FALSE);
}
} | Gets whether this component is 'valid'. Valid in this context means that no validation errors
were reported the last time the form component was processed. This variable not only is
convenient for 'business' use, but is also necessary as we don't want the form component
models updated with invalid input.
@return valid... | component | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void processInput()
{
inputChanged();
validate();
if (hasErrorMessage())
{
invalid();
}
else
{
valid();
updateModel();
}
} | This method will retrieve the request parameter, validate it, and if valid update the model.
These are the same steps as would be performed by the form.
This is useful when a formcomponent is used outside a form. | processInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public FormComponent<T> setLabel(IModel<String> labelModel)
{
super.setLabel(labelModel);
return this;
} | The value will be made available to the validator property by means of ${label}. It does not
have any specific meaning to FormComponent itself.
@param labelModel
@return this for chaining | setLabel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public void setModelValue(final String[] value)
{
convertedInput = convertValue(value);
updateModel();
} | Sets the value for a form component.
@param value
The value | setModelValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final FormComponent<T> setRequired(final boolean required)
{
if (!required && getType() != null && getType().isPrimitive())
{
throw new WicketRuntimeException(
"FormComponent has to be required when the type is primitive class: " + this);
}
if (required != isRequired())
{
addStateChange();
... | Sets the required flag
@param required
@return this for chaining | setRequired | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public FormComponent<T> setType(Class<?> type)
{
typeName = type == null ? null : type.getName();
if (type != null && type.isPrimitive())
{
setRequired(true);
}
return this;
} | Sets the type that will be used when updating the model for this component. If no type is
specified String type is assumed.
@param type
@return this for chaining | setType | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public void updateModel()
{
setModelObject(getConvertedInput());
} | Updates this components model from the request, it expects that the object is already
converted through the convertInput() call that is called by the validate() method when a form
is being processed.
By default it just does this:
<pre>
setModelObject(getConvertedInput());
</pre>
<strong>DO NOT CALL THIS METHOD DIREC... | updateModel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void valid()
{
clearInput();
onValid();
} | Called to indicate that the user input is valid. | valid | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public void validate()
{
// clear any previous feedback messages
if (hasFeedbackMessage())
{
getFeedbackMessages().clear();
}
// validate
validateRequired();
if (isValid())
{
convertInput();
if (isValid())
{
if (isRequired() && getConvertedInput() == null && isInputNullable())
{
... | Performs full validation of the form component, which consists of calling validateRequired(),
convertInput(), and validateValidators(). This method should only be used if the form
component needs to be fully validated outside the form process. | validate | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public void convertInput()
{
if (typeName == null)
{
try
{
convertedInput = convertValue(getInputAsArray());
}
catch (ConversionException e)
{
error(newValidationError(e));
}
}
else
{
final IConverter<T> converter = getConverter(getType());
try
{
convertedInput = conve... | Converts and validates the conversion of the raw input string into the object specified by
{@link FormComponent#getType()} and records any thrown {@link ConversionException}s.
Converted value is available through {@link FormComponent#getConvertedInput()}.
<p>
Usually the user should do custom conversions by specifying... | convertInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected ValidationError newValidationError(ConversionException cause)
{
ValidationError error = new ValidationError(cause.getMessage());
if (cause.getResourceKey() != null)
{
error.addKey(cause.getResourceKey());
}
if (typeName == null)
{
if (cause.getTargetType() != null)
{
error.addKey("... | This method is called, when the validation triggered by {@link FormComponent#convertInput()}
failed with a {@link ConversionException}, to construct a {@link ValidationError} based on
the exception.
<p>
Override this method to modify the ValidationError object, e.g. add a custom variable for
message substitution:
<p>
... | newValidationError | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unchecked")
protected T convertValue(String[] value) throws ConversionException
{
return (T)(value != null && value.length > 0 && value[0] != null ? trim(value[0]) : null);
} | Subclasses should overwrite this if the conversion is not done through the type field and the
{@link IConverter}. <strong>WARNING: this method may be removed in future versions.</strong>
If conversion fails then a ConversionException should be thrown
@param value
The value can be the getInput() or through ... | convertValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected String getModelValue()
{
return getDefaultModelObjectAsString();
} | @return Value to return when model value is needed | getModelValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected final int inputAsInt()
{
final String string = getInput();
try
{
return Integer.parseInt(string);
}
catch (NumberFormatException e)
{
throw new IllegalArgumentException(
exceptionMessage("Internal error. Request string '" + string +
"' not a valid integer"));
}
} | Gets the request parameter for this component as an int.
@return The value in the request for this component | inputAsInt | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected final int inputAsInt(final int defaultValue)
{
final String string = getInput();
if (string != null)
{
try
{
return Integer.parseInt(string);
}
catch (NumberFormatException e)
{
throw new IllegalArgumentException(exceptionMessage("Request string '" + string +
"' is not a val... | Gets the request parameter for this component as an int, using the given default in case no
corresponding request parameter was found.
@param defaultValue
Default value to return if request does not have an integer for this component
@return The value in the request for this component | inputAsInt | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected final int[] inputAsIntArray()
{
final String[] strings = getInputAsArray();
if (strings != null)
{
final int[] ints = new int[strings.length];
for (int i = 0; i < strings.length; i++)
{
ints[i] = Integer.parseInt(strings[i]);
}
return ints;
}
return null;
} | Gets the request parameters for this component as ints.
@return The values in the request for this component | inputAsIntArray | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected void onDisabled(final ComponentTag tag)
{
tag.put("disabled", "disabled");
} | Called by {@link #onComponentTag(ComponentTag)} when the component is disabled. By default,
this method will add a disabled="disabled" attribute to the tag. Components may override this
method to tweak the tag as they think is fit.
@param tag
the tag that is being rendered | onDisabled | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Deprecated
protected void onRequired(final ComponentTag tag)
{
} | Called by {@link #onComponentTag(ComponentTag)} when the component is required.
@param tag
the tag that is being rendered | onRequired | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected boolean shouldTrimInput()
{
return true;
} | Determines whether or not this component should trim its input prior to processing it. The
default value is <code>true</code>
@return True if the input should be trimmed. | shouldTrimInput | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected String trim(String string)
{
String trimmed = string;
if (trimmed != null && shouldTrimInput())
{
trimmed = trimmed.trim();
}
return trimmed;
} | Trims the input according to {@link #shouldTrimInput()}
@param string
@return trimmed input if {@link #shouldTrimInput()} returns true, unchanged input otherwise | trim | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected final void validateRequired()
{
if (!checkRequired())
{
reportRequiredError();
}
} | Checks if the raw input value is not null if this component is required. | validateRequired | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected void reportRequiredError()
{
error(new ValidationError().addKey("Required"));
} | Reports required error against this component | reportRequiredError | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unchecked")
protected final void validateValidators()
{
final IValidatable<T> validatable = newValidatable();
boolean isNull = getConvertedInput() == null;
IValidator<T> validator;
for (Behavior behavior : getBehaviors())
{
if (isBehaviorAccepted(behavior) == false)
{
continu... | Validates this component using the component's validators. | validateValidators | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final IValidatable<T> newValidatable()
{
return new ValidatableAdapter();
} | Creates an IValidatable that can be used to validate this form component. This validatable
incorporates error key lookups that correspond to this form component.
This method is useful when validation needs to happen outside the regular validation workflow
but error messages should still be properly reported against th... | newValidatable | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
@SuppressWarnings("unchecked")
public final IModel<T> getModel()
{
return (IModel<T>)getDefaultModel();
} | Creates an IValidatable that can be used to validate this form component. This validatable
incorporates error key lookups that correspond to this form component.
This method is useful when validation needs to happen outside the regular validation workflow
but error messages should still be properly reported against th... | getModel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public final void setModel(IModel<T> model)
{
setDefaultModel(model);
} | Creates an IValidatable that can be used to validate this form component. This validatable
incorporates error key lookups that correspond to this form component.
This method is useful when validation needs to happen outside the regular validation workflow
but error messages should still be properly reported against th... | setModel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@SuppressWarnings("unchecked")
@Override
public final T getModelObject()
{
return (T)getDefaultModelObject();
} | Creates an IValidatable that can be used to validate this form component. This validatable
incorporates error key lookups that correspond to this form component.
This method is useful when validation needs to happen outside the regular validation workflow
but error messages should still be properly reported against th... | getModelObject | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
@Override
public final void setModelObject(T object)
{
setDefaultModelObject(object);
} | Creates an IValidatable that can be used to validate this form component. This validatable
incorporates error key lookups that correspond to this form component.
This method is useful when validation needs to happen outside the regular validation workflow
but error messages should still be properly reported against th... | setModelObject | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public final void updateAutoLabels(AjaxRequestTarget target)
{
AutoLabelMarker marker = getMetaData(AutoLabelResolver.MARKER_KEY);
if (marker == null)
{
// this component does not have an auto label
return;
}
marker.updateFrom(this, target);
} | Updates auto label css classes such as error/required during ajax updates when the labels may
not be directly repainted in the response.
@param target | updateAutoLabels | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
public static <S> void updateCollectionModel(FormComponent<Collection<S>> formComponent)
{
Collection<S> convertedInput = formComponent.getConvertedInput();
if (convertedInput == null) {
convertedInput = Collections.emptyList();
}
Collection<S> collection = formComponent.getModelObject();
if (collection ... | Update the model of a {@link FormComponent} containing a {@link Collection}.
If the model object does not yet exists, a new {@link ArrayList} is filled with the converted
input and used as the new model object. Otherwise the existing collection is modified
in-place, then {@link Model#setObject(Object)} is called with ... | updateCollectionModel | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java | MIT |
protected Boolean initialValue()
{
return Boolean.FALSE;
} | A flag indicating whether this session entry is being re-set in the Session.
<p>
Web containers intercept
{@link javax.servlet.http.HttpSession#setAttribute(String, Object)} to detect changes and
replicate the session. If the attribute has been already bound in the session then
{@link SessionEntry#valueUnbound(HttpSess... | initialValue | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
@Override
public void valueBound(HttpSessionBindingEvent event)
{
} | set the list of pages to remember after the request
@param pages | valueBound | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
@Override
public void valueUnbound(HttpSessionBindingEvent event)
{
if (STORING_TOUCHED_PAGES.get())
{
// triggered by #storeTouchedPages(), so do not remove the data
return;
}
clear();
} | set the list of pages to remember after the request
@param pages | valueUnbound | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
@Override
public boolean equals(Object o)
{
// see https://issues.apache.org/jira/browse/WICKET-5390
return false;
} | set the list of pages to remember after the request
@param pages | equals | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
public void clear()
{
// WICKET-5164 use the original sessionId
IPageStore store = getPageStore();
// store might be null if destroyed already
if (store != null)
{
store.unbind(sessionId);
}
} | set the list of pages to remember after the request
@param pages | clear | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
private String getAttributeName()
{
return ATTRIBUTE_NAME + " - " + applicationName;
} | set the list of pages to remember after the request
@param pages | getAttributeName | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/PageStoreManager.java | MIT |
protected void bind()
{
context.bind();
} | Bind the session
@see IPageManagerContext#bind() | bind | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
public void setSessionAttribute(String key, Serializable value)
{
context.setSessionAttribute(key, value);
} | @see IPageManagerContext#setSessionAttribute(String, Serializable)
@param key
@param value | setSessionAttribute | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
public Serializable getSessionAttribute(final String key)
{
return context.getSessionAttribute(key);
} | @see IPageManagerContext#getSessionAttribute(String)
@param key
@return the session attribute | getSessionAttribute | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
public String getSessionId()
{
return context.getSessionId();
} | @see IPageManagerContext#getSessionId()
@return session id | getSessionId | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
protected IManageablePage findPage(final int id)
{
for (IManageablePage page : touchedPages)
{
if (page.getPageId() == id)
{
return page;
}
}
return null;
} | @param id
@return null, if not found | findPage | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
protected void touch(final IManageablePage page)
{
if (findPage(page.getPageId()) == null)
{
touchedPages.add(page);
}
} | Touches a page, so it will be stored in the page stores
at the end of the request cycle
@param page The page to mark as dirty | touch | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
protected void untouch(final IManageablePage page)
{
Iterator<IManageablePage> iterator = touchedPages.iterator();
while (iterator.hasNext())
{
IManageablePage touchedPage = iterator.next();
if (touchedPage.getPageId() == page.getPageId())
{
iterator.remove();
break;
}
}
} | @param page The page to unmark as dirty, so it won't be stored
at the end of the request cycle | untouch | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
protected void commitRequest()
{
// store pages that are not stateless
if (touchedPages.isEmpty() == false)
{
List<IManageablePage> statefulPages = new ArrayList<IManageablePage>(
touchedPages.size());
for (IManageablePage page : touchedPages)
{
statefulPages.add(page);
}
if (statefulPage... | Modified by Robin to remove the logic to check stateless page as otherwise Wicket reports error
when a page containing "wicket:enclosure" is accessed anonymously and is redirected to signin page | commitRequest | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/page/RequestAdapter.java | MIT |
@Override
public void onMessage(final String message)
{
broadcastMessage(new TextMessage(message));
} | Constructor.
@param request
the http request that was used to create the TomcatWebSocketProcessor
@param application
the current Wicket Application | onMessage | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | MIT |
@Override
public void onMessage(byte[] data, int offset, int length)
{
BinaryMessage binaryMessage = new BinaryMessage(data, offset, length);
broadcastMessage(binaryMessage);
} | Constructor.
@param request
the http request that was used to create the TomcatWebSocketProcessor
@param application
the current Wicket Application | onMessage | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | MIT |
protected final void onConnect(final IWebSocketConnection connection) {
IKey key = getRegistryKey();
connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection);
if (connectionFilter != null)
{
ConnectionRejected connectionRejected = connectionFilter.doFilter(servletRequest);
if (... | A helper that registers the opened connection in the application-level registry.
@param connection
the web socket connection to use to communicate with the client
@see #onOpen(Object) | onConnect | java | theonedev/onedev | server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | https://github.com/theonedev/onedev/blob/master/server-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.