bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
3,231,317
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
3,231,318
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
public ISourcePosition getPosition(ISourcePosition startPosition, boolean inclusive) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
3,231,319
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
3,231,320
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("resources/graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
3,231,321
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("resources/graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("resources/graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
3,231,322
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("resources/graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("resources/graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
3,231,323
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("resources/graphx/server_connect16.png", "Server connected."); }
3,231,324
public TimedReloadContext(CacheReloadContext reloadContext,long checkInterval) { super(); this.reloadContext = reloadContext; this.checkInterval = checkInterval; this.nextCheck = now + checkInterval; }
public TimedReloadContext(CacheReloadContext reloadContext,long checkInterval) { super(); this.reloadContext = reloadContext; this.checkInterval = checkInterval; this.nextCheck = Clock.TIME + checkInterval; }
3,231,325
public boolean shouldReload() { //long time = System.currentTimeMillis(); if (now >= nextCheck) { nextCheck = now + checkInterval; return reloadContext.shouldReload(); } else { return false; } }
public boolean shouldReload() { //long time = System.currentTimeMillis(); if (now >= nextCheck) { nextCheck = now + checkInterval; return reloadContext.shouldReload(); } else { return false; } }
3,231,326
public ZlibInflate(IRubyObject caller) { super(); flater = new Inflater(); collected = new StringBuffer(); runtime = caller.getRuntime(); }
public ZlibInflate(IRubyObject caller) { super(); flater = new Inflater(true); collected = new StringBuffer(); runtime = caller.getRuntime(); }
3,231,327
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); System.err.println("[BUG] Not supported yet."); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[BUG] Jarfile not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); ruby.getInterpreter().load((RubyString)arg1, false); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[BUG] Jarfile not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
3,231,329
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); System.err.println("[BUG] Not supported yet."); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[BUG] Jarfile not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); System.err.println("[BUG] Not supported yet."); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[Error] Jarfile + \"" + jarFile.getAbsolutePath() + "\"not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
3,231,330
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
3,231,331
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
3,231,332
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
3,231,334
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
3,231,335
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; if (gridModel == null) return; gridModel.drawAxes(g2); if (slider != null) { gridModel.drawSliderGuides(g2,slider.getLeftXCoord(), slider.getRightXCoord()); } drawExecutions(g2); if (currentExecution != null && pressSelected == false) { currentExecution.drawExecutionTip(g2,xLoc,yLoc); } if (currentHash != null) currentHash.drawHashTip(g2,xLoc,yLoc); if (currentRowDecoration != null) currentRowDecoration.drawFull(g2); }
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; if (gridModel == null) return; gridModel.drawAxes(g2); if (slider != null) { gridModel.drawSliderGuides(g2,slider.getLeftXCoord(), slider.getRightXCoord()); } drawExecutions(g2); if (currentExecution != null && pressSelected == false) { currentExecution.drawExecutionTip(g2,xLoc,yLoc); } if (currentHash != null) currentHash.drawHashTip(g2,xLoc,yLoc); if (currentRowDecoration != null) currentRowDecoration.drawFull(g2); }
3,231,336
public static IRubyObject new_array(IRubyObject recv, IRubyObject object) { ICallable method = recv.getMetaClass().searchMethod("to_a"); if (method.getImplementationClass() == recv.getRuntime().getKernel()) { return recv.getRuntime().newArray(recv); } return object.callMethod("to_a"); }
public static IRubyObject new_array(IRubyObject recv, IRubyObject object) { ICallable method = recv.getMetaClass().searchMethod("to_a"); if (method.getImplementationClass() == recv.getRuntime().getKernel()) { return recv.getRuntime().newArray(recv); } return object.callMethod("to_a"); }
3,231,337
public void setEndCoords(float x,float y) { if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); setPoint(pointCount,new Point2D.Float(x,y)); setLine(); }
public void setEndCoords(float x,float y) { if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); setPoint(pointCount,new Point2D.Float(x,y)); setLine(); }
3,231,338
public void setPoint(int index,Point2D pt) { if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); if (points.size() <= index) { points.add(index,pt); } else points.set(index,pt); updateBounds(); }
public void setPoint(int index,Point2D pt) { if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); if (points.size() <= index) { points.add(index,pt); } else points.set(index,pt); updateBounds(); }
3,231,339
public RubyBlock cloneBlock() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby); }
public RubyBlock cloneBlock() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby); }
3,231,340
public RubyBlock getTmp() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); }
public RubyBlock getTmp() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); }
3,231,341
public void pop() { if (prev == null) { System.err.println("[BUG] Try to pop block from empty stack."); return; } this.var = prev.var; this.body = prev.body; this.self = prev.self; this.frame = prev.frame; this.scope = prev.scope; this.klass = prev.klass; this.iter = prev.iter; this.vmode = prev.vmode; this.flags = prev.flags; this.dynamicVars = prev.dynamicVars; this.origThread = prev.origThread; this.prev = prev.prev; }
public void pop() { if (prev == null) { System.err.println("[BUG] Try to pop block from empty stack."); return; } this.var = prev.var; this.body = prev.body; this.self = prev.self; this.frame = prev.frame; this.scope = prev.scope; this.klass = prev.klass; this.iter = prev.iter; this.vmode = prev.vmode; this.flags = prev.flags; this.dynamicVars = prev.dynamicVars; this.origThread = prev.origThread; this.prev = prev.prev; }
3,231,342
public void push(Node v, Node b, RubyObject newSelf) { RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); var = v; body = b; self = newSelf; frame = ruby.getRubyFrame(); klass = ruby.getRubyClass(); frame.setFile(ruby.getSourceFile()); frame.setLine(ruby.getSourceLine()); scope = ruby.getRubyScope(); prev = oldBlock; iter = ruby.getIter().getIter(); vmode = ruby.getActMethodScope(); flags = BLOCK_D_SCOPE; dynamicVars = ruby.getDynamicVars(); }
public void push(Node v, Node b, RubyObject newSelf) { RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); var = v; body = b; self = newSelf; frame = ruby.getRubyFrame(); klass = ruby.getRubyClass(); frame.setFile(ruby.getSourceFile()); frame.setLine(ruby.getSourceLine()); scope = ruby.getRubyScope(); prev = oldBlock; iter = ruby.getIter().getIter(); vmode = ruby.getActMethodScope(); flags = BLOCK_D_SCOPE; dynamicVars = ruby.getDynamicVars(); }
3,231,343
Accessor (String name) { _name = name; }
Accessor (String name) { _name = name; }
3,231,344
Object get (Object instance) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
Object get (Object instance) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
3,231,345
final String getName () { return _name; }
final String getName () { return _name; }
3,231,346
boolean set (Object instance, Object value) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
boolean set (Object instance, Object value) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
3,231,347
public final String toString () { return "Accessor:" + _name; }
public final String toString () { return "Accessor:" + _name; }
3,231,348
BinaryMethodAccessor (String name, Method m, Class[] params) throws PropertyException { super(name, m, params); }
BinaryMethodAccessor (String name, Method m, Class[] params) throws PropertyException { super(name, m, params); }
3,231,349
final Object get (final Object instance, String prop) throws PropertyException, NoSuchMethodException { Object[] args = {prop}; return PropertyOperator.invoke(_getMethod, instance, args); }
final Object get (final Object instance, String prop) throws PropertyException, NoSuchMethodException { Object[] args = {prop}; return PropertyOperator.invoke(_getMethod, instance, args); }
3,231,350
final int numArgsGet () { return 1; }
final int numArgsGet () { return 1; }
3,231,351
final int numArgsSet () { return 2; }
final int numArgsSet () { return 2; }
3,231,352
final boolean set (final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { Object[] args = {prop, value}; return setImpl(instance, args); }
final boolean set (final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { Object[] args = {prop, value}; return setImpl(instance, args); }
3,231,353
DirectAccessor (final String name, final Method m, final Class[] params) { super(name); addMethod(m, params); }
DirectAccessor (final String name, final Method m, final Class[] params) { super(name); addMethod(m, params); }
3,231,354
final void addMethod (final Method m, Class[] params) { _methods.addElement(m); }
final void addMethod (final Method m, Class[] params) { _methods.addElement(m); }
3,231,355
final Object get (Object instance, Object[] args) throws PropertyException, NoSuchMethodException { Class[] types = new Class[args.length]; for (int i = 0; i < args.length; i++) { try { types[i] = args[i].getClass(); } catch (NullPointerException e) { types[i] = null; } } for (int i = 0; i < _methods.size(); i++) { Method m = (Method) _methods.elementAt(i); Class[] sig = m.getParameterTypes(); if (IntrospectionUtils.matches(sig, types)) { return PropertyOperator.invoke(m, instance, args); } } // not found StringBuffer arglist = new StringBuffer(); Method m = (Method) _methods.firstElement(); for (int i = 0; i < args.length; i++) { if (i > 0) { arglist.append(", "); } arglist.append((args[i] == null) ? "null" : args[i].getClass().getName()); } throw new PropertyException .NoSuchMethodWithArgumentsException(getName(), m.getDeclaringClass().getName(), arglist.toString()); }
final Object get (Object instance, Object[] args) throws PropertyException, NoSuchMethodException { Class[] types = new Class[args.length]; for (int i = 0; i < args.length; i++) { try { types[i] = args[i].getClass(); } catch (NullPointerException e) { types[i] = null; } } for (int i = 0; i < _methods.size(); i++) { Method m = (Method) _methods.elementAt(i); Class[] sig = m.getParameterTypes(); if (IntrospectionUtils.matches(sig, types)) { return PropertyOperator.invoke(m, instance, args); } } // not found StringBuffer arglist = new StringBuffer(); Method m = (Method) _methods.firstElement(); for (int i = 0; i < args.length; i++) { if (i > 0) { arglist.append(", "); } arglist.append((args[i] == null) ? "null" : args[i].getClass().getName()); } throw new PropertyException .NoSuchMethodWithArgumentsException(getName(), m.getDeclaringClass().getName(), arglist.toString()); }
3,231,356
FieldAccessor (final Field f) { super(f.getName()); _field = f; }
FieldAccessor (final Field f) { super(f.getName()); _field = f; }
3,231,357
final Object get (final Object instance) throws PropertyException { try { return _field.get(instance); } catch (Exception e) { throw new PropertyException("Unable to read field " + _field + " on object " + instance + " of " + instance.getClass(), e); } }
final Object get (final Object instance) throws PropertyException { try { return _field.get(instance); } catch (Exception e) { throw new PropertyException("Unable to read field " + _field + " on object " + instance + " of " + instance.getClass(), e); } }
3,231,358
final boolean set (final Object instance, final Object value) throws PropertyException { try { _field.set(instance, value); } catch (Exception e) { throw new PropertyException("Unable to write field " + _field + " on object " + instance + " of " + instance.getClass(), e); } return true; }
final boolean set (final Object instance, final Object value) throws PropertyException { try { _field.set(instance, value); } catch (Exception e) { throw new PropertyException("Unable to write field " + _field + " on object " + instance + " of " + instance.getClass(), e); } return true; }
3,231,359
LengthAccessor () { super("length"); }
LengthAccessor () { super("length"); }
3,231,360
final Object get (final Object instance) throws PropertyException { try { return new Integer(java.lang.reflect.Array.getLength(instance)); } catch (Exception e) { throw new PropertyException("Unable to fetch length of object " + instance + " of " + instance.getClass(), e); } }
final Object get (final Object instance) throws PropertyException { try { return new Integer(java.lang.reflect.Array.getLength(instance)); } catch (Exception e) { throw new PropertyException("Unable to fetch length of object " + instance + " of " + instance.getClass(), e); } }
3,231,361
final boolean set (final Object instance, final Object value) throws PropertyException { throw new PropertyException("Cannot set length of array"); }
final boolean set (final Object instance, final Object value) throws PropertyException { throw new PropertyException("Cannot set length of array"); }
3,231,362
MethodAccessor (final String name, final Method m, final Class[] params) throws PropertyException { super(name); addMethod(m, params); }
MethodAccessor (final String name, final Method m, final Class[] params) throws PropertyException { super(name); addMethod(m, params); }
3,231,363
final void addMethod (final Method m, Class[] params) throws PropertyException { final int setArgsLength = numArgsSet(); final int getArgsLength = numArgsGet(); if (params.length == getArgsLength) { _getMethod = m; } else if (params.length == setArgsLength) { setCount++; if (_setMethods == null) { _setMethods = new Method[1]; _setParams = new Class[1]; _setPrimitiveType = new Class[1]; } else if (_setMethods.length <= setCount) { Method[] tmpMethods = new Method[(setCount + 1) * 2]; Class[] tmpParams = new Class[(setCount + 1) * 2]; Class[] tmpPrimitive = new Class[(setCount + 1) * 2]; System.arraycopy(_setMethods, 0, tmpMethods, 0, _setMethods.length); System.arraycopy(_setParams, 0, tmpParams, 0, _setParams.length); System.arraycopy(_setPrimitiveType, 0, tmpPrimitive, 0, _setParams.length); _setMethods = tmpMethods; _setParams = tmpParams; _setPrimitiveType = tmpPrimitive; } // record the method, and the type of the variable parameter _setMethods[setCount - 1] = m; _setParams[setCount - 1] = params[setArgsLength - 1]; if (_setParams[setCount - 1].isPrimitive()) _setPrimitiveType[setCount - 1] = getWrapperClass(_setParams[setCount - 1]); } else { throw new PropertyException("PropertyOperator FAILED for method " + m + "--please report this bug!"); } }
final void addMethod (final Method m, Class[] params) throws PropertyException { final int setArgsLength = numArgsSet(); final int getArgsLength = numArgsGet(); if (params.length == getArgsLength) { _getMethod = m; } else if (params.length == setArgsLength) { setCount++; if (_setMethods == null) { _setMethods = new Method[1]; _setParams = new Class[1]; _setPrimitiveType = new Class[1]; } else if (_setMethods.length <= setCount) { Method[] tmpMethods = new Method[(setCount + 1) * 2]; Class[] tmpParams = new Class[(setCount + 1) * 2]; Class[] tmpPrimitive = new Class[(setCount + 1) * 2]; System.arraycopy(_setMethods, 0, tmpMethods, 0, _setMethods.length); System.arraycopy(_setParams, 0, tmpParams, 0, _setParams.length); System.arraycopy(_setPrimitiveType, 0, tmpPrimitive, 0, _setParams.length); _setMethods = tmpMethods; _setParams = tmpParams; _setPrimitiveType = tmpPrimitive; } // record the method, and the type of the variable parameter _setMethods[setCount - 1] = m; _setParams[setCount - 1] = params[setArgsLength - 1]; if (_setParams[setCount - 1].isPrimitive()) _setPrimitiveType[setCount - 1] = getWrapperClass(_setParams[setCount - 1]); } else { throw new PropertyException("PropertyOperator FAILED for method " + m + "--please report this bug!"); } }
3,231,364
private Class getWrapperClass (Class s) { if (s == Integer.TYPE) return Integer.class; else if (s == Boolean.TYPE) return Boolean.class; else if (s == Character.TYPE) return Character.class; else if (s == Long.TYPE) return Long.class; else if (s == Short.TYPE) return Short.class; else if (s == Double.TYPE) return Double.class; else if (s == Float.TYPE) return Float.class; else if (s == Void.TYPE) return Void.class; else if (s == Byte.TYPE) return Byte.class; else return null; }
private Class getWrapperClass (Class s) { if (s == Integer.TYPE) return Integer.class; else if (s == Boolean.TYPE) return Boolean.class; else if (s == Character.TYPE) return Character.class; else if (s == Long.TYPE) return Long.class; else if (s == Short.TYPE) return Short.class; else if (s == Double.TYPE) return Double.class; else if (s == Float.TYPE) return Float.class; else if (s == Void.TYPE) return Void.class; else if (s == Byte.TYPE) return Byte.class; else return null; }
3,231,365
abstract int numArgsGet ();
abstract int numArgsGet ();
3,231,366
abstract int numArgsSet ();
abstract int numArgsSet ();
3,231,367
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
3,231,368
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
3,231,369
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
3,231,370
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,371
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,372
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,373
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,374
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,375
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,376
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,377
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,378
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,379
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,380
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
3,231,381
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
3,231,382
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
3,231,383
private static final String fillInName (Object[] names, int end) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < end; x++) { if (x > 0) sb.append("."); sb.append(names[x]); } return sb.toString(); }
private static final String fillInName (Object[] names, int end) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < end; x++) { if (x > 0) sb.append("."); sb.append(names[x]); } return sb.toString(); }
3,231,384
public Iterator findIterator (Object instance) throws PropertyException { if (iteratorMethod != null) { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } throw new PropertyException((instance == null ? "null" : instance.getClass().getName()) + " is not a list"); }
public Iterator findIterator (Object instance) throws PropertyException { if (iteratorMethod != null) { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } throw new PropertyException((instance == null ? "null" : instance.getClass().getName()) + " is not a list"); }
3,231,385
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
3,231,386
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
3,231,387
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
3,231,388
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
3,231,389
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(v1.elementAt(i)); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
3,231,390
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
3,231,391
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,392
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,393
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,394
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,395
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,396
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,397
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,398
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,399
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } } else { acc = null; } } if (acc == null) { acc = _hashAccessor; try { if (acc != null) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,400
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen nextPropValue = acc.get(instance, propName); start++; } } else { return nextPropValue; } }
3,231,401
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,231,402
static Object invoke (Method meth, Object instance, Object[] args) throws PropertyException { try { Object obj = meth.invoke(instance, args); // if the method's return type is void return the VoidMacro // instance, instead of the 'null' we used to return here // otherwise, just return whatever the method returned if (obj == null && meth.getReturnType() == java.lang.Void.TYPE) return org.webmacro.engine.VoidMacro.instance; else return obj; } catch (IllegalAccessException e) { throw new PropertyException( "You don't have permission to access the requested method (" + meth + " in class " + instance.getClass() + " on object " + instance + "). Private/protected/package access " + " values cannot be accessed via property introspection.", e); } catch (IllegalArgumentException e) { throw new PropertyException( "Some kind of error occurred processing your request: this " + "indicates a failure in PropertyOperator.java that should be " + "reported: attempt to access method " + meth + " on object " + instance + " with " + args.length + " parameters " + " threw an exception: " + e, e); } catch (InvocationTargetException e) { // if this is a wrapped UndefinedVariableException, unwrap and rethrow it if (e.getTargetException() instanceof PropertyException.UndefinedVariableException) throw (PropertyException) e.getTargetException(); throw new PropertyException( "Attempt to invoke method " + meth + " on object " + instance.getClass().getName() + " raised an exception: " + e.getTargetException().getClass().getName(), e.getTargetException()); } catch (NullPointerException e) { throw new PropertyException( "NullPointerException thrown from method " + meth + " on object " + instance + " -- most likely you have attempted " + "to use an undefined value, or a failure in that method.", e); } }
static Object invoke (Method meth, Object instance, Object[] args) throws PropertyException { try { Object obj = meth.invoke(instance, args); // if the method's return type is void return the VoidMacro // instance, instead of the 'null' we used to return here // otherwise, just return whatever the method returned if (obj == null && meth.getReturnType() == java.lang.Void.TYPE) return org.webmacro.engine.VoidMacro.instance; else return obj; } catch (IllegalAccessException e) { throw new PropertyException( "You don't have permission to access the requested method (" + meth + " in class " + instance.getClass() + " on object " + instance + "). Private/protected/package access " + " values cannot be accessed via property introspection.", e); } catch (IllegalArgumentException e) { throw new PropertyException( "Some kind of error occurred processing your request: this " + "indicates a failure in PropertyOperator.java that should be " + "reported: attempt to access method " + meth + " on object " + instance + " with " + args.length + " parameters " + " threw an exception: " + e, e); } catch (InvocationTargetException e) { // if this is a wrapped UndefinedVariableException, unwrap and rethrow it if (e.getTargetException() instanceof PropertyException.UndefinedVariableException) throw (PropertyException) e.getTargetException(); throw new PropertyException( "Attempt to invoke method " + meth + " on object " + instance.getClass().getName() + " raised an exception: " + e.getTargetException().getClass().getName(), e.getTargetException()); } catch (NullPointerException e) { throw new PropertyException( "NullPointerException thrown from method " + meth + " on object " + instance + " -- most likely you have attempted " + "to use an undefined value, or a failure in that method.", e); } }
3,231,403
boolean isMethodAllowed (Method m) { Class c = m.getDeclaringClass(); Map restrictedClasses = _cache.getRestrictedClassMap(); if (restrictedClasses.containsKey(c)) { // this class is restricted, check if method is allowed List okMeths = (List) restrictedClasses.get(c); return (okMeths != null && okMeths.contains(m.getName())); } return true; }
boolean isMethodAllowed (Method m) { Class c = m.getDeclaringClass(); Map restrictedClasses = _cache.getRestrictedClassMap(); if (restrictedClasses.containsKey(c)) { // this class is restricted, check if method is allowed List okMeths = (List) restrictedClasses.get(c); return (okMeths != null && okMeths.contains(m.getName())); } return true; }
3,231,404
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
3,231,405
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
3,231,406
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
boolean isMethodRestricted (Class c, String name) { // check if object is restricted Map restrictedClassMap = _cache.getRestrictedClassMap(); if (!restrictedClassMap.containsKey(c)) { return false; // there are no restrictions on this class } else { // restricted class, check method Method[] meths = c.getMethods(); for (int i = 0; i < meths.length; i++) { if (meths[i].getName().equals(name)) { // check if method is explicitly allowed List l = (List) restrictedClassMap.get(c); if (l != null) return !l.contains(name); } } } return false; }
3,231,407
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
3,231,408
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
3,231,409
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
private int precedes (Class[] lhs, Class[] rhs) { if (lhs.length == rhs.length) { for (int i = 0; i < lhs.length; i++) { if (!rhs[i].equals(lhs[i])) { if (lhs[i].isAssignableFrom(rhs[i])) { // rhs is more specific than lhs return 1; } if (rhs[i].isAssignableFrom(lhs[i])) { // lhs is more specific than rhs return -1; } // not related by inheritance, put lhs later on return 1; } } return 0; // all the same } else { return (lhs.length < rhs.length) ? -1 : 1; } }
3,231,410
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
3,231,411
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
3,231,412
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
return false; return false; return false; return false; publicreturn false; booleanreturn false; setPropertyreturn false; (Contextreturn false; context,return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Objectreturn false; instance,return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Object[]return false; names,return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Objectreturn false; value,return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; intreturn false; pos)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; throwsreturn false; PropertyException,return false; NoSuchMethodExceptionreturn false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; //return false; names[pos]return false; isreturn false; whatreturn false; wereturn false; couldreturn false; setreturn false; fromreturn false; herereturn false; return false; return false; return false; return false; return false; return false; return false; intreturn false; binPosreturn false; =return false; names.lengthreturn false; -return false; 2;return false; return false; return false; return false; return false; return false; return false; return false; //return false; ifreturn false; we'rereturn false; notreturn false; yetreturn false; atreturn false; thereturn false; binary-settablereturn false; parent,return false; goreturn false; therereturn false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (posreturn false; <return false; binPos)return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Objectreturn false; grandparentreturn false; =return false; getProperty(context,return false; instance,return false; names,return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; pos,return false; binPosreturn false; -return false; 1);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; PropertyOperatorreturn false; poreturn false; =return false; _cache.getOperator(grandparent);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; po.setProperty(context,return false; grandparent,return false; names,return false; value,return false; binPos);return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; //return false; ifreturn false; we'rereturn false; atreturn false; thereturn false; binary-settablereturn false; parent,return false; tryreturn false; directreturn false; firstreturn false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (posreturn false; ==return false; binPos)return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; tryreturn false; directreturn false; --return false; movereturn false; toreturn false; directreturn false; parentreturn false; andreturn false; tryreturn false; fromreturn false; therereturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Objectreturn false; parentreturn false; =return false; null;return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; tryreturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; parentreturn false; =return false; getProperty(context,return false; instance,return false; names,return false; pos,return false; pos);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (parentreturn false; !=return false; null)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; PropertyOperatorreturn false; poreturn false; =return false; _cache.getOperator(parent);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (po.setProperty(context,return false; parent,return false; names,return false; value,return false; posreturn false; +return false; 1))return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; true;return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; catchreturn false; (NoSuchMethodExceptionreturn false; e)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; ohreturn false; well,return false; keepreturn false; trying:return false; XXXreturn false; thisreturn false; makesreturn false; binOpreturn false; expensivereturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; ifreturn false; directreturn false; failed,return false; tryreturn false; binaryreturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; Accessorreturn false; binOpreturn false; =return false; (Accessor)return false; _binaryAccessors.get(names[pos]);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (binOpreturn false; !=return false; null)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; tryreturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; binOp.set(instance,return false; (String)return false; names[posreturn false; +return false; 1],return false; value);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; catchreturn false; (ClassCastExceptionreturn false; e)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; names[pos+1]return false; wasreturn false; notreturn false; areturn false; string,return false; justreturn false; movereturn false; onreturn false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; false;return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; catchreturn false; (NoSuchMethodExceptionreturn false; e)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; false;return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; false;return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; //return false; we'rereturn false; thereturn false; directreturn false; parent,return false; usereturn false; unaryOpreturn false; orreturn false; hashreturn false; methodreturn false; return false; return false; return false; return false; return false; return false; return false; Accessorreturn false; unaryOpreturn false; =return false; (Accessor)return false; _unaryAccessors.get(names[pos]);return false; return false; return false; return false; return false; return false; return false; return false; tryreturn false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; ((unaryOpreturn false; !=return false; null)return false; &&return false; unaryOp.set(instance,return false; value))return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; true;return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; ifreturn false; (_hashAccessorreturn false; !=return false; null)return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; _hashAccessor.set(instance,return false; (String)return false; names[pos],return false; value);return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; catchreturn false; (NoSuchMethodExceptionreturn false; e)return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; fallreturn false; throughreturn false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; catchreturn false; (ClassCastExceptionreturn false; e)return false; return false; return false; return false; return false; return false; return false; return false; {return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; return false; //return false; names[pos]return false; wasreturn false; notreturn false; areturn false; string,return false; fallreturn false; throughreturn false; return false; return false; return false; return false; return false; return false; return false; }return false; return false; return false; return false; return false; return false; return false; return false; returnreturn false; false;return false; return false; return false; return false; }
3,231,413
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int binPos = names.length - 2; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
3,231,414
public PropertyOperatorCache () { }
public PropertyOperatorCache () { }
3,231,415
final public Iterator getIterator (Object instance) throws PropertyException { if (instance instanceof Object[]) return new ArrayIterator((Object[]) instance); else if (instance.getClass().isArray()) return new PrimitiveArrayIterator(instance); else if (instance instanceof Iterator) return (Iterator) instance; else if (instance instanceof Enumeration) return new EnumIterator((Enumeration) instance); else return getOperator(instance).findIterator(instance); }
final public Iterator getIterator (Object instance) throws PropertyException { if (instance instanceof Object[]) return new ArrayIterator((Object[]) instance); else if (instance.getClass().isArray()) return new PrimitiveArrayIterator(instance); else if (instance instanceof Iterator) return (Iterator) instance; else if (instance instanceof Enumeration) return new EnumIterator((Enumeration) instance); else return getOperator(instance).findIterator(instance); }
3,231,416
final public PropertyOperator getOperator (final Class type) throws PropertyException { Object o = _cache.get(type); if (o == null) { PropertyOperator po = new PropertyOperator(type, this); _cache.put(type, po); return po; } else return (PropertyOperator) o; }
final public PropertyOperator getOperator (final Class type) throws PropertyException { Object o = _cache.get(type); if (o == null) { PropertyOperator po = new PropertyOperator(type, this); _cache.put(type, po); return po; } else return (PropertyOperator) o; }
3,231,417
final public Object getProperty (final Context context, final Object instance, final Object[] names, int start) throws PropertyException, SecurityException { if (instance == null) { return null; } else { return getOperator(instance).getProperty( context, instance, names, start, names.length - 1); } }
final public Object getProperty (final Context context, final Object instance, final Object[] names, int start) throws PropertyException, SecurityException { if (instance == null) { return null; } else { return getOperator(instance).getProperty( context, instance, names, start, names.length - 1); } }
3,231,418