protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { List<ElementValuePair> evps = ((AnnotationElementValue) value) .getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
AnnotationEntry(final DataInput input, final ConstantPool constant_pool) throws IOException { this.constant_pool = constant_pool; type_index = input.readUnsignedShort(); final int num_element_value_pairs = input.readUnsignedShort(); element_value_pairs = new ArrayList<>(num_element_value_pairs); for (int i = 0; i < num_element_value_pairs; i++) { element_value_pairs.add(new ElementValuePair(input, constant_pool)); } }
public void dump(DataOutputStream dos) throws IOException { dos.writeShort(type_index); // u2 index of type name in cpool dos.writeShort(element_value_pairs.size()); // u2 element_value pair // count for (int i = 0; i < element_value_pairs.size(); i++) { final ElementValuePair envp = element_value_pairs.get(i); envp.dump(dos); } } }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { List<ElementValuePair> evps = ((AnnotationElementValue) value) .getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
public void dump(DataOutputStream dos) throws IOException { dos.writeShort(type_index); // u2 index of type name in cpool dos.writeShort(element_value_pairs.size()); // u2 element_value pair count for (int i = 0 ; i<element_value_pairs.size();i++) { ElementValuePair envp = element_value_pairs.get(i); envp.dump(dos); } }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
public void dump(DataOutputStream dos) throws IOException { dos.writeShort(type_index); // u2 index of type name in cpool dos.writeShort(element_value_pairs.size()); // u2 element_value pair // count for (int i = 0; i < element_value_pairs.size(); i++) { final ElementValuePair envp = element_value_pairs.get(i); envp.dump(dos); } } }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<String,String>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<String,String>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<String,String>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<String,String>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
protected Map<String,String> processAnnotationWebInitParams( ElementValue ev) { Map<String, String> result = new HashMap<String,String>(); if (ev instanceof ArrayElementValue) { ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray(); for (ElementValue value : arrayValues) { if (value instanceof AnnotationElementValue) { ElementValuePair[] evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs(); String initParamName = null; String initParamValue = null; for (ElementValuePair evp : evps) { if ("name".equals(evp.getNameString())) { initParamName = evp.getValue().stringifyValue(); } else if ("value".equals(evp.getNameString())) { initParamValue = evp.getValue().stringifyValue(); } else { // Ignore } } result.put(initParamName, initParamValue); } } } return result; }
@Override protected void processAnnotationWebServlet(final String className, final AnnotationEntry ae, final WebXml fragment) { try { super.processAnnotationWebServlet(className, ae, fragment); } catch (final IllegalArgumentException iae) { // otherwise TCKs are not passing, hope to be able to let it with next TCK versions String[] urlPatterns = null; for (final ElementValuePair evp : ae.getElementValuePairs()) { final String name = evp.getNameString(); if ("value".equals(name) || "urlPatterns".equals(name)) { urlPatterns = processAnnotationsStringArray(evp.getValue()); break; } } if (urlPatterns != null) { for (final String pattern : urlPatterns) { if (fragment.getServletMappings().containsKey(pattern)) { logger.warning(iae.getMessage(), iae); return; } } } throw iae; } }
String name = evp.getNameString(); if ("name".equals(name)) { servletName = evp.getValue().stringifyValue(); break; String name = evp.getNameString(); if ("value".equals(name) || "urlPatterns".equals(name)) { if (urlPatternsSet) { urlPatterns = processAnnotationsStringArray(evp.getValue()); } else if ("description".equals(name)) { if (servletDef.getDescription() == null) { servletDef.setDescription(evp.getValue().stringifyValue()); servletDef.setDisplayName(evp.getValue().stringifyValue()); servletDef.setLargeIcon(evp.getValue().stringifyValue()); servletDef.setSmallIcon(evp.getValue().stringifyValue()); servletDef.setAsyncSupported(evp.getValue() .stringifyValue()); if (servletDef.getLoadOnStartup() == null) { servletDef .setLoadOnStartup(evp.getValue().stringifyValue()); .getValue()); if (isWebXMLservletDef) {
String name = evp.getNameString(); if ("name".equals(name)) { servletName = evp.getValue().stringifyValue(); break; String name = evp.getNameString(); if ("value".equals(name) || "urlPatterns".equals(name)) { if (urlPatternsSet) { urlPatterns = processAnnotationsStringArray(evp.getValue()); } else if ("description".equals(name)) { if (servletDef.getDescription() == null) { servletDef.setDescription(evp.getValue().stringifyValue()); servletDef.setDisplayName(evp.getValue().stringifyValue()); servletDef.setLargeIcon(evp.getValue().stringifyValue()); servletDef.setSmallIcon(evp.getValue().stringifyValue()); servletDef.setAsyncSupported(evp.getValue() .stringifyValue()); if (servletDef.getLoadOnStartup() == null) { servletDef .setLoadOnStartup(evp.getValue().stringifyValue()); .getValue()); if (isWebXMLservletDef) {
String name = evp.getNameString(); if ("name".equals(name)) { servletName = evp.getValue().stringifyValue(); break; String name = evp.getNameString(); if ("value".equals(name) || "urlPatterns".equals(name)) { if (urlPatternsSet) { urlPatterns = processAnnotationsStringArray(evp.getValue()); } else if ("description".equals(name)) { if (servletDef.getDescription() == null) { servletDef.setDescription(evp.getValue().stringifyValue()); servletDef.setDisplayName(evp.getValue().stringifyValue()); servletDef.setLargeIcon(evp.getValue().stringifyValue()); servletDef.setSmallIcon(evp.getValue().stringifyValue()); servletDef.setAsyncSupported(evp.getValue() .stringifyValue()); if (servletDef.getLoadOnStartup() == null) { servletDef .setLoadOnStartup(evp.getValue().stringifyValue()); .getValue()); if (isWebXMLservletDef) {