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
146,300
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createSymbolizer
public static SymbolizerTypeInfo createSymbolizer(LayerType type, FeatureStyleInfo featureStyle) { SymbolInfo symbol = featureStyle.getSymbol(); SymbolizerTypeInfo symbolizer = null; StrokeInfo stroke = createStroke(featureStyle.getStrokeColor(), featureStyle.getStrokeWidth(), featureStyle.getStrokeOpacity(), featureStyle.getDashArray()); FillInfo fill = createFill(featureStyle.getFillColor(), featureStyle.getFillOpacity()); switch (type) { case GEOMETRY: break; case LINESTRING: case MULTILINESTRING: symbolizer = createLineSymbolizer(stroke); break; case MULTIPOINT: case POINT: GraphicInfo graphic; if (symbol.getCircle() != null) { MarkInfo circle = createMark(WKN_CIRCLE, fill, stroke); graphic = createGraphic(circle, (int) (2 * symbol.getCircle().getR())); } else if (symbol.getRect() != null) { MarkInfo rect = createMark(WKN_RECT, fill, stroke); graphic = createGraphic(rect, (int) symbol.getRect().getH()); } else { ExternalGraphicInfo image = createExternalGraphic(symbol.getImage().getHref()); graphic = createGraphic(image, symbol.getImage().getHeight()); } symbolizer = createPointSymbolizer(graphic); break; case POLYGON: case MULTIPOLYGON: symbolizer = createPolygonSymbolizer(fill, stroke); break; default: throw new IllegalStateException("Unknown layer type " + type); } return symbolizer; }
java
public static SymbolizerTypeInfo createSymbolizer(LayerType type, FeatureStyleInfo featureStyle) { SymbolInfo symbol = featureStyle.getSymbol(); SymbolizerTypeInfo symbolizer = null; StrokeInfo stroke = createStroke(featureStyle.getStrokeColor(), featureStyle.getStrokeWidth(), featureStyle.getStrokeOpacity(), featureStyle.getDashArray()); FillInfo fill = createFill(featureStyle.getFillColor(), featureStyle.getFillOpacity()); switch (type) { case GEOMETRY: break; case LINESTRING: case MULTILINESTRING: symbolizer = createLineSymbolizer(stroke); break; case MULTIPOINT: case POINT: GraphicInfo graphic; if (symbol.getCircle() != null) { MarkInfo circle = createMark(WKN_CIRCLE, fill, stroke); graphic = createGraphic(circle, (int) (2 * symbol.getCircle().getR())); } else if (symbol.getRect() != null) { MarkInfo rect = createMark(WKN_RECT, fill, stroke); graphic = createGraphic(rect, (int) symbol.getRect().getH()); } else { ExternalGraphicInfo image = createExternalGraphic(symbol.getImage().getHref()); graphic = createGraphic(image, symbol.getImage().getHeight()); } symbolizer = createPointSymbolizer(graphic); break; case POLYGON: case MULTIPOLYGON: symbolizer = createPolygonSymbolizer(fill, stroke); break; default: throw new IllegalStateException("Unknown layer type " + type); } return symbolizer; }
[ "public", "static", "SymbolizerTypeInfo", "createSymbolizer", "(", "LayerType", "type", ",", "FeatureStyleInfo", "featureStyle", ")", "{", "SymbolInfo", "symbol", "=", "featureStyle", ".", "getSymbol", "(", ")", ";", "SymbolizerTypeInfo", "symbolizer", "=", "null", ";", "StrokeInfo", "stroke", "=", "createStroke", "(", "featureStyle", ".", "getStrokeColor", "(", ")", ",", "featureStyle", ".", "getStrokeWidth", "(", ")", ",", "featureStyle", ".", "getStrokeOpacity", "(", ")", ",", "featureStyle", ".", "getDashArray", "(", ")", ")", ";", "FillInfo", "fill", "=", "createFill", "(", "featureStyle", ".", "getFillColor", "(", ")", ",", "featureStyle", ".", "getFillOpacity", "(", ")", ")", ";", "switch", "(", "type", ")", "{", "case", "GEOMETRY", ":", "break", ";", "case", "LINESTRING", ":", "case", "MULTILINESTRING", ":", "symbolizer", "=", "createLineSymbolizer", "(", "stroke", ")", ";", "break", ";", "case", "MULTIPOINT", ":", "case", "POINT", ":", "GraphicInfo", "graphic", ";", "if", "(", "symbol", ".", "getCircle", "(", ")", "!=", "null", ")", "{", "MarkInfo", "circle", "=", "createMark", "(", "WKN_CIRCLE", ",", "fill", ",", "stroke", ")", ";", "graphic", "=", "createGraphic", "(", "circle", ",", "(", "int", ")", "(", "2", "*", "symbol", ".", "getCircle", "(", ")", ".", "getR", "(", ")", ")", ")", ";", "}", "else", "if", "(", "symbol", ".", "getRect", "(", ")", "!=", "null", ")", "{", "MarkInfo", "rect", "=", "createMark", "(", "WKN_RECT", ",", "fill", ",", "stroke", ")", ";", "graphic", "=", "createGraphic", "(", "rect", ",", "(", "int", ")", "symbol", ".", "getRect", "(", ")", ".", "getH", "(", ")", ")", ";", "}", "else", "{", "ExternalGraphicInfo", "image", "=", "createExternalGraphic", "(", "symbol", ".", "getImage", "(", ")", ".", "getHref", "(", ")", ")", ";", "graphic", "=", "createGraphic", "(", "image", ",", "symbol", ".", "getImage", "(", ")", ".", "getHeight", "(", ")", ")", ";", "}", "symbolizer", "=", "createPointSymbolizer", "(", "graphic", ")", ";", "break", ";", "case", "POLYGON", ":", "case", "MULTIPOLYGON", ":", "symbolizer", "=", "createPolygonSymbolizer", "(", "fill", ",", "stroke", ")", ";", "break", ";", "default", ":", "throw", "new", "IllegalStateException", "(", "\"Unknown layer type \"", "+", "type", ")", ";", "}", "return", "symbolizer", ";", "}" ]
Create a symbolizer from a feature style. @param type the layer type @param featureStyle the style @return the symbolizer
[ "Create", "a", "symbolizer", "from", "a", "feature", "style", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L88-L124
146,301
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createRule
public static RuleInfo createRule(String title, String name, SymbolizerTypeInfo symbolizer) { RuleInfo rule = new RuleInfo(); rule.setTitle(title); rule.setName(name); rule.getSymbolizerList().add(symbolizer); return rule; }
java
public static RuleInfo createRule(String title, String name, SymbolizerTypeInfo symbolizer) { RuleInfo rule = new RuleInfo(); rule.setTitle(title); rule.setName(name); rule.getSymbolizerList().add(symbolizer); return rule; }
[ "public", "static", "RuleInfo", "createRule", "(", "String", "title", ",", "String", "name", ",", "SymbolizerTypeInfo", "symbolizer", ")", "{", "RuleInfo", "rule", "=", "new", "RuleInfo", "(", ")", ";", "rule", ".", "setTitle", "(", "title", ")", ";", "rule", ".", "setName", "(", "name", ")", ";", "rule", ".", "getSymbolizerList", "(", ")", ".", "add", "(", "symbolizer", ")", ";", "return", "rule", ";", "}" ]
Create a non-filtered rule with the specified title, name and symbolizer. @param title the title @param name the name @param symbolizer the symbolizer @return the rule
[ "Create", "a", "non", "-", "filtered", "rule", "with", "the", "specified", "title", "name", "and", "symbolizer", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L134-L140
146,302
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createPointSymbolizer
public static PointSymbolizerInfo createPointSymbolizer(GraphicInfo graphicInfo) { PointSymbolizerInfo symbolizerInfo = new PointSymbolizerInfo(); symbolizerInfo.setGraphic(graphicInfo); return symbolizerInfo; }
java
public static PointSymbolizerInfo createPointSymbolizer(GraphicInfo graphicInfo) { PointSymbolizerInfo symbolizerInfo = new PointSymbolizerInfo(); symbolizerInfo.setGraphic(graphicInfo); return symbolizerInfo; }
[ "public", "static", "PointSymbolizerInfo", "createPointSymbolizer", "(", "GraphicInfo", "graphicInfo", ")", "{", "PointSymbolizerInfo", "symbolizerInfo", "=", "new", "PointSymbolizerInfo", "(", ")", ";", "symbolizerInfo", ".", "setGraphic", "(", "graphicInfo", ")", ";", "return", "symbolizerInfo", ";", "}" ]
Creates a point symbolizer with the specified graphic. @param graphicInfo the graphic @return the symbolizer
[ "Creates", "a", "point", "symbolizer", "with", "the", "specified", "graphic", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L148-L152
146,303
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createLineSymbolizer
public static LineSymbolizerInfo createLineSymbolizer(StrokeInfo strokeInfo) { LineSymbolizerInfo symbolizerInfo = new LineSymbolizerInfo(); symbolizerInfo.setStroke(strokeInfo); return symbolizerInfo; }
java
public static LineSymbolizerInfo createLineSymbolizer(StrokeInfo strokeInfo) { LineSymbolizerInfo symbolizerInfo = new LineSymbolizerInfo(); symbolizerInfo.setStroke(strokeInfo); return symbolizerInfo; }
[ "public", "static", "LineSymbolizerInfo", "createLineSymbolizer", "(", "StrokeInfo", "strokeInfo", ")", "{", "LineSymbolizerInfo", "symbolizerInfo", "=", "new", "LineSymbolizerInfo", "(", ")", ";", "symbolizerInfo", ".", "setStroke", "(", "strokeInfo", ")", ";", "return", "symbolizerInfo", ";", "}" ]
Creates a line symbolizer with the specified stroke. @param strokeInfo the stroke @return the symbolizer
[ "Creates", "a", "line", "symbolizer", "with", "the", "specified", "stroke", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L160-L164
146,304
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createPolygonSymbolizer
public static PolygonSymbolizerInfo createPolygonSymbolizer(FillInfo fillInfo, StrokeInfo strokeInfo) { PolygonSymbolizerInfo symbolizerInfo = new PolygonSymbolizerInfo(); symbolizerInfo.setFill(fillInfo); symbolizerInfo.setStroke(strokeInfo); return symbolizerInfo; }
java
public static PolygonSymbolizerInfo createPolygonSymbolizer(FillInfo fillInfo, StrokeInfo strokeInfo) { PolygonSymbolizerInfo symbolizerInfo = new PolygonSymbolizerInfo(); symbolizerInfo.setFill(fillInfo); symbolizerInfo.setStroke(strokeInfo); return symbolizerInfo; }
[ "public", "static", "PolygonSymbolizerInfo", "createPolygonSymbolizer", "(", "FillInfo", "fillInfo", ",", "StrokeInfo", "strokeInfo", ")", "{", "PolygonSymbolizerInfo", "symbolizerInfo", "=", "new", "PolygonSymbolizerInfo", "(", ")", ";", "symbolizerInfo", ".", "setFill", "(", "fillInfo", ")", ";", "symbolizerInfo", ".", "setStroke", "(", "strokeInfo", ")", ";", "return", "symbolizerInfo", ";", "}" ]
Creates a polygon symbolizer with the specified fill and stroke. @param fillInfo the fill @param strokeInfo the stroke @return the symbolizer
[ "Creates", "a", "polygon", "symbolizer", "with", "the", "specified", "fill", "and", "stroke", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L173-L178
146,305
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createStroke
public static StrokeInfo createStroke(String color, int width, float opacity, String dashArray) { StrokeInfo strokeInfo = new StrokeInfo(); if (color != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke", color)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-width", width)); if (dashArray != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke-dasharray", dashArray)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-opacity", opacity)); return strokeInfo; }
java
public static StrokeInfo createStroke(String color, int width, float opacity, String dashArray) { StrokeInfo strokeInfo = new StrokeInfo(); if (color != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke", color)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-width", width)); if (dashArray != null) { strokeInfo.getCssParameterList().add(createCssParameter("stroke-dasharray", dashArray)); } strokeInfo.getCssParameterList().add(createCssParameter("stroke-opacity", opacity)); return strokeInfo; }
[ "public", "static", "StrokeInfo", "createStroke", "(", "String", "color", ",", "int", "width", ",", "float", "opacity", ",", "String", "dashArray", ")", "{", "StrokeInfo", "strokeInfo", "=", "new", "StrokeInfo", "(", ")", ";", "if", "(", "color", "!=", "null", ")", "{", "strokeInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"stroke\"", ",", "color", ")", ")", ";", "}", "strokeInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"stroke-width\"", ",", "width", ")", ")", ";", "if", "(", "dashArray", "!=", "null", ")", "{", "strokeInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"stroke-dasharray\"", ",", "dashArray", ")", ")", ";", "}", "strokeInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"stroke-opacity\"", ",", "opacity", ")", ")", ";", "return", "strokeInfo", ";", "}" ]
Creates a stroke with the specified CSS parameters. @param color the color @param width the width @param opacity the opacity @param dashArray the dash array @return the stroke
[ "Creates", "a", "stroke", "with", "the", "specified", "CSS", "parameters", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L198-L209
146,306
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createFill
public static FillInfo createFill(String color, float opacity) { FillInfo fillInfo = new FillInfo(); if (color != null) { fillInfo.getCssParameterList().add(createCssParameter("fill", color)); } fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity)); return fillInfo; }
java
public static FillInfo createFill(String color, float opacity) { FillInfo fillInfo = new FillInfo(); if (color != null) { fillInfo.getCssParameterList().add(createCssParameter("fill", color)); } fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity)); return fillInfo; }
[ "public", "static", "FillInfo", "createFill", "(", "String", "color", ",", "float", "opacity", ")", "{", "FillInfo", "fillInfo", "=", "new", "FillInfo", "(", ")", ";", "if", "(", "color", "!=", "null", ")", "{", "fillInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"fill\"", ",", "color", ")", ")", ";", "}", "fillInfo", ".", "getCssParameterList", "(", ")", ".", "add", "(", "createCssParameter", "(", "\"fill-opacity\"", ",", "opacity", ")", ")", ";", "return", "fillInfo", ";", "}" ]
Creates a fill with the specified CSS parameters. @param color the color @param opacity the opacity @return the fill
[ "Creates", "a", "fill", "with", "the", "specified", "CSS", "parameters", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L227-L234
146,307
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createMark
public static MarkInfo createMark(String wellKnownName, FillInfo fill, StrokeInfo stroke) { MarkInfo mark = new MarkInfo(); mark.setFill(fill); mark.setStroke(stroke); WellKnownNameInfo wellKnownNameInfo = new WellKnownNameInfo(); wellKnownNameInfo.setWellKnownName(wellKnownName); mark.setWellKnownName(wellKnownNameInfo); return mark; }
java
public static MarkInfo createMark(String wellKnownName, FillInfo fill, StrokeInfo stroke) { MarkInfo mark = new MarkInfo(); mark.setFill(fill); mark.setStroke(stroke); WellKnownNameInfo wellKnownNameInfo = new WellKnownNameInfo(); wellKnownNameInfo.setWellKnownName(wellKnownName); mark.setWellKnownName(wellKnownNameInfo); return mark; }
[ "public", "static", "MarkInfo", "createMark", "(", "String", "wellKnownName", ",", "FillInfo", "fill", ",", "StrokeInfo", "stroke", ")", "{", "MarkInfo", "mark", "=", "new", "MarkInfo", "(", ")", ";", "mark", ".", "setFill", "(", "fill", ")", ";", "mark", ".", "setStroke", "(", "stroke", ")", ";", "WellKnownNameInfo", "wellKnownNameInfo", "=", "new", "WellKnownNameInfo", "(", ")", ";", "wellKnownNameInfo", ".", "setWellKnownName", "(", "wellKnownName", ")", ";", "mark", ".", "setWellKnownName", "(", "wellKnownNameInfo", ")", ";", "return", "mark", ";", "}" ]
Creates a mark with the specified parameters. @param wellKnownName the well known name @param fill the fill @param stroke the stroke @return the mark
[ "Creates", "a", "mark", "with", "the", "specified", "parameters", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L253-L261
146,308
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createExternalGraphic
public static ExternalGraphicInfo createExternalGraphic(String href) { ExternalGraphicInfo externalGraphic = new ExternalGraphicInfo(); FormatInfo format = new FormatInfo(); format.setFormat("image/" + getExtension(href)); externalGraphic.setFormat(format); OnlineResourceInfo onlineResource = new OnlineResourceInfo(); onlineResource.setType("simple"); HrefInfo hrefInfo = new HrefInfo(); hrefInfo.setHref(href); onlineResource.setHref(hrefInfo); externalGraphic.setOnlineResource(onlineResource); return externalGraphic; }
java
public static ExternalGraphicInfo createExternalGraphic(String href) { ExternalGraphicInfo externalGraphic = new ExternalGraphicInfo(); FormatInfo format = new FormatInfo(); format.setFormat("image/" + getExtension(href)); externalGraphic.setFormat(format); OnlineResourceInfo onlineResource = new OnlineResourceInfo(); onlineResource.setType("simple"); HrefInfo hrefInfo = new HrefInfo(); hrefInfo.setHref(href); onlineResource.setHref(hrefInfo); externalGraphic.setOnlineResource(onlineResource); return externalGraphic; }
[ "public", "static", "ExternalGraphicInfo", "createExternalGraphic", "(", "String", "href", ")", "{", "ExternalGraphicInfo", "externalGraphic", "=", "new", "ExternalGraphicInfo", "(", ")", ";", "FormatInfo", "format", "=", "new", "FormatInfo", "(", ")", ";", "format", ".", "setFormat", "(", "\"image/\"", "+", "getExtension", "(", "href", ")", ")", ";", "externalGraphic", ".", "setFormat", "(", "format", ")", ";", "OnlineResourceInfo", "onlineResource", "=", "new", "OnlineResourceInfo", "(", ")", ";", "onlineResource", ".", "setType", "(", "\"simple\"", ")", ";", "HrefInfo", "hrefInfo", "=", "new", "HrefInfo", "(", ")", ";", "hrefInfo", ".", "setHref", "(", "href", ")", ";", "onlineResource", ".", "setHref", "(", "hrefInfo", ")", ";", "externalGraphic", ".", "setOnlineResource", "(", "onlineResource", ")", ";", "return", "externalGraphic", ";", "}" ]
Creates an external graphic for the specified href. @param href the href @return the graphic
[ "Creates", "an", "external", "graphic", "for", "the", "specified", "href", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L269-L281
146,309
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createGraphic
public static GraphicInfo createGraphic(MarkInfo mark, int size) { GraphicInfo graphicInfo = new GraphicInfo(); ChoiceInfo choice = new ChoiceInfo(); choice.setMark(mark); graphicInfo.getChoiceList().add(choice); SizeInfo sizeInfo = new SizeInfo(); sizeInfo.setValue(Integer.toString(size)); graphicInfo.setSize(sizeInfo); return graphicInfo; }
java
public static GraphicInfo createGraphic(MarkInfo mark, int size) { GraphicInfo graphicInfo = new GraphicInfo(); ChoiceInfo choice = new ChoiceInfo(); choice.setMark(mark); graphicInfo.getChoiceList().add(choice); SizeInfo sizeInfo = new SizeInfo(); sizeInfo.setValue(Integer.toString(size)); graphicInfo.setSize(sizeInfo); return graphicInfo; }
[ "public", "static", "GraphicInfo", "createGraphic", "(", "MarkInfo", "mark", ",", "int", "size", ")", "{", "GraphicInfo", "graphicInfo", "=", "new", "GraphicInfo", "(", ")", ";", "ChoiceInfo", "choice", "=", "new", "ChoiceInfo", "(", ")", ";", "choice", ".", "setMark", "(", "mark", ")", ";", "graphicInfo", ".", "getChoiceList", "(", ")", ".", "add", "(", "choice", ")", ";", "SizeInfo", "sizeInfo", "=", "new", "SizeInfo", "(", ")", ";", "sizeInfo", ".", "setValue", "(", "Integer", ".", "toString", "(", "size", ")", ")", ";", "graphicInfo", ".", "setSize", "(", "sizeInfo", ")", ";", "return", "graphicInfo", ";", "}" ]
Creates a graphic with the specified mark and size. @param mark the mark @param size the size @return the graphic
[ "Creates", "a", "graphic", "with", "the", "specified", "mark", "and", "size", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L299-L308
146,310
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createGraphic
public static GraphicInfo createGraphic(ExternalGraphicInfo graphic, int size) { GraphicInfo graphicInfo = new GraphicInfo(); ChoiceInfo choice = new ChoiceInfo(); choice.setExternalGraphic(graphic); graphicInfo.getChoiceList().add(choice); SizeInfo sizeInfo = new SizeInfo(); sizeInfo.setValue(Integer.toString(size)); graphicInfo.setSize(sizeInfo); return graphicInfo; }
java
public static GraphicInfo createGraphic(ExternalGraphicInfo graphic, int size) { GraphicInfo graphicInfo = new GraphicInfo(); ChoiceInfo choice = new ChoiceInfo(); choice.setExternalGraphic(graphic); graphicInfo.getChoiceList().add(choice); SizeInfo sizeInfo = new SizeInfo(); sizeInfo.setValue(Integer.toString(size)); graphicInfo.setSize(sizeInfo); return graphicInfo; }
[ "public", "static", "GraphicInfo", "createGraphic", "(", "ExternalGraphicInfo", "graphic", ",", "int", "size", ")", "{", "GraphicInfo", "graphicInfo", "=", "new", "GraphicInfo", "(", ")", ";", "ChoiceInfo", "choice", "=", "new", "ChoiceInfo", "(", ")", ";", "choice", ".", "setExternalGraphic", "(", "graphic", ")", ";", "graphicInfo", ".", "getChoiceList", "(", ")", ".", "add", "(", "choice", ")", ";", "SizeInfo", "sizeInfo", "=", "new", "SizeInfo", "(", ")", ";", "sizeInfo", ".", "setValue", "(", "Integer", ".", "toString", "(", "size", ")", ")", ";", "graphicInfo", ".", "setSize", "(", "sizeInfo", ")", ";", "return", "graphicInfo", ";", "}" ]
Creates a graphic with the specified external graphic and size. @param graphic the graphic @param size the size @return the graphic
[ "Creates", "a", "graphic", "with", "the", "specified", "external", "graphic", "and", "size", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L317-L326
146,311
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createCssParameter
public static CssParameterInfo createCssParameter(String name, Object value) { CssParameterInfo css = new CssParameterInfo(); css.setName(name); css.setValue(value.toString()); return css; }
java
public static CssParameterInfo createCssParameter(String name, Object value) { CssParameterInfo css = new CssParameterInfo(); css.setName(name); css.setValue(value.toString()); return css; }
[ "public", "static", "CssParameterInfo", "createCssParameter", "(", "String", "name", ",", "Object", "value", ")", "{", "CssParameterInfo", "css", "=", "new", "CssParameterInfo", "(", ")", ";", "css", ".", "setName", "(", "name", ")", ";", "css", ".", "setValue", "(", "value", ".", "toString", "(", ")", ")", ";", "return", "css", ";", "}" ]
Creates a CSS parameter with specified name and value. @param name the name @param value the value @return the parameter
[ "Creates", "a", "CSS", "parameter", "with", "specified", "name", "and", "value", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L335-L340
146,312
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java
StyleUtil.createSymbolizer
public static TextSymbolizerInfo createSymbolizer(FontStyleInfo style) { TextSymbolizerInfo symbolizerInfo = new TextSymbolizerInfo(); FontInfo font = new FontInfo(); font.setFamily(style.getFamily()); font.setStyle(style.getStyle()); font.setWeight(style.getWeight()); font.setSize(style.getSize()); symbolizerInfo.setFont(font); symbolizerInfo.setFill(createFill(style.getColor(), style.getOpacity())); return symbolizerInfo; }
java
public static TextSymbolizerInfo createSymbolizer(FontStyleInfo style) { TextSymbolizerInfo symbolizerInfo = new TextSymbolizerInfo(); FontInfo font = new FontInfo(); font.setFamily(style.getFamily()); font.setStyle(style.getStyle()); font.setWeight(style.getWeight()); font.setSize(style.getSize()); symbolizerInfo.setFont(font); symbolizerInfo.setFill(createFill(style.getColor(), style.getOpacity())); return symbolizerInfo; }
[ "public", "static", "TextSymbolizerInfo", "createSymbolizer", "(", "FontStyleInfo", "style", ")", "{", "TextSymbolizerInfo", "symbolizerInfo", "=", "new", "TextSymbolizerInfo", "(", ")", ";", "FontInfo", "font", "=", "new", "FontInfo", "(", ")", ";", "font", ".", "setFamily", "(", "style", ".", "getFamily", "(", ")", ")", ";", "font", ".", "setStyle", "(", "style", ".", "getStyle", "(", ")", ")", ";", "font", ".", "setWeight", "(", "style", ".", "getWeight", "(", ")", ")", ";", "font", ".", "setSize", "(", "style", ".", "getSize", "(", ")", ")", ";", "symbolizerInfo", ".", "setFont", "(", "font", ")", ";", "symbolizerInfo", ".", "setFill", "(", "createFill", "(", "style", ".", "getColor", "(", ")", ",", "style", ".", "getOpacity", "(", ")", ")", ")", ";", "return", "symbolizerInfo", ";", "}" ]
Creates a text symbolizer with the specified font style. @param style font style @return the symbolizer
[ "Creates", "a", "text", "symbolizer", "with", "the", "specified", "font", "style", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L348-L358
146,313
geomajas/geomajas-project-client-gwt2
plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java
NearestVertexSnapAlgorithm.getCoordinates
private List<Coordinate> getCoordinates(Geometry[] geometries) { List<Coordinate> coordinates = new ArrayList<Coordinate>(); for (Geometry geometry : geometries) { addCoordinateArrays(geometry, coordinates); } return coordinates; }
java
private List<Coordinate> getCoordinates(Geometry[] geometries) { List<Coordinate> coordinates = new ArrayList<Coordinate>(); for (Geometry geometry : geometries) { addCoordinateArrays(geometry, coordinates); } return coordinates; }
[ "private", "List", "<", "Coordinate", ">", "getCoordinates", "(", "Geometry", "[", "]", "geometries", ")", "{", "List", "<", "Coordinate", ">", "coordinates", "=", "new", "ArrayList", "<", "Coordinate", ">", "(", ")", ";", "for", "(", "Geometry", "geometry", ":", "geometries", ")", "{", "addCoordinateArrays", "(", "geometry", ",", "coordinates", ")", ";", "}", "return", "coordinates", ";", "}" ]
Get a single list of coordinates from an array of geometries.
[ "Get", "a", "single", "list", "of", "coordinates", "from", "an", "array", "of", "geometries", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java#L123-L129
146,314
geomajas/geomajas-project-client-gwt2
plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java
NearestVertexSnapAlgorithm.sortX
private List<Coordinate> sortX(List<Coordinate> coordinates) { List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates); Collections.sort(sorted, new XComparator()); return sorted; }
java
private List<Coordinate> sortX(List<Coordinate> coordinates) { List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates); Collections.sort(sorted, new XComparator()); return sorted; }
[ "private", "List", "<", "Coordinate", ">", "sortX", "(", "List", "<", "Coordinate", ">", "coordinates", ")", "{", "List", "<", "Coordinate", ">", "sorted", "=", "new", "ArrayList", "<", "Coordinate", ">", "(", "coordinates", ")", ";", "Collections", ".", "sort", "(", "sorted", ",", "new", "XComparator", "(", ")", ")", ";", "return", "sorted", ";", "}" ]
Return a new and sorted list of coordinates. They should be sorted by their X values.
[ "Return", "a", "new", "and", "sorted", "list", "of", "coordinates", ".", "They", "should", "be", "sorted", "by", "their", "X", "values", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java#L149-L153
146,315
geomajas/geomajas-project-client-gwt2
plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java
NearestVertexSnapAlgorithm.sortY
private List<Coordinate> sortY(List<Coordinate> coordinates) { List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates); Collections.sort(sorted, new YComparator()); return sorted; }
java
private List<Coordinate> sortY(List<Coordinate> coordinates) { List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates); Collections.sort(sorted, new YComparator()); return sorted; }
[ "private", "List", "<", "Coordinate", ">", "sortY", "(", "List", "<", "Coordinate", ">", "coordinates", ")", "{", "List", "<", "Coordinate", ">", "sorted", "=", "new", "ArrayList", "<", "Coordinate", ">", "(", "coordinates", ")", ";", "Collections", ".", "sort", "(", "sorted", ",", "new", "YComparator", "(", ")", ")", ";", "return", "sorted", ";", "}" ]
Return a new and sorted list of coordinates. They should be sorted by their Y values.
[ "Return", "a", "new", "and", "sorted", "list", "of", "coordinates", ".", "They", "should", "be", "sorted", "by", "their", "Y", "values", "." ]
bd8d7904e861fa80522eed7b83c4ea99844180c7
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/snap/algorithm/NearestVertexSnapAlgorithm.java#L158-L162
146,316
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java
UserCredentialsFileRepository.readFile
private void readFile() throws IOException { BufferedReader reader = null; try { reader = new BufferedReader( new InputStreamReader( new FileInputStream( file ), PcsUtils.UTF8 ) ); LOGGER.debug( "Reading credentials file {}", file ); String line; int index = 1; while ( ( line = reader.readLine() ) != null ) { line = line.trim(); if ( line.startsWith( "#" ) || line.length() == 0 ) { continue; } String[] userCredentialsArray = line.split( "=", 2 ); if ( userCredentialsArray.length != 2 ) { throw new IllegalArgumentException( "Not parsable line #" + index ); } // Key final String key = userCredentialsArray[0].trim(); final Credentials value = Credentials.createFromJson( userCredentialsArray[1].trim() ); credentialsMap.put( key, value ); index++; } } finally { PcsUtils.closeQuietly( reader ); } }
java
private void readFile() throws IOException { BufferedReader reader = null; try { reader = new BufferedReader( new InputStreamReader( new FileInputStream( file ), PcsUtils.UTF8 ) ); LOGGER.debug( "Reading credentials file {}", file ); String line; int index = 1; while ( ( line = reader.readLine() ) != null ) { line = line.trim(); if ( line.startsWith( "#" ) || line.length() == 0 ) { continue; } String[] userCredentialsArray = line.split( "=", 2 ); if ( userCredentialsArray.length != 2 ) { throw new IllegalArgumentException( "Not parsable line #" + index ); } // Key final String key = userCredentialsArray[0].trim(); final Credentials value = Credentials.createFromJson( userCredentialsArray[1].trim() ); credentialsMap.put( key, value ); index++; } } finally { PcsUtils.closeQuietly( reader ); } }
[ "private", "void", "readFile", "(", ")", "throws", "IOException", "{", "BufferedReader", "reader", "=", "null", ";", "try", "{", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", "file", ")", ",", "PcsUtils", ".", "UTF8", ")", ")", ";", "LOGGER", ".", "debug", "(", "\"Reading credentials file {}\"", ",", "file", ")", ";", "String", "line", ";", "int", "index", "=", "1", ";", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "line", "=", "line", ".", "trim", "(", ")", ";", "if", "(", "line", ".", "startsWith", "(", "\"#\"", ")", "||", "line", ".", "length", "(", ")", "==", "0", ")", "{", "continue", ";", "}", "String", "[", "]", "userCredentialsArray", "=", "line", ".", "split", "(", "\"=\"", ",", "2", ")", ";", "if", "(", "userCredentialsArray", ".", "length", "!=", "2", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Not parsable line #\"", "+", "index", ")", ";", "}", "// Key", "final", "String", "key", "=", "userCredentialsArray", "[", "0", "]", ".", "trim", "(", ")", ";", "final", "Credentials", "value", "=", "Credentials", ".", "createFromJson", "(", "userCredentialsArray", "[", "1", "]", ".", "trim", "(", ")", ")", ";", "credentialsMap", ".", "put", "(", "key", ",", "value", ")", ";", "index", "++", ";", "}", "}", "finally", "{", "PcsUtils", ".", "closeQuietly", "(", "reader", ")", ";", "}", "}" ]
Parses a file of credentials @throws IOException Error reading the file
[ "Parses", "a", "file", "of", "credentials" ]
20691e52e144014f99ca75cb7dedc7ba0c18586c
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java#L70-L108
146,317
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java
UserCredentialsFileRepository.writeFile
private void writeFile() throws IOException { LOGGER.debug( "Writing credentials file to {}", file ); File tempFile = new File( file.getPath() + ".tmp" ); Writer writer = null; try { writer = new OutputStreamWriter( new FileOutputStream( tempFile ), PcsUtils.UTF8 ); for ( String key : credentialsMap.keySet() ) { Credentials cred = credentialsMap.get( key ); final String line = key + "=" + cred.toJson() + "\n"; writer.write( line ); } writer.flush(); } finally { PcsUtils.closeQuietly( writer ); } file.delete(); tempFile.renameTo( file ); }
java
private void writeFile() throws IOException { LOGGER.debug( "Writing credentials file to {}", file ); File tempFile = new File( file.getPath() + ".tmp" ); Writer writer = null; try { writer = new OutputStreamWriter( new FileOutputStream( tempFile ), PcsUtils.UTF8 ); for ( String key : credentialsMap.keySet() ) { Credentials cred = credentialsMap.get( key ); final String line = key + "=" + cred.toJson() + "\n"; writer.write( line ); } writer.flush(); } finally { PcsUtils.closeQuietly( writer ); } file.delete(); tempFile.renameTo( file ); }
[ "private", "void", "writeFile", "(", ")", "throws", "IOException", "{", "LOGGER", ".", "debug", "(", "\"Writing credentials file to {}\"", ",", "file", ")", ";", "File", "tempFile", "=", "new", "File", "(", "file", ".", "getPath", "(", ")", "+", "\".tmp\"", ")", ";", "Writer", "writer", "=", "null", ";", "try", "{", "writer", "=", "new", "OutputStreamWriter", "(", "new", "FileOutputStream", "(", "tempFile", ")", ",", "PcsUtils", ".", "UTF8", ")", ";", "for", "(", "String", "key", ":", "credentialsMap", ".", "keySet", "(", ")", ")", "{", "Credentials", "cred", "=", "credentialsMap", ".", "get", "(", "key", ")", ";", "final", "String", "line", "=", "key", "+", "\"=\"", "+", "cred", ".", "toJson", "(", ")", "+", "\"\\n\"", ";", "writer", ".", "write", "(", "line", ")", ";", "}", "writer", ".", "flush", "(", ")", ";", "}", "finally", "{", "PcsUtils", ".", "closeQuietly", "(", "writer", ")", ";", "}", "file", ".", "delete", "(", ")", ";", "tempFile", ".", "renameTo", "(", "file", ")", ";", "}" ]
Serializes credentials data @throws IOException Error while saving the file
[ "Serializes", "credentials", "data" ]
20691e52e144014f99ca75cb7dedc7ba0c18586c
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java#L157-L180
146,318
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java
UserCredentialsFileRepository.getUserKey
private String getUserKey( AppInfo appInfo, String userId ) { if ( userId == null ) { throw new IllegalArgumentException( "userId should not be null" ); } return String.format( "%s%s", getAppPrefix( appInfo ), userId ); }
java
private String getUserKey( AppInfo appInfo, String userId ) { if ( userId == null ) { throw new IllegalArgumentException( "userId should not be null" ); } return String.format( "%s%s", getAppPrefix( appInfo ), userId ); }
[ "private", "String", "getUserKey", "(", "AppInfo", "appInfo", ",", "String", "userId", ")", "{", "if", "(", "userId", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"userId should not be null\"", ")", ";", "}", "return", "String", ".", "format", "(", "\"%s%s\"", ",", "getAppPrefix", "(", "appInfo", ")", ",", "userId", ")", ";", "}" ]
Builds the key of a credentials according to a given appInfo and userId @param appInfo The application informations @param userId The user identifier @return The user key
[ "Builds", "the", "key", "of", "a", "credentials", "according", "to", "a", "given", "appInfo", "and", "userId" ]
20691e52e144014f99ca75cb7dedc7ba0c18586c
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java#L189-L196
146,319
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java
UserCredentialsFileRepository.getAppPrefix
private String getAppPrefix( AppInfo appInfo ) { /// @TODO scope is ignored in key return String.format( "%s.%s.", appInfo.getProviderName(), appInfo.getAppName() ); }
java
private String getAppPrefix( AppInfo appInfo ) { /// @TODO scope is ignored in key return String.format( "%s.%s.", appInfo.getProviderName(), appInfo.getAppName() ); }
[ "private", "String", "getAppPrefix", "(", "AppInfo", "appInfo", ")", "{", "/// @TODO scope is ignored in key", "return", "String", ".", "format", "(", "\"%s.%s.\"", ",", "appInfo", ".", "getProviderName", "(", ")", ",", "appInfo", ".", "getAppName", "(", ")", ")", ";", "}" ]
Builds a key prefix according to a given appInfo @param appInfo The application informations @return The application prefix
[ "Builds", "a", "key", "prefix", "according", "to", "a", "given", "appInfo" ]
20691e52e144014f99ca75cb7dedc7ba0c18586c
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/credentials/UserCredentialsFileRepository.java#L204-L208
146,320
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java
ServletBeanContext.beginContext
public void beginContext(ServletContext context, ServletRequest req, ServletResponse resp) { pushRequestContext(context, req, resp); super.beginContext(); }
java
public void beginContext(ServletContext context, ServletRequest req, ServletResponse resp) { pushRequestContext(context, req, resp); super.beginContext(); }
[ "public", "void", "beginContext", "(", "ServletContext", "context", ",", "ServletRequest", "req", ",", "ServletResponse", "resp", ")", "{", "pushRequestContext", "(", "context", ",", "req", ",", "resp", ")", ";", "super", ".", "beginContext", "(", ")", ";", "}" ]
Begins a new execution context, associated with a specific ServletRequest
[ "Begins", "a", "new", "execution", "context", "associated", "with", "a", "specific", "ServletRequest" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java#L81-L85
146,321
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java
ServletBeanContext.pushRequestContext
private synchronized void pushRequestContext(ServletContext context, ServletRequest req, ServletResponse resp) { getRequestStack().push(new RequestContext(context, req, resp)); }
java
private synchronized void pushRequestContext(ServletContext context, ServletRequest req, ServletResponse resp) { getRequestStack().push(new RequestContext(context, req, resp)); }
[ "private", "synchronized", "void", "pushRequestContext", "(", "ServletContext", "context", ",", "ServletRequest", "req", ",", "ServletResponse", "resp", ")", "{", "getRequestStack", "(", ")", ".", "push", "(", "new", "RequestContext", "(", "context", ",", "req", ",", "resp", ")", ")", ";", "}" ]
Pushes the current request context onto the stack
[ "Pushes", "the", "current", "request", "context", "onto", "the", "stack" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java#L107-L112
146,322
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java
ServletBeanContext.peekRequestContext
private synchronized RequestContext peekRequestContext() { Stack<RequestContext> reqStack = getRequestStack(); if (reqStack.empty()) return null; return reqStack.peek(); }
java
private synchronized RequestContext peekRequestContext() { Stack<RequestContext> reqStack = getRequestStack(); if (reqStack.empty()) return null; return reqStack.peek(); }
[ "private", "synchronized", "RequestContext", "peekRequestContext", "(", ")", "{", "Stack", "<", "RequestContext", ">", "reqStack", "=", "getRequestStack", "(", ")", ";", "if", "(", "reqStack", ".", "empty", "(", ")", ")", "return", "null", ";", "return", "reqStack", ".", "peek", "(", ")", ";", "}" ]
Returns the current request context, or null is none is available
[ "Returns", "the", "current", "request", "context", "or", "null", "is", "none", "is", "available" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java#L125-L132
146,323
tootedom/related
app/domain/src/main/java/org/greencheek/related/util/parsing/HostParsingUtil.java
HostParsingUtil.getHostsToPowerOfTwo
public static String[] getHostsToPowerOfTwo(String[] numberOfHosts) { int definedHosts = numberOfHosts.length; int numOfHosts = Util.ceilingNextPowerOfTwo(definedHosts); Set<String> newHosts = new HashSet<String>(numOfHosts); if(definedHosts < numOfHosts) { for(int i =0;i < numOfHosts;i++) { newHosts.add(numberOfHosts[i%definedHosts]); } } else { return numberOfHosts; } return newHosts.toArray(new String[newHosts.size()]); }
java
public static String[] getHostsToPowerOfTwo(String[] numberOfHosts) { int definedHosts = numberOfHosts.length; int numOfHosts = Util.ceilingNextPowerOfTwo(definedHosts); Set<String> newHosts = new HashSet<String>(numOfHosts); if(definedHosts < numOfHosts) { for(int i =0;i < numOfHosts;i++) { newHosts.add(numberOfHosts[i%definedHosts]); } } else { return numberOfHosts; } return newHosts.toArray(new String[newHosts.size()]); }
[ "public", "static", "String", "[", "]", "getHostsToPowerOfTwo", "(", "String", "[", "]", "numberOfHosts", ")", "{", "int", "definedHosts", "=", "numberOfHosts", ".", "length", ";", "int", "numOfHosts", "=", "Util", ".", "ceilingNextPowerOfTwo", "(", "definedHosts", ")", ";", "Set", "<", "String", ">", "newHosts", "=", "new", "HashSet", "<", "String", ">", "(", "numOfHosts", ")", ";", "if", "(", "definedHosts", "<", "numOfHosts", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numOfHosts", ";", "i", "++", ")", "{", "newHosts", ".", "add", "(", "numberOfHosts", "[", "i", "%", "definedHosts", "]", ")", ";", "}", "}", "else", "{", "return", "numberOfHosts", ";", "}", "return", "newHosts", ".", "toArray", "(", "new", "String", "[", "newHosts", ".", "size", "(", ")", "]", ")", ";", "}" ]
Given an array of host names, makes the host list into a array that has a power of two length. It does this by reusing existing strings to form the new string. for example. Given : String[] { "localhost:9999","localhost:8888","localhost:8080"} The resulting array is : String[] { "localhost:9999","localhost:8888","localhost:8080","localhost:9999"} for example. Given : String[] { "localhost:9999","localhost:8888","localhost:8080","localhost:80","localhost:9200"} The resulting array is : String[] { "localhost:9999","localhost:8888","localhost:8080","localhost:80", "localhost:9200","localhost:9999","localhost:8888","localhost:8080",} @param numberOfHosts @return
[ "Given", "an", "array", "of", "host", "names", "makes", "the", "host", "list", "into", "a", "array", "that", "has", "a", "power", "of", "two", "length", ".", "It", "does", "this", "by", "reusing", "existing", "strings", "to", "form", "the", "new", "string", "." ]
3782dd5a839bbcdc15661d598e8b895aae8aabb7
https://github.com/tootedom/related/blob/3782dd5a839bbcdc15661d598e8b895aae8aabb7/app/domain/src/main/java/org/greencheek/related/util/parsing/HostParsingUtil.java#L104-L117
146,324
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java
SqlSubstitutionFragment.getParameterValues
protected Object[] getParameterValues(ControlBeanContext context, Method m, Object[] args) { ArrayList<Object> paramValues = new ArrayList<Object>(); for (SqlFragment frag : _children) { if (frag.hasComplexValue(context, m, args)) { paramValues.addAll(Arrays.asList(frag.getParameterValues(context, m, args))); } } return paramValues.toArray(); }
java
protected Object[] getParameterValues(ControlBeanContext context, Method m, Object[] args) { ArrayList<Object> paramValues = new ArrayList<Object>(); for (SqlFragment frag : _children) { if (frag.hasComplexValue(context, m, args)) { paramValues.addAll(Arrays.asList(frag.getParameterValues(context, m, args))); } } return paramValues.toArray(); }
[ "protected", "Object", "[", "]", "getParameterValues", "(", "ControlBeanContext", "context", ",", "Method", "m", ",", "Object", "[", "]", "args", ")", "{", "ArrayList", "<", "Object", ">", "paramValues", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "for", "(", "SqlFragment", "frag", ":", "_children", ")", "{", "if", "(", "frag", ".", "hasComplexValue", "(", "context", ",", "m", ",", "args", ")", ")", "{", "paramValues", ".", "addAll", "(", "Arrays", ".", "asList", "(", "frag", ".", "getParameterValues", "(", "context", ",", "m", ",", "args", ")", ")", ")", ";", "}", "}", "return", "paramValues", ".", "toArray", "(", ")", ";", "}" ]
Get the parameter values from this fragment and its children. An SqlSubstitutionFragment only contains parameters if one of its children has a complex value type. @param context A ControlBeanContext instance @param m The annotated method @param args The method parameters @return Array of objects.
[ "Get", "the", "parameter", "values", "from", "this", "fragment", "and", "its", "children", ".", "An", "SqlSubstitutionFragment", "only", "contains", "parameters", "if", "one", "of", "its", "children", "has", "a", "complex", "value", "type", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java#L97-L105
146,325
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java
SqlSubstitutionFragment.getPreparedStatementText
protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) { StringBuilder sb = new StringBuilder(); for (SqlFragment frag : _children) { boolean complexFragment = frag.hasComplexValue(context, m, args); if (frag.hasParamValue() && !complexFragment) { Object[] pValues = frag.getParameterValues(context, m, args); for (Object o : pValues) { sb.append(processSqlParams(o)); } } else { _hasParamValue |= complexFragment; sb.append(frag.getPreparedStatementText(context, m, args)); } } return sb.toString(); }
java
protected String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) { StringBuilder sb = new StringBuilder(); for (SqlFragment frag : _children) { boolean complexFragment = frag.hasComplexValue(context, m, args); if (frag.hasParamValue() && !complexFragment) { Object[] pValues = frag.getParameterValues(context, m, args); for (Object o : pValues) { sb.append(processSqlParams(o)); } } else { _hasParamValue |= complexFragment; sb.append(frag.getPreparedStatementText(context, m, args)); } } return sb.toString(); }
[ "protected", "String", "getPreparedStatementText", "(", "ControlBeanContext", "context", ",", "Method", "m", ",", "Object", "[", "]", "args", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "SqlFragment", "frag", ":", "_children", ")", "{", "boolean", "complexFragment", "=", "frag", ".", "hasComplexValue", "(", "context", ",", "m", ",", "args", ")", ";", "if", "(", "frag", ".", "hasParamValue", "(", ")", "&&", "!", "complexFragment", ")", "{", "Object", "[", "]", "pValues", "=", "frag", ".", "getParameterValues", "(", "context", ",", "m", ",", "args", ")", ";", "for", "(", "Object", "o", ":", "pValues", ")", "{", "sb", ".", "append", "(", "processSqlParams", "(", "o", ")", ")", ";", "}", "}", "else", "{", "_hasParamValue", "|=", "complexFragment", ";", "sb", ".", "append", "(", "frag", ".", "getPreparedStatementText", "(", "context", ",", "m", ",", "args", ")", ")", ";", "}", "}", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
Return the text for a PreparedStatement from this fragment. This type of fragment typically evaluates any reflection parameters at this point. The exception is if the reflected result is a ComplexSqlFragment, it that case the sql text is retrieved from the fragment in this method. The parameter values are retrieved in the getParameterValues method of this class. @param context A ControlBeanContext instance @param m The annotated method @param args The method parameters @return A String containing the value of this fragment and its children
[ "Return", "the", "text", "for", "a", "PreparedStatement", "from", "this", "fragment", ".", "This", "type", "of", "fragment", "typically", "evaluates", "any", "reflection", "parameters", "at", "this", "point", ".", "The", "exception", "is", "if", "the", "reflected", "result", "is", "a", "ComplexSqlFragment", "it", "that", "case", "the", "sql", "text", "is", "retrieved", "from", "the", "fragment", "in", "this", "method", ".", "The", "parameter", "values", "are", "retrieved", "in", "the", "getParameterValues", "method", "of", "this", "class", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java#L119-L136
146,326
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java
SqlSubstitutionFragment.processSqlParams
private String processSqlParams(Object value) { Object[] arr = null; if (value != null) { arr = TypeMappingsFactory.toObjectArray(value); } if (value == null || (arr != null && arr.length == 0)) { return ""; } else if (arr != null) { StringBuilder result = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i > 0) { result.append(','); result.append(arr[i].toString()); } else { result.append(arr[i].toString()); } } return result.toString(); } else { return value.toString(); } }
java
private String processSqlParams(Object value) { Object[] arr = null; if (value != null) { arr = TypeMappingsFactory.toObjectArray(value); } if (value == null || (arr != null && arr.length == 0)) { return ""; } else if (arr != null) { StringBuilder result = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i > 0) { result.append(','); result.append(arr[i].toString()); } else { result.append(arr[i].toString()); } } return result.toString(); } else { return value.toString(); } }
[ "private", "String", "processSqlParams", "(", "Object", "value", ")", "{", "Object", "[", "]", "arr", "=", "null", ";", "if", "(", "value", "!=", "null", ")", "{", "arr", "=", "TypeMappingsFactory", ".", "toObjectArray", "(", "value", ")", ";", "}", "if", "(", "value", "==", "null", "||", "(", "arr", "!=", "null", "&&", "arr", ".", "length", "==", "0", ")", ")", "{", "return", "\"\"", ";", "}", "else", "if", "(", "arr", "!=", "null", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "result", ".", "append", "(", "'", "'", ")", ";", "result", ".", "append", "(", "arr", "[", "i", "]", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "result", ".", "append", "(", "arr", "[", "i", "]", ".", "toString", "(", ")", ")", ";", "}", "}", "return", "result", ".", "toString", "(", ")", ";", "}", "else", "{", "return", "value", ".", "toString", "(", ")", ";", "}", "}" ]
Check for the cases of a null or array type param value. If array type build a string of the array values seperated by commas. @param value @return String containing value.
[ "Check", "for", "the", "cases", "of", "a", "null", "or", "array", "type", "param", "value", ".", "If", "array", "type", "build", "a", "string", "of", "the", "array", "values", "seperated", "by", "commas", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlSubstitutionFragment.java#L149-L172
146,327
moparisthebest/beehive
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java
EJBControlImpl.mapControlBeanMethodToEJB
protected Method mapControlBeanMethodToEJB(Method m) { Method ejbMethod = findEjbMethod(m, _homeInterface); if (ejbMethod == null) { if (_beanInstance == null) { _beanInstance = resolveBeanInstance(); if (_beanInstance == null) { throw new ControlException("Unable to resolve bean instance"); } } ejbMethod = findEjbMethod(m, _beanInstance.getClass()); if (ejbMethod == null) { throw new ControlException("Unable to map ejb control interface method to EJB method: " + m.getName()); } } return ejbMethod; }
java
protected Method mapControlBeanMethodToEJB(Method m) { Method ejbMethod = findEjbMethod(m, _homeInterface); if (ejbMethod == null) { if (_beanInstance == null) { _beanInstance = resolveBeanInstance(); if (_beanInstance == null) { throw new ControlException("Unable to resolve bean instance"); } } ejbMethod = findEjbMethod(m, _beanInstance.getClass()); if (ejbMethod == null) { throw new ControlException("Unable to map ejb control interface method to EJB method: " + m.getName()); } } return ejbMethod; }
[ "protected", "Method", "mapControlBeanMethodToEJB", "(", "Method", "m", ")", "{", "Method", "ejbMethod", "=", "findEjbMethod", "(", "m", ",", "_homeInterface", ")", ";", "if", "(", "ejbMethod", "==", "null", ")", "{", "if", "(", "_beanInstance", "==", "null", ")", "{", "_beanInstance", "=", "resolveBeanInstance", "(", ")", ";", "if", "(", "_beanInstance", "==", "null", ")", "{", "throw", "new", "ControlException", "(", "\"Unable to resolve bean instance\"", ")", ";", "}", "}", "ejbMethod", "=", "findEjbMethod", "(", "m", ",", "_beanInstance", ".", "getClass", "(", ")", ")", ";", "if", "(", "ejbMethod", "==", "null", ")", "{", "throw", "new", "ControlException", "(", "\"Unable to map ejb control interface method to EJB method: \"", "+", "m", ".", "getName", "(", ")", ")", ";", "}", "}", "return", "ejbMethod", ";", "}" ]
Map a control bean method to an EJB method. @param m The control bean method. @return The corresponding method of the EJB.
[ "Map", "a", "control", "bean", "method", "to", "an", "EJB", "method", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java#L129-L144
146,328
moparisthebest/beehive
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java
EJBControlImpl.findEjbMethod
protected Method findEjbMethod(Method controlBeanMethod, Class ejbInterface) { final String cbMethodName = controlBeanMethod.getName(); final Class cbMethodReturnType = controlBeanMethod.getReturnType(); final Class[] cbMethodParams = controlBeanMethod.getParameterTypes(); Method[] ejbMethods = ejbInterface.getMethods(); for (Method m : ejbMethods) { if (!cbMethodName.equals(m.getName()) || !cbMethodReturnType.equals(m.getReturnType())) { continue; } Class[] params = m.getParameterTypes(); if (cbMethodParams.length == params.length) { int i; for (i = 0; i < cbMethodParams.length; i++) { if (cbMethodParams[i] != params[i]) break; } if (i == cbMethodParams.length) return m; } } return null; }
java
protected Method findEjbMethod(Method controlBeanMethod, Class ejbInterface) { final String cbMethodName = controlBeanMethod.getName(); final Class cbMethodReturnType = controlBeanMethod.getReturnType(); final Class[] cbMethodParams = controlBeanMethod.getParameterTypes(); Method[] ejbMethods = ejbInterface.getMethods(); for (Method m : ejbMethods) { if (!cbMethodName.equals(m.getName()) || !cbMethodReturnType.equals(m.getReturnType())) { continue; } Class[] params = m.getParameterTypes(); if (cbMethodParams.length == params.length) { int i; for (i = 0; i < cbMethodParams.length; i++) { if (cbMethodParams[i] != params[i]) break; } if (i == cbMethodParams.length) return m; } } return null; }
[ "protected", "Method", "findEjbMethod", "(", "Method", "controlBeanMethod", ",", "Class", "ejbInterface", ")", "{", "final", "String", "cbMethodName", "=", "controlBeanMethod", ".", "getName", "(", ")", ";", "final", "Class", "cbMethodReturnType", "=", "controlBeanMethod", ".", "getReturnType", "(", ")", ";", "final", "Class", "[", "]", "cbMethodParams", "=", "controlBeanMethod", ".", "getParameterTypes", "(", ")", ";", "Method", "[", "]", "ejbMethods", "=", "ejbInterface", ".", "getMethods", "(", ")", ";", "for", "(", "Method", "m", ":", "ejbMethods", ")", "{", "if", "(", "!", "cbMethodName", ".", "equals", "(", "m", ".", "getName", "(", ")", ")", "||", "!", "cbMethodReturnType", ".", "equals", "(", "m", ".", "getReturnType", "(", ")", ")", ")", "{", "continue", ";", "}", "Class", "[", "]", "params", "=", "m", ".", "getParameterTypes", "(", ")", ";", "if", "(", "cbMethodParams", ".", "length", "==", "params", ".", "length", ")", "{", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "cbMethodParams", ".", "length", ";", "i", "++", ")", "{", "if", "(", "cbMethodParams", "[", "i", "]", "!=", "params", "[", "i", "]", ")", "break", ";", "}", "if", "(", "i", "==", "cbMethodParams", ".", "length", ")", "return", "m", ";", "}", "}", "return", "null", ";", "}" ]
Find the method which has the same signature in the specified class. @param controlBeanMethod Method signature find. @param ejbInterface Class to search for method signature. @return Method from ejbInterface if found, null if not found.
[ "Find", "the", "method", "which", "has", "the", "same", "signature", "in", "the", "specified", "class", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java#L153-L176
146,329
moparisthebest/beehive
beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java
EJBControlImpl.lookupHomeInstance
private Object lookupHomeInstance() throws NamingException { javax.naming.Context ctx = getInitialContext(); try { return ctx.lookup(_jndiName); } catch (NameNotFoundException nnfe) { // attempt again without application scoping if (!_jndiName.startsWith(JNDI_APPSCOPED_PREFIX)) { throw nnfe; } } return ctx.lookup(_jndiName.substring(JNDI_APPSCOPED_PREFIX.length())); }
java
private Object lookupHomeInstance() throws NamingException { javax.naming.Context ctx = getInitialContext(); try { return ctx.lookup(_jndiName); } catch (NameNotFoundException nnfe) { // attempt again without application scoping if (!_jndiName.startsWith(JNDI_APPSCOPED_PREFIX)) { throw nnfe; } } return ctx.lookup(_jndiName.substring(JNDI_APPSCOPED_PREFIX.length())); }
[ "private", "Object", "lookupHomeInstance", "(", ")", "throws", "NamingException", "{", "javax", ".", "naming", ".", "Context", "ctx", "=", "getInitialContext", "(", ")", ";", "try", "{", "return", "ctx", ".", "lookup", "(", "_jndiName", ")", ";", "}", "catch", "(", "NameNotFoundException", "nnfe", ")", "{", "// attempt again without application scoping", "if", "(", "!", "_jndiName", ".", "startsWith", "(", "JNDI_APPSCOPED_PREFIX", ")", ")", "{", "throw", "nnfe", ";", "}", "}", "return", "ctx", ".", "lookup", "(", "_jndiName", ".", "substring", "(", "JNDI_APPSCOPED_PREFIX", ".", "length", "(", ")", ")", ")", ";", "}" ]
Do a JNDI lookup for the home instance of the ejb. Attempt the lookup first using an app scoped jndi prefix, if not successful, attempt without the prefix. @return HomeInstance object. @throws NamingException If HomeInstance cannot be found in JNDI registry.
[ "Do", "a", "JNDI", "lookup", "for", "the", "home", "instance", "of", "the", "ejb", ".", "Attempt", "the", "lookup", "first", "using", "an", "app", "scoped", "jndi", "prefix", "if", "not", "successful", "attempt", "without", "the", "prefix", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-ejb-control/src/main/java/org/apache/beehive/controls/system/ejb/EJBControlImpl.java#L457-L471
146,330
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Row.java
Row.setTagId
public void setTagId(String tagId) throws JspException { JspContext jspContext = getJspContext(); DataGridTagModel dataGridModel = DataGridUtil.getDataGridTagModel(jspContext); if(dataGridModel == null) throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel")); int renderState = dataGridModel.getRenderState(); if(renderState == DataGridTagModel.RENDER_STATE_GRID) applyIndexedTagId(_trState, tagId); else applyTagId(_trState, tagId); }
java
public void setTagId(String tagId) throws JspException { JspContext jspContext = getJspContext(); DataGridTagModel dataGridModel = DataGridUtil.getDataGridTagModel(jspContext); if(dataGridModel == null) throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel")); int renderState = dataGridModel.getRenderState(); if(renderState == DataGridTagModel.RENDER_STATE_GRID) applyIndexedTagId(_trState, tagId); else applyTagId(_trState, tagId); }
[ "public", "void", "setTagId", "(", "String", "tagId", ")", "throws", "JspException", "{", "JspContext", "jspContext", "=", "getJspContext", "(", ")", ";", "DataGridTagModel", "dataGridModel", "=", "DataGridUtil", ".", "getDataGridTagModel", "(", "jspContext", ")", ";", "if", "(", "dataGridModel", "==", "null", ")", "throw", "new", "JspException", "(", "Bundle", ".", "getErrorString", "(", "\"DataGridTags_MissingDataGridModel\"", ")", ")", ";", "int", "renderState", "=", "dataGridModel", ".", "getRenderState", "(", ")", ";", "if", "(", "renderState", "==", "DataGridTagModel", ".", "RENDER_STATE_GRID", ")", "applyIndexedTagId", "(", "_trState", ",", "tagId", ")", ";", "else", "applyTagId", "(", "_trState", ",", "tagId", ")", ";", "}" ]
Set the name of the tagId for the HTML tr tag. @param tagId the the name of the tagId for the table row. @jsptagref.attributedescription The tagId for the HTML tr tat. @jsptagref.attributesyntaxvalue <i>string_tagId</i> @netui:attribute required="false" rtexprvalue="true" description="String value. Sets the id (or name) attribute of the HTML tr tag."
[ "Set", "the", "name", "of", "the", "tagId", "for", "the", "HTML", "tr", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Row.java#L304-L316
146,331
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ImplInitializer.java
ImplInitializer.initialize
public void initialize(ControlBean bean, Object target) { initServices(bean, target); initControls(bean, target); initEventProxies(bean, target); }
java
public void initialize(ControlBean bean, Object target) { initServices(bean, target); initControls(bean, target); initEventProxies(bean, target); }
[ "public", "void", "initialize", "(", "ControlBean", "bean", ",", "Object", "target", ")", "{", "initServices", "(", "bean", ",", "target", ")", ";", "initControls", "(", "bean", ",", "target", ")", ";", "initEventProxies", "(", "bean", ",", "target", ")", ";", "}" ]
Initializes a new ControlImplementation instance associated with the specified bean.
[ "Initializes", "a", "new", "ControlImplementation", "instance", "associated", "with", "the", "specified", "bean", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ImplInitializer.java#L32-L37
146,332
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
Header.setOnClick
public void setOnClick(String onClick) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); }
java
public void setOnClick(String onClick) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONCLICK, onClick); }
[ "public", "void", "setOnClick", "(", "String", "onClick", ")", "{", "_theadTag", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONCLICK", ",", "onClick", ")", ";", "}" ]
Sets the onClick JavaScript event for the HTML thead tag. @param onClick the onClick event. @jsptagref.attributedescription The onClick JavaScript event for the HTML thead tag. @jsptagref.attributesyntaxvalue <i>string_onClick</i> @netui:attribute required="false" rtexprvalue="true" description="The onClick JavaScript event for the HTML thead tag."
[ "Sets", "the", "onClick", "JavaScript", "event", "for", "the", "HTML", "thead", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java#L128-L130
146,333
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
Header.setOnDblClick
public void setOnDblClick(String onDblClick) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); }
java
public void setOnDblClick(String onDblClick) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONDBLCLICK, onDblClick); }
[ "public", "void", "setOnDblClick", "(", "String", "onDblClick", ")", "{", "_theadTag", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONDBLCLICK", ",", "onDblClick", ")", ";", "}" ]
Sets the onDblClick JavaScript event for the HTML thead tag. @param onDblClick the onDblClick event. @jsptagref.attributedescription The onDblClick JavaScript event for the HTML thead tag. @jsptagref.attributesyntaxvalue <i>string_onDblClick</i> @netui:attribute required="false" rtexprvalue="true" description="The onDblClick JavaScript event for the HTML thead tag."
[ "Sets", "the", "onDblClick", "JavaScript", "event", "for", "the", "HTML", "thead", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java#L140-L142
146,334
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
Header.setOnKeyDown
public void setOnKeyDown(String onKeyDown) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); }
java
public void setOnKeyDown(String onKeyDown) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYDOWN, onKeyDown); }
[ "public", "void", "setOnKeyDown", "(", "String", "onKeyDown", ")", "{", "_theadTag", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONKEYDOWN", ",", "onKeyDown", ")", ";", "}" ]
Sets the onKeyDown JavaScript event for the HTML thead tag. @param onKeyDown the onKeyDown event. @jsptagref.attributedescription The onKeyDown JavaScript event for the HTML thead tag. @jsptagref.attributesyntaxvalue <i>string_onKeyDown</i> @netui:attribute required="false" rtexprvalue="true" description="The onKeyDown JavaScript event for the HTML thead tag."
[ "Sets", "the", "onKeyDown", "JavaScript", "event", "for", "the", "HTML", "thead", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java#L152-L154
146,335
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
Header.setChar
public void setChar(String alignChar) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAR, alignChar); }
java
public void setChar(String alignChar) { _theadTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.CHAR, alignChar); }
[ "public", "void", "setChar", "(", "String", "alignChar", ")", "{", "_theadTag", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "HtmlConstants", ".", "CHAR", ",", "alignChar", ")", ";", "}" ]
Sets the value of the horizontal alignment character attribute rendered by the HTML thead tag. @param alignChar the alignment character @jsptagref.attributedescription The horizontal alignment character rendered by the HTML thead tag. @jsptagref.attributesyntaxvalue <i>string_alignChar</i> @netui:attribute required="false" rtexprvalue="true" description="The horizontal alignment character rendered by the HTML thead tag."
[ "Sets", "the", "value", "of", "the", "horizontal", "alignment", "character", "attribute", "rendered", "by", "the", "HTML", "thead", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java#L301-L303
146,336
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java
Header.setValign
public void setValign(String valign) { /* todo: should this enforce top|middle|bottom|baseline as in the spec */ _theadTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, valign); }
java
public void setValign(String valign) { /* todo: should this enforce top|middle|bottom|baseline as in the spec */ _theadTag.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.VALIGN, valign); }
[ "public", "void", "setValign", "(", "String", "valign", ")", "{", "/* todo: should this enforce top|middle|bottom|baseline as in the spec */", "_theadTag", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "HtmlConstants", ".", "VALIGN", ",", "valign", ")", ";", "}" ]
Sets the value of the vertical alignment attribute rendered by the HTML thead tag. @param valign the vertical alignment @jsptagref.attributedescription The vertical alignment rendered by the HTML thead tag @jsptagref.attributesyntaxvalue <i>string_align</i> @netui:attribute required="false" rtexprvalue="true" description="The vertical alignment rendered by the HTML thead tag.
[ "Sets", "the", "value", "of", "the", "vertical", "alignment", "attribute", "rendered", "by", "the", "HTML", "thead", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/Header.java#L325-L328
146,337
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XConceptExtension.java
XConceptExtension.extractName
public String extractName(XAttributable element) { XAttribute attribute = element.getAttributes().get(KEY_NAME); if (attribute == null) { return null; } else { return ((XAttributeLiteral) attribute).getValue(); } }
java
public String extractName(XAttributable element) { XAttribute attribute = element.getAttributes().get(KEY_NAME); if (attribute == null) { return null; } else { return ((XAttributeLiteral) attribute).getValue(); } }
[ "public", "String", "extractName", "(", "XAttributable", "element", ")", "{", "XAttribute", "attribute", "=", "element", ".", "getAttributes", "(", ")", ".", "get", "(", "KEY_NAME", ")", ";", "if", "(", "attribute", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "(", "(", "XAttributeLiteral", ")", "attribute", ")", ".", "getValue", "(", ")", ";", "}", "}" ]
Retrieves the name of a log data hierarchy element, if set by this extension's name attribute. @param element Log hierarchy element to extract name from. @return The requested element name.
[ "Retrieves", "the", "name", "of", "a", "log", "data", "hierarchy", "element", "if", "set", "by", "this", "extension", "s", "name", "attribute", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XConceptExtension.java#L162-L169
146,338
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XConceptExtension.java
XConceptExtension.assignName
public void assignName(XAttributable element, String name) { if (name != null && name.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_NAME.clone(); attr.setValue(name); element.getAttributes().put(KEY_NAME, attr); } }
java
public void assignName(XAttributable element, String name) { if (name != null && name.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_NAME.clone(); attr.setValue(name); element.getAttributes().put(KEY_NAME, attr); } }
[ "public", "void", "assignName", "(", "XAttributable", "element", ",", "String", "name", ")", "{", "if", "(", "name", "!=", "null", "&&", "name", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ")", "{", "XAttributeLiteral", "attr", "=", "(", "XAttributeLiteral", ")", "ATTR_NAME", ".", "clone", "(", ")", ";", "attr", ".", "setValue", "(", "name", ")", ";", "element", ".", "getAttributes", "(", ")", ".", "put", "(", "KEY_NAME", ",", "attr", ")", ";", "}", "}" ]
Assigns any log data hierarchy element its name, as defined by this extension's name attribute. @param element Log hierarchy element to assign name to. @param name The name to be assigned.
[ "Assigns", "any", "log", "data", "hierarchy", "element", "its", "name", "as", "defined", "by", "this", "extension", "s", "name", "attribute", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XConceptExtension.java#L180-L186
146,339
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XConceptExtension.java
XConceptExtension.extractInstance
public String extractInstance(XEvent event) { XAttribute attribute = event.getAttributes().get(KEY_INSTANCE); if (attribute == null) { return null; } else { return ((XAttributeLiteral) attribute).getValue(); } }
java
public String extractInstance(XEvent event) { XAttribute attribute = event.getAttributes().get(KEY_INSTANCE); if (attribute == null) { return null; } else { return ((XAttributeLiteral) attribute).getValue(); } }
[ "public", "String", "extractInstance", "(", "XEvent", "event", ")", "{", "XAttribute", "attribute", "=", "event", ".", "getAttributes", "(", ")", ".", "get", "(", "KEY_INSTANCE", ")", ";", "if", "(", "attribute", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "(", "(", "XAttributeLiteral", ")", "attribute", ")", ".", "getValue", "(", ")", ";", "}", "}" ]
Retrieves the activity instance identifier of an event, if set by this extension's instance attribute. @param event Event to extract instance from. @return The requested activity instance identifier.
[ "Retrieves", "the", "activity", "instance", "identifier", "of", "an", "event", "if", "set", "by", "this", "extension", "s", "instance", "attribute", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XConceptExtension.java#L196-L203
146,340
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XConceptExtension.java
XConceptExtension.assignInstance
public void assignInstance(XEvent event, String instance) { if (instance != null && instance.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_INSTANCE.clone(); attr.setValue(instance); event.getAttributes().put(KEY_INSTANCE, attr); } }
java
public void assignInstance(XEvent event, String instance) { if (instance != null && instance.trim().length() > 0) { XAttributeLiteral attr = (XAttributeLiteral) ATTR_INSTANCE.clone(); attr.setValue(instance); event.getAttributes().put(KEY_INSTANCE, attr); } }
[ "public", "void", "assignInstance", "(", "XEvent", "event", ",", "String", "instance", ")", "{", "if", "(", "instance", "!=", "null", "&&", "instance", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ")", "{", "XAttributeLiteral", "attr", "=", "(", "XAttributeLiteral", ")", "ATTR_INSTANCE", ".", "clone", "(", ")", ";", "attr", ".", "setValue", "(", "instance", ")", ";", "event", ".", "getAttributes", "(", ")", ".", "put", "(", "KEY_INSTANCE", ",", "attr", ")", ";", "}", "}" ]
Assigns any event its activity instance identifier, as defined by this extension's instance attribute. @param event Event to assign activity instance identifier to. @param name The activity instance identifier to be assigned.
[ "Assigns", "any", "event", "its", "activity", "instance", "identifier", "as", "defined", "by", "this", "extension", "s", "instance", "attribute", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XConceptExtension.java#L214-L220
146,341
iig-uni-freiburg/SEWOL
src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java
RoleGraphMouse.loadPlugins
@Override protected void loadPlugins() { pickingPlugin = new PickingGraphMousePlugin<String,String>(); scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out); editingPlugin = new RoleGraphEditingPlugin(); add(scalingPlugin); setMode(Mode.EDITING); }
java
@Override protected void loadPlugins() { pickingPlugin = new PickingGraphMousePlugin<String,String>(); scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out); editingPlugin = new RoleGraphEditingPlugin(); add(scalingPlugin); setMode(Mode.EDITING); }
[ "@", "Override", "protected", "void", "loadPlugins", "(", ")", "{", "pickingPlugin", "=", "new", "PickingGraphMousePlugin", "<", "String", ",", "String", ">", "(", ")", ";", "scalingPlugin", "=", "new", "ScalingGraphMousePlugin", "(", "new", "CrossoverScalingControl", "(", ")", ",", "0", ",", "in", ",", "out", ")", ";", "editingPlugin", "=", "new", "RoleGraphEditingPlugin", "(", ")", ";", "add", "(", "scalingPlugin", ")", ";", "setMode", "(", "Mode", ".", "EDITING", ")", ";", "}" ]
create the plugins, and load the plugins for TRANSFORMING mode
[ "create", "the", "plugins", "and", "load", "the", "plugins", "for", "TRANSFORMING", "mode" ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java#L55-L62
146,342
iig-uni-freiburg/SEWOL
src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java
RoleGraphMouse.setMode
@Override public void setMode(Mode mode) { if(this.mode != mode) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this.mode, ItemEvent.DESELECTED)); this.mode = mode; if(mode == Mode.PICKING) { setPickingMode(); } else if(mode == Mode.EDITING) { setEditingMode(); } if(modeBox != null) { modeBox.setSelectedItem(mode); } fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED)); } }
java
@Override public void setMode(Mode mode) { if(this.mode != mode) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this.mode, ItemEvent.DESELECTED)); this.mode = mode; if(mode == Mode.PICKING) { setPickingMode(); } else if(mode == Mode.EDITING) { setEditingMode(); } if(modeBox != null) { modeBox.setSelectedItem(mode); } fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED)); } }
[ "@", "Override", "public", "void", "setMode", "(", "Mode", "mode", ")", "{", "if", "(", "this", ".", "mode", "!=", "mode", ")", "{", "fireItemStateChanged", "(", "new", "ItemEvent", "(", "this", ",", "ItemEvent", ".", "ITEM_STATE_CHANGED", ",", "this", ".", "mode", ",", "ItemEvent", ".", "DESELECTED", ")", ")", ";", "this", ".", "mode", "=", "mode", ";", "if", "(", "mode", "==", "Mode", ".", "PICKING", ")", "{", "setPickingMode", "(", ")", ";", "}", "else", "if", "(", "mode", "==", "Mode", ".", "EDITING", ")", "{", "setEditingMode", "(", ")", ";", "}", "if", "(", "modeBox", "!=", "null", ")", "{", "modeBox", ".", "setSelectedItem", "(", "mode", ")", ";", "}", "fireItemStateChanged", "(", "new", "ItemEvent", "(", "this", ",", "ItemEvent", ".", "ITEM_STATE_CHANGED", ",", "mode", ",", "ItemEvent", ".", "SELECTED", ")", ")", ";", "}", "}" ]
setter for the Mode.
[ "setter", "for", "the", "Mode", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/accesscontrol/rbac/lattice/graphic/RoleGraphMouse.java#L67-L83
146,343
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/iterator/MapIterator.java
MapIterator.remove
public void remove() { if(_mapIterator == null) throw new UnsupportedOperationException(Bundle.getErrorString("IteratorFactory_Iterator_removeUnsupported", new Object[]{this.getClass().getName()})); else _mapIterator.remove(); }
java
public void remove() { if(_mapIterator == null) throw new UnsupportedOperationException(Bundle.getErrorString("IteratorFactory_Iterator_removeUnsupported", new Object[]{this.getClass().getName()})); else _mapIterator.remove(); }
[ "public", "void", "remove", "(", ")", "{", "if", "(", "_mapIterator", "==", "null", ")", "throw", "new", "UnsupportedOperationException", "(", "Bundle", ".", "getErrorString", "(", "\"IteratorFactory_Iterator_removeUnsupported\"", ",", "new", "Object", "[", "]", "{", "this", ".", "getClass", "(", ")", ".", "getName", "(", ")", "}", ")", ")", ";", "else", "_mapIterator", ".", "remove", "(", ")", ";", "}" ]
Remove the current item in the iterator.
[ "Remove", "the", "current", "item", "in", "the", "iterator", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/iterator/MapIterator.java#L76-L80
146,344
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Area.java
Area.setAlt
public void setAlt(String alt) { _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, alt, true); }
java
public void setAlt(String alt) { _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, alt, true); }
[ "public", "void", "setAlt", "(", "String", "alt", ")", "{", "_state", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "ALT", ",", "alt", ",", "true", ")", ";", "}" ]
Sets the property to specify the alt text of the image. @param alt the image alignment. @jsptagref.attributedescription Specifies alternate text for the area. @jsptagref.databindable false @jsptagref.attributesyntaxvalue <i>string_alt</i> @netui:attribute required="false" rtexprvalue="true" description="Specifies alternate text for the area."
[ "Sets", "the", "property", "to", "specify", "the", "alt", "text", "of", "the", "image", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Area.java#L80-L83
146,345
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/AnnotationConstraintValidator.java
AnnotationConstraintValidator.validate
public static void validate(PropertyKey key, Object value) throws IllegalArgumentException { validate(key.getAnnotations(), value); }
java
public static void validate(PropertyKey key, Object value) throws IllegalArgumentException { validate(key.getAnnotations(), value); }
[ "public", "static", "void", "validate", "(", "PropertyKey", "key", ",", "Object", "value", ")", "throws", "IllegalArgumentException", "{", "validate", "(", "key", ".", "getAnnotations", "(", ")", ",", "value", ")", ";", "}" ]
This method ensures that any control property value assignment satisfies all property constraints. This method should be called by control property setters to ensure values assigned to properties at runtime are validated. @param key The property that the specified key is assigned to @param value The value assigned to the specified property key @throws IllegalArgumentException when the value assigned to the specified property key does not satisfy a property constraint.
[ "This", "method", "ensures", "that", "any", "control", "property", "value", "assignment", "satisfies", "all", "property", "constraints", ".", "This", "method", "should", "be", "called", "by", "control", "property", "setters", "to", "ensure", "values", "assigned", "to", "properties", "at", "runtime", "are", "validated", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/AnnotationConstraintValidator.java#L68-L72
146,346
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/AnnotationConstraintValidator.java
AnnotationConstraintValidator.validateMembership
public static void validateMembership(Annotation propertySet) { Class c = propertySet.annotationType(); MembershipRule rule = (MembershipRule) c.getAnnotation(MembershipRule.class); if (rule == null) return; MembershipRuleValues ruleValue = rule.value(); String[] memberNames = rule.memberNames(); Method[] members = getMembers(c, memberNames); int i = getNumOfMembersSet(propertySet, members); if (ruleValue == MembershipRuleValues.ALL_IF_ANY) { if (i != 0 && i != members.length) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. Either all members must be set or none is set"); } else if (ruleValue == MembershipRuleValues.EXACTLY_ONE) { if (i != 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. Exactly one member must be set"); } else if (ruleValue == MembershipRuleValues.AT_LEAST_ONE) { if (i < 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. At least one member must be set"); } else if (ruleValue == MembershipRuleValues.AT_MOST_ONE) { if (i > 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. At most one member may be set"); } }
java
public static void validateMembership(Annotation propertySet) { Class c = propertySet.annotationType(); MembershipRule rule = (MembershipRule) c.getAnnotation(MembershipRule.class); if (rule == null) return; MembershipRuleValues ruleValue = rule.value(); String[] memberNames = rule.memberNames(); Method[] members = getMembers(c, memberNames); int i = getNumOfMembersSet(propertySet, members); if (ruleValue == MembershipRuleValues.ALL_IF_ANY) { if (i != 0 && i != members.length) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. Either all members must be set or none is set"); } else if (ruleValue == MembershipRuleValues.EXACTLY_ONE) { if (i != 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. Exactly one member must be set"); } else if (ruleValue == MembershipRuleValues.AT_LEAST_ONE) { if (i < 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. At least one member must be set"); } else if (ruleValue == MembershipRuleValues.AT_MOST_ONE) { if (i > 1) throw new IllegalArgumentException("The membership rule on " + propertySet.toString() + " is not satisfied. At most one member may be set"); } }
[ "public", "static", "void", "validateMembership", "(", "Annotation", "propertySet", ")", "{", "Class", "c", "=", "propertySet", ".", "annotationType", "(", ")", ";", "MembershipRule", "rule", "=", "(", "MembershipRule", ")", "c", ".", "getAnnotation", "(", "MembershipRule", ".", "class", ")", ";", "if", "(", "rule", "==", "null", ")", "return", ";", "MembershipRuleValues", "ruleValue", "=", "rule", ".", "value", "(", ")", ";", "String", "[", "]", "memberNames", "=", "rule", ".", "memberNames", "(", ")", ";", "Method", "[", "]", "members", "=", "getMembers", "(", "c", ",", "memberNames", ")", ";", "int", "i", "=", "getNumOfMembersSet", "(", "propertySet", ",", "members", ")", ";", "if", "(", "ruleValue", "==", "MembershipRuleValues", ".", "ALL_IF_ANY", ")", "{", "if", "(", "i", "!=", "0", "&&", "i", "!=", "members", ".", "length", ")", "throw", "new", "IllegalArgumentException", "(", "\"The membership rule on \"", "+", "propertySet", ".", "toString", "(", ")", "+", "\" is not satisfied. Either all members must be set or none is set\"", ")", ";", "}", "else", "if", "(", "ruleValue", "==", "MembershipRuleValues", ".", "EXACTLY_ONE", ")", "{", "if", "(", "i", "!=", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"The membership rule on \"", "+", "propertySet", ".", "toString", "(", ")", "+", "\" is not satisfied. Exactly one member must be set\"", ")", ";", "}", "else", "if", "(", "ruleValue", "==", "MembershipRuleValues", ".", "AT_LEAST_ONE", ")", "{", "if", "(", "i", "<", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"The membership rule on \"", "+", "propertySet", ".", "toString", "(", ")", "+", "\" is not satisfied. At least one member must be set\"", ")", ";", "}", "else", "if", "(", "ruleValue", "==", "MembershipRuleValues", ".", "AT_MOST_ONE", ")", "{", "if", "(", "i", ">", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"The membership rule on \"", "+", "propertySet", ".", "toString", "(", ")", "+", "\" is not satisfied. At most one member may be set\"", ")", ";", "}", "}" ]
This method ensures the membership constraints defined on a property set is satisfied. @param propertySet the property set to validate
[ "This", "method", "ensures", "the", "membership", "constraints", "defined", "on", "a", "property", "set", "is", "satisfied", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/AnnotationConstraintValidator.java#L80-L114
146,347
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
AnchorCell.setOnKeyUp
public void setOnKeyUp(String onKeyUp) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); }
java
public void setOnKeyUp(String onKeyUp) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYUP, onKeyUp); }
[ "public", "void", "setOnKeyUp", "(", "String", "onKeyUp", ")", "{", "_anchorState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONKEYUP", ",", "onKeyUp", ")", ";", "}" ]
Sets the onKeyUp JavaScript event for the HTML anchor. @param onKeyUp the onKeyUp event. @jsptagref.attributedescription The onKeyUp JavaScript event for the HTML anchor. @jsptagref.attributesyntaxvalue <i>string_onKeyUp</i> @netui:attribute required="false" rtexprvalue="true" description="The onKeyUp JavaScript event."
[ "Sets", "the", "onKeyUp", "JavaScript", "event", "for", "the", "HTML", "anchor", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L182-L184
146,348
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
AnchorCell.setOnKeyPress
public void setOnKeyPress(String onKeyPress) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); }
java
public void setOnKeyPress(String onKeyPress) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONKEYPRESS, onKeyPress); }
[ "public", "void", "setOnKeyPress", "(", "String", "onKeyPress", ")", "{", "_anchorState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONKEYPRESS", ",", "onKeyPress", ")", ";", "}" ]
Sets the onKeyPress JavaScript event for the HTML anchor. @param onKeyPress the onKeyPress event. @jsptagref.attributedescription The onKeyPress JavaScript event for the HTML anchor. @jsptagref.attributesyntaxvalue <i>string_onKeyPress</i> @netui:attribute required="false" rtexprvalue="true" description="The onKeyPress JavaScript event."
[ "Sets", "the", "onKeyPress", "JavaScript", "event", "for", "the", "HTML", "anchor", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L194-L196
146,349
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
AnchorCell.setTarget
public void setTarget(String target) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TARGET, target); }
java
public void setTarget(String target) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TARGET, target); }
[ "public", "void", "setTarget", "(", "String", "target", ")", "{", "_anchorState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "HtmlConstants", ".", "TARGET", ",", "target", ")", ";", "}" ]
Sets the window target for the HTML anchor. @param target the window target for the HTML anchor. @jsptagref.attributedescription The window target for the HTML anchor. @jsptagref.attributesyntaxvalue <i>string_target</i> @netui:attribute required="false" rtexprvalue="true" description="The window target."
[ "Sets", "the", "window", "target", "for", "the", "HTML", "anchor", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L366-L368
146,350
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
AnchorCell.setOnBlur
public void setOnBlur(String onblur) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONBLUR, onblur); }
java
public void setOnBlur(String onblur) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONBLUR, onblur); }
[ "public", "void", "setOnBlur", "(", "String", "onblur", ")", "{", "_anchorState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONBLUR", ",", "onblur", ")", ";", "}" ]
Sets the onBlur JavaScript event for the HTML anchor. @param onblur the onBlur event. @jsptagref.attributedescription The onBlur JavaScript event for the HTML anchor. @jsptagref.attributesyntaxvalue <i>string_onBlur</i> @netui:attribute required="false" rtexprvalue="true" description="The onBlur JavaScript event."
[ "Sets", "the", "onBlur", "JavaScript", "event", "for", "the", "HTML", "anchor", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L495-L498
146,351
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java
AnchorCell.setOnFocus
public void setOnFocus(String onfocus) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONFOCUS, onfocus); }
java
public void setOnFocus(String onfocus) { _anchorState.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, HtmlConstants.ONFOCUS, onfocus); }
[ "public", "void", "setOnFocus", "(", "String", "onfocus", ")", "{", "_anchorState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_JAVASCRIPT", ",", "HtmlConstants", ".", "ONFOCUS", ",", "onfocus", ")", ";", "}" ]
Sets the onFocus JavaScript event for the HTML anchor. @param onfocus the onFocus event. @jsptagref.attributedescription The onFocus JavaScript event for the HTML anchor. @jsptagref.attributesyntaxvalue <i>string_onFocus</i> @netui:attribute required="false" rtexprvalue="true" description="The onFocus JavaScript event."
[ "Sets", "the", "onFocus", "JavaScript", "event", "for", "the", "HTML", "anchor", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L508-L511
146,352
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Attribute.java
Attribute.doStartTag
public int doStartTag() throws JspException { ServletRequest req = pageContext.getRequest(); HashMap atts = (HashMap) req.getAttribute(TEMPLATE_ATTRIBUTES); try { if (atts != null) { String val = (String) atts.get(_name); if (val != null) { Writer out = pageContext.getOut(); out.write(val); } else { Writer out = pageContext.getOut(); if (_defaultValue != null) out.write(_defaultValue); else out.write(""); } } else { Writer out = pageContext.getOut(); if (_defaultValue != null) out.write(_defaultValue); else out.write(""); } } catch (IOException e) { localRelease(); JspException jspException = new JspException("Caught IO Exception:" + e.getMessage(),e); // todo: future cleanup // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction, // this will cause an IllegalStateException on the following call. if (jspException.getCause() == null) { jspException.initCause(e); } throw jspException; } localRelease(); return EVAL_PAGE; }
java
public int doStartTag() throws JspException { ServletRequest req = pageContext.getRequest(); HashMap atts = (HashMap) req.getAttribute(TEMPLATE_ATTRIBUTES); try { if (atts != null) { String val = (String) atts.get(_name); if (val != null) { Writer out = pageContext.getOut(); out.write(val); } else { Writer out = pageContext.getOut(); if (_defaultValue != null) out.write(_defaultValue); else out.write(""); } } else { Writer out = pageContext.getOut(); if (_defaultValue != null) out.write(_defaultValue); else out.write(""); } } catch (IOException e) { localRelease(); JspException jspException = new JspException("Caught IO Exception:" + e.getMessage(),e); // todo: future cleanup // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction, // this will cause an IllegalStateException on the following call. if (jspException.getCause() == null) { jspException.initCause(e); } throw jspException; } localRelease(); return EVAL_PAGE; }
[ "public", "int", "doStartTag", "(", ")", "throws", "JspException", "{", "ServletRequest", "req", "=", "pageContext", ".", "getRequest", "(", ")", ";", "HashMap", "atts", "=", "(", "HashMap", ")", "req", ".", "getAttribute", "(", "TEMPLATE_ATTRIBUTES", ")", ";", "try", "{", "if", "(", "atts", "!=", "null", ")", "{", "String", "val", "=", "(", "String", ")", "atts", ".", "get", "(", "_name", ")", ";", "if", "(", "val", "!=", "null", ")", "{", "Writer", "out", "=", "pageContext", ".", "getOut", "(", ")", ";", "out", ".", "write", "(", "val", ")", ";", "}", "else", "{", "Writer", "out", "=", "pageContext", ".", "getOut", "(", ")", ";", "if", "(", "_defaultValue", "!=", "null", ")", "out", ".", "write", "(", "_defaultValue", ")", ";", "else", "out", ".", "write", "(", "\"\"", ")", ";", "}", "}", "else", "{", "Writer", "out", "=", "pageContext", ".", "getOut", "(", ")", ";", "if", "(", "_defaultValue", "!=", "null", ")", "out", ".", "write", "(", "_defaultValue", ")", ";", "else", "out", ".", "write", "(", "\"\"", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "localRelease", "(", ")", ";", "JspException", "jspException", "=", "new", "JspException", "(", "\"Caught IO Exception:\"", "+", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "// todo: future cleanup", "// The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,", "// this will cause an IllegalStateException on the following call.", "if", "(", "jspException", ".", "getCause", "(", ")", "==", "null", ")", "{", "jspException", ".", "initCause", "(", "e", ")", ";", "}", "throw", "jspException", ";", "}", "localRelease", "(", ")", ";", "return", "EVAL_PAGE", ";", "}" ]
Renders the content of the attribute. @return EVAL_PAGE to continue evaluation of the page. @throws JspException If there is any failure in the tag.
[ "Renders", "the", "content", "of", "the", "attribute", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Attribute.java#L169-L209
146,353
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.initContexts
private ArrayList<AptContextField> initContexts() { ArrayList<AptContextField> contexts = new ArrayList<AptContextField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return contexts; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(org.apache.beehive.controls.api.context.Context.class) != null) contexts.add(new AptContextField(this, fieldDecl, _ap)); } return contexts; }
java
private ArrayList<AptContextField> initContexts() { ArrayList<AptContextField> contexts = new ArrayList<AptContextField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return contexts; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(org.apache.beehive.controls.api.context.Context.class) != null) contexts.add(new AptContextField(this, fieldDecl, _ap)); } return contexts; }
[ "private", "ArrayList", "<", "AptContextField", ">", "initContexts", "(", ")", "{", "ArrayList", "<", "AptContextField", ">", "contexts", "=", "new", "ArrayList", "<", "AptContextField", ">", "(", ")", ";", "if", "(", "_implDecl", "==", "null", "||", "_implDecl", ".", "getFields", "(", ")", "==", "null", ")", "return", "contexts", ";", "Collection", "<", "FieldDeclaration", ">", "declaredFields", "=", "_implDecl", ".", "getFields", "(", ")", ";", "for", "(", "FieldDeclaration", "fieldDecl", ":", "declaredFields", ")", "{", "if", "(", "fieldDecl", ".", "getAnnotation", "(", "org", ".", "apache", ".", "beehive", ".", "controls", ".", "api", ".", "context", ".", "Context", ".", "class", ")", "!=", "null", ")", "contexts", ".", "add", "(", "new", "AptContextField", "(", "this", ",", "fieldDecl", ",", "_ap", ")", ")", ";", "}", "return", "contexts", ";", "}" ]
Initializes the list of ContextField declared directly by this ControlImpl
[ "Initializes", "the", "list", "of", "ContextField", "declared", "directly", "by", "this", "ControlImpl" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L135-L149
146,354
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.initControls
private ArrayList<AptControlField> initControls() { ArrayList<AptControlField> fields = new ArrayList<AptControlField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return fields; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(org.apache.beehive.controls.api.bean.Control.class) != null) fields.add(new AptControlField(this, fieldDecl, _ap)); } return fields; }
java
private ArrayList<AptControlField> initControls() { ArrayList<AptControlField> fields = new ArrayList<AptControlField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return fields; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(org.apache.beehive.controls.api.bean.Control.class) != null) fields.add(new AptControlField(this, fieldDecl, _ap)); } return fields; }
[ "private", "ArrayList", "<", "AptControlField", ">", "initControls", "(", ")", "{", "ArrayList", "<", "AptControlField", ">", "fields", "=", "new", "ArrayList", "<", "AptControlField", ">", "(", ")", ";", "if", "(", "_implDecl", "==", "null", "||", "_implDecl", ".", "getFields", "(", ")", "==", "null", ")", "return", "fields", ";", "Collection", "<", "FieldDeclaration", ">", "declaredFields", "=", "_implDecl", ".", "getFields", "(", ")", ";", "for", "(", "FieldDeclaration", "fieldDecl", ":", "declaredFields", ")", "{", "if", "(", "fieldDecl", ".", "getAnnotation", "(", "org", ".", "apache", ".", "beehive", ".", "controls", ".", "api", ".", "bean", ".", "Control", ".", "class", ")", "!=", "null", ")", "fields", ".", "add", "(", "new", "AptControlField", "(", "this", ",", "fieldDecl", ",", "_ap", ")", ")", ";", "}", "return", "fields", ";", "}" ]
Initializes the list of ControlFields for this ControlImpl
[ "Initializes", "the", "list", "of", "ControlFields", "for", "this", "ControlImpl" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L164-L178
146,355
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.initClients
protected ArrayList<AptClientField> initClients() { ArrayList<AptClientField> clients = new ArrayList<AptClientField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return clients; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(Client.class) != null) clients.add(new AptClientField(this, fieldDecl)); } return clients; }
java
protected ArrayList<AptClientField> initClients() { ArrayList<AptClientField> clients = new ArrayList<AptClientField>(); if ( _implDecl == null || _implDecl.getFields() == null ) return clients; Collection<FieldDeclaration> declaredFields = _implDecl.getFields(); for (FieldDeclaration fieldDecl : declaredFields) { if (fieldDecl.getAnnotation(Client.class) != null) clients.add(new AptClientField(this, fieldDecl)); } return clients; }
[ "protected", "ArrayList", "<", "AptClientField", ">", "initClients", "(", ")", "{", "ArrayList", "<", "AptClientField", ">", "clients", "=", "new", "ArrayList", "<", "AptClientField", ">", "(", ")", ";", "if", "(", "_implDecl", "==", "null", "||", "_implDecl", ".", "getFields", "(", ")", "==", "null", ")", "return", "clients", ";", "Collection", "<", "FieldDeclaration", ">", "declaredFields", "=", "_implDecl", ".", "getFields", "(", ")", ";", "for", "(", "FieldDeclaration", "fieldDecl", ":", "declaredFields", ")", "{", "if", "(", "fieldDecl", ".", "getAnnotation", "(", "Client", ".", "class", ")", "!=", "null", ")", "clients", ".", "add", "(", "new", "AptClientField", "(", "this", ",", "fieldDecl", ")", ")", ";", "}", "return", "clients", ";", "}" ]
Initializes the list of ClientFields declared directly by this ControlImpl
[ "Initializes", "the", "list", "of", "ClientFields", "declared", "directly", "by", "this", "ControlImpl" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L188-L202
146,356
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.getCheckOutput
public List<GeneratorOutput> getCheckOutput(Filer filer) throws IOException { HashMap<String,Object> map = new HashMap<String,Object>(); map.put("impl", this); // control implementation map.put("init", _init); // control impl initializer Writer writer = new IndentingWriter(filer.createSourceFile(_init.getClassName())); GeneratorOutput genOut = new GeneratorOutput(writer,"org/apache/beehive/controls/runtime/generator/ImplInitializer.vm", map); ArrayList<GeneratorOutput> genList = new ArrayList<GeneratorOutput>(1); genList.add(genOut); return genList; }
java
public List<GeneratorOutput> getCheckOutput(Filer filer) throws IOException { HashMap<String,Object> map = new HashMap<String,Object>(); map.put("impl", this); // control implementation map.put("init", _init); // control impl initializer Writer writer = new IndentingWriter(filer.createSourceFile(_init.getClassName())); GeneratorOutput genOut = new GeneratorOutput(writer,"org/apache/beehive/controls/runtime/generator/ImplInitializer.vm", map); ArrayList<GeneratorOutput> genList = new ArrayList<GeneratorOutput>(1); genList.add(genOut); return genList; }
[ "public", "List", "<", "GeneratorOutput", ">", "getCheckOutput", "(", "Filer", "filer", ")", "throws", "IOException", "{", "HashMap", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "map", ".", "put", "(", "\"impl\"", ",", "this", ")", ";", "// control implementation", "map", ".", "put", "(", "\"init\"", ",", "_init", ")", ";", "// control impl initializer", "Writer", "writer", "=", "new", "IndentingWriter", "(", "filer", ".", "createSourceFile", "(", "_init", ".", "getClassName", "(", ")", ")", ")", ";", "GeneratorOutput", "genOut", "=", "new", "GeneratorOutput", "(", "writer", ",", "\"org/apache/beehive/controls/runtime/generator/ImplInitializer.vm\"", ",", "map", ")", ";", "ArrayList", "<", "GeneratorOutput", ">", "genList", "=", "new", "ArrayList", "<", "GeneratorOutput", ">", "(", "1", ")", ";", "genList", ".", "add", "(", "genOut", ")", ";", "return", "genList", ";", "}" ]
Returns the information necessary to generate a ImplInitializer from this ControlImplementation.
[ "Returns", "the", "information", "necessary", "to", "generate", "a", "ImplInitializer", "from", "this", "ControlImplementation", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L256-L269
146,357
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.getControlInterface
public AptControlInterface getControlInterface() { if ( _implDecl == null || _implDecl.getSuperinterfaces() == null ) return null; Collection<InterfaceType> superInterfaces = _implDecl.getSuperinterfaces(); for (InterfaceType intfType : superInterfaces) { InterfaceDeclaration intfDecl = intfType.getDeclaration(); if (intfDecl != null && intfDecl.getAnnotation(org.apache.beehive.controls.api.bean.ControlInterface.class) != null) return new AptControlInterface(intfDecl, _ap); } return null; }
java
public AptControlInterface getControlInterface() { if ( _implDecl == null || _implDecl.getSuperinterfaces() == null ) return null; Collection<InterfaceType> superInterfaces = _implDecl.getSuperinterfaces(); for (InterfaceType intfType : superInterfaces) { InterfaceDeclaration intfDecl = intfType.getDeclaration(); if (intfDecl != null && intfDecl.getAnnotation(org.apache.beehive.controls.api.bean.ControlInterface.class) != null) return new AptControlInterface(intfDecl, _ap); } return null; }
[ "public", "AptControlInterface", "getControlInterface", "(", ")", "{", "if", "(", "_implDecl", "==", "null", "||", "_implDecl", ".", "getSuperinterfaces", "(", ")", "==", "null", ")", "return", "null", ";", "Collection", "<", "InterfaceType", ">", "superInterfaces", "=", "_implDecl", ".", "getSuperinterfaces", "(", ")", ";", "for", "(", "InterfaceType", "intfType", ":", "superInterfaces", ")", "{", "InterfaceDeclaration", "intfDecl", "=", "intfType", ".", "getDeclaration", "(", ")", ";", "if", "(", "intfDecl", "!=", "null", "&&", "intfDecl", ".", "getAnnotation", "(", "org", ".", "apache", ".", "beehive", ".", "controls", ".", "api", ".", "bean", ".", "ControlInterface", ".", "class", ")", "!=", "null", ")", "return", "new", "AptControlInterface", "(", "intfDecl", ",", "_ap", ")", ";", "}", "return", "null", ";", "}" ]
Returns the ControlInterface implemented by this ControlImpl.
[ "Returns", "the", "ControlInterface", "implemented", "by", "this", "ControlImpl", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L283-L298
146,358
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java
AptControlImplementation.isSerializable
protected boolean isSerializable() { for (InterfaceType superIntf: _implDecl.getSuperinterfaces()) { if (superIntf.toString().equals("java.io.Serializable")) { return true; } } // check to see if the superclass is serializable return _superClass != null && _superClass.isSerializable(); }
java
protected boolean isSerializable() { for (InterfaceType superIntf: _implDecl.getSuperinterfaces()) { if (superIntf.toString().equals("java.io.Serializable")) { return true; } } // check to see if the superclass is serializable return _superClass != null && _superClass.isSerializable(); }
[ "protected", "boolean", "isSerializable", "(", ")", "{", "for", "(", "InterfaceType", "superIntf", ":", "_implDecl", ".", "getSuperinterfaces", "(", ")", ")", "{", "if", "(", "superIntf", ".", "toString", "(", ")", ".", "equals", "(", "\"java.io.Serializable\"", ")", ")", "{", "return", "true", ";", "}", "}", "// check to see if the superclass is serializable", "return", "_superClass", "!=", "null", "&&", "_superClass", ".", "isSerializable", "(", ")", ";", "}" ]
Does this control impl on one of it superclasses implement java.io.Serializable? @return true if this control impl or one of its superclasses implements java.io.Serializable.
[ "Does", "this", "control", "impl", "on", "one", "of", "it", "superclasses", "implement", "java", ".", "io", ".", "Serializable?" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L496-L506
146,359
greatman/GreatmancodeTools
src/main/java/com/greatmancode/tools/utils/Updater.java
Updater.waitForThread
private void waitForThread() { if ((this.thread != null) && this.thread.isAlive()) { try { this.thread.join(); } catch (final InterruptedException e) { e.printStackTrace(); } } }
java
private void waitForThread() { if ((this.thread != null) && this.thread.isAlive()) { try { this.thread.join(); } catch (final InterruptedException e) { e.printStackTrace(); } } }
[ "private", "void", "waitForThread", "(", ")", "{", "if", "(", "(", "this", ".", "thread", "!=", "null", ")", "&&", "this", ".", "thread", ".", "isAlive", "(", ")", ")", "{", "try", "{", "this", ".", "thread", ".", "join", "(", ")", ";", "}", "catch", "(", "final", "InterruptedException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}" ]
As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result.
[ "As", "the", "result", "of", "Updater", "output", "depends", "on", "the", "thread", "s", "completion", "it", "is", "necessary", "to", "wait", "for", "the", "thread", "to", "finish", "before", "allowing", "anyone", "to", "check", "the", "result", "." ]
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Updater.java#L269-L277
146,360
greatman/GreatmancodeTools
src/main/java/com/greatmancode/tools/utils/Updater.java
Updater.versionCheck
private boolean versionCheck(String title) { if (this.type != UpdateType.NO_VERSION_CHECK) { final String version = caller.getPluginVersion(); final String remoteVersion = title; // Get the newest file's version number if (this.hasTag(version) || version.contains(remoteVersion)) { // We already have the latest version, or this build is tagged for no-update this.result = Updater.UpdateResult.NO_UPDATE; return false; } } return true; }
java
private boolean versionCheck(String title) { if (this.type != UpdateType.NO_VERSION_CHECK) { final String version = caller.getPluginVersion(); final String remoteVersion = title; // Get the newest file's version number if (this.hasTag(version) || version.contains(remoteVersion)) { // We already have the latest version, or this build is tagged for no-update this.result = Updater.UpdateResult.NO_UPDATE; return false; } } return true; }
[ "private", "boolean", "versionCheck", "(", "String", "title", ")", "{", "if", "(", "this", ".", "type", "!=", "UpdateType", ".", "NO_VERSION_CHECK", ")", "{", "final", "String", "version", "=", "caller", ".", "getPluginVersion", "(", ")", ";", "final", "String", "remoteVersion", "=", "title", ";", "// Get the newest file's version number", "if", "(", "this", ".", "hasTag", "(", "version", ")", "||", "version", ".", "contains", "(", "remoteVersion", ")", ")", "{", "// We already have the latest version, or this build is tagged for no-update", "this", ".", "result", "=", "Updater", ".", "UpdateResult", ".", "NO_UPDATE", ";", "return", "false", ";", "}", "}", "return", "true", ";", "}" ]
Check to see if the program should continue by evaluation whether the plugin is already updated, or shouldn't be updated
[ "Check", "to", "see", "if", "the", "program", "should", "continue", "by", "evaluation", "whether", "the", "plugin", "is", "already", "updated", "or", "shouldn", "t", "be", "updated" ]
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Updater.java#L282-L294
146,361
greatman/GreatmancodeTools
src/main/java/com/greatmancode/tools/utils/Updater.java
Updater.hasTag
private boolean hasTag(String version) { for (final String string : Updater.NO_UPDATE_TAG) { if (version.contains(string)) { return true; } } return false; }
java
private boolean hasTag(String version) { for (final String string : Updater.NO_UPDATE_TAG) { if (version.contains(string)) { return true; } } return false; }
[ "private", "boolean", "hasTag", "(", "String", "version", ")", "{", "for", "(", "final", "String", "string", ":", "Updater", ".", "NO_UPDATE_TAG", ")", "{", "if", "(", "version", ".", "contains", "(", "string", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Evaluate whether the version number is marked showing that it should not be updated by this program
[ "Evaluate", "whether", "the", "version", "number", "is", "marked", "showing", "that", "it", "should", "not", "be", "updated", "by", "this", "program" ]
4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1
https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Updater.java#L299-L306
146,362
iig-uni-freiburg/SEWOL
src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContext.java
ConstraintContext.removeRoutingConstraintsOnAttribute
private void removeRoutingConstraintsOnAttribute(String attribute, boolean notifyListeners) { for (String activity : activities) { removeRoutingConstraintsOnAttribute(activity, attribute, notifyListeners); } }
java
private void removeRoutingConstraintsOnAttribute(String attribute, boolean notifyListeners) { for (String activity : activities) { removeRoutingConstraintsOnAttribute(activity, attribute, notifyListeners); } }
[ "private", "void", "removeRoutingConstraintsOnAttribute", "(", "String", "attribute", ",", "boolean", "notifyListeners", ")", "{", "for", "(", "String", "activity", ":", "activities", ")", "{", "removeRoutingConstraintsOnAttribute", "(", "activity", ",", "attribute", ",", "notifyListeners", ")", ";", "}", "}" ]
Removes all routing constraints that relate to the given attribute @param attribute @param notifyListeners
[ "Removes", "all", "routing", "constraints", "that", "relate", "to", "the", "given", "attribute" ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContext.java#L152-L156
146,363
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlParser.java
SqlParser.parse
public SqlStatement parse(String sql) { // does a cached parse result exist for this statement? if (_cachedSqlStatements.containsKey(sql)) { return _cachedSqlStatements.get(sql); } SqlGrammar _parser = new SqlGrammar(new StringReader(sql)); SqlStatement parsed = null; try { parsed = _parser.parse(); } catch (ParseException e) { throw new ControlException("Error parsing SQL statment." + e.getMessage(), e); } catch (TokenMgrError tme) { throw new ControlException("Error parsing SQL statment. " + tme.getMessage(), tme); } if (parsed.isCacheable()) { _cachedSqlStatements.put(sql, parsed); } return parsed; }
java
public SqlStatement parse(String sql) { // does a cached parse result exist for this statement? if (_cachedSqlStatements.containsKey(sql)) { return _cachedSqlStatements.get(sql); } SqlGrammar _parser = new SqlGrammar(new StringReader(sql)); SqlStatement parsed = null; try { parsed = _parser.parse(); } catch (ParseException e) { throw new ControlException("Error parsing SQL statment." + e.getMessage(), e); } catch (TokenMgrError tme) { throw new ControlException("Error parsing SQL statment. " + tme.getMessage(), tme); } if (parsed.isCacheable()) { _cachedSqlStatements.put(sql, parsed); } return parsed; }
[ "public", "SqlStatement", "parse", "(", "String", "sql", ")", "{", "// does a cached parse result exist for this statement?", "if", "(", "_cachedSqlStatements", ".", "containsKey", "(", "sql", ")", ")", "{", "return", "_cachedSqlStatements", ".", "get", "(", "sql", ")", ";", "}", "SqlGrammar", "_parser", "=", "new", "SqlGrammar", "(", "new", "StringReader", "(", "sql", ")", ")", ";", "SqlStatement", "parsed", "=", "null", ";", "try", "{", "parsed", "=", "_parser", ".", "parse", "(", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "throw", "new", "ControlException", "(", "\"Error parsing SQL statment.\"", "+", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "catch", "(", "TokenMgrError", "tme", ")", "{", "throw", "new", "ControlException", "(", "\"Error parsing SQL statment. \"", "+", "tme", ".", "getMessage", "(", ")", ",", "tme", ")", ";", "}", "if", "(", "parsed", ".", "isCacheable", "(", ")", ")", "{", "_cachedSqlStatements", ".", "put", "(", "sql", ",", "parsed", ")", ";", "}", "return", "parsed", ";", "}" ]
Parse the sql and return an SqlStatement. @param sql A String contianing the sql to parse. @return A SqlStatement instance.
[ "Parse", "the", "sql", "and", "return", "an", "SqlStatement", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlParser.java#L63-L84
146,364
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java
DefaultRowSetResultSetMapper.mapToResultType
public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) { final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class); final int maxrows = methodSQL.maxRows(); try { CachedRowSetImpl rows = new CachedRowSetImpl(); if (maxrows > 0) { rows.setMaxRows(maxrows); } rows.populate(resultSet); return rows; } catch (SQLException e) { throw new ControlException(e.getMessage(), e); } }
java
public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) { final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class); final int maxrows = methodSQL.maxRows(); try { CachedRowSetImpl rows = new CachedRowSetImpl(); if (maxrows > 0) { rows.setMaxRows(maxrows); } rows.populate(resultSet); return rows; } catch (SQLException e) { throw new ControlException(e.getMessage(), e); } }
[ "public", "RowSet", "mapToResultType", "(", "ControlBeanContext", "context", ",", "Method", "m", ",", "ResultSet", "resultSet", ",", "Calendar", "cal", ")", "{", "final", "SQL", "methodSQL", "=", "(", "SQL", ")", "context", ".", "getMethodPropertySet", "(", "m", ",", "SQL", ".", "class", ")", ";", "final", "int", "maxrows", "=", "methodSQL", ".", "maxRows", "(", ")", ";", "try", "{", "CachedRowSetImpl", "rows", "=", "new", "CachedRowSetImpl", "(", ")", ";", "if", "(", "maxrows", ">", "0", ")", "{", "rows", ".", "setMaxRows", "(", "maxrows", ")", ";", "}", "rows", ".", "populate", "(", "resultSet", ")", ";", "return", "rows", ";", "}", "catch", "(", "SQLException", "e", ")", "{", "throw", "new", "ControlException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}" ]
Map a ResultSet to a RowSet. Type of RowSet is defined by the SQL annotation for the method. @param context A ControlBeanContext instance. @param m Method assoicated with this call. @param resultSet Result set to map. @param cal A Calendar instance for resolving date/time values. @return A RowSet object.
[ "Map", "a", "ResultSet", "to", "a", "RowSet", ".", "Type", "of", "RowSet", "is", "defined", "by", "the", "SQL", "annotation", "for", "the", "method", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultRowSetResultSetMapper.java#L47-L63
146,365
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
FacesBackingBeanFactory.get
public static FacesBackingBeanFactory get( ServletContext servletContext ) { FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext.getAttribute( CONTEXT_ATTR ); assert factory != null : FacesBackingBeanFactory.class.getName() + " was not found in ServletContext attribute " + CONTEXT_ATTR; factory.reinit( servletContext ); return factory; }
java
public static FacesBackingBeanFactory get( ServletContext servletContext ) { FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext.getAttribute( CONTEXT_ATTR ); assert factory != null : FacesBackingBeanFactory.class.getName() + " was not found in ServletContext attribute " + CONTEXT_ATTR; factory.reinit( servletContext ); return factory; }
[ "public", "static", "FacesBackingBeanFactory", "get", "(", "ServletContext", "servletContext", ")", "{", "FacesBackingBeanFactory", "factory", "=", "(", "FacesBackingBeanFactory", ")", "servletContext", ".", "getAttribute", "(", "CONTEXT_ATTR", ")", ";", "assert", "factory", "!=", "null", ":", "FacesBackingBeanFactory", ".", "class", ".", "getName", "(", ")", "+", "\" was not found in ServletContext attribute \"", "+", "CONTEXT_ATTR", ";", "factory", ".", "reinit", "(", "servletContext", ")", ";", "return", "factory", ";", "}" ]
Get a FacesBackingBeanFactory. @param servletContext the current ServletContext. @return a FacesBackingBeanFactory for the given ServletContext. It may or may not be a cached instance.
[ "Get", "a", "FacesBackingBeanFactory", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java#L98-L105
146,366
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
FacesBackingBeanFactory.getFacesBackingBeanForRequest
public FacesBackingBean getFacesBackingBeanForRequest( RequestContext requestContext ) { HttpServletRequest request = requestContext.getHttpRequest(); String uri = InternalUtils.getDecodedServletPath( request ); assert uri.charAt( 0 ) == '/' : uri; String backingClassName = FileUtils.stripFileExtension( uri.substring( 1 ).replace( '/', '.' ) ); FacesBackingBean currentBean = InternalUtils.getFacesBackingBean( request, getServletContext() ); // // If there is no current backing bean, or if the current one doesn't match the desired classname, create one. // if ( currentBean == null || ! currentBean.getClass().getName().equals( backingClassName ) ) { FacesBackingBean bean = null; if ( FileUtils.uriEndsWith( uri, FACES_EXTENSION ) || FileUtils.uriEndsWith( uri, JSF_EXTENSION ) ) { bean = loadFacesBackingBean( requestContext, backingClassName ); // // If we didn't create (or failed to create) a backing bean, and if this is a JSF request, then create // a default one. This ensures that there will be a place for things like page inputs, that get stored // in the backing bean across postbacks to the same JSF. // if ( bean == null ) bean = new DefaultFacesBackingBean(); // // If we created a backing bean, invoke its create callback, and tell it to store itself in the session. // if ( bean != null ) { HttpServletResponse response = requestContext.getHttpResponse(); try { bean.create( request, response, getServletContext() ); } catch ( Exception e ) { _log.error( "Error while creating backing bean instance of " + backingClassName, e ); } bean.persistInSession( request, response ); return bean; } } // // We didn't create a backing bean. If there's one in the session (an inappropriate one), remove it. // InternalUtils.removeCurrentFacesBackingBean( request, getServletContext() ); } else if ( currentBean != null ) { if ( _log.isDebugEnabled() ) { _log.debug( "Using existing backing bean instance " + currentBean + " for request " + request.getRequestURI() ); } currentBean.reinitialize( request, requestContext.getHttpResponse(), getServletContext() ); } return currentBean; }
java
public FacesBackingBean getFacesBackingBeanForRequest( RequestContext requestContext ) { HttpServletRequest request = requestContext.getHttpRequest(); String uri = InternalUtils.getDecodedServletPath( request ); assert uri.charAt( 0 ) == '/' : uri; String backingClassName = FileUtils.stripFileExtension( uri.substring( 1 ).replace( '/', '.' ) ); FacesBackingBean currentBean = InternalUtils.getFacesBackingBean( request, getServletContext() ); // // If there is no current backing bean, or if the current one doesn't match the desired classname, create one. // if ( currentBean == null || ! currentBean.getClass().getName().equals( backingClassName ) ) { FacesBackingBean bean = null; if ( FileUtils.uriEndsWith( uri, FACES_EXTENSION ) || FileUtils.uriEndsWith( uri, JSF_EXTENSION ) ) { bean = loadFacesBackingBean( requestContext, backingClassName ); // // If we didn't create (or failed to create) a backing bean, and if this is a JSF request, then create // a default one. This ensures that there will be a place for things like page inputs, that get stored // in the backing bean across postbacks to the same JSF. // if ( bean == null ) bean = new DefaultFacesBackingBean(); // // If we created a backing bean, invoke its create callback, and tell it to store itself in the session. // if ( bean != null ) { HttpServletResponse response = requestContext.getHttpResponse(); try { bean.create( request, response, getServletContext() ); } catch ( Exception e ) { _log.error( "Error while creating backing bean instance of " + backingClassName, e ); } bean.persistInSession( request, response ); return bean; } } // // We didn't create a backing bean. If there's one in the session (an inappropriate one), remove it. // InternalUtils.removeCurrentFacesBackingBean( request, getServletContext() ); } else if ( currentBean != null ) { if ( _log.isDebugEnabled() ) { _log.debug( "Using existing backing bean instance " + currentBean + " for request " + request.getRequestURI() ); } currentBean.reinitialize( request, requestContext.getHttpResponse(), getServletContext() ); } return currentBean; }
[ "public", "FacesBackingBean", "getFacesBackingBeanForRequest", "(", "RequestContext", "requestContext", ")", "{", "HttpServletRequest", "request", "=", "requestContext", ".", "getHttpRequest", "(", ")", ";", "String", "uri", "=", "InternalUtils", ".", "getDecodedServletPath", "(", "request", ")", ";", "assert", "uri", ".", "charAt", "(", "0", ")", "==", "'", "'", ":", "uri", ";", "String", "backingClassName", "=", "FileUtils", ".", "stripFileExtension", "(", "uri", ".", "substring", "(", "1", ")", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ")", ";", "FacesBackingBean", "currentBean", "=", "InternalUtils", ".", "getFacesBackingBean", "(", "request", ",", "getServletContext", "(", ")", ")", ";", "//", "// If there is no current backing bean, or if the current one doesn't match the desired classname, create one.", "//", "if", "(", "currentBean", "==", "null", "||", "!", "currentBean", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "backingClassName", ")", ")", "{", "FacesBackingBean", "bean", "=", "null", ";", "if", "(", "FileUtils", ".", "uriEndsWith", "(", "uri", ",", "FACES_EXTENSION", ")", "||", "FileUtils", ".", "uriEndsWith", "(", "uri", ",", "JSF_EXTENSION", ")", ")", "{", "bean", "=", "loadFacesBackingBean", "(", "requestContext", ",", "backingClassName", ")", ";", "//", "// If we didn't create (or failed to create) a backing bean, and if this is a JSF request, then create", "// a default one. This ensures that there will be a place for things like page inputs, that get stored", "// in the backing bean across postbacks to the same JSF.", "//", "if", "(", "bean", "==", "null", ")", "bean", "=", "new", "DefaultFacesBackingBean", "(", ")", ";", "//", "// If we created a backing bean, invoke its create callback, and tell it to store itself in the session.", "//", "if", "(", "bean", "!=", "null", ")", "{", "HttpServletResponse", "response", "=", "requestContext", ".", "getHttpResponse", "(", ")", ";", "try", "{", "bean", ".", "create", "(", "request", ",", "response", ",", "getServletContext", "(", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "_log", ".", "error", "(", "\"Error while creating backing bean instance of \"", "+", "backingClassName", ",", "e", ")", ";", "}", "bean", ".", "persistInSession", "(", "request", ",", "response", ")", ";", "return", "bean", ";", "}", "}", "//", "// We didn't create a backing bean. If there's one in the session (an inappropriate one), remove it.", "//", "InternalUtils", ".", "removeCurrentFacesBackingBean", "(", "request", ",", "getServletContext", "(", ")", ")", ";", "}", "else", "if", "(", "currentBean", "!=", "null", ")", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"Using existing backing bean instance \"", "+", "currentBean", "+", "\" for request \"", "+", "request", ".", "getRequestURI", "(", ")", ")", ";", "}", "currentBean", ".", "reinitialize", "(", "request", ",", "requestContext", ".", "getHttpResponse", "(", ")", ",", "getServletContext", "(", ")", ")", ";", "}", "return", "currentBean", ";", "}" ]
Get the "backing bean" associated with the JavaServer Faces page for a request. @param requestContext a {@link RequestContext} object which contains the current request and response.
[ "Get", "the", "backing", "bean", "associated", "with", "the", "JavaServer", "Faces", "page", "for", "a", "request", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java#L112-L176
146,367
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
FacesBackingBeanFactory.loadFacesBackingBean
protected FacesBackingBean loadFacesBackingBean( RequestContext requestContext, String backingClassName ) { try { Class backingClass = null; try { backingClass = getFacesBackingBeanClass( backingClassName ); } catch ( ClassNotFoundException e ) { // ignore -- we deal with this and log this immediately below. getFacesBackingBeanClass() by default // does not throw this exception, but a derived version might. } if ( backingClass == null ) { if ( _log.isTraceEnabled() ) { _log.trace( "No backing bean class " + backingClassName + " found for request " + requestContext.getHttpRequest().getRequestURI() ); } } else { AnnotationReader annReader = AnnotationReader.getAnnotationReader( backingClass, getServletContext() ); if ( annReader.getJpfAnnotation( backingClass, "FacesBacking" ) != null ) { if ( _log.isDebugEnabled() ) { _log.debug( "Found backing class " + backingClassName + " for request " + requestContext.getHttpRequest().getRequestURI() + "; creating a new instance." ); } return getFacesBackingBeanInstance( backingClass ); } else { if ( _log.isDebugEnabled() ) { _log.debug( "Found matching backing class " + backingClassName + " for request " + requestContext.getHttpRequest().getRequestURI() + ", but it does not have the " + ANNOTATION_QUALIFIER + "FacesBacking" + " annotation." ); } } } } catch ( InstantiationException e ) { _log.error( "Could not create backing bean instance of " + backingClassName, e ); } catch ( IllegalAccessException e ) { _log.error( "Could not create backing bean instance of " + backingClassName, e ); } return null; }
java
protected FacesBackingBean loadFacesBackingBean( RequestContext requestContext, String backingClassName ) { try { Class backingClass = null; try { backingClass = getFacesBackingBeanClass( backingClassName ); } catch ( ClassNotFoundException e ) { // ignore -- we deal with this and log this immediately below. getFacesBackingBeanClass() by default // does not throw this exception, but a derived version might. } if ( backingClass == null ) { if ( _log.isTraceEnabled() ) { _log.trace( "No backing bean class " + backingClassName + " found for request " + requestContext.getHttpRequest().getRequestURI() ); } } else { AnnotationReader annReader = AnnotationReader.getAnnotationReader( backingClass, getServletContext() ); if ( annReader.getJpfAnnotation( backingClass, "FacesBacking" ) != null ) { if ( _log.isDebugEnabled() ) { _log.debug( "Found backing class " + backingClassName + " for request " + requestContext.getHttpRequest().getRequestURI() + "; creating a new instance." ); } return getFacesBackingBeanInstance( backingClass ); } else { if ( _log.isDebugEnabled() ) { _log.debug( "Found matching backing class " + backingClassName + " for request " + requestContext.getHttpRequest().getRequestURI() + ", but it does not have the " + ANNOTATION_QUALIFIER + "FacesBacking" + " annotation." ); } } } } catch ( InstantiationException e ) { _log.error( "Could not create backing bean instance of " + backingClassName, e ); } catch ( IllegalAccessException e ) { _log.error( "Could not create backing bean instance of " + backingClassName, e ); } return null; }
[ "protected", "FacesBackingBean", "loadFacesBackingBean", "(", "RequestContext", "requestContext", ",", "String", "backingClassName", ")", "{", "try", "{", "Class", "backingClass", "=", "null", ";", "try", "{", "backingClass", "=", "getFacesBackingBeanClass", "(", "backingClassName", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "// ignore -- we deal with this and log this immediately below. getFacesBackingBeanClass() by default", "// does not throw this exception, but a derived version might.", "}", "if", "(", "backingClass", "==", "null", ")", "{", "if", "(", "_log", ".", "isTraceEnabled", "(", ")", ")", "{", "_log", ".", "trace", "(", "\"No backing bean class \"", "+", "backingClassName", "+", "\" found for request \"", "+", "requestContext", ".", "getHttpRequest", "(", ")", ".", "getRequestURI", "(", ")", ")", ";", "}", "}", "else", "{", "AnnotationReader", "annReader", "=", "AnnotationReader", ".", "getAnnotationReader", "(", "backingClass", ",", "getServletContext", "(", ")", ")", ";", "if", "(", "annReader", ".", "getJpfAnnotation", "(", "backingClass", ",", "\"FacesBacking\"", ")", "!=", "null", ")", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"Found backing class \"", "+", "backingClassName", "+", "\" for request \"", "+", "requestContext", ".", "getHttpRequest", "(", ")", ".", "getRequestURI", "(", ")", "+", "\"; creating a new instance.\"", ")", ";", "}", "return", "getFacesBackingBeanInstance", "(", "backingClass", ")", ";", "}", "else", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"Found matching backing class \"", "+", "backingClassName", "+", "\" for request \"", "+", "requestContext", ".", "getHttpRequest", "(", ")", ".", "getRequestURI", "(", ")", "+", "\", but it does not have the \"", "+", "ANNOTATION_QUALIFIER", "+", "\"FacesBacking\"", "+", "\" annotation.\"", ")", ";", "}", "}", "}", "}", "catch", "(", "InstantiationException", "e", ")", "{", "_log", ".", "error", "(", "\"Could not create backing bean instance of \"", "+", "backingClassName", ",", "e", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "_log", ".", "error", "(", "\"Could not create backing bean instance of \"", "+", "backingClassName", ",", "e", ")", ";", "}", "return", "null", ";", "}" ]
Load a "backing bean" associated with the JavaServer Faces page for a request. @param requestContext a {@link RequestContext} object which contains the current request and response. @param backingClassName the name of the backing bean class. @return an initialized FacesBackingBean, or <code>null</code> if an error occurred.
[ "Load", "a", "backing", "bean", "associated", "with", "the", "JavaServer", "Faces", "page", "for", "a", "request", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java#L184-L243
146,368
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java
FacesBackingBeanFactory.getFacesBackingBeanInstance
public FacesBackingBean getFacesBackingBeanInstance( Class beanClass ) throws InstantiationException, IllegalAccessException { assert FacesBackingBean.class.isAssignableFrom( beanClass ) : "Class " + beanClass.getName() + " does not extend " + FacesBackingBean.class.getName(); return ( FacesBackingBean ) beanClass.newInstance(); }
java
public FacesBackingBean getFacesBackingBeanInstance( Class beanClass ) throws InstantiationException, IllegalAccessException { assert FacesBackingBean.class.isAssignableFrom( beanClass ) : "Class " + beanClass.getName() + " does not extend " + FacesBackingBean.class.getName(); return ( FacesBackingBean ) beanClass.newInstance(); }
[ "public", "FacesBackingBean", "getFacesBackingBeanInstance", "(", "Class", "beanClass", ")", "throws", "InstantiationException", ",", "IllegalAccessException", "{", "assert", "FacesBackingBean", ".", "class", ".", "isAssignableFrom", "(", "beanClass", ")", ":", "\"Class \"", "+", "beanClass", ".", "getName", "(", ")", "+", "\" does not extend \"", "+", "FacesBackingBean", ".", "class", ".", "getName", "(", ")", ";", "return", "(", "FacesBackingBean", ")", "beanClass", ".", "newInstance", "(", ")", ";", "}" ]
Get a FacesBackingBean instance, given a FacesBackingBean class. @param beanClass the Class, which must be assignable to {@link FacesBackingBean}. @return a new FacesBackingBean instance.
[ "Get", "a", "FacesBackingBean", "instance", "given", "a", "FacesBackingBean", "class", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FacesBackingBeanFactory.java#L269-L275
146,369
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/DiscoveryUtils.java
DiscoveryUtils.getClassLoader
public static ClassLoader getClassLoader() { try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if ( cl != null ) return cl; } catch ( SecurityException e ) { if ( _log.isDebugEnabled() ) { _log.debug( "Could not get thread context classloader.", e ); } } if ( _log.isTraceEnabled() ) { _log.trace( "Can't use thread context classloader; using classloader for " + DiscoveryUtils.class.getName() ); } return DiscoveryUtils.class.getClassLoader(); }
java
public static ClassLoader getClassLoader() { try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if ( cl != null ) return cl; } catch ( SecurityException e ) { if ( _log.isDebugEnabled() ) { _log.debug( "Could not get thread context classloader.", e ); } } if ( _log.isTraceEnabled() ) { _log.trace( "Can't use thread context classloader; using classloader for " + DiscoveryUtils.class.getName() ); } return DiscoveryUtils.class.getClassLoader(); }
[ "public", "static", "ClassLoader", "getClassLoader", "(", ")", "{", "try", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "if", "(", "cl", "!=", "null", ")", "return", "cl", ";", "}", "catch", "(", "SecurityException", "e", ")", "{", "if", "(", "_log", ".", "isDebugEnabled", "(", ")", ")", "{", "_log", ".", "debug", "(", "\"Could not get thread context classloader.\"", ",", "e", ")", ";", "}", "}", "if", "(", "_log", ".", "isTraceEnabled", "(", ")", ")", "{", "_log", ".", "trace", "(", "\"Can't use thread context classloader; using classloader for \"", "+", "DiscoveryUtils", ".", "class", ".", "getName", "(", ")", ")", ";", "}", "return", "DiscoveryUtils", ".", "class", ".", "getClassLoader", "(", ")", ";", "}" ]
Get the ClassLoader from which implementor classes will be discovered and loaded.
[ "Get", "the", "ClassLoader", "from", "which", "implementor", "classes", "will", "be", "discovered", "and", "loaded", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/DiscoveryUtils.java#L48-L69
146,370
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
FlowControllerFactory.init
public static void init( ServletContext servletContext ) { PageFlowFactoriesConfig factoriesBean = ConfigUtil.getConfig().getPageFlowFactories(); FlowControllerFactory factory = null; if ( factoriesBean != null ) { PageFlowFactoryConfig fcFactoryBean = factoriesBean.getPageFlowFactory(); factory = ( FlowControllerFactory ) FactoryUtils.getFactory( servletContext, fcFactoryBean, FlowControllerFactory.class ); } if ( factory == null ) factory = new FlowControllerFactory(); factory.reinit( servletContext ); servletContext.setAttribute( CONTEXT_ATTR, factory ); }
java
public static void init( ServletContext servletContext ) { PageFlowFactoriesConfig factoriesBean = ConfigUtil.getConfig().getPageFlowFactories(); FlowControllerFactory factory = null; if ( factoriesBean != null ) { PageFlowFactoryConfig fcFactoryBean = factoriesBean.getPageFlowFactory(); factory = ( FlowControllerFactory ) FactoryUtils.getFactory( servletContext, fcFactoryBean, FlowControllerFactory.class ); } if ( factory == null ) factory = new FlowControllerFactory(); factory.reinit( servletContext ); servletContext.setAttribute( CONTEXT_ATTR, factory ); }
[ "public", "static", "void", "init", "(", "ServletContext", "servletContext", ")", "{", "PageFlowFactoriesConfig", "factoriesBean", "=", "ConfigUtil", ".", "getConfig", "(", ")", ".", "getPageFlowFactories", "(", ")", ";", "FlowControllerFactory", "factory", "=", "null", ";", "if", "(", "factoriesBean", "!=", "null", ")", "{", "PageFlowFactoryConfig", "fcFactoryBean", "=", "factoriesBean", ".", "getPageFlowFactory", "(", ")", ";", "factory", "=", "(", "FlowControllerFactory", ")", "FactoryUtils", ".", "getFactory", "(", "servletContext", ",", "fcFactoryBean", ",", "FlowControllerFactory", ".", "class", ")", ";", "}", "if", "(", "factory", "==", "null", ")", "factory", "=", "new", "FlowControllerFactory", "(", ")", ";", "factory", ".", "reinit", "(", "servletContext", ")", ";", "servletContext", ".", "setAttribute", "(", "CONTEXT_ATTR", ",", "factory", ")", ";", "}" ]
Initialize an instance of this class in the ServletContext. This is a framework-invoked method and should not normally be called directly.
[ "Initialize", "an", "instance", "of", "this", "class", "in", "the", "ServletContext", ".", "This", "is", "a", "framework", "-", "invoked", "method", "and", "should", "not", "normally", "be", "called", "directly", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L69-L86
146,371
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
FlowControllerFactory.getFlowControllerInstance
public FlowController getFlowControllerInstance( Class flowControllerClass ) throws InstantiationException, IllegalAccessException { assert FlowController.class.isAssignableFrom( flowControllerClass ) : "Class " + flowControllerClass.getName() + " does not extend " + FlowController.class.getName(); return ( FlowController ) flowControllerClass.newInstance(); }
java
public FlowController getFlowControllerInstance( Class flowControllerClass ) throws InstantiationException, IllegalAccessException { assert FlowController.class.isAssignableFrom( flowControllerClass ) : "Class " + flowControllerClass.getName() + " does not extend " + FlowController.class.getName(); return ( FlowController ) flowControllerClass.newInstance(); }
[ "public", "FlowController", "getFlowControllerInstance", "(", "Class", "flowControllerClass", ")", "throws", "InstantiationException", ",", "IllegalAccessException", "{", "assert", "FlowController", ".", "class", ".", "isAssignableFrom", "(", "flowControllerClass", ")", ":", "\"Class \"", "+", "flowControllerClass", ".", "getName", "(", ")", "+", "\" does not extend \"", "+", "FlowController", ".", "class", ".", "getName", "(", ")", ";", "return", "(", "FlowController", ")", "flowControllerClass", ".", "newInstance", "(", ")", ";", "}" ]
Get a FlowController instance, given a FlowController class. @param flowControllerClass the Class, which must be assignable to {@link FlowController}. @return a new FlowController instance.
[ "Get", "a", "FlowController", "instance", "given", "a", "FlowController", "class", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L542-L548
146,372
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java
HtmlGroupBaseTag.addOption
protected void addOption(AbstractRenderAppender buffer, String type, String optionValue, String optionDisplay, int idx, String altText, char accessKey, boolean disabled) throws JspException { ServletRequest req = pageContext.getRequest(); if (_cr == null) _cr = TagRenderingBase.Factory.getConstantRendering(req); assert(buffer != null); assert(optionValue != null); assert(optionDisplay != null); assert(type != null); if (_orientation != null && isVertical()) { _cr.TR_TD(buffer); } _inputState.clear(); _inputState.type = type; _inputState.name = getQualifiedDataSourceName(); _inputState.value = optionValue; _inputState.style = _style; _inputState.styleClass = _class; if (isMatched(optionValue, null)) { _inputState.checked = true; } _inputState.disabled = isDisabled(); _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, altText); if (accessKey != 0x00) _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ACCESSKEY, Character.toString(accessKey)); // if there are attributes defined push them to the options. if (_attrs != null && _attrs.size() > 0) { Iterator iterator = _attrs.keySet().iterator(); for (; iterator.hasNext();) { String key = (String) iterator.next(); if (key == null) continue; String value = (String) _attrs.get(key); _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, key, value); } } TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req); br.doStartTag(buffer, _inputState); br.doEndTag(buffer); String ls = _labelStyle; String lsc = _labelStyleClass; _spanState.style = ls; _spanState.styleClass = lsc; br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req); br.doStartTag(buffer, _spanState); buffer.append(optionDisplay); br.doEndTag(buffer); // backward compatibility this is now overridden by the _orientation if (_orientation == null) { _cr.BR(buffer); } else { if (isVertical()) { _cr.TR_TD(buffer); } else { _cr.NBSP(buffer); } } }
java
protected void addOption(AbstractRenderAppender buffer, String type, String optionValue, String optionDisplay, int idx, String altText, char accessKey, boolean disabled) throws JspException { ServletRequest req = pageContext.getRequest(); if (_cr == null) _cr = TagRenderingBase.Factory.getConstantRendering(req); assert(buffer != null); assert(optionValue != null); assert(optionDisplay != null); assert(type != null); if (_orientation != null && isVertical()) { _cr.TR_TD(buffer); } _inputState.clear(); _inputState.type = type; _inputState.name = getQualifiedDataSourceName(); _inputState.value = optionValue; _inputState.style = _style; _inputState.styleClass = _class; if (isMatched(optionValue, null)) { _inputState.checked = true; } _inputState.disabled = isDisabled(); _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALT, altText); if (accessKey != 0x00) _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ACCESSKEY, Character.toString(accessKey)); // if there are attributes defined push them to the options. if (_attrs != null && _attrs.size() > 0) { Iterator iterator = _attrs.keySet().iterator(); for (; iterator.hasNext();) { String key = (String) iterator.next(); if (key == null) continue; String value = (String) _attrs.get(key); _inputState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, key, value); } } TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req); br.doStartTag(buffer, _inputState); br.doEndTag(buffer); String ls = _labelStyle; String lsc = _labelStyleClass; _spanState.style = ls; _spanState.styleClass = lsc; br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req); br.doStartTag(buffer, _spanState); buffer.append(optionDisplay); br.doEndTag(buffer); // backward compatibility this is now overridden by the _orientation if (_orientation == null) { _cr.BR(buffer); } else { if (isVertical()) { _cr.TR_TD(buffer); } else { _cr.NBSP(buffer); } } }
[ "protected", "void", "addOption", "(", "AbstractRenderAppender", "buffer", ",", "String", "type", ",", "String", "optionValue", ",", "String", "optionDisplay", ",", "int", "idx", ",", "String", "altText", ",", "char", "accessKey", ",", "boolean", "disabled", ")", "throws", "JspException", "{", "ServletRequest", "req", "=", "pageContext", ".", "getRequest", "(", ")", ";", "if", "(", "_cr", "==", "null", ")", "_cr", "=", "TagRenderingBase", ".", "Factory", ".", "getConstantRendering", "(", "req", ")", ";", "assert", "(", "buffer", "!=", "null", ")", ";", "assert", "(", "optionValue", "!=", "null", ")", ";", "assert", "(", "optionDisplay", "!=", "null", ")", ";", "assert", "(", "type", "!=", "null", ")", ";", "if", "(", "_orientation", "!=", "null", "&&", "isVertical", "(", ")", ")", "{", "_cr", ".", "TR_TD", "(", "buffer", ")", ";", "}", "_inputState", ".", "clear", "(", ")", ";", "_inputState", ".", "type", "=", "type", ";", "_inputState", ".", "name", "=", "getQualifiedDataSourceName", "(", ")", ";", "_inputState", ".", "value", "=", "optionValue", ";", "_inputState", ".", "style", "=", "_style", ";", "_inputState", ".", "styleClass", "=", "_class", ";", "if", "(", "isMatched", "(", "optionValue", ",", "null", ")", ")", "{", "_inputState", ".", "checked", "=", "true", ";", "}", "_inputState", ".", "disabled", "=", "isDisabled", "(", ")", ";", "_inputState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "ALT", ",", "altText", ")", ";", "if", "(", "accessKey", "!=", "0x00", ")", "_inputState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "ACCESSKEY", ",", "Character", ".", "toString", "(", "accessKey", ")", ")", ";", "// if there are attributes defined push them to the options.", "if", "(", "_attrs", "!=", "null", "&&", "_attrs", ".", "size", "(", ")", ">", "0", ")", "{", "Iterator", "iterator", "=", "_attrs", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "for", "(", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "String", "key", "=", "(", "String", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "key", "==", "null", ")", "continue", ";", "String", "value", "=", "(", "String", ")", "_attrs", ".", "get", "(", "key", ")", ";", "_inputState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "key", ",", "value", ")", ";", "}", "}", "TagRenderingBase", "br", "=", "TagRenderingBase", ".", "Factory", ".", "getRendering", "(", "TagRenderingBase", ".", "INPUT_BOOLEAN_TAG", ",", "req", ")", ";", "br", ".", "doStartTag", "(", "buffer", ",", "_inputState", ")", ";", "br", ".", "doEndTag", "(", "buffer", ")", ";", "String", "ls", "=", "_labelStyle", ";", "String", "lsc", "=", "_labelStyleClass", ";", "_spanState", ".", "style", "=", "ls", ";", "_spanState", ".", "styleClass", "=", "lsc", ";", "br", "=", "TagRenderingBase", ".", "Factory", ".", "getRendering", "(", "TagRenderingBase", ".", "SPAN_TAG", ",", "req", ")", ";", "br", ".", "doStartTag", "(", "buffer", ",", "_spanState", ")", ";", "buffer", ".", "append", "(", "optionDisplay", ")", ";", "br", ".", "doEndTag", "(", "buffer", ")", ";", "// backward compatibility this is now overridden by the _orientation", "if", "(", "_orientation", "==", "null", ")", "{", "_cr", ".", "BR", "(", "buffer", ")", ";", "}", "else", "{", "if", "(", "isVertical", "(", ")", ")", "{", "_cr", ".", "TR_TD", "(", "buffer", ")", ";", "}", "else", "{", "_cr", ".", "NBSP", "(", "buffer", ")", ";", "}", "}", "}" ]
This will create a new option in the HTML.
[ "This", "will", "create", "a", "new", "option", "in", "the", "HTML", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlGroupBaseTag.java#L516-L588
146,373
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Html.java
Html.getTargetDocumentType
public int getTargetDocumentType() { if (_rendering != TagRenderingBase.UNKNOWN_RENDERING) return _rendering; if (_docType != null) { if (_docType.equals(HTML_401)) _rendering = TagRenderingBase.HTML_RENDERING; else if (_docType.equals(HTML_401_QUIRKS)) _rendering = TagRenderingBase.HTML_RENDERING_QUIRKS; else if (_docType.equals(XHTML_10)) _rendering = TagRenderingBase.XHTML_RENDERING; else _rendering = TagRenderingBase.getDefaultDocType(); } else { _rendering = TagRenderingBase.getDefaultDocType(); } return _rendering; }
java
public int getTargetDocumentType() { if (_rendering != TagRenderingBase.UNKNOWN_RENDERING) return _rendering; if (_docType != null) { if (_docType.equals(HTML_401)) _rendering = TagRenderingBase.HTML_RENDERING; else if (_docType.equals(HTML_401_QUIRKS)) _rendering = TagRenderingBase.HTML_RENDERING_QUIRKS; else if (_docType.equals(XHTML_10)) _rendering = TagRenderingBase.XHTML_RENDERING; else _rendering = TagRenderingBase.getDefaultDocType(); } else { _rendering = TagRenderingBase.getDefaultDocType(); } return _rendering; }
[ "public", "int", "getTargetDocumentType", "(", ")", "{", "if", "(", "_rendering", "!=", "TagRenderingBase", ".", "UNKNOWN_RENDERING", ")", "return", "_rendering", ";", "if", "(", "_docType", "!=", "null", ")", "{", "if", "(", "_docType", ".", "equals", "(", "HTML_401", ")", ")", "_rendering", "=", "TagRenderingBase", ".", "HTML_RENDERING", ";", "else", "if", "(", "_docType", ".", "equals", "(", "HTML_401_QUIRKS", ")", ")", "_rendering", "=", "TagRenderingBase", ".", "HTML_RENDERING_QUIRKS", ";", "else", "if", "(", "_docType", ".", "equals", "(", "XHTML_10", ")", ")", "_rendering", "=", "TagRenderingBase", ".", "XHTML_RENDERING", ";", "else", "_rendering", "=", "TagRenderingBase", ".", "getDefaultDocType", "(", ")", ";", "}", "else", "{", "_rendering", "=", "TagRenderingBase", ".", "getDefaultDocType", "(", ")", ";", "}", "return", "_rendering", ";", "}" ]
This method will return the TagRenderBase enum value for the document type. The default value is HTML 4.01. @return int
[ "This", "method", "will", "return", "the", "TagRenderBase", "enum", "value", "for", "the", "document", "type", ".", "The", "default", "value", "is", "HTML", "4", ".", "01", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Html.java#L106-L125
146,374
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Html.java
Html.returnErrors
public ArrayList returnErrors() { if (_containerErrors != null) return _containerErrors.returnErrors(); ArrayList e = _errors; _errors = null; return e; }
java
public ArrayList returnErrors() { if (_containerErrors != null) return _containerErrors.returnErrors(); ArrayList e = _errors; _errors = null; return e; }
[ "public", "ArrayList", "returnErrors", "(", ")", "{", "if", "(", "_containerErrors", "!=", "null", ")", "return", "_containerErrors", ".", "returnErrors", "(", ")", ";", "ArrayList", "e", "=", "_errors", ";", "_errors", "=", "null", ";", "return", "e", ";", "}" ]
Return an ArrayList of the errors @return an <code>ArrayList</code> of all errors.
[ "Return", "an", "ArrayList", "of", "the", "errors" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Html.java#L291-L298
146,375
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java
JdbcControlChecker.check
public void check(Declaration decl, AnnotationProcessorEnvironment env) { _locale = Locale.getDefault(); if (decl instanceof TypeDeclaration) { // // Check method annotations // Collection<? extends MethodDeclaration> methods = ((TypeDeclaration) decl).getMethods(); for (MethodDeclaration method : methods) { checkSQL(method, env); } } else if (decl instanceof FieldDeclaration) { // // NOOP // } else { // // NOOP // } }
java
public void check(Declaration decl, AnnotationProcessorEnvironment env) { _locale = Locale.getDefault(); if (decl instanceof TypeDeclaration) { // // Check method annotations // Collection<? extends MethodDeclaration> methods = ((TypeDeclaration) decl).getMethods(); for (MethodDeclaration method : methods) { checkSQL(method, env); } } else if (decl instanceof FieldDeclaration) { // // NOOP // } else { // // NOOP // } }
[ "public", "void", "check", "(", "Declaration", "decl", ",", "AnnotationProcessorEnvironment", "env", ")", "{", "_locale", "=", "Locale", ".", "getDefault", "(", ")", ";", "if", "(", "decl", "instanceof", "TypeDeclaration", ")", "{", "//", "// Check method annotations", "//", "Collection", "<", "?", "extends", "MethodDeclaration", ">", "methods", "=", "(", "(", "TypeDeclaration", ")", "decl", ")", ".", "getMethods", "(", ")", ";", "for", "(", "MethodDeclaration", "method", ":", "methods", ")", "{", "checkSQL", "(", "method", ",", "env", ")", ";", "}", "}", "else", "if", "(", "decl", "instanceof", "FieldDeclaration", ")", "{", "//", "// NOOP", "//", "}", "else", "{", "//", "// NOOP", "//", "}", "}" ]
Invoked by the control build-time infrastructure to process a declaration of a control extension (ie, an interface annotated with @ControlExtension), or a field instance of a control type.
[ "Invoked", "by", "the", "control", "build", "-", "time", "infrastructure", "to", "process", "a", "declaration", "of", "a", "control", "extension", "(", "ie", "an", "interface", "annotated", "with" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlChecker.java#L57-L82
146,376
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
TemplatedURLFormatter.getTemplatedURLFormatter
public static TemplatedURLFormatter getTemplatedURLFormatter( ServletContext servletContext ) { assert servletContext != null : "The ServletContext cannot be null."; if ( servletContext == null ) { throw new IllegalArgumentException( "The ServletContext cannot be null." ); } return ( TemplatedURLFormatter ) servletContext.getAttribute( TEMPLATED_URL_FORMATTER_ATTR ); }
java
public static TemplatedURLFormatter getTemplatedURLFormatter( ServletContext servletContext ) { assert servletContext != null : "The ServletContext cannot be null."; if ( servletContext == null ) { throw new IllegalArgumentException( "The ServletContext cannot be null." ); } return ( TemplatedURLFormatter ) servletContext.getAttribute( TEMPLATED_URL_FORMATTER_ATTR ); }
[ "public", "static", "TemplatedURLFormatter", "getTemplatedURLFormatter", "(", "ServletContext", "servletContext", ")", "{", "assert", "servletContext", "!=", "null", ":", "\"The ServletContext cannot be null.\"", ";", "if", "(", "servletContext", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ServletContext cannot be null.\"", ")", ";", "}", "return", "(", "TemplatedURLFormatter", ")", "servletContext", ".", "getAttribute", "(", "TEMPLATED_URL_FORMATTER_ATTR", ")", ";", "}" ]
Gets the TemplatedURLFormatter instance from a ServletContext attribute. @param servletContext the current ServletContext. @return the TemplatedURLFormatter instance from the ServletContext.
[ "Gets", "the", "TemplatedURLFormatter", "instance", "from", "a", "ServletContext", "attribute", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java#L77-L87
146,377
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
TemplatedURLFormatter.initServletContext
public static void initServletContext( ServletContext servletContext, TemplatedURLFormatter formatter ) { assert servletContext != null : "The ServletContext cannot be null."; if ( servletContext == null ) { throw new IllegalArgumentException( "The ServletContext cannot be null." ); } servletContext.setAttribute( TEMPLATED_URL_FORMATTER_ATTR, formatter ); }
java
public static void initServletContext( ServletContext servletContext, TemplatedURLFormatter formatter ) { assert servletContext != null : "The ServletContext cannot be null."; if ( servletContext == null ) { throw new IllegalArgumentException( "The ServletContext cannot be null." ); } servletContext.setAttribute( TEMPLATED_URL_FORMATTER_ATTR, formatter ); }
[ "public", "static", "void", "initServletContext", "(", "ServletContext", "servletContext", ",", "TemplatedURLFormatter", "formatter", ")", "{", "assert", "servletContext", "!=", "null", ":", "\"The ServletContext cannot be null.\"", ";", "if", "(", "servletContext", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ServletContext cannot be null.\"", ")", ";", "}", "servletContext", ".", "setAttribute", "(", "TEMPLATED_URL_FORMATTER_ATTR", ",", "formatter", ")", ";", "}" ]
Adds a given TemplatedURLFormatter instance as an attribute on the ServletContext. @param servletContext the current ServletContext. @param formatter the TemplatedURLFormatter instance to add as an attribute of the context
[ "Adds", "a", "given", "TemplatedURLFormatter", "instance", "as", "an", "attribute", "on", "the", "ServletContext", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java#L95-L105
146,378
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
TemplatedURLFormatter.getTemplatedURLFormatter
public static TemplatedURLFormatter getTemplatedURLFormatter(ServletRequest servletRequest) { assert servletRequest != null : "The ServletRequest cannot be null."; if (servletRequest == null) { throw new IllegalArgumentException("The ServletRequest cannot be null."); } return (TemplatedURLFormatter) servletRequest.getAttribute(TEMPLATED_URL_FORMATTER_ATTR); }
java
public static TemplatedURLFormatter getTemplatedURLFormatter(ServletRequest servletRequest) { assert servletRequest != null : "The ServletRequest cannot be null."; if (servletRequest == null) { throw new IllegalArgumentException("The ServletRequest cannot be null."); } return (TemplatedURLFormatter) servletRequest.getAttribute(TEMPLATED_URL_FORMATTER_ATTR); }
[ "public", "static", "TemplatedURLFormatter", "getTemplatedURLFormatter", "(", "ServletRequest", "servletRequest", ")", "{", "assert", "servletRequest", "!=", "null", ":", "\"The ServletRequest cannot be null.\"", ";", "if", "(", "servletRequest", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ServletRequest cannot be null.\"", ")", ";", "}", "return", "(", "TemplatedURLFormatter", ")", "servletRequest", ".", "getAttribute", "(", "TEMPLATED_URL_FORMATTER_ATTR", ")", ";", "}" ]
Gets the TemplatedURLFormatter instance from a ServletRequest attribute. @param servletRequest the current ServletRequest. @return the TemplatedURLFormatter instance from the ServletRequest.
[ "Gets", "the", "TemplatedURLFormatter", "instance", "from", "a", "ServletRequest", "attribute", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java#L113-L122
146,379
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
TemplatedURLFormatter.initServletRequest
public static void initServletRequest(ServletRequest servletRequest, TemplatedURLFormatter formatter) { assert servletRequest != null : "The ServletRequest cannot be null."; if (servletRequest == null) { throw new IllegalArgumentException("The ServletRequest cannot be null."); } servletRequest.setAttribute(TEMPLATED_URL_FORMATTER_ATTR, formatter); }
java
public static void initServletRequest(ServletRequest servletRequest, TemplatedURLFormatter formatter) { assert servletRequest != null : "The ServletRequest cannot be null."; if (servletRequest == null) { throw new IllegalArgumentException("The ServletRequest cannot be null."); } servletRequest.setAttribute(TEMPLATED_URL_FORMATTER_ATTR, formatter); }
[ "public", "static", "void", "initServletRequest", "(", "ServletRequest", "servletRequest", ",", "TemplatedURLFormatter", "formatter", ")", "{", "assert", "servletRequest", "!=", "null", ":", "\"The ServletRequest cannot be null.\"", ";", "if", "(", "servletRequest", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ServletRequest cannot be null.\"", ")", ";", "}", "servletRequest", ".", "setAttribute", "(", "TEMPLATED_URL_FORMATTER_ATTR", ",", "formatter", ")", ";", "}" ]
Adds a given TemplatedURLFormatter instance as an attribute on the ServletRequest. @param servletRequest the current ServletRequest. @param formatter the TemplatedURLFormatter instance to add as an attribute of the request
[ "Adds", "a", "given", "TemplatedURLFormatter", "instance", "as", "an", "attribute", "on", "the", "ServletRequest", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java#L130-L139
146,380
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/CheckBox.java
CheckBox.doEndTag
public int doEndTag() throws JspException { Tag parent = getParent(); if (parent instanceof CheckBoxGroup) registerTagError(Bundle.getString("Tags_CheckBoxGroupChildError"), null); Object val = evaluateDataSource(); if (hasErrors()) return reportAndExit(EVAL_PAGE); ByRef ref = new ByRef(); nameHtmlControl(_state, ref); String hiddenParamName = _state.name + OLDVALUE_SUFFIX; ServletRequest req = pageContext.getRequest(); if (val instanceof String) { if (val != null && Boolean.valueOf(val.toString()).booleanValue()) _state.checked = true; else _state.checked = false; } else if (val instanceof Boolean) { _state.checked = ((Boolean) val).booleanValue(); } else { String oldCheckBoxValue = req.getParameter(hiddenParamName); if (oldCheckBoxValue != null) { _state.checked = new Boolean(oldCheckBoxValue).booleanValue(); } else { _state.checked = evaluateDefaultValue(); } } _state.disabled = isDisabled(); //Create a hidden field to store the CheckBox oldValue String oldValue = req.getParameter(_state.name); WriteRenderAppender writer = new WriteRenderAppender(pageContext); // if the checkbox is disabled we need to not write out the hidden // field because it can cause the default state to change from // true to false. Disabled check boxes do not postback. if (!_state.disabled) { _hiddenState.name = hiddenParamName; if (oldValue == null) { _hiddenState.value = "false"; } else { _hiddenState.value = oldValue; } TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req); hiddenTag.doStartTag(writer, _hiddenState); hiddenTag.doEndTag(writer); } _state.type = INPUT_CHECKBOX; TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req); br.doStartTag(writer, _state); if (!ref.isNull()) write((String) ref.getRef()); // Continue processing this page localRelease(); return EVAL_PAGE; }
java
public int doEndTag() throws JspException { Tag parent = getParent(); if (parent instanceof CheckBoxGroup) registerTagError(Bundle.getString("Tags_CheckBoxGroupChildError"), null); Object val = evaluateDataSource(); if (hasErrors()) return reportAndExit(EVAL_PAGE); ByRef ref = new ByRef(); nameHtmlControl(_state, ref); String hiddenParamName = _state.name + OLDVALUE_SUFFIX; ServletRequest req = pageContext.getRequest(); if (val instanceof String) { if (val != null && Boolean.valueOf(val.toString()).booleanValue()) _state.checked = true; else _state.checked = false; } else if (val instanceof Boolean) { _state.checked = ((Boolean) val).booleanValue(); } else { String oldCheckBoxValue = req.getParameter(hiddenParamName); if (oldCheckBoxValue != null) { _state.checked = new Boolean(oldCheckBoxValue).booleanValue(); } else { _state.checked = evaluateDefaultValue(); } } _state.disabled = isDisabled(); //Create a hidden field to store the CheckBox oldValue String oldValue = req.getParameter(_state.name); WriteRenderAppender writer = new WriteRenderAppender(pageContext); // if the checkbox is disabled we need to not write out the hidden // field because it can cause the default state to change from // true to false. Disabled check boxes do not postback. if (!_state.disabled) { _hiddenState.name = hiddenParamName; if (oldValue == null) { _hiddenState.value = "false"; } else { _hiddenState.value = oldValue; } TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req); hiddenTag.doStartTag(writer, _hiddenState); hiddenTag.doEndTag(writer); } _state.type = INPUT_CHECKBOX; TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req); br.doStartTag(writer, _state); if (!ref.isNull()) write((String) ref.getRef()); // Continue processing this page localRelease(); return EVAL_PAGE; }
[ "public", "int", "doEndTag", "(", ")", "throws", "JspException", "{", "Tag", "parent", "=", "getParent", "(", ")", ";", "if", "(", "parent", "instanceof", "CheckBoxGroup", ")", "registerTagError", "(", "Bundle", ".", "getString", "(", "\"Tags_CheckBoxGroupChildError\"", ")", ",", "null", ")", ";", "Object", "val", "=", "evaluateDataSource", "(", ")", ";", "if", "(", "hasErrors", "(", ")", ")", "return", "reportAndExit", "(", "EVAL_PAGE", ")", ";", "ByRef", "ref", "=", "new", "ByRef", "(", ")", ";", "nameHtmlControl", "(", "_state", ",", "ref", ")", ";", "String", "hiddenParamName", "=", "_state", ".", "name", "+", "OLDVALUE_SUFFIX", ";", "ServletRequest", "req", "=", "pageContext", ".", "getRequest", "(", ")", ";", "if", "(", "val", "instanceof", "String", ")", "{", "if", "(", "val", "!=", "null", "&&", "Boolean", ".", "valueOf", "(", "val", ".", "toString", "(", ")", ")", ".", "booleanValue", "(", ")", ")", "_state", ".", "checked", "=", "true", ";", "else", "_state", ".", "checked", "=", "false", ";", "}", "else", "if", "(", "val", "instanceof", "Boolean", ")", "{", "_state", ".", "checked", "=", "(", "(", "Boolean", ")", "val", ")", ".", "booleanValue", "(", ")", ";", "}", "else", "{", "String", "oldCheckBoxValue", "=", "req", ".", "getParameter", "(", "hiddenParamName", ")", ";", "if", "(", "oldCheckBoxValue", "!=", "null", ")", "{", "_state", ".", "checked", "=", "new", "Boolean", "(", "oldCheckBoxValue", ")", ".", "booleanValue", "(", ")", ";", "}", "else", "{", "_state", ".", "checked", "=", "evaluateDefaultValue", "(", ")", ";", "}", "}", "_state", ".", "disabled", "=", "isDisabled", "(", ")", ";", "//Create a hidden field to store the CheckBox oldValue", "String", "oldValue", "=", "req", ".", "getParameter", "(", "_state", ".", "name", ")", ";", "WriteRenderAppender", "writer", "=", "new", "WriteRenderAppender", "(", "pageContext", ")", ";", "// if the checkbox is disabled we need to not write out the hidden", "// field because it can cause the default state to change from", "// true to false. Disabled check boxes do not postback.", "if", "(", "!", "_state", ".", "disabled", ")", "{", "_hiddenState", ".", "name", "=", "hiddenParamName", ";", "if", "(", "oldValue", "==", "null", ")", "{", "_hiddenState", ".", "value", "=", "\"false\"", ";", "}", "else", "{", "_hiddenState", ".", "value", "=", "oldValue", ";", "}", "TagRenderingBase", "hiddenTag", "=", "TagRenderingBase", ".", "Factory", ".", "getRendering", "(", "TagRenderingBase", ".", "INPUT_HIDDEN_TAG", ",", "req", ")", ";", "hiddenTag", ".", "doStartTag", "(", "writer", ",", "_hiddenState", ")", ";", "hiddenTag", ".", "doEndTag", "(", "writer", ")", ";", "}", "_state", ".", "type", "=", "INPUT_CHECKBOX", ";", "TagRenderingBase", "br", "=", "TagRenderingBase", ".", "Factory", ".", "getRendering", "(", "TagRenderingBase", ".", "INPUT_BOOLEAN_TAG", ",", "req", ")", ";", "br", ".", "doStartTag", "(", "writer", ",", "_state", ")", ";", "if", "(", "!", "ref", ".", "isNull", "(", ")", ")", "write", "(", "(", "String", ")", "ref", ".", "getRef", "(", ")", ")", ";", "// Continue processing this page", "localRelease", "(", ")", ";", "return", "EVAL_PAGE", ";", "}" ]
Render the checkbox. @throws JspException if a JSP exception has occurred
[ "Render", "the", "checkbox", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/CheckBox.java#L249-L316
146,381
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java
PageFlowController.create
public final synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext ) { reinitialize( request, response, servletContext ); initializeSharedFlowFields( request ); if ( isNestable() ) { // Initialize a ViewRenderer for exiting the nested page flow. This is used (currently) as part of popup // window support -- when exiting a popup nested page flow, a special view renderer writes out javascript // that maps output values to the original window and closes the popup window. String vrClassName = request.getParameter( InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM ); if ( vrClassName != null ) { ViewRenderer vr = ( ViewRenderer ) DiscoveryUtils.newImplementorInstance( vrClassName, ViewRenderer.class ); if ( vr != null ) { vr.init( request ); PageFlowController nestingPageFlow = PageFlowUtils.getCurrentPageFlow(request, servletContext); nestingPageFlow.setReturnActionViewRenderer(vr); } } } super.create( request, response, servletContext ); }
java
public final synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext ) { reinitialize( request, response, servletContext ); initializeSharedFlowFields( request ); if ( isNestable() ) { // Initialize a ViewRenderer for exiting the nested page flow. This is used (currently) as part of popup // window support -- when exiting a popup nested page flow, a special view renderer writes out javascript // that maps output values to the original window and closes the popup window. String vrClassName = request.getParameter( InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM ); if ( vrClassName != null ) { ViewRenderer vr = ( ViewRenderer ) DiscoveryUtils.newImplementorInstance( vrClassName, ViewRenderer.class ); if ( vr != null ) { vr.init( request ); PageFlowController nestingPageFlow = PageFlowUtils.getCurrentPageFlow(request, servletContext); nestingPageFlow.setReturnActionViewRenderer(vr); } } } super.create( request, response, servletContext ); }
[ "public", "final", "synchronized", "void", "create", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "ServletContext", "servletContext", ")", "{", "reinitialize", "(", "request", ",", "response", ",", "servletContext", ")", ";", "initializeSharedFlowFields", "(", "request", ")", ";", "if", "(", "isNestable", "(", ")", ")", "{", "// Initialize a ViewRenderer for exiting the nested page flow. This is used (currently) as part of popup", "// window support -- when exiting a popup nested page flow, a special view renderer writes out javascript", "// that maps output values to the original window and closes the popup window.", "String", "vrClassName", "=", "request", ".", "getParameter", "(", "InternalConstants", ".", "RETURN_ACTION_VIEW_RENDERER_PARAM", ")", ";", "if", "(", "vrClassName", "!=", "null", ")", "{", "ViewRenderer", "vr", "=", "(", "ViewRenderer", ")", "DiscoveryUtils", ".", "newImplementorInstance", "(", "vrClassName", ",", "ViewRenderer", ".", "class", ")", ";", "if", "(", "vr", "!=", "null", ")", "{", "vr", ".", "init", "(", "request", ")", ";", "PageFlowController", "nestingPageFlow", "=", "PageFlowUtils", ".", "getCurrentPageFlow", "(", "request", ",", "servletContext", ")", ";", "nestingPageFlow", ".", "setReturnActionViewRenderer", "(", "vr", ")", ";", "}", "}", "}", "super", ".", "create", "(", "request", ",", "response", ",", "servletContext", ")", ";", "}" ]
This is a framework method for initializing a newly-created page flow, and should not normally be called directly.
[ "This", "is", "a", "framework", "method", "for", "initializing", "a", "newly", "-", "created", "page", "flow", "and", "should", "not", "normally", "be", "called", "directly", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java#L406-L435
146,382
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java
PagerModel.getPage
public int getPage() { int row = getRow(); assert row % getPageSize() == 0 : "Invalid current row \"" + row + "\" for page size \"" + getPageSize() + "\""; assert getPageSize() > 0; return row / getPageSize(); }
java
public int getPage() { int row = getRow(); assert row % getPageSize() == 0 : "Invalid current row \"" + row + "\" for page size \"" + getPageSize() + "\""; assert getPageSize() > 0; return row / getPageSize(); }
[ "public", "int", "getPage", "(", ")", "{", "int", "row", "=", "getRow", "(", ")", ";", "assert", "row", "%", "getPageSize", "(", ")", "==", "0", ":", "\"Invalid current row \\\"\"", "+", "row", "+", "\"\\\" for page size \\\"\"", "+", "getPageSize", "(", ")", "+", "\"\\\"\"", ";", "assert", "getPageSize", "(", ")", ">", "0", ";", "return", "row", "/", "getPageSize", "(", ")", ";", "}" ]
Get the page number given the current page size and current row. The page number is zero based and should be adjusted by one when being displayed to users. @return the page number
[ "Get", "the", "page", "number", "given", "the", "current", "page", "size", "and", "current", "row", ".", "The", "page", "number", "is", "zero", "based", "and", "should", "be", "adjusted", "by", "one", "when", "being", "displayed", "to", "users", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java#L175-L180
146,383
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java
PagerModel.setPage
public void setPage(int page) { if(page < 0) throw new IllegalArgumentException(Bundle.getErrorString("PagerModel_IllegalPage")); /* todo: need to check that the new 'current' page is in range given the first/last boundaries */ _currentRow = new Integer(page * getPageSize()); }
java
public void setPage(int page) { if(page < 0) throw new IllegalArgumentException(Bundle.getErrorString("PagerModel_IllegalPage")); /* todo: need to check that the new 'current' page is in range given the first/last boundaries */ _currentRow = new Integer(page * getPageSize()); }
[ "public", "void", "setPage", "(", "int", "page", ")", "{", "if", "(", "page", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "Bundle", ".", "getErrorString", "(", "\"PagerModel_IllegalPage\"", ")", ")", ";", "/* todo: need to check that the new 'current' page is in range given the first/last boundaries */", "_currentRow", "=", "new", "Integer", "(", "page", "*", "getPageSize", "(", ")", ")", ";", "}" ]
Set a specific page. This will change the current row to match the given page value. @param page the new page @throws IllegalArgumentException if the given page is less than zero
[ "Set", "a", "specific", "page", ".", "This", "will", "change", "the", "current", "row", "to", "match", "the", "given", "page", "value", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java#L188-L194
146,384
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java
PagerModel.getRow
public int getRow() { if(_currentRow != null) { int row = _currentRow.intValue(); /* if the row is out of range, simply adjust to the last row */ if(_dataSetSize != null && (row > _dataSetSize.intValue())) row = _dataSetSize.intValue(); if(row % getPageSize() != 0) { int adjustedPage = row - (row % getPageSize()); return adjustedPage; } else return row; } else return DEFAULT_ROW; }
java
public int getRow() { if(_currentRow != null) { int row = _currentRow.intValue(); /* if the row is out of range, simply adjust to the last row */ if(_dataSetSize != null && (row > _dataSetSize.intValue())) row = _dataSetSize.intValue(); if(row % getPageSize() != 0) { int adjustedPage = row - (row % getPageSize()); return adjustedPage; } else return row; } else return DEFAULT_ROW; }
[ "public", "int", "getRow", "(", ")", "{", "if", "(", "_currentRow", "!=", "null", ")", "{", "int", "row", "=", "_currentRow", ".", "intValue", "(", ")", ";", "/* if the row is out of range, simply adjust to the last row */", "if", "(", "_dataSetSize", "!=", "null", "&&", "(", "row", ">", "_dataSetSize", ".", "intValue", "(", ")", ")", ")", "row", "=", "_dataSetSize", ".", "intValue", "(", ")", ";", "if", "(", "row", "%", "getPageSize", "(", ")", "!=", "0", ")", "{", "int", "adjustedPage", "=", "row", "-", "(", "row", "%", "getPageSize", "(", ")", ")", ";", "return", "adjustedPage", ";", "}", "else", "return", "row", ";", "}", "else", "return", "DEFAULT_ROW", ";", "}" ]
Get the current row. If no row has been specified, the default row is returned. @return the current row
[ "Get", "the", "current", "row", ".", "If", "no", "row", "has", "been", "specified", "the", "default", "row", "is", "returned", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java#L200-L215
146,385
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java
PagerModel.getRowForLastPage
public int getRowForLastPage() { Integer lastRow = internalGetLastRow(); if(lastRow != null) return lastRow.intValue(); else throw new IllegalStateException(Bundle.getErrorString("PagerModel_CantCalculateLastPage")); }
java
public int getRowForLastPage() { Integer lastRow = internalGetLastRow(); if(lastRow != null) return lastRow.intValue(); else throw new IllegalStateException(Bundle.getErrorString("PagerModel_CantCalculateLastPage")); }
[ "public", "int", "getRowForLastPage", "(", ")", "{", "Integer", "lastRow", "=", "internalGetLastRow", "(", ")", ";", "if", "(", "lastRow", "!=", "null", ")", "return", "lastRow", ".", "intValue", "(", ")", ";", "else", "throw", "new", "IllegalStateException", "(", "Bundle", ".", "getErrorString", "(", "\"PagerModel_CantCalculateLastPage\"", ")", ")", ";", "}" ]
Get the row used to display the last page. This requires tha the data set size has been set via @return the row for the last page @throws IllegalStateException when the size of the data set has not been set
[ "Get", "the", "row", "used", "to", "display", "the", "last", "page", ".", "This", "requires", "tha", "the", "data", "set", "size", "has", "been", "set", "via" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java#L284-L289
146,386
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java
PagerModel.internalGetLastRow
private Integer internalGetLastRow() { if(_dataSetSize != null) { /* 29 / 10: 0-9, 10-19, 20-29 _lastRow = 20 30 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 31 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 32 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 29 - (29%10) = 20 30 - (30%10) = 30 30 - (30%10) = 30 36 - (36%10) = 30 12 / 2: 0-1, 2-3, 4-5, 6-7, 8-9, 10-11, 12-13 _lastRow=10 12 / 5: 0-4, 5-9, 10-14 _lastRow=5 */ int lastRow = getPageSize() * (int)Math.floor((double)(_dataSetSize.intValue()-1) / (double)getPageSize()); return new Integer(lastRow); } else return null; }
java
private Integer internalGetLastRow() { if(_dataSetSize != null) { /* 29 / 10: 0-9, 10-19, 20-29 _lastRow = 20 30 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 31 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 32 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30 29 - (29%10) = 20 30 - (30%10) = 30 30 - (30%10) = 30 36 - (36%10) = 30 12 / 2: 0-1, 2-3, 4-5, 6-7, 8-9, 10-11, 12-13 _lastRow=10 12 / 5: 0-4, 5-9, 10-14 _lastRow=5 */ int lastRow = getPageSize() * (int)Math.floor((double)(_dataSetSize.intValue()-1) / (double)getPageSize()); return new Integer(lastRow); } else return null; }
[ "private", "Integer", "internalGetLastRow", "(", ")", "{", "if", "(", "_dataSetSize", "!=", "null", ")", "{", "/*\n 29 / 10: 0-9, 10-19, 20-29 _lastRow = 20\n 30 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30\n 31 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30\n 32 / 10: 0-9, 10-19, 20-29, 30-39 _lastRow = 30\n\n 29 - (29%10) = 20\n 30 - (30%10) = 30\n 30 - (30%10) = 30\n 36 - (36%10) = 30\n\n 12 / 2: 0-1, 2-3, 4-5, 6-7, 8-9, 10-11, 12-13 _lastRow=10\n 12 / 5: 0-4, 5-9, 10-14 _lastRow=5\n */", "int", "lastRow", "=", "getPageSize", "(", ")", "*", "(", "int", ")", "Math", ".", "floor", "(", "(", "double", ")", "(", "_dataSetSize", ".", "intValue", "(", ")", "-", "1", ")", "/", "(", "double", ")", "getPageSize", "(", ")", ")", ";", "return", "new", "Integer", "(", "lastRow", ")", ";", "}", "else", "return", "null", ";", "}" ]
Internal method used to calculate the last row given a data set size. @return the last row or <code>null</code> if the last row can not be calculated
[ "Internal", "method", "used", "to", "calculate", "the", "last", "row", "given", "a", "data", "set", "size", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/pager/PagerModel.java#L358-L378
146,387
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java
AnnotatedElementMap.getMethodMapClass
Class getMethodMapClass(Method method) { Class origMapClass = method.getDeclaringClass(); Class mapClass = origMapClass; while (mapClass != null && !isValidMapClass(mapClass)) { mapClass = mapClass.getDeclaringClass(); } if (mapClass == null) { mapClass = origMapClass; } return mapClass; }
java
Class getMethodMapClass(Method method) { Class origMapClass = method.getDeclaringClass(); Class mapClass = origMapClass; while (mapClass != null && !isValidMapClass(mapClass)) { mapClass = mapClass.getDeclaringClass(); } if (mapClass == null) { mapClass = origMapClass; } return mapClass; }
[ "Class", "getMethodMapClass", "(", "Method", "method", ")", "{", "Class", "origMapClass", "=", "method", ".", "getDeclaringClass", "(", ")", ";", "Class", "mapClass", "=", "origMapClass", ";", "while", "(", "mapClass", "!=", "null", "&&", "!", "isValidMapClass", "(", "mapClass", ")", ")", "{", "mapClass", "=", "mapClass", ".", "getDeclaringClass", "(", ")", ";", "}", "if", "(", "mapClass", "==", "null", ")", "{", "mapClass", "=", "origMapClass", ";", "}", "return", "mapClass", ";", "}" ]
further in the hierarchy.
[ "further", "in", "the", "hierarchy", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java#L65-L76
146,388
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java
AnnotatedElementMap.getMethodArgs
private String getMethodArgs(Method m) { StringBuffer sb = new StringBuffer(); Class [] argTypes = m.getParameterTypes(); for (int i = 0; i < argTypes.length; i++) { if (i != 0) sb.append(","); sb.append(argTypes[i].toString()); } return sb.toString(); }
java
private String getMethodArgs(Method m) { StringBuffer sb = new StringBuffer(); Class [] argTypes = m.getParameterTypes(); for (int i = 0; i < argTypes.length; i++) { if (i != 0) sb.append(","); sb.append(argTypes[i].toString()); } return sb.toString(); }
[ "private", "String", "getMethodArgs", "(", "Method", "m", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "Class", "[", "]", "argTypes", "=", "m", ".", "getParameterTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "sb", ".", "append", "(", "\",\"", ")", ";", "sb", ".", "append", "(", "argTypes", "[", "i", "]", ".", "toString", "(", ")", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
Returns a String version of method argument lists based upon the method argument types
[ "Returns", "a", "String", "version", "of", "method", "argument", "lists", "based", "upon", "the", "method", "argument", "types" ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java#L179-L189
146,389
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java
AnnotatedElementMap.writeObject
private void writeObject(java.io.ObjectOutputStream out) throws IOException { // // When serializing, compute sufficient information about the annotated element to // allow it to be reassociated later in readObject // if (_annotElem instanceof Class) { _elemClass = (Class)_annotElem; _elemDesc = null; // non required } else if (_annotElem instanceof Field) { Field f = (Field)_annotElem; _elemClass = f.getDeclaringClass(); _elemDesc = f.getName(); } else if (_annotElem instanceof Method) { Method m = (Method)_annotElem; _elemClass = m.getDeclaringClass(); _elemDesc = m.getName() + "(" + getMethodArgs(m) + ")"; } out.defaultWriteObject(); }
java
private void writeObject(java.io.ObjectOutputStream out) throws IOException { // // When serializing, compute sufficient information about the annotated element to // allow it to be reassociated later in readObject // if (_annotElem instanceof Class) { _elemClass = (Class)_annotElem; _elemDesc = null; // non required } else if (_annotElem instanceof Field) { Field f = (Field)_annotElem; _elemClass = f.getDeclaringClass(); _elemDesc = f.getName(); } else if (_annotElem instanceof Method) { Method m = (Method)_annotElem; _elemClass = m.getDeclaringClass(); _elemDesc = m.getName() + "(" + getMethodArgs(m) + ")"; } out.defaultWriteObject(); }
[ "private", "void", "writeObject", "(", "java", ".", "io", ".", "ObjectOutputStream", "out", ")", "throws", "IOException", "{", "//", "// When serializing, compute sufficient information about the annotated element to", "// allow it to be reassociated later in readObject", "//", "if", "(", "_annotElem", "instanceof", "Class", ")", "{", "_elemClass", "=", "(", "Class", ")", "_annotElem", ";", "_elemDesc", "=", "null", ";", "// non required", "}", "else", "if", "(", "_annotElem", "instanceof", "Field", ")", "{", "Field", "f", "=", "(", "Field", ")", "_annotElem", ";", "_elemClass", "=", "f", ".", "getDeclaringClass", "(", ")", ";", "_elemDesc", "=", "f", ".", "getName", "(", ")", ";", "}", "else", "if", "(", "_annotElem", "instanceof", "Method", ")", "{", "Method", "m", "=", "(", "Method", ")", "_annotElem", ";", "_elemClass", "=", "m", ".", "getDeclaringClass", "(", ")", ";", "_elemDesc", "=", "m", ".", "getName", "(", ")", "+", "\"(\"", "+", "getMethodArgs", "(", "m", ")", "+", "\")\"", ";", "}", "out", ".", "defaultWriteObject", "(", ")", ";", "}" ]
Overrides the standard Serialization writeObject method to compute and store the element information in a serializable form.
[ "Overrides", "the", "standard", "Serialization", "writeObject", "method", "to", "compute", "and", "store", "the", "element", "information", "in", "a", "serializable", "form", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java#L195-L220
146,390
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java
AnnotatedElementMap.readObject
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (_elemDesc == null) // element is a Class _annotElem = _elemClass; else { int argsIndex = _elemDesc.indexOf('('); if (argsIndex < 0) // element is a Field { try { _annotElem = _elemClass.getDeclaredField(_elemDesc); } catch (NoSuchFieldException nsfe) { throw new IOException("Unable to locate field " + nsfe); } } else // element is a method { String methodName = _elemDesc.substring(0, argsIndex); if (_elemDesc.charAt(argsIndex+1) == ')') { // At least handle the null args case quickly try { _annotElem = _elemClass.getDeclaredMethod(methodName, new Class [] {}); } catch (NoSuchMethodException nsme) { throw new IOException("Unable to locate method " +_elemDesc); } } else { // Linear search for the rest :( String methodArgs = _elemDesc.substring(argsIndex+1, _elemDesc.length()-1); Method [] methods = _elemClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().equals(methodName) && getMethodArgs(methods[i]).equals(methodArgs)) { _annotElem = methods[i]; break; } } if (_annotElem == null) { throw new IOException("Unable to locate method " + _elemDesc); } } } } }
java
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (_elemDesc == null) // element is a Class _annotElem = _elemClass; else { int argsIndex = _elemDesc.indexOf('('); if (argsIndex < 0) // element is a Field { try { _annotElem = _elemClass.getDeclaredField(_elemDesc); } catch (NoSuchFieldException nsfe) { throw new IOException("Unable to locate field " + nsfe); } } else // element is a method { String methodName = _elemDesc.substring(0, argsIndex); if (_elemDesc.charAt(argsIndex+1) == ')') { // At least handle the null args case quickly try { _annotElem = _elemClass.getDeclaredMethod(methodName, new Class [] {}); } catch (NoSuchMethodException nsme) { throw new IOException("Unable to locate method " +_elemDesc); } } else { // Linear search for the rest :( String methodArgs = _elemDesc.substring(argsIndex+1, _elemDesc.length()-1); Method [] methods = _elemClass.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().equals(methodName) && getMethodArgs(methods[i]).equals(methodArgs)) { _annotElem = methods[i]; break; } } if (_annotElem == null) { throw new IOException("Unable to locate method " + _elemDesc); } } } } }
[ "private", "void", "readObject", "(", "java", ".", "io", ".", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "in", ".", "defaultReadObject", "(", ")", ";", "if", "(", "_elemDesc", "==", "null", ")", "// element is a Class", "_annotElem", "=", "_elemClass", ";", "else", "{", "int", "argsIndex", "=", "_elemDesc", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "argsIndex", "<", "0", ")", "// element is a Field", "{", "try", "{", "_annotElem", "=", "_elemClass", ".", "getDeclaredField", "(", "_elemDesc", ")", ";", "}", "catch", "(", "NoSuchFieldException", "nsfe", ")", "{", "throw", "new", "IOException", "(", "\"Unable to locate field \"", "+", "nsfe", ")", ";", "}", "}", "else", "// element is a method", "{", "String", "methodName", "=", "_elemDesc", ".", "substring", "(", "0", ",", "argsIndex", ")", ";", "if", "(", "_elemDesc", ".", "charAt", "(", "argsIndex", "+", "1", ")", "==", "'", "'", ")", "{", "// At least handle the null args case quickly", "try", "{", "_annotElem", "=", "_elemClass", ".", "getDeclaredMethod", "(", "methodName", ",", "new", "Class", "[", "]", "{", "}", ")", ";", "}", "catch", "(", "NoSuchMethodException", "nsme", ")", "{", "throw", "new", "IOException", "(", "\"Unable to locate method \"", "+", "_elemDesc", ")", ";", "}", "}", "else", "{", "// Linear search for the rest :(", "String", "methodArgs", "=", "_elemDesc", ".", "substring", "(", "argsIndex", "+", "1", ",", "_elemDesc", ".", "length", "(", ")", "-", "1", ")", ";", "Method", "[", "]", "methods", "=", "_elemClass", ".", "getDeclaredMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methods", ".", "length", ";", "i", "++", ")", "{", "if", "(", "methods", "[", "i", "]", ".", "getName", "(", ")", ".", "equals", "(", "methodName", ")", "&&", "getMethodArgs", "(", "methods", "[", "i", "]", ")", ".", "equals", "(", "methodArgs", ")", ")", "{", "_annotElem", "=", "methods", "[", "i", "]", ";", "break", ";", "}", "}", "if", "(", "_annotElem", "==", "null", ")", "{", "throw", "new", "IOException", "(", "\"Unable to locate method \"", "+", "_elemDesc", ")", ";", "}", "}", "}", "}", "}" ]
Overrides the standard Serialization readObject implementation to reassociated with the target AnnotatedElement after deserialization.
[ "Overrides", "the", "standard", "Serialization", "readObject", "implementation", "to", "reassociated", "with", "the", "target", "AnnotatedElement", "after", "deserialization", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/properties/AnnotatedElementMap.java#L226-L284
146,391
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RewriteName.java
RewriteName.doStartTag
public int doStartTag() throws JspException { String realName = rewriteName(_name); if (_resultId != null) pageContext.setAttribute(_resultId, realName); // @TODO: Is there any way to make this work. Currently if // there is now script container, we will eat the <script> blocks // because we cannot write them out in the middle of the tag being // written IScriptReporter scriptReporter = getScriptReporter(); ScriptRequestState srs = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest()); if (TagConfig.isLegacyJavaScript()) { srs.mapLegacyTagId(scriptReporter, _name, realName); } write(realName); localRelease(); return SKIP_BODY; }
java
public int doStartTag() throws JspException { String realName = rewriteName(_name); if (_resultId != null) pageContext.setAttribute(_resultId, realName); // @TODO: Is there any way to make this work. Currently if // there is now script container, we will eat the <script> blocks // because we cannot write them out in the middle of the tag being // written IScriptReporter scriptReporter = getScriptReporter(); ScriptRequestState srs = ScriptRequestState.getScriptRequestState((HttpServletRequest) pageContext.getRequest()); if (TagConfig.isLegacyJavaScript()) { srs.mapLegacyTagId(scriptReporter, _name, realName); } write(realName); localRelease(); return SKIP_BODY; }
[ "public", "int", "doStartTag", "(", ")", "throws", "JspException", "{", "String", "realName", "=", "rewriteName", "(", "_name", ")", ";", "if", "(", "_resultId", "!=", "null", ")", "pageContext", ".", "setAttribute", "(", "_resultId", ",", "realName", ")", ";", "// @TODO: Is there any way to make this work. Currently if", "// there is now script container, we will eat the <script> blocks", "// because we cannot write them out in the middle of the tag being", "// written", "IScriptReporter", "scriptReporter", "=", "getScriptReporter", "(", ")", ";", "ScriptRequestState", "srs", "=", "ScriptRequestState", ".", "getScriptRequestState", "(", "(", "HttpServletRequest", ")", "pageContext", ".", "getRequest", "(", ")", ")", ";", "if", "(", "TagConfig", ".", "isLegacyJavaScript", "(", ")", ")", "{", "srs", ".", "mapLegacyTagId", "(", "scriptReporter", ",", "_name", ",", "realName", ")", ";", "}", "write", "(", "realName", ")", ";", "localRelease", "(", ")", ";", "return", "SKIP_BODY", ";", "}" ]
Pass the name attribute to the URLRewriter and output the returned value. Updates the HTML tag to output the mapping. @throws JspException if a JSP exception has occurred
[ "Pass", "the", "name", "attribute", "to", "the", "URLRewriter", "and", "output", "the", "returned", "value", ".", "Updates", "the", "HTML", "tag", "to", "output", "the", "mapping", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/RewriteName.java#L96-L114
146,392
matthewhorridge/owlapi-gwt
owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/IRI.java
IRI.isAbsolute
public boolean isAbsolute() { int colonIndex = namespace.indexOf(':'); if (colonIndex == -1) { return false; } for (int i = 0; i < colonIndex; i++) { char ch = namespace.charAt(i); if (!Character.isLetter(ch) && !Character.isDigit(ch) && ch != '.' && ch != '+' && ch != '-') { return false; } } return true; }
java
public boolean isAbsolute() { int colonIndex = namespace.indexOf(':'); if (colonIndex == -1) { return false; } for (int i = 0; i < colonIndex; i++) { char ch = namespace.charAt(i); if (!Character.isLetter(ch) && !Character.isDigit(ch) && ch != '.' && ch != '+' && ch != '-') { return false; } } return true; }
[ "public", "boolean", "isAbsolute", "(", ")", "{", "int", "colonIndex", "=", "namespace", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "colonIndex", "==", "-", "1", ")", "{", "return", "false", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "colonIndex", ";", "i", "++", ")", "{", "char", "ch", "=", "namespace", ".", "charAt", "(", "i", ")", ";", "if", "(", "!", "Character", ".", "isLetter", "(", "ch", ")", "&&", "!", "Character", ".", "isDigit", "(", "ch", ")", "&&", "ch", "!=", "'", "'", "&&", "ch", "!=", "'", "'", "&&", "ch", "!=", "'", "'", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}" ]
Determines if this IRI is absolute @return {@code true} if this IRI is absolute or {@code false} if this IRI is not absolute
[ "Determines", "if", "this", "IRI", "is", "absolute" ]
7ab975fb6cef3c8947099983551672a3b5d4e2fd
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-client-side-emul/src/main/java/org/semanticweb/owlapi/model/IRI.java#L43-L55
146,393
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XAbstractNestedAttributeSupport.java
XAbstractNestedAttributeSupport.extractValues
public Map<String, Type> extractValues(XAttributable element) { Map<String, Type> values = new HashMap<String, Type>(); Map<List<String>, Type> nestedValues = extractNestedValues(element); /* * Now copy top-level values. */ for (List<String> keys : nestedValues.keySet()) { if (keys.size() == 1) { /* * Is top-level value, as key list contains only a single key. * Copy it. */ values.put(keys.get(0), nestedValues.get(keys)); } } return values; }
java
public Map<String, Type> extractValues(XAttributable element) { Map<String, Type> values = new HashMap<String, Type>(); Map<List<String>, Type> nestedValues = extractNestedValues(element); /* * Now copy top-level values. */ for (List<String> keys : nestedValues.keySet()) { if (keys.size() == 1) { /* * Is top-level value, as key list contains only a single key. * Copy it. */ values.put(keys.get(0), nestedValues.get(keys)); } } return values; }
[ "public", "Map", "<", "String", ",", "Type", ">", "extractValues", "(", "XAttributable", "element", ")", "{", "Map", "<", "String", ",", "Type", ">", "values", "=", "new", "HashMap", "<", "String", ",", "Type", ">", "(", ")", ";", "Map", "<", "List", "<", "String", ">", ",", "Type", ">", "nestedValues", "=", "extractNestedValues", "(", "element", ")", ";", "/*\r\n\t\t * Now copy top-level values.\r\n\t\t */", "for", "(", "List", "<", "String", ">", "keys", ":", "nestedValues", ".", "keySet", "(", ")", ")", "{", "if", "(", "keys", ".", "size", "(", ")", "==", "1", ")", "{", "/*\r\n\t\t\t\t * Is top-level value, as key list contains only a single key.\r\n\t\t\t\t * Copy it.\r\n\t\t\t\t */", "values", ".", "put", "(", "keys", ".", "get", "(", "0", ")", ",", "nestedValues", ".", "get", "(", "keys", ")", ")", ";", "}", "}", "return", "values", ";", "}" ]
Retrieves a map containing all values for all child attributes of an element. For example, the XES fragment: <pre> {@code <trace> <string key="key.1" value=""> <float key="ext:attr" value="val.1"/> <string key="key.1.1" value=""> <float key="ext:attr" value="val.1.1"/> </string> <string key="key.1.2" value=""> <float key="ext:attr" value="val.1.2"/> </string> </string> <string key="key.2" value=""> <float key="ext:attr" value="val.2"/> </string> <string key="key.3" value=""> <float key="ext:attr" value="val.3"/> </string> </trace> } </pre> should result into the following: <pre> [[key.1 val.1] [key.2 val.2] [key.3 val.3]] </pre> @param element Element to retrieve all values for. @return Map from all child keys to values.
[ "Retrieves", "a", "map", "containing", "all", "values", "for", "all", "child", "attributes", "of", "an", "element", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XAbstractNestedAttributeSupport.java#L116-L132
146,394
iig-uni-freiburg/SEWOL
ext/org/deckfour/xes/extension/std/XAbstractNestedAttributeSupport.java
XAbstractNestedAttributeSupport.extractNestedValues
public Map<List<String>, Type> extractNestedValues(XAttributable element) { Map<List<String>, Type> nestedValues = new HashMap<List<String>, Type>(); for (XAttribute attr : element.getAttributes().values()) { List<String> keys = new ArrayList<String>(); keys.add(attr.getKey()); extractNestedValuesPrivate(attr, nestedValues, keys); } return nestedValues; }
java
public Map<List<String>, Type> extractNestedValues(XAttributable element) { Map<List<String>, Type> nestedValues = new HashMap<List<String>, Type>(); for (XAttribute attr : element.getAttributes().values()) { List<String> keys = new ArrayList<String>(); keys.add(attr.getKey()); extractNestedValuesPrivate(attr, nestedValues, keys); } return nestedValues; }
[ "public", "Map", "<", "List", "<", "String", ">", ",", "Type", ">", "extractNestedValues", "(", "XAttributable", "element", ")", "{", "Map", "<", "List", "<", "String", ">", ",", "Type", ">", "nestedValues", "=", "new", "HashMap", "<", "List", "<", "String", ">", ",", "Type", ">", "(", ")", ";", "for", "(", "XAttribute", "attr", ":", "element", ".", "getAttributes", "(", ")", ".", "values", "(", ")", ")", "{", "List", "<", "String", ">", "keys", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "keys", ".", "add", "(", "attr", ".", "getKey", "(", ")", ")", ";", "extractNestedValuesPrivate", "(", "attr", ",", "nestedValues", ",", "keys", ")", ";", "}", "return", "nestedValues", ";", "}" ]
Retrieves a map containing all values for all descending attributes of an element. For example, the XES fragment: <pre> {@code <trace> <string key="key.1" value=""> <float key="ext:attr" value="val.1"/> <string key="key.1.1" value=""> <float key="ext:attr" value="val.1.1"/> </string> <string key="key.1.2" value=""> <float key="ext:attr" value="val.1.2"/> </string> </string> <string key="key.2" value=""> <float key="ext:attr" value="val.2"/> </string> <string key="key.3" value=""> <float key="ext:attr" value="val.3"/> </string> </trace> } </pre> should result into the following: <pre> [[[key.1] val.1] [[key.1 key.1.1] val.1.1] [[key.1 key.1.2] val.1.2] [[key.2] val.2] [[key.3] val.3]] </pre> @param element Element to retrieve all values for. @return Map from all descending keys to values.
[ "Retrieves", "a", "map", "containing", "all", "values", "for", "all", "descending", "attributes", "of", "an", "element", "." ]
e791cb07a6e62ecf837d760d58a25f32fbf6bbca
https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XAbstractNestedAttributeSupport.java#L172-L180
146,395
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java
DefaultDataGridResourceProvider.formatMessage
public String formatMessage(String key, Object[] args) { String msg = internalFormatMessage(getMessage(key), args); return msg; }
java
public String formatMessage(String key, Object[] args) { String msg = internalFormatMessage(getMessage(key), args); return msg; }
[ "public", "String", "formatMessage", "(", "String", "key", ",", "Object", "[", "]", "args", ")", "{", "String", "msg", "=", "internalFormatMessage", "(", "getMessage", "(", "key", ")", ",", "args", ")", ";", "return", "msg", ";", "}" ]
Format a message associated with the given key and with the given message arguments. @param key the key @param args the formatting arguments @return the formatted message
[ "Format", "a", "message", "associated", "with", "the", "given", "key", "and", "with", "the", "given", "message", "arguments", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java#L75-L78
146,396
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java
DefaultDataGridResourceProvider.getDefaultMessage
private String getDefaultMessage(String key) { if(_defaultResourceBundle == null) _defaultResourceBundle = createResourceBundle(DEFAULT_RESOURCE_BUNDLE); return _defaultResourceBundle.getString(key); }
java
private String getDefaultMessage(String key) { if(_defaultResourceBundle == null) _defaultResourceBundle = createResourceBundle(DEFAULT_RESOURCE_BUNDLE); return _defaultResourceBundle.getString(key); }
[ "private", "String", "getDefaultMessage", "(", "String", "key", ")", "{", "if", "(", "_defaultResourceBundle", "==", "null", ")", "_defaultResourceBundle", "=", "createResourceBundle", "(", "DEFAULT_RESOURCE_BUNDLE", ")", ";", "return", "_defaultResourceBundle", ".", "getString", "(", "key", ")", ";", "}" ]
Get a message with the given key from the default message bundle. @param key the key @return the message
[ "Get", "a", "message", "with", "the", "given", "key", "from", "the", "default", "message", "bundle", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/config/DefaultDataGridResourceProvider.java#L114-L118
146,397
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java
DefaultObjectResultSetMapper.arrayFromResultSet
protected Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal) throws SQLException { ArrayList<Object> list = new ArrayList<Object>(); Class componentType = arrayClass.getComponentType(); RowMapper rowMapper = RowMapperFactory.getRowMapper(rs, componentType, cal); // a value of zero indicates that all rows from the resultset should be included. if (maxRows == 0) { maxRows = -1; } int numRows; boolean hasMoreRows = rs.next(); for (numRows = 0; numRows != maxRows && hasMoreRows; numRows++) { list.add(rowMapper.mapRowToReturnType()); hasMoreRows = rs.next(); } Object array = Array.newInstance(componentType, numRows); try { for (int i = 0; i < numRows; i++) { Array.set(array, i, list.get(i)); } } catch (IllegalArgumentException iae) { ResultSetMetaData md = rs.getMetaData(); // assuming no errors in resultSetObject() this can only happen // for single column result sets. throw new ControlException("The declared Java type for array " + componentType.getName() + "is incompatible with the SQL format of column " + md.getColumnName(1) + md.getColumnTypeName(1) + "which returns objects of type + " + list.get(0).getClass().getName()); } return array; }
java
protected Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal) throws SQLException { ArrayList<Object> list = new ArrayList<Object>(); Class componentType = arrayClass.getComponentType(); RowMapper rowMapper = RowMapperFactory.getRowMapper(rs, componentType, cal); // a value of zero indicates that all rows from the resultset should be included. if (maxRows == 0) { maxRows = -1; } int numRows; boolean hasMoreRows = rs.next(); for (numRows = 0; numRows != maxRows && hasMoreRows; numRows++) { list.add(rowMapper.mapRowToReturnType()); hasMoreRows = rs.next(); } Object array = Array.newInstance(componentType, numRows); try { for (int i = 0; i < numRows; i++) { Array.set(array, i, list.get(i)); } } catch (IllegalArgumentException iae) { ResultSetMetaData md = rs.getMetaData(); // assuming no errors in resultSetObject() this can only happen // for single column result sets. throw new ControlException("The declared Java type for array " + componentType.getName() + "is incompatible with the SQL format of column " + md.getColumnName(1) + md.getColumnTypeName(1) + "which returns objects of type + " + list.get(0).getClass().getName()); } return array; }
[ "protected", "Object", "arrayFromResultSet", "(", "ResultSet", "rs", ",", "int", "maxRows", ",", "Class", "arrayClass", ",", "Calendar", "cal", ")", "throws", "SQLException", "{", "ArrayList", "<", "Object", ">", "list", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "Class", "componentType", "=", "arrayClass", ".", "getComponentType", "(", ")", ";", "RowMapper", "rowMapper", "=", "RowMapperFactory", ".", "getRowMapper", "(", "rs", ",", "componentType", ",", "cal", ")", ";", "// a value of zero indicates that all rows from the resultset should be included.", "if", "(", "maxRows", "==", "0", ")", "{", "maxRows", "=", "-", "1", ";", "}", "int", "numRows", ";", "boolean", "hasMoreRows", "=", "rs", ".", "next", "(", ")", ";", "for", "(", "numRows", "=", "0", ";", "numRows", "!=", "maxRows", "&&", "hasMoreRows", ";", "numRows", "++", ")", "{", "list", ".", "add", "(", "rowMapper", ".", "mapRowToReturnType", "(", ")", ")", ";", "hasMoreRows", "=", "rs", ".", "next", "(", ")", ";", "}", "Object", "array", "=", "Array", ".", "newInstance", "(", "componentType", ",", "numRows", ")", ";", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numRows", ";", "i", "++", ")", "{", "Array", ".", "set", "(", "array", ",", "i", ",", "list", ".", "get", "(", "i", ")", ")", ";", "}", "}", "catch", "(", "IllegalArgumentException", "iae", ")", "{", "ResultSetMetaData", "md", "=", "rs", ".", "getMetaData", "(", ")", ";", "// assuming no errors in resultSetObject() this can only happen", "// for single column result sets.", "throw", "new", "ControlException", "(", "\"The declared Java type for array \"", "+", "componentType", ".", "getName", "(", ")", "+", "\"is incompatible with the SQL format of column \"", "+", "md", ".", "getColumnName", "(", "1", ")", "+", "md", ".", "getColumnTypeName", "(", "1", ")", "+", "\"which returns objects of type + \"", "+", "list", ".", "get", "(", "0", ")", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "return", "array", ";", "}" ]
Invoked when the return type of the method is an array type. @param rs ResultSet to process. @param maxRows The maximum size of array to create, a value of 0 indicates that the array size will be the same as the result set size (no limit). @param arrayClass The class of object contained within the array @param cal A calendar instance to use for date/time values @return An array of the specified class type @throws SQLException On error.
[ "Invoked", "when", "the", "return", "type", "of", "the", "method", "is", "an", "array", "type", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/DefaultObjectResultSetMapper.java#L88-L122
146,398
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Button.java
Button.addParameter
public void addParameter(String name, Object value, String facet) throws JspException { assert(name != null) : "Parameter 'name' must not be null"; if (_params == null) { _params = new HashMap(); } ParamHelper.addParam(_params, name, value); }
java
public void addParameter(String name, Object value, String facet) throws JspException { assert(name != null) : "Parameter 'name' must not be null"; if (_params == null) { _params = new HashMap(); } ParamHelper.addParam(_params, name, value); }
[ "public", "void", "addParameter", "(", "String", "name", ",", "Object", "value", ",", "String", "facet", ")", "throws", "JspException", "{", "assert", "(", "name", "!=", "null", ")", ":", "\"Parameter 'name' must not be null\"", ";", "if", "(", "_params", "==", "null", ")", "{", "_params", "=", "new", "HashMap", "(", ")", ";", "}", "ParamHelper", ".", "addParam", "(", "_params", ",", "name", ",", "value", ")", ";", "}" ]
Adds a URL parameter to the generated hyperlink. @param name the name of the parameter to be added. @param value the value of the parameter to be added (a String or String[]). @param facet
[ "Adds", "a", "URL", "parameter", "to", "the", "generated", "hyperlink", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Button.java#L281-L290
146,399
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java
ImageAnchorCell.setAlt
public void setAlt(String alt) { _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALT, alt); }
java
public void setAlt(String alt) { _imageState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.ALT, alt); }
[ "public", "void", "setAlt", "(", "String", "alt", ")", "{", "_imageState", ".", "registerAttribute", "(", "AbstractHtmlState", ".", "ATTR_GENERAL", ",", "HtmlConstants", ".", "ALT", ",", "alt", ")", ";", "}" ]
Sets the alt text attribute for the HTML image tag. @param alt the alt attribute. @jsptagref.attributedescription The alternative text of the HTML image tag. @jsptagref.attributesyntaxvalue <i>string_alt</i> @netui:attribute required="false" rtexprvalue="true" description="The alternative text of the HTML image tag."
[ "Sets", "the", "alt", "text", "attribute", "for", "the", "HTML", "image", "tag", "." ]
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/ImageAnchorCell.java#L427-L429