repo_name
stringlengths
5
108
path
stringlengths
6
333
size
stringlengths
1
6
content
stringlengths
4
977k
license
stringclasses
15 values
cytoscape/cytoscape-impl
equations-impl/src/main/java/org/cytoscape/equations/internal/builtins/Or.java
2633
package org.cytoscape.equations.internal.builtins; /* * #%L * Cytoscape Equations Impl (equations-impl) * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2010 - 2021 The Cytoscape Consortium * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import org.cytoscape.equations.AbstractFunction; import org.cytoscape.equations.ArgDescriptor; import org.cytoscape.equations.ArgType; import org.cytoscape.equations.FunctionUtil; import org.cytoscape.equations.internal.Categories; public class Or extends AbstractFunction { public Or() { super(new ArgDescriptor[] { new ArgDescriptor(ArgType.OPT_BOOLS, "truth_values", "Zero or more truth values or lists of truth values."), }); } /** * Used to parse the function string. * @return the name by which you must call the function when used in an attribute equation. */ public String getName() { return "OR"; } @Override public String getCategoryName() { return Categories.BOOLEAN; } /** * Used to provide help for users. * @return a description of what this function does */ public String getFunctionSummary() { return "Returns the logical disjunction of any number of boolean values."; } public Class<?> getReturnType() { return Boolean.class; } /** * @param args the function arguments which must all be of type Boolean * @return the result of the function evaluation which is either true or false * @throws ArithmeticException this can never happen * @throws IllegalArgumentException thrown if any of the arguments is not of type Boolean */ public Object evaluateFunction(final Object[] args) throws IllegalArgumentException, ArithmeticException { final boolean[] booleans; try { booleans = FunctionUtil.getBooleans(args); } catch (final Exception e) { throw new IllegalArgumentException("can't convert an argument or a list element to a boolean in a call to OR()."); } for (final boolean b : booleans) { if (b) return true; } return false; } }
lgpl-2.1
trejkaz/swingx
swingx-core/src/main/java/org/jdesktop/swingx/rollover/RolloverProducer.java
11562
/* * $Id$ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx.rollover; import static javax.swing.SwingUtilities.convertPointFromScreen; import static javax.swing.SwingUtilities.isDescendingFrom; import java.awt.KeyboardFocusManager; import java.awt.MouseInfo; import java.awt.Point; import java.awt.PointerInfo; import java.awt.Window; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.util.logging.Logger; import javax.swing.JComponent; /** * Mouse/Motion/Listener which maps mouse coordinates to client coordinates * and stores these as client properties in the target JComponent. The exact * mapping process is left to subclasses. Typically, they will map to "cell" * coordinates. <p> * * Note: this class assumes that the target component is of type JComponent.<p> * Note: this implementation is stateful, it can't be shared across different * instances of a target component.<p> * * * @author Jeanette Winzenburg */ public abstract class RolloverProducer implements MouseListener, MouseMotionListener, ComponentListener { @SuppressWarnings("unused") private static final Logger LOG = Logger.getLogger(RolloverProducer.class .getName()); /** * Key for client property mapped from mouse-triggered action. * Note that the actual mouse-event which results in setting the property * depends on the implementation of the concrete RolloverProducer. */ public static final String CLICKED_KEY = "swingx.clicked"; /** Key for client property mapped from rollover events */ public static final String ROLLOVER_KEY = "swingx.rollover"; // public static final String PRESSED_KEY = "swingx.pressed"; private boolean isDragging; /** * Installs all listeners, as required. * * @param component target to install required listeners on, must * not be null. */ public void install(JComponent component) { component.addMouseListener(this); component.addMouseMotionListener(this); component.addComponentListener(this); } /** * Removes all listeners. * * @param component target component to uninstall required listeners from, * must not be null */ public void release(JComponent component) { component.removeMouseListener(this); component.removeMouseMotionListener(this); component.removeComponentListener(this); } //----------------- mouseListener /** * Implemented to map to Rollover properties as needed. This implemenation calls * updateRollover with both ROLLOVER_KEY and CLICKED_KEY properties. */ @Override public void mouseReleased(MouseEvent e) { Point oldCell = new Point(rollover); // JW: fix for #456-swingx - rollover not updated after end of dragging updateRollover(e, ROLLOVER_KEY, false); // Fix Issue 1387-swingx - no click on release-after-drag if (isClick(e, oldCell, isDragging)) { updateRollover(e, CLICKED_KEY, true); } isDragging = false; } /** * Returns a boolean indicating whether or not the given mouse event should * be interpreted as a click. This method is called from mouseReleased * after the cell coordiates were updated. While the ID of mouse event * is not formally enforced, it is assumed to be a MOUSE_RELEASED. Calling * for other types might or might not work as expected. <p> * * This implementation returns true if the current rollover point is the same * cell as the given oldRollover, that is ending a drag inside the same cell * triggers the action while ending a drag somewhere does not. <p> * * PENDING JW: open to more complex logic in case it clashes with existing code, * see Issue #1387. * * @param e the mouseEvent which triggered calling this, assumed to be * a mouseReleased, must not be null * @param oldRollover the cell before the mouseEvent was mapped, must not be null * @param wasDragging true if the release happened * @return a boolean indicating whether or not the given mouseEvent should * be interpreted as a click. */ protected boolean isClick(MouseEvent e, Point oldRollover, boolean wasDragging) { return oldRollover.equals(rollover); } /** * Implemented to map to client property rollover and fire only if client * coordinate changed. */ @Override public void mouseEntered(MouseEvent e) { // LOG.info("" + e); isDragging = false; updateRollover(e, ROLLOVER_KEY, false); } /** * Implemented to remove client properties rollover and clicked. if the * source is a JComponent. Does nothing otherwise. */ @Override public void mouseExited(MouseEvent e) { isDragging = false; // screenLocation = null; // LOG.info("" + e); // if (((JComponent) e.getComponent()).getMousePosition(true) != null) { // updateRollover(e, ROLLOVER_KEY, false); // } else { // } ((JComponent) e.getSource()).putClientProperty(ROLLOVER_KEY, null); ((JComponent) e.getSource()).putClientProperty(CLICKED_KEY, null); } /** * Implemented to do nothing. */ @Override public void mouseClicked(MouseEvent e) { } /** * Implemented to do nothing. */ @Override public void mousePressed(MouseEvent e) { } // ---------------- MouseMotionListener /** * Implemented to set a dragging flag to true. */ @Override public void mouseDragged(MouseEvent e) { isDragging = true; } /** * Implemented to map to client property rollover and fire only if client * coordinate changed. */ @Override public void mouseMoved(MouseEvent e) { updateRollover(e, ROLLOVER_KEY, false); } //---------------- ComponentListener @Override public void componentShown(ComponentEvent e) { } @Override public void componentResized(ComponentEvent e) { updateRollover(e); } @Override public void componentMoved(ComponentEvent e) { updateRollover(e); } /** * @param e */ private void updateRollover(ComponentEvent e) { Point componentLocation = null; try { componentLocation = e.getComponent().getMousePosition(); } catch (ClassCastException | NullPointerException ignore) { // caused by core issue on Mac/Java 7 //try to work our way there by a different path //*sigh* this requires permissions //if this fails, rollover is effectively neutered Window w = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); if (w != null && isDescendingFrom(e.getComponent(), w)) { try { PointerInfo pi = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<PointerInfo>() { @Override public PointerInfo run() { return MouseInfo.getPointerInfo(); } } ); componentLocation = pi.getLocation(); convertPointFromScreen(componentLocation, e.getComponent()); } catch (SecurityException se) { } } } if (componentLocation == null) { componentLocation = new Point(-1, -1); } // LOG.info("" + componentLocation + " / " + e); updateRolloverPoint((JComponent) e.getComponent(), componentLocation); updateClientProperty((JComponent) e.getComponent(), ROLLOVER_KEY, true); } @Override public void componentHidden(ComponentEvent e) { } //---------------- mapping methods /** * Controls the mapping of the given mouse event to a client property. This * implementation first calls updateRolloverPoint to convert the mouse coordinates. * Then calls updateClientProperty to actually set the client property in the * * @param e the MouseEvent to map to client coordinates * @param property the client property to map to * @param fireAlways a flag indicating whether a client event should be fired if unchanged. * * @see #updateRolloverPoint(JComponent, Point) * @see #updateClientProperty(JComponent, String, boolean) */ protected void updateRollover(MouseEvent e, String property, boolean fireAlways) { updateRolloverPoint((JComponent) e.getComponent(), e.getPoint()); updateClientProperty((JComponent) e.getComponent(), property, fireAlways); } /** Current mouse location in client coordinates. */ protected Point rollover = new Point(-1, -1); /** * Sets the given client property to the value of current mouse location in * client coordinates. If fireAlways, the property is force to fire a change. * * @param component the target component * @param property the client property to set * @param fireAlways a flag indicating whether a client property * should be forced to fire an event. */ protected void updateClientProperty(JComponent component, String property, boolean fireAlways) { if (fireAlways) { // fix Issue #864-swingx: force propertyChangeEvent component.putClientProperty(property, null); component.putClientProperty(property, new Point(rollover)); } else { Point p = (Point) component.getClientProperty(property); if (p == null || (rollover.x != p.x) || (rollover.y != p.y)) { component.putClientProperty(property, new Point(rollover)); } } } /** * Subclasses must implement to map the given mouse coordinates into * appropriate client coordinates. The result must be stored in the * rollover field. * * @param component the target component which received a mouse event * @param mousePoint the mouse position of the event, coordinates are * component pixels */ protected abstract void updateRolloverPoint(JComponent component, Point mousePoint); }
lgpl-2.1
mcarniel/oswing
srcdemo/demo47/demo47Client/appClientModule/demo47/client/OrderFrame.java
27302
package demo47.client; import javax.swing.*; import javax.swing.tree.DefaultTreeModel; import org.openswing.swing.client.*; import org.openswing.swing.message.send.java.*; import java.awt.*; import org.openswing.swing.table.columns.client.*; import org.openswing.swing.lookup.client.LookupController; import org.openswing.swing.lookup.client.LookupDataLocator; import org.openswing.swing.lookup.client.LookupListener; import java.awt.event.*; import java.util.*; import org.openswing.swing.table.java.*; import org.openswing.swing.mdi.client.InternalFrame; import org.openswing.swing.mdi.client.MDIFrame; import org.openswing.swing.message.receive.java.ErrorResponse; import org.openswing.swing.message.receive.java.Response; import org.openswing.swing.message.receive.java.VOResponse; import org.openswing.swing.message.receive.java.ValueObject; import org.openswing.swing.message.send.java.GridParams; import org.openswing.swing.util.client.ClientSettings; import org.openswing.swing.table.client.GridController; import org.openswing.swing.tree.java.OpenSwingTreeNode; import org.openswing.swing.form.client.Form; import org.openswing.swing.util.java.Consts; import demo47.java.Doc01Orders; import demo47.server.ArticlesRemote; import demo47.server.CustomersRemote; import demo47.server.OrdersRemote; import demo47.server.PricelistsRemote; /** * <p>Title: OpenSwing Framework</p> * <p>Description: Grid Frame for orders.</p> * <p>Copyright: Copyright (C) 2006 Mauro Carniel</p> * <p> </p> * @author Mauro Carniel * @version 1.0 */ public class OrderFrame extends InternalFrame { GridControl grid = new GridControl(); JPanel detailButtonsPanel = new JPanel(); JPanel gridButtonsPanel = new JPanel(); InsertButton insertButton = new InsertButton(); ReloadButton reloadButton = new ReloadButton(); DeleteButton deleteButton = new DeleteButton(); EditButton editButton = new EditButton(); SaveButton saveButton = new SaveButton(); ExportButton exportButton = new ExportButton(); FlowLayout flowLayout1 = new FlowLayout(); FlowLayout flowLayout2 = new FlowLayout(); IntegerColumn colOrderRowNr = new IntegerColumn(); IntegerColumn colQty = new IntegerColumn(); TextColumn colItemDescr = new TextColumn(); CurrencyColumn colUnitPrice = new CurrencyColumn(); CurrencyColumn colTotal = new CurrencyColumn(); TextColumn colNote = new TextColumn(); CodLookupColumn colItemId = new CodLookupColumn(); JPanel detailPanel = new JPanel(); Form form = new Form(); JPanel gridPanel = new JPanel(); BorderLayout borderLayout1 = new BorderLayout(); BorderLayout borderLayout2 = new BorderLayout(); InsertButton insert2Button = new InsertButton(); ReloadButton reload2Button = new ReloadButton(); EditButton edit2Button = new EditButton(); SaveButton save2Button = new SaveButton(); DeleteButton delete2Button = new DeleteButton(); GridBagLayout gridBagLayout1 = new GridBagLayout(); LabelControl labelYear = new LabelControl(); LabelControl labelNote = new LabelControl(); LabelControl labelNr = new LabelControl(); NumericControl controlYear = new NumericControl(); NumericControl controlNr = new NumericControl(); LabelControl labelDate = new LabelControl(); DateControl controlDate = new DateControl(); LabelControl labelCust = new LabelControl(); LabelControl labelPricelist = new LabelControl(); ComboBoxControl controlState = new ComboBoxControl(); LabelControl labelState = new LabelControl(); TextAreaControl controlNote = new TextAreaControl(); LabelControl labelTotal = new LabelControl(); CurrencyControl controlTotal = new CurrencyControl(); CodLookupControl controlCustomer = new CodLookupControl(); TextControl controlCustDesc = new TextControl(); CodLookupControl controlPricelist = new CodLookupControl(); TextControl controlPricelistDesc = new TextControl(); NavigatorBar navigatorBar = new NavigatorBar(); private OrdersFrame parentFrame = null; public OrderFrame(OrdersFrame parentFrame,OrderController controller) { this.parentFrame = parentFrame; try { jbInit(); setSize(800,500); OrderRowsController gridController = new OrderRowsController(this); grid.setController(gridController); grid.setGridDataLocator(gridController); form.setFormController(controller); // link the parent grid to the current Form... HashSet pk = new HashSet(); pk.add("pk.docNumber"); pk.add("pk.docYear"); form.linkGrid(parentFrame.getGrid(),pk,true,true,true,navigatorBar); LookupController lookupControllerCustomer = new LookupController(); lookupControllerCustomer.setLookupValueObjectClassName("demo47.java.Doc02Customers"); lookupControllerCustomer.addLookup2ParentLink("customerId","customerId.customerId"); // necessario per l'auto-completition... // lookupControllerCustomer.addLookup2ParentLink("description","customerId.description"); lookupControllerCustomer.addLookup2ParentLink("customerId"); lookupControllerCustomer.setVisibleColumn("customerId", true); lookupControllerCustomer.setVisibleColumn("description", true); lookupControllerCustomer.setHeaderColumnName("customerId", "Customer Id"); lookupControllerCustomer.setHeaderColumnName("description", "Description"); lookupControllerCustomer.setFilterableColumn("customerId", true); lookupControllerCustomer.setSortedColumn("customerId", Consts.ASC_SORTED); lookupControllerCustomer.addLookupListener(new LookupListener() { @Override public void beforeLookupAction(ValueObject arg0) { } @Override public void codeChanged(ValueObject arg0, Collection arg1) { Doc01Orders vo = (Doc01Orders)form.getVOModel().getValueObject(); controlPricelist.setValue(null); controlPricelistDesc.setValue(null); vo.setDoc03Pricelists(null); } @Override public void codeValidated(boolean arg0) { } @Override public void forceValidate() { } }); controlCustomer.setLookupController(lookupControllerCustomer); lookupControllerCustomer.setLookupDataLocator(new LookupDataLocator() { /** * Method called by lookup controller when validating code. * @param code code to validate * @return code validation response: VOListResponse if code validation has success, ErrorResponse otherwise */ public Response validateCode(String code) { try { FilterWhereClause filter = new FilterWhereClause("customerId","=",code); GridParams gridParams = new GridParams(); gridParams.getFilteredColumns().put("customerId", new FilterWhereClause[] {filter,null} ); CustomersRemote customersService = (CustomersRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("CustomersBean"); return customersService.getCustomers(gridParams); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by lookup controller when user clicks on lookup button. * @param action fetching versus: PREVIOUS_BLOCK_ACTION, NEXT_BLOCK_ACTION or LAST_BLOCK_ACTION * @param startIndex current index row on grid to use to start fetching data * @param filteredColumns filtered columns * @param currentSortedColumns sorted columns * @param currentSortedVersusColumns ordering versus of sorted columns * @param valueObjectType type of value object associated to the lookup grid * @return list of value objects to fill in the lookup grid: VOListResponse if data fetching has success, ErrorResponse otherwise */ public Response loadData( int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType ) { try { CustomersRemote customersService = (CustomersRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("CustomersBean"); return customersService.getCustomers( new GridParams( action, startIndex, filteredColumns, currentSortedColumns, currentSortedVersusColumns, new HashMap() ) ); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by the TreePanel to fill the tree. * @return a VOReponse containing a DefaultTreeModel object */ public Response getTreeModel(JTree tree) { return new VOResponse(new DefaultTreeModel(new OpenSwingTreeNode())); } }); LookupController lookupControllerPricelist = new LookupController(); lookupControllerPricelist.setLookupValueObjectClassName("demo47.java.Doc03Pricelists"); lookupControllerPricelist.addLookup2ParentLink("pk.pricelistId","customerId.customerId"); // necessario per l'auto-completition... // lookupControllerPricelist.addLookup2ParentLink("description","customerId.description"); lookupControllerPricelist.addLookup2ParentLink("doc03Pricelists"); lookupControllerPricelist.setVisibleColumn("pk.pricelistId", true); lookupControllerPricelist.setVisibleColumn("description", true); lookupControllerPricelist.setHeaderColumnName("pk.pricelistId", "Pricelist Id"); lookupControllerPricelist.setHeaderColumnName("description", "Description"); lookupControllerPricelist.setFilterableColumn("pk.pricelistId", true); lookupControllerPricelist.setSortedColumn("pk.pricelistId", Consts.ASC_SORTED); controlPricelist.setLookupController(lookupControllerPricelist); lookupControllerPricelist.setLookupDataLocator(new LookupDataLocator() { /** * Method called by lookup controller when validating code. * @param code code to validate * @return code validation response: VOListResponse if code validation has success, ErrorResponse otherwise */ public Response validateCode(String code) { try { Doc01Orders vo = (Doc01Orders)form.getVOModel().getValueObject(); FilterWhereClause filter = new FilterWhereClause("pk.pricelistId","=",code); GridParams gridParams = new GridParams(); gridParams.getFilteredColumns().put("pk.pricelistId", new FilterWhereClause[] {filter,null} ); PricelistsRemote pricelistsService = (PricelistsRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("PricelistsBean"); return pricelistsService.getPricelists(vo.getCustomerId(),gridParams); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by lookup controller when user clicks on lookup button. * @param action fetching versus: PREVIOUS_BLOCK_ACTION, NEXT_BLOCK_ACTION or LAST_BLOCK_ACTION * @param startIndex current index row on grid to use to start fetching data * @param filteredColumns filtered columns * @param currentSortedColumns sorted columns * @param currentSortedVersusColumns ordering versus of sorted columns * @param valueObjectType type of value object associated to the lookup grid * @return list of value objects to fill in the lookup grid: VOListResponse if data fetching has success, ErrorResponse otherwise */ public Response loadData( int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType ) { try { Doc01Orders vo = (Doc01Orders)form.getVOModel().getValueObject(); PricelistsRemote pricelistsService = (PricelistsRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("PricelistsBean"); return pricelistsService.getPricelists( vo.getCustomerId(), new GridParams( action, startIndex, filteredColumns, currentSortedColumns, currentSortedVersusColumns, new HashMap() ) ); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by the TreePanel to fill the tree. * @return a VOReponse containing a DefaultTreeModel object */ public Response getTreeModel(JTree tree) { return new VOResponse(new DefaultTreeModel(new OpenSwingTreeNode())); } }); LookupController lookupControllerItem = new LookupController(); lookupControllerItem.setLookupValueObjectClassName("demo47.java.Doc05Articles"); lookupControllerItem.addLookup2ParentLink("itemId","itemId.itemId"); // necessario per l'auto-completition... // lookupControllerItem.addLookup2ParentLink("descrizione","itemId.descrizione"); lookupControllerItem.addLookup2ParentLink("defaultUnitPrice","unitPrice"); // necessario per l'auto-completition... lookupControllerItem.addLookup2ParentLink("itemId"); lookupControllerItem.setVisibleColumn("itemId", true); lookupControllerItem.setVisibleColumn("descrizione", true); lookupControllerItem.setFilterableColumn("itemId", true); lookupControllerItem.setSortedColumn("itemId", Consts.ASC_SORTED); lookupControllerItem.setHeaderColumnName("itemId", "Item Id"); lookupControllerItem.setHeaderColumnName("descrizione", "Description"); colItemId.setLookupController(lookupControllerItem); lookupControllerItem.setLookupDataLocator(new LookupDataLocator() { /** * Method called by lookup controller when validating code. * @param code code to validate * @return code validation response: VOListResponse if code validation has success, ErrorResponse otherwise */ public Response validateCode(String code) { try { FilterWhereClause filter = new FilterWhereClause("itemId","=",code); GridParams gridParams = new GridParams(); gridParams.getFilteredColumns().put("itemId", new FilterWhereClause[] {filter,null} ); ArticlesRemote articlesService = (ArticlesRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("ArticlesBean"); return articlesService.getArticles(gridParams); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by lookup controller when user clicks on lookup button. * @param action fetching versus: PREVIOUS_BLOCK_ACTION, NEXT_BLOCK_ACTION or LAST_BLOCK_ACTION * @param startIndex current index row on grid to use to start fetching data * @param filteredColumns filtered columns * @param currentSortedColumns sorted columns * @param currentSortedVersusColumns ordering versus of sorted columns * @param valueObjectType type of value object associated to the lookup grid * @return list of value objects to fill in the lookup grid: VOListResponse if data fetching has success, ErrorResponse otherwise */ public Response loadData( int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType ) { try { ArticlesRemote articlesService = (ArticlesRemote)((DemoClientFacade)MDIFrame.getClientFacade()).getRemote("ArticlesBean"); return articlesService.getArticles( new GridParams( action, startIndex, filteredColumns, currentSortedColumns, currentSortedVersusColumns, new HashMap() ) ); } catch (Exception ex) { ex.printStackTrace(); return new ErrorResponse(ex.getMessage()); } } /** * Method called by the TreePanel to fill the tree. * @return a VOReponse containing a DefaultTreeModel object */ public Response getTreeModel(JTree tree) { return new VOResponse(new DefaultTreeModel(new OpenSwingTreeNode())); } }); setTitle("Order"); } catch(Exception e) { e.printStackTrace(); } } public Form getForm() { return form; } public GridControl getGrid() { return grid; } public void reloadData() { grid.reloadData(); } private void jbInit() throws Exception { System.currentTimeMillis(); gridButtonsPanel.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); controlYear.setAttributeName("pk.docYear"); controlNr.setAttributeName("pk.docNumber"); controlDate.setAttributeName("docDate"); controlState.setAttributeName("state"); controlNote.setAttributeName("note"); controlTotal.setAttributeName("total"); controlCustomer.setAttributeName("customerId.customerId"); controlCustDesc.setAttributeName("customerId.description"); controlPricelist.setAttributeName("doc03Pricelists.pk.pricelistId"); controlPricelistDesc.setAttributeName("doc03Pricelists.description"); controlCustomer.setRequired(true); controlPricelist.setRequired(true); controlPricelist.setMaxCharacters(20); controlNr.setLinkLabel(labelNr); controlDate.setLinkLabel(labelDate); controlState.setLinkLabel(labelState); controlNote.setLinkLabel(labelNote); controlTotal.setLinkLabel(labelTotal); controlCustomer.setLinkLabel(labelCust); controlPricelist.setLinkLabel(labelPricelist); form.setInsertButton(insert2Button); form.setReloadButton(reload2Button); form.setSaveButton(save2Button); form.setEditButton(edit2Button); form.setDeleteButton(delete2Button); form.setVOClassName("demo47.java.Doc01Orders"); form.setLayout(gridBagLayout1); grid.setDeleteButton(deleteButton); grid.setExportButton(exportButton); grid.setInsertButton(insertButton); grid.setReloadButton(reloadButton); grid.setSaveButton(saveButton); grid.setEditButton(editButton); grid.setValueObjectClassName("demo47.java.Doc04OrderRows"); grid.setCreateInnerVO(true); gridPanel.setLayout(borderLayout1); detailPanel.setLayout(borderLayout2); flowLayout2.setAlignment(FlowLayout.LEFT); labelYear.setLabel("Year"); labelNote.setLabel("Note"); labelNr.setLabel("Order Nr"); labelDate.setLabel("Order Date"); labelCust.setLabel("Customer"); labelPricelist.setLabel("Pricelist"); labelState.setLabel("State"); labelTotal.setLabel("Total Amount"); controlYear.setRequired(true); controlYear.setEnabledOnEdit(false); controlNr.setRequired(true); controlNr.setEnabledOnEdit(false); controlDate.setRequired(true); controlCustomer.setMaxCharacters(20); controlCustDesc.setEnabledOnInsert(false); controlCustDesc.setEnabledOnEdit(false); controlPricelistDesc.setEnabledOnInsert(false); controlPricelistDesc.setEnabledOnEdit(false); controlState.setDomainId("ORDER_STATE"); controlState.setRequired(true); controlTotal.setEnabledOnEdit(false); controlTotal.setEnabledOnInsert(false); gridPanel.add(gridButtonsPanel,BorderLayout.NORTH); gridPanel.add(grid,BorderLayout.CENTER); detailPanel.add(detailButtonsPanel,BorderLayout.NORTH); detailPanel.add(form,BorderLayout.CENTER); form.add(labelYear, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(labelNote, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); form.add(labelNr, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlYear, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlNr, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(labelDate, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlDate, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(labelCust, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(labelPricelist, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(labelState, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlState, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlNote, new GridBagConstraints(1, 4, 5, 2, 1.0, 1.0 ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 40)); form.add(labelTotal, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlTotal, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); detailButtonsPanel.setLayout(flowLayout2); this.getContentPane().add(gridPanel, BorderLayout.CENTER); this.getContentPane().add(detailPanel, BorderLayout.NORTH); gridButtonsPanel.add(insertButton, null); gridButtonsPanel.add(editButton, null); gridButtonsPanel.add(saveButton, null); gridButtonsPanel.add(reloadButton, null); gridButtonsPanel.add(exportButton, null); gridButtonsPanel.add(deleteButton, null); grid.add(colOrderRowNr, null); grid.add(colItemId, null); grid.add(colItemDescr, null); grid.add(colQty, null); grid.add(colUnitPrice, null); grid.add(colTotal, null); grid.add(colNote, null); grid.setAutoLoadData(false); colItemId.setColumnName("itemId.itemId"); colItemId.setHeaderColumnName("Item Id"); colItemId.setPreferredWidth(100); colItemId.setEditableOnEdit(false); colItemId.setEditableOnInsert(true); colItemId.setColumnFilterable(true); colItemDescr.setColumnName("itemId.descrizione"); colItemDescr.setHeaderColumnName("Description"); colItemDescr.setPreferredWidth(200); colItemDescr.setEditableOnEdit(false); colItemDescr.setEditableOnInsert(false); colTotal.setColumnName("total"); colTotal.setHeaderColumnName("Total"); colTotal.setPreferredWidth(80); colTotal.setEditableOnEdit(false); colTotal.setEditableOnInsert(false); colNote.setColumnName("note"); colNote.setHeaderColumnName("Note"); colNote.setPreferredWidth(250); colNote.setEditableOnEdit(true); colNote.setEditableOnInsert(true); colNote.setColumnRequired(false); colOrderRowNr.setColumnName("pk.rowNumber"); colOrderRowNr.setHeaderColumnName("Nr"); colOrderRowNr.setPreferredWidth(50); colOrderRowNr.setSortingOrder(1); colOrderRowNr.setSortVersus(Consts.ASC_SORTED); colOrderRowNr.setColumnVisible(false); colOrderRowNr.setColumnSelectable(false); colQty.setColumnName("qty"); colQty.setHeaderColumnName("Qty"); colQty.setEditableOnEdit(true); colQty.setEditableOnInsert(true); colQty.setColumnRequired(true); colQty.setPreferredWidth(50); colUnitPrice.setColumnName("unitPrice"); colUnitPrice.setHeaderColumnName("Unit Price"); colQty.setEditableOnEdit(true); colQty.setEditableOnInsert(true); colUnitPrice.setPreferredWidth(80); colUnitPrice.setEditableOnEdit(true); colUnitPrice.setEditableOnInsert(true); detailButtonsPanel.add(insert2Button, null); detailButtonsPanel.add(edit2Button, null); detailButtonsPanel.add(save2Button, null); detailButtonsPanel.add(reload2Button, null); detailButtonsPanel.add(delete2Button, null); detailButtonsPanel.add(navigatorBar, null); form.add(controlCustomer, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlCustDesc, new GridBagConstraints(2, 1, 4, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); form.add(controlPricelist, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); form.add(controlPricelistDesc, new GridBagConstraints(2, 2, 4, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0)); } public void setButtonsEnabled(boolean enabled) { deleteButton.setEnabled(enabled); insertButton.setEnabled(enabled); reloadButton.setEnabled(enabled); editButton.setEnabled(enabled); exportButton.setEnabled(enabled); if (!enabled) saveButton.setEnabled(false); } }
lgpl-2.1
falko0000/moduleEProc
Bidqueue/Bidqueue-service/src/main/java/tj/bid/queue/model/impl/BidqueueCacheModel.java
3465
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package tj.bid.queue.model.impl; import aQute.bnd.annotation.ProviderType; import com.liferay.portal.kernel.model.CacheModel; import com.liferay.portal.kernel.util.HashUtil; import com.liferay.portal.kernel.util.StringBundler; import tj.bid.queue.model.Bidqueue; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Date; /** * The cache model class for representing Bidqueue in entity cache. * * @author Brian Wing Shun Chan * @see Bidqueue * @generated */ @ProviderType public class BidqueueCacheModel implements CacheModel<Bidqueue>, Externalizable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof BidqueueCacheModel)) { return false; } BidqueueCacheModel bidqueueCacheModel = (BidqueueCacheModel)obj; if (bid_queue_id == bidqueueCacheModel.bid_queue_id) { return true; } return false; } @Override public int hashCode() { return HashUtil.hash(0, bid_queue_id); } @Override public String toString() { StringBundler sb = new StringBundler(13); sb.append("{bid_queue_id="); sb.append(bid_queue_id); sb.append(", izvewenija_id="); sb.append(izvewenija_id); sb.append(", closing_date="); sb.append(closing_date); sb.append(", closing_by_minutes="); sb.append(closing_by_minutes); sb.append(", state="); sb.append(state); sb.append(", status="); sb.append(status); sb.append("}"); return sb.toString(); } @Override public Bidqueue toEntityModel() { BidqueueImpl bidqueueImpl = new BidqueueImpl(); bidqueueImpl.setBid_queue_id(bid_queue_id); bidqueueImpl.setIzvewenija_id(izvewenija_id); if (closing_date == Long.MIN_VALUE) { bidqueueImpl.setClosing_date(null); } else { bidqueueImpl.setClosing_date(new Date(closing_date)); } bidqueueImpl.setClosing_by_minutes(closing_by_minutes); bidqueueImpl.setState(state); bidqueueImpl.setStatus(status); bidqueueImpl.resetOriginalValues(); return bidqueueImpl; } @Override public void readExternal(ObjectInput objectInput) throws IOException { bid_queue_id = objectInput.readLong(); izvewenija_id = objectInput.readLong(); closing_date = objectInput.readLong(); closing_by_minutes = objectInput.readLong(); state = objectInput.readInt(); status = objectInput.readInt(); } @Override public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeLong(bid_queue_id); objectOutput.writeLong(izvewenija_id); objectOutput.writeLong(closing_date); objectOutput.writeLong(closing_by_minutes); objectOutput.writeInt(state); objectOutput.writeInt(status); } public long bid_queue_id; public long izvewenija_id; public long closing_date; public long closing_by_minutes; public int state; public int status; }
lgpl-2.1
aktion-hip/viffw
org.hip.viffw/src/org/hip/kernel/bom/impl/FlatJoinCriteriaStack.java
1589
/** This package is part of the framework used for the application VIF. Copyright (C) 2006-2014, Benno Luthiger This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.hip.kernel.bom.impl; /** Critieria stack where nested levels are flatted and joined uniformly using the specified join. * * @author Luthiger Created on 13.07.2007 */ @SuppressWarnings("serial") public class FlatJoinCriteriaStack extends AbstractCriteriaStack { // NOPMD by lbenno @Override public String render() { // NOPMD by lbenno final StringBuffer outSQL = new StringBuffer(); boolean lFirst = true; for (final String lCriterium : criteria) { if (!lFirst) { outSQL.append(join); } lFirst = false; outSQL.append(lCriterium); } reset(); return new String(outSQL); } }
lgpl-2.1
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-common/src/main/java/org/xwiki/crypto/internal/encoder/AbstractBouncyCastleInternalBinaryStringEncoder.java
2475
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.crypto.internal.encoder; import java.io.IOException; import java.io.OutputStream; import org.bouncycastle.util.encoders.Encoder; /** * Abstract base class to build binary string encoder based on Bouncy Castle. * * @version $Id$ * @since 5.4M1 */ public abstract class AbstractBouncyCastleInternalBinaryStringEncoder implements InternalBinaryStringEncoder { private final Encoder encoder; private final int blockSize; private final int charSize; /** * Create a wrapper over the given encoder, providing size methods. * * @param encoder the bouncy castle encoder. * @param blockSize the blocksize to report for encoding. * @param charSize the blocksize to report for decoding. */ public AbstractBouncyCastleInternalBinaryStringEncoder(Encoder encoder, int blockSize, int charSize) { this.encoder = encoder; this.blockSize = blockSize; this.charSize = charSize; } @Override public int encode(byte[] buffer, int offset, int length, OutputStream outputStream) throws IOException { return this.encoder.encode(buffer, offset, length, outputStream); } @Override public int decode(byte[] buffer, int offset, int length, OutputStream outputStream) throws IOException { return this.encoder.decode(buffer, offset, length, outputStream); } @Override public int getEncodingBlockSize() { return this.blockSize; } @Override public int getDecodingBlockSize() { return this.charSize; } }
lgpl-2.1
dtag-dbu/speechalyzer
src/FelixUtil/src/com/felix/util/PlayWave.java
5342
package com.felix.util; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; /** * Helper class to play an audio file. * * @author felix * */ public class PlayWave extends Thread { public static final String AUDIOFORMAT_WAV = "wav"; public static final String AUDIOFORMAT_PCM_22050 = "pcm22050"; private boolean _playing = false; public static enum Position { LEFT, RIGHT, NORMAL }; private String audioFormat = "wav"; private String filename; private Position curPosition; private final int EXTERNAL_BUFFER_SIZE = 524288; // 128Kb /** * Stop the current playback. * */ public void stopPlayback() { _playing = false; } /** * Empty connstructor to play from bytestream. */ public PlayWave() { } /** * Constructor for a wav-headed file. * * @param wavfile */ public PlayWave(String wavfile) { filename = wavfile; curPosition = Position.NORMAL; } /** * Constructor for wav headed file and panorama position. * * @param wavfile * @param p */ public PlayWave(String wavfile, Position p) { filename = wavfile; curPosition = p; } /** * Set format for headerless files. * * @param afm */ public void setAudioformat(String afm) { this.audioFormat = afm; } public void run() { File soundFile = new File(filename); if (!soundFile.exists()) { System.err.println("Wave file not found: " + filename); return; } AudioInputStream audioInputStream = null; try { audioInputStream = AudioSystem.getAudioInputStream(soundFile); } catch (UnsupportedAudioFileException e1) { e1.printStackTrace(); return; } catch (IOException e1) { e1.printStackTrace(); return; } AudioFormat format = null; if (audioFormat.compareTo(AUDIOFORMAT_WAV) == 0) { format = audioInputStream.getFormat(); } else if (audioFormat.compareTo(AUDIOFORMAT_PCM_22050) == 0) { format = AudioUtil.FORMAT_PCM_22KHZ; } else { System.err.println("undefined autio format: " + audioFormat); return; } SourceDataLine auline = null; DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); try { auline = (SourceDataLine) AudioSystem.getLine(info); auline.open(format); } catch (LineUnavailableException e) { e.printStackTrace(); return; } catch (Exception e) { e.printStackTrace(); return; } if (auline.isControlSupported(FloatControl.Type.PAN)) { FloatControl pan = (FloatControl) auline .getControl(FloatControl.Type.PAN); if (curPosition == Position.RIGHT) pan.setValue(1.0f); else if (curPosition == Position.LEFT) pan.setValue(-1.0f); } auline.start(); int nBytesRead = 0; byte[] abData = new byte[EXTERNAL_BUFFER_SIZE]; _playing = true; try { while (nBytesRead != -1) { nBytesRead = audioInputStream.read(abData, 0, abData.length); if (nBytesRead >= 0) auline.write(abData, 0, nBytesRead); if (! _playing) break; } _playing = false; audioInputStream.close(); } catch (IOException e) { e.printStackTrace(); return; } finally { auline.drain(); auline.close(); auline = null; audioInputStream = null; soundFile = null; } } /** * Play from a byte array output stream. * * @param out * @param format * @throws Exception */ public void playAudioFromByteStrean(ByteArrayOutputStream out, AudioFormat format) throws Exception { byte audio[] = out.toByteArray(); playAudioFromByteArray(audio, format); } /** * Play from a byte array. * * @param audio The byte array. * @param format * @throws Exception */ public void playAudioFromByteArray(byte[] audio, AudioFormat format) throws Exception { final AudioFormat _format = format; InputStream input = new ByteArrayInputStream(audio); final AudioInputStream ais = new AudioInputStream(input, format, audio.length / format.getFrameSize()); DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); line.open(format); line.start(); Runnable runner = new Runnable() { int bufferSize = (int) _format.getSampleRate() * _format.getFrameSize(); byte buffer[] = new byte[bufferSize]; public void run() { try { int count; _playing = true; while ((count = ais.read(buffer, 0, buffer.length)) != -1) { if (count > 0) { line.write(buffer, 0, count); } if (! _playing) break; } _playing = false; line.drain(); line.close(); } catch (Exception e) { e.printStackTrace(); } } }; Thread playThread = new Thread(runner); playThread.start(); } }
lgpl-2.1
EgorZhuk/pentaho-reporting
engine/core/src/it/java/org/pentaho/reporting/engine/classic/core/bugs/Prd5595IT.java
2075
/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2006 - 2016 Pentaho Corporation.. All rights reserved. */ package org.pentaho.reporting.engine.classic.core.bugs; import java.io.IOException; import java.net.URL; import org.junit.Before; import org.junit.Test; import org.pentaho.reporting.engine.classic.core.ClassicEngineBoot; import org.pentaho.reporting.engine.classic.core.MasterReport; import org.pentaho.reporting.engine.classic.core.ReportProcessingException; import org.pentaho.reporting.engine.classic.core.modules.output.table.xls.ExcelReportUtil; import org.pentaho.reporting.libraries.resourceloader.ResourceException; import org.pentaho.reporting.libraries.resourceloader.ResourceManager; public class Prd5595IT { @Before public void setUp() throws Exception { ClassicEngineBoot.getInstance().start(); } // Fails with GC overhead limit exceeded @Test public void testMemoryLeak() throws ResourceException, IOException, ReportProcessingException { URL url = getClass().getResource( "Prd-5595.prpt" ); MasterReport report = (MasterReport) new ResourceManager().createDirectly( url, MasterReport.class ).getResource(); org.pentaho.reporting.engine.classic.core.testsupport.DebugReportRunner.createTestOutputFile(); ExcelReportUtil.createXLSX( report, "test-output/Prd-5595.xlsx" ); } }
lgpl-2.1
viktorbahr/jaer
src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.java
49704
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package eu.seebetter.ini.chips.davis; import java.awt.Color; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Observable; import java.util.Observer; import java.util.logging.Logger; import javax.swing.JSpinner; import ch.unizh.ini.jaer.chip.retina.DVSTweaks; import eu.seebetter.ini.chips.DavisChip; import net.sf.jaer.biasgen.PotTweaker; import net.sf.jaer.chip.AEChip; import net.sf.jaer.chip.Chip; import net.sf.jaer.graphics.AEChipRenderer; import net.sf.jaer.graphics.AEFrameChipRenderer; /** * Wraps some key apsDVS sensor control in more user-friendly control panel. * * @author tobi */ public class DavisUserControlPanel extends javax.swing.JPanel implements PropertyChangeListener, Observer { private static final long serialVersionUID = 3894988983329773402L; protected DavisChip chip = null; protected DavisTweaks apsDvsTweaks; DavisConfig.VideoControl videoControl; DavisVideoContrastController contrastController; AEChipRenderer renderer = null; private static final Logger log = Logger.getLogger("DVSFunctionalControlPanel"); /** * Creates new form ApsDVSUserControlPanel */ public DavisUserControlPanel(final Chip chip) { this.chip = (DavisChip) chip; // will throw ClassCastException if not right kind of chip. renderer = this.chip.getRenderer(); apsDvsTweaks = (DavisTweaks) chip.getBiasgen(); initComponents(); // code must be after initComponents so that these components exist final PotTweaker[] tweakers = { thresholdTweaker, onOffBalanceTweaker, maxFiringRateTweaker, bandwidthTweaker }; for (final PotTweaker tweaker : tweakers) { chip.getBiasgen().getSupport().addPropertyChangeListener(tweaker); // to reset sliders on load/save of } histCB.setSelected(this.chip.isShowImageHistogram()); fdSp.setValue(getConfig().getFrameDelayMs()); edSp.setValue(getConfig().getExposureDelayMs()); glShutterCB.setSelected(((DavisBaseCamera) chip).getDavisConfig().isGlobalShutter()); displayEventsCheckBox.setSelected(getConfig().isDisplayEvents()); displayFramesCheckBox.setSelected(getConfig().isDisplayFrames()); captureFramesCheckBox.setSelected(getConfig().isCaptureFramesEnabled()); captureEventsCB.setSelected(getConfig().isCaptureEventsEnabled()); autoshotThresholdSp.setValue(this.chip.getAutoshotThresholdEvents() >> 10); final int[] vals = { 10, 100, 1000 }, mults = { 1, 10, 100 }; final float[] fvals = { .02f, .2f, 2, 20, 200, 2000 }, fmults = { .001f, .01f, .1f, 1, 10, 100 }; autoshotThresholdSp.addMouseWheelListener(new SpinnerMouseWheelIntHandler(vals, mults)); autoExpCB.setSelected(this.chip.isAutoExposureEnabled()); fdSp.addMouseWheelListener(new SpinnerMouseWheelFloatHandler(fvals, fmults)); edSp.addMouseWheelListener(new SpinnerMouseWheelFloatHandler(fvals, fmults)); dvsContSp.addMouseWheelListener(new SpinnerMouseWheelIntHandler(new int[] { 10, 20 }, new int[] { 1, 2 })); dvsContSp.setValue(renderer.getColorScale()); contrastSp.addMouseWheelListener(new SpinnerMouseWheelFloatHandler(new float[] { 1, 2 }, new float[] { .05f, .1f })); setDvsColorModeRadioButtons(); renderer.getSupport().addPropertyChangeListener(this); if (getConfig() instanceof DavisConfig) { // add us as observer for various property changes final DavisConfig config = getConfig(); videoControl = config.getVideoControl(); videoControl.addObserver(this); // display of various events/frames enabled comes here // config.exposureControlRegister.addObserver(this); // config.frameDelayControlRegister.addObserver(this); // TODO generates loop that resets the spinner if the // new spinner // value does not change the exposureControlRegister in ms according to new register value imuVisibleCB.setSelected(config.isDisplayImu()); imuEnabledCB.setSelected(config.isImuEnabled()); } contrastController = ((AEFrameChipRenderer) ((AEChip) chip).getRenderer()).getContrastController(); contrastController.addObserver(this); // get updates from contrast controller contrastSp.setValue(contrastController.getContrast()); contrastSp.setEnabled(!contrastController.isUseAutoContrast()); autoContrastCB.setSelected(contrastController.isUseAutoContrast()); this.chip.addObserver(this); chip.getSupport().addPropertyChangeListener(this); chip.getBiasgen().getSupport().addPropertyChangeListener(this); } private void setDvsColorModeRadioButtons() { switch (renderer.getColorMode()) { case RedGreen: dvsRedGrRB.setSelected(true); break; case GrayLevel: dvsGrayRB.setSelected(true); break; default: dvsColorButGrp.clearSelection(); } } private DavisConfig getConfig() { return ((DavisBaseCamera) chip).getDavisConfig(); } private class SpinnerMouseWheelIntHandler implements MouseWheelListener { private final int[] vals, mults; /** * Constructs a new instance * * @param vals * the threshold values * @param mults * the multipliers for spinner values less than or equal to * that number */ SpinnerMouseWheelIntHandler(final int[] vals, final int[] mults) { if ((vals == null) || (mults == null)) { throw new RuntimeException("vals or mults is null"); } if (vals.length != mults.length) { throw new RuntimeException("vals and mults array must be same length and they are not: vals.length=" + vals.length + " mults.length=" + mults.length); } this.vals = vals; this.mults = mults; } @Override public void mouseWheelMoved(final MouseWheelEvent mwe) { final JSpinner spinner = (JSpinner) mwe.getSource(); if (mwe.getScrollType() != MouseWheelEvent.WHEEL_UNIT_SCROLL) { return; } try { int value = (Integer) spinner.getValue(); int i = 0; for (i = 0; i < vals.length; i++) { if (value < vals[i]) { break; } } if (i >= vals.length) { i = vals.length - 1; } final int mult = mults[i]; value -= mult * mwe.getWheelRotation(); if (value < 0) { value = 0; } spinner.setValue(value); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); return; } } } private class SpinnerMouseWheelFloatHandler implements MouseWheelListener { private final float[] vals, mults; /** * Constructs a new instance * * @param vals * the threshold values * @param mults * the multipliers for spinner values less than or equal to * that number */ SpinnerMouseWheelFloatHandler(final float[] vals, final float[] mults) { if ((vals == null) || (mults == null)) { throw new RuntimeException("vals or mults is null"); } if (vals.length != mults.length) { throw new RuntimeException("vals and mults array must be same length and they are not: vals.length=" + vals.length + " mults.length=" + mults.length); } this.vals = vals; this.mults = mults; } @Override public void mouseWheelMoved(final MouseWheelEvent mwe) { final JSpinner spinner = (JSpinner) mwe.getSource(); if (mwe.getScrollType() != MouseWheelEvent.WHEEL_UNIT_SCROLL) { return; } try { float value = (Float) spinner.getValue(); int i = 0; // int rot = mwe.getWheelRotation(); // >0 is roll down, want smaller value if (true) { for (i = 0; i < vals.length; i++) { if (value <= vals[i]) { break; // take value from vals array that is just above our current value, e.g. if our // current value is 11, then take 20 (if that is next higher vals) as next value and // mult of 20 value as decrement amount } } if (i > (vals.length - 1)) { i = vals.length - 1; } } // else { // roll up, want larger value // for (i = vals.length-1; i >=0 ; i--) { // if (value >= vals[i]) { // break; // now start at highest vals value and go down, until we find next lower or equal vals, e.g. // if we are at 11, then take 2 (if that is next lower value) and then choose that mult that goes with 2 // to decr // } // } // if (i<0) { // i = 0; // } // } final float mult = mults[i]; value -= mult * mwe.getWheelRotation(); if (value < 0) { value = 0; } spinner.setValue(value); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); } } } private void setFileModified() { if ((getChip() != null) && (getChip().getAeViewer() != null) && (getChip().getAeViewer().getBiasgenFrame() != null)) { getChip().getAeViewer().getBiasgenFrame().setFileModified(true); } } /** * Handles property changes from PotTweakers and measured * exposureControlRegister and frame rate from chip * * @param evt */ @Override public void propertyChange(final PropertyChangeEvent evt) { final String name = evt.getPropertyName(); try { switch (name) { case DavisVideoContrastController.AGC_VALUES: { contrastSp.setValue(contrastController.getAutoContrast()); } break; case DVSTweaks.THRESHOLD: // fired from Davis240Config setBandwidthTweak { final float v = (Float) evt.getNewValue(); thresholdTweaker.setValue(v); } break; case DVSTweaks.BANDWIDTH: // log.info(evt.toString()); { final float v = (Float) evt.getNewValue(); bandwidthTweaker.setValue(v); } break; case DVSTweaks.MAX_FIRING_RATE: { final float v = (Float) evt.getNewValue(); maxFiringRateTweaker.setValue(v); } break; case DVSTweaks.ON_OFF_BALANCE: { final float v = (Float) evt.getNewValue(); onOffBalanceTweaker.setValue(v); } break; case DavisChip.PROPERTY_MEASURED_EXPOSURE_MS: { exposMsTF.setText(String.format("%.3f", (Float) evt.getNewValue())); } break; case DavisChip.PROPERTY_FRAME_RATE_HZ: { fpsTF.setText(String.format("%.3f", (Float) evt.getNewValue())); } break; case AEChipRenderer.EVENT_COLOR_MODE_CHANGE: { setDvsColorModeRadioButtons(); } break; case AEChipRenderer.EVENT_COLOR_SCALE_CHANGE: { dvsContSp.setValue(renderer.getColorScale()); } break; case DavisDisplayConfigInterface.PROPERTY_IMU_ENABLED: { imuEnabledCB.setSelected((boolean) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_IMU_DISPLAY_ENABLED: { imuVisibleCB.setSelected((boolean) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_DISPLAY_FRAMES_ENABLED: { displayFramesCheckBox.setSelected((boolean) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_CAPTURE_FRAMES_ENABLED: { captureFramesCheckBox.setSelected((boolean) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_CAPTURE_EVENTS_ENABLED: { captureEventsCB.setSelected((boolean) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_DISPLAY_EVENTS_ENABLED: { displayEventsCheckBox.setSelected((boolean) evt.getNewValue()); } break; case DavisVideoContrastController.PROPERTY_CONTRAST: { contrastSp.setValue((float) evt.getNewValue()); } break; case DavisDisplayConfigInterface.PROPERTY_EXPOSURE_DELAY_US: { edSp.setValue((Integer) evt.getNewValue() * .001f); } break; case DavisDisplayConfigInterface.PROPERTY_FRAME_DELAY_US: { fdSp.setValue((Integer) evt.getNewValue() * .001f); } break; case DavisDisplayConfigInterface.PROPERTY_GLOBAL_SHUTTER_MODE_ENABLED: { glShutterCB.setSelected((Boolean) evt.getNewValue()); } break; case DavisChip.PROPERTY_AUTO_EXPOSURE_ENABLED: { autoExpCB.setSelected((Boolean) evt.getNewValue()); } break; } } catch (final Exception e) { DavisUserControlPanel.log.warning("responding to property change, caught " + e.toString()); e.printStackTrace(); } } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { dvsColorButGrp = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jPanel2 = new javax.swing.JPanel(); dvsPanel = new javax.swing.JPanel(); displayEventsCheckBox = new javax.swing.JCheckBox(); dvsPixControl = new javax.swing.JPanel(); bandwidthTweaker = new net.sf.jaer.biasgen.PotTweaker(); thresholdTweaker = new net.sf.jaer.biasgen.PotTweaker(); maxFiringRateTweaker = new net.sf.jaer.biasgen.PotTweaker(); onOffBalanceTweaker = new net.sf.jaer.biasgen.PotTweaker(); dvsRedGrRB = new javax.swing.JRadioButton(); dvsGrayRB = new javax.swing.JRadioButton(); dvsContLabel = new javax.swing.JLabel(); dvsContSp = new javax.swing.JSpinner(); captureEventsCB = new javax.swing.JCheckBox(); apsPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); fdSp = new javax.swing.JSpinner(); jLabel2 = new javax.swing.JLabel(); edSp = new javax.swing.JSpinner(); autoExpCB = new javax.swing.JCheckBox(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); fpsTF = new javax.swing.JTextField(); exposMsTF = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); autoshotThresholdSp = new javax.swing.JSpinner(); contrastSp = new javax.swing.JSpinner(); autoContrastCB = new javax.swing.JCheckBox(); displayFramesCheckBox = new javax.swing.JCheckBox(); histCB = new javax.swing.JCheckBox(); snapshotButton = new javax.swing.JButton(); captureFramesCheckBox = new javax.swing.JCheckBox(); glShutterCB = new javax.swing.JCheckBox(); imuPanel = new javax.swing.JPanel(); imuVisibleCB = new javax.swing.JCheckBox(); imuEnabledCB = new javax.swing.JCheckBox(); final javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100, Short.MAX_VALUE)); jPanel1Layout .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100, Short.MAX_VALUE)); dvsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DVS", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N dvsPanel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N displayEventsCheckBox.setText("Display events"); displayEventsCheckBox.setToolTipText("Enables rendering of DVS events"); displayEventsCheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { displayEventsCheckBoxActionPerformed(evt); } }); final javax.swing.GroupLayout dvsPixControlLayout = new javax.swing.GroupLayout(dvsPixControl); dvsPixControl.setLayout(dvsPixControlLayout); dvsPixControlLayout.setHorizontalGroup( dvsPixControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); dvsPixControlLayout.setVerticalGroup( dvsPixControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); bandwidthTweaker.setLessDescription("Slower"); bandwidthTweaker.setMinimumSize(new java.awt.Dimension(80, 30)); bandwidthTweaker.setMoreDescription("Faster"); bandwidthTweaker.setName("Adjusts pixel bandwidth"); // NOI18N bandwidthTweaker.setPreferredSize(new java.awt.Dimension(250, 47)); bandwidthTweaker.setTweakDescription(""); bandwidthTweaker.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { bandwidthTweakerStateChanged(evt); } }); thresholdTweaker.setLessDescription("Lower/more events"); thresholdTweaker.setMinimumSize(new java.awt.Dimension(80, 30)); thresholdTweaker.setMoreDescription("Higher/less events"); thresholdTweaker.setName("Adjusts event threshold"); // NOI18N thresholdTweaker.setPreferredSize(new java.awt.Dimension(250, 47)); thresholdTweaker.setTweakDescription(""); thresholdTweaker.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { thresholdTweakerStateChanged(evt); } }); maxFiringRateTweaker.setLessDescription("Slower"); maxFiringRateTweaker.setMinimumSize(new java.awt.Dimension(80, 30)); maxFiringRateTweaker.setMoreDescription("Faster"); maxFiringRateTweaker.setName("Adjusts maximum pixel firing rate (1/refactory period)"); // NOI18N maxFiringRateTweaker.setPreferredSize(new java.awt.Dimension(250, 47)); maxFiringRateTweaker.setTweakDescription(""); maxFiringRateTweaker.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { maxFiringRateTweakerStateChanged(evt); } }); onOffBalanceTweaker.setLessDescription("More Off events"); onOffBalanceTweaker.setMinimumSize(new java.awt.Dimension(80, 30)); onOffBalanceTweaker.setMoreDescription("More On events"); onOffBalanceTweaker.setName("Adjusts balance bewteen On and Off events"); // NOI18N onOffBalanceTweaker.setPreferredSize(new java.awt.Dimension(250, 47)); onOffBalanceTweaker.setTweakDescription(""); onOffBalanceTweaker.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { onOffBalanceTweakerStateChanged(evt); } }); dvsColorButGrp.add(dvsRedGrRB); dvsRedGrRB.setText("Red/Green"); dvsRedGrRB.setToolTipText("Show DVS events rendered as green (ON) and red (OFF) 2d histogram"); dvsRedGrRB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { dvsRedGrRBActionPerformed(evt); } }); dvsColorButGrp.add(dvsGrayRB); dvsGrayRB.setText("Gray"); dvsGrayRB.setToolTipText("Show DVS events rendered as gray scale 2d histogram"); dvsGrayRB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { dvsGrayRBActionPerformed(evt); } }); dvsContLabel.setText("Contrast"); dvsContSp.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1))); dvsContSp.setToolTipText( "Rendering contrast of DVS events (1 is default). This many events makes full scale color, either black/white or red/green."); dvsContSp.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { dvsContSpStateChanged(evt); } }); captureEventsCB.setText("Capture events"); captureEventsCB.setToolTipText("Enables capture of DVS events. Disabling capture turns off AER output of sensor."); captureEventsCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { captureEventsCBActionPerformed(evt); } }); final javax.swing.GroupLayout dvsPanelLayout = new javax.swing.GroupLayout(dvsPanel); dvsPanel.setLayout(dvsPanelLayout); dvsPanelLayout.setHorizontalGroup(dvsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dvsPanelLayout.createSequentialGroup().addGap(10, 10, 10) .addGroup(dvsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(thresholdTweaker, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(maxFiringRateTweaker, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(onOffBalanceTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(bandwidthTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(dvsPixControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dvsPanelLayout.createSequentialGroup().addContainerGap() .addComponent(captureEventsCB, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(displayEventsCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(dvsContLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(dvsContSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(dvsGrayRB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(dvsRedGrRB))); dvsPanelLayout.setVerticalGroup(dvsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, dvsPanelLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(dvsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(captureEventsCB) .addComponent(displayEventsCheckBox).addComponent(dvsContLabel) .addComponent(dvsContSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(dvsGrayRB).addComponent(dvsRedGrRB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(dvsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(dvsPixControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( dvsPanelLayout.createSequentialGroup() .addComponent(bandwidthTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(thresholdTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(maxFiringRateTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(onOffBalanceTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); apsPanel.setBorder( javax.swing.BorderFactory.createTitledBorder(null, "Image Sensor", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N apsPanel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setText("Frame Delay (ms)"); fdSp.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), Float.valueOf(0.0f), null, Float.valueOf(1.0f))); fdSp.setToolTipText("Delay of starting new frame capture after last frame"); fdSp.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { fdSpStateChanged(evt); } }); jLabel2.setText("Exposure delay (ms)"); edSp.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f))); edSp.setToolTipText("The exposure delay; affects actual exposure time"); edSp.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { edSpStateChanged(evt); } }); autoExpCB.setText("Auto exposure"); autoExpCB.setToolTipText("Automatically set pixel exposure delay. See AutoExposureController panel for full parameter set."); autoExpCB.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); autoExpCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); autoExpCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { autoExpCBActionPerformed(evt); } }); jLabel3.setText("Auto-Shot kevents/frame"); jLabel4.setText("Frame rate (Hz)"); jLabel5.setText("Expos. (ms)"); fpsTF.setEditable(false); fpsTF.setToolTipText("Measured frame rate in Hz"); exposMsTF.setEditable(false); exposMsTF.setToolTipText("Measured exposure time in ms"); exposMsTF.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { exposMsTFActionPerformed(evt); } }); jLabel6.setText("Contrast"); autoshotThresholdSp.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1))); autoshotThresholdSp.setToolTipText( "<html>Set non-zero to automatically trigger APS frame captures every this many thousand DVS events. <br>For better control of automatic frame capture,<br> including the use of pre-filtering of the DVS events, use the filter ApsDvsAutoShooter."); autoshotThresholdSp.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { autoshotThresholdSpStateChanged(evt); } }); contrastSp.setModel( new javax.swing.SpinnerNumberModel(Float.valueOf(1.0f), Float.valueOf(0.2f), Float.valueOf(5.0f), Float.valueOf(0.05f))); contrastSp.setToolTipText("Sets rendering contrast gain (1 is default). See Video Control panel for full set of controls."); contrastSp.addChangeListener(new javax.swing.event.ChangeListener() { @Override public void stateChanged(final javax.swing.event.ChangeEvent evt) { contrastSpStateChanged(evt); } }); autoContrastCB.setText("Auto contrast"); autoContrastCB.setToolTipText( "Uses DavisVideoContrastController to automatically set rendering contrast so that brightness (offset) and contrast (gain) scale min and max values to 0 and 1 respectively"); autoContrastCB.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); autoContrastCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); autoContrastCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { autoContrastCBActionPerformed(evt); } }); displayFramesCheckBox.setText("Display Frames"); displayFramesCheckBox.setToolTipText("Enables display of APS imager output"); displayFramesCheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { displayFramesCheckBoxActionPerformed(evt); } }); histCB.setText("histogram"); histCB.setToolTipText("Display hisogram of captured pixel values from ADC (reset - signal values)"); histCB.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); histCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); histCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { histCBActionPerformed(evt); } }); snapshotButton.setText("Take Snapshot"); snapshotButton.setToolTipText("Triggers a single frame capture to onscreen buffer"); snapshotButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { snapshotButtonActionPerformed(evt); } }); captureFramesCheckBox.setText("Capture Frames"); captureFramesCheckBox.setToolTipText("Enables capture of APS imager output (turns on ADC state machine)"); captureFramesCheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { captureFramesCheckBoxActionPerformed(evt); } }); glShutterCB.setText("Global shutter"); glShutterCB.setToolTipText("Enables global (synchronous) electronic shutter. Unchecked enables rolling shutter readout."); glShutterCB.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); glShutterCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); glShutterCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { glShutterCBActionPerformed(evt); } }); final javax.swing.GroupLayout apsPanelLayout = new javax.swing.GroupLayout(apsPanel); apsPanel.setLayout(apsPanelLayout); apsPanelLayout.setHorizontalGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(apsPanelLayout.createSequentialGroup() .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, apsPanelLayout.createSequentialGroup().addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(edSp)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, apsPanelLayout.createSequentialGroup().addGap(13, 13, 13).addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(fdSp, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel4) .addComponent(jLabel5)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addComponent(exposMsTF) .addComponent(fpsTF))) .addGroup(apsPanelLayout.createSequentialGroup().addContainerGap().addComponent(captureFramesCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(displayFramesCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(snapshotButton)) .addGroup(apsPanelLayout.createSequentialGroup() .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(apsPanelLayout.createSequentialGroup().addGap(4, 4, 4).addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(contrastSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(autoContrastCB)) .addGroup(apsPanelLayout.createSequentialGroup().addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(autoshotThresholdSp, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(autoExpCB) .addGroup(apsPanelLayout.createSequentialGroup().addComponent(glShutterCB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(histCB))))); apsPanelLayout.setVerticalGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(apsPanelLayout.createSequentialGroup() .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(apsPanelLayout.createSequentialGroup().addGap(4, 4, 4) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(captureFramesCheckBox).addComponent(displayFramesCheckBox))) .addComponent(snapshotButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1) .addComponent(fdSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4).addComponent(fpsTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2) .addComponent(edSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5).addComponent(exposMsTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(autoshotThresholdSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(autoExpCB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(apsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel6) .addComponent(contrastSp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(autoContrastCB).addComponent(histCB).addComponent(glShutterCB)))); snapshotButton.getAccessibleContext().setAccessibleName("snapshotButton"); imuPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("IMU")); imuPanel.setToolTipText("Controls for Inertial Measurement Unit (Gyro/Accelometer)"); imuVisibleCB.setText("Display"); imuVisibleCB.setToolTipText("show the IMU output if it is available"); imuVisibleCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); imuVisibleCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { imuVisibleCBActionPerformed(evt); } }); imuEnabledCB.setText("Enable"); imuEnabledCB.setToolTipText("show the IMU output if it is available"); imuEnabledCB.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); imuEnabledCB.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final java.awt.event.ActionEvent evt) { imuEnabledCBActionPerformed(evt); } }); final javax.swing.GroupLayout imuPanelLayout = new javax.swing.GroupLayout(imuPanel); imuPanel.setLayout(imuPanelLayout); imuPanelLayout.setHorizontalGroup(imuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, imuPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addGroup(imuPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(imuVisibleCB).addComponent(imuEnabledCB)) .addContainerGap())); imuPanelLayout .setVerticalGroup(imuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(imuPanelLayout.createSequentialGroup() .addComponent(imuEnabledCB, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(imuVisibleCB, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))); final javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout .createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(apsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jPanel2Layout .setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(apsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jScrollPane1.setViewportView(jPanel2); final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addComponent(jScrollPane1).addGap(16, 16, 16))); }// </editor-fold>//GEN-END:initComponents private void glShutterCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_glShutterCBActionPerformed ((DavisBaseCamera) chip).getDavisConfig().setGlobalShutter(glShutterCB.isSelected()); }// GEN-LAST:event_glShutterCBActionPerformed private void contrastSpStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_contrastSpStateChanged if (contrastController.isUseAutoContrast()) { return; // don't update if only used for display of contrast } try { final float f = (float) contrastSp.getValue(); contrastController.setContrast(f); contrastSp.setBackground(Color.GRAY); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); contrastSp.setBackground(Color.red); } }// GEN-LAST:event_contrastSpStateChanged private void autoContrastCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_autoContrastCBActionPerformed contrastController.setUseAutoContrast(autoContrastCB.isSelected()); }// GEN-LAST:event_autoContrastCBActionPerformed private void bandwidthTweakerStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_bandwidthTweakerStateChanged getDvsTweaks().setBandwidthTweak(bandwidthTweaker.getValue()); setFileModified(); }// GEN-LAST:event_bandwidthTweakerStateChanged private void thresholdTweakerStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_thresholdTweakerStateChanged getDvsTweaks().setThresholdTweak(thresholdTweaker.getValue()); setFileModified(); }// GEN-LAST:event_thresholdTweakerStateChanged private void maxFiringRateTweakerStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_maxFiringRateTweakerStateChanged getDvsTweaks().setMaxFiringRateTweak(maxFiringRateTweaker.getValue()); setFileModified(); }// GEN-LAST:event_maxFiringRateTweakerStateChanged private void onOffBalanceTweakerStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_onOffBalanceTweakerStateChanged getDvsTweaks().setOnOffBalanceTweak(onOffBalanceTweaker.getValue()); setFileModified(); }// GEN-LAST:event_onOffBalanceTweakerStateChanged private void exposMsTFActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_exposMsTFActionPerformed try { getConfig().setExposureDelayMs((float) edSp.getValue()); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); } }// GEN-LAST:event_exposMsTFActionPerformed private void fdSpStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_fdSpStateChanged try { getConfig().setFrameDelayMs((float) fdSp.getValue()); fdSp.setBackground(Color.WHITE); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); fdSp.setBackground(Color.RED); } }// GEN-LAST:event_fdSpStateChanged private void edSpStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_edSpStateChanged try { getConfig().setExposureDelayMs((float) edSp.getValue()); edSp.setBackground(Color.WHITE); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); edSp.setBackground(Color.RED); } }// GEN-LAST:event_edSpStateChanged private void displayFramesCheckBoxActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_displayFramesCheckBoxActionPerformed getConfig().setDisplayFrames(displayFramesCheckBox.isSelected()); }// GEN-LAST:event_displayFramesCheckBoxActionPerformed private void displayEventsCheckBoxActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_displayEventsCheckBoxActionPerformed getConfig().setDisplayEvents(displayEventsCheckBox.isSelected()); }// GEN-LAST:event_displayEventsCheckBoxActionPerformed private void autoshotThresholdSpStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_autoshotThresholdSpStateChanged try { chip.setAutoshotThresholdEvents((Integer) autoshotThresholdSp.getValue() << 10); } catch (final Exception e) { DavisUserControlPanel.log.warning(e.toString()); } }// GEN-LAST:event_autoshotThresholdSpStateChanged private void histCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_histCBActionPerformed chip.setShowImageHistogram(histCB.isSelected()); }// GEN-LAST:event_histCBActionPerformed private void dvsGrayRBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_dvsGrayRBActionPerformed renderer.setColorMode(AEChipRenderer.ColorMode.GrayLevel); }// GEN-LAST:event_dvsGrayRBActionPerformed private void dvsRedGrRBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_dvsRedGrRBActionPerformed renderer.setColorMode(AEChipRenderer.ColorMode.RedGreen); }// GEN-LAST:event_dvsRedGrRBActionPerformed private void dvsContSpStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_dvsContSpStateChanged renderer.setColorScale((Integer) dvsContSp.getValue()); }// GEN-LAST:event_dvsContSpStateChanged private void imuVisibleCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_imuVisibleCBActionPerformed getConfig().setDisplayImu(imuVisibleCB.isSelected()); }// GEN-LAST:event_imuVisibleCBActionPerformed private void snapshotButtonActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_snapshotButtonActionPerformed chip.takeSnapshot(); }// GEN-LAST:event_snapshotButtonActionPerformed private void autoExpCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_autoExpCBActionPerformed chip.setAutoExposureEnabled(autoExpCB.isSelected()); }// GEN-LAST:event_autoExpCBActionPerformed private void captureFramesCheckBoxActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_captureFramesCheckBoxActionPerformed getConfig().setCaptureFramesEnabled(captureFramesCheckBox.isSelected()); }// GEN-LAST:event_captureFramesCheckBoxActionPerformed private void captureEventsCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_captureEventsCBActionPerformed getConfig().setCaptureEvents(captureEventsCB.isSelected()); }// GEN-LAST:event_captureEventsCBActionPerformed private void imuEnabledCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_imuEnabledCBActionPerformed getConfig().setImuEnabled(imuEnabledCB.isSelected()); }// GEN-LAST:event_imuEnabledCBActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel apsPanel; private javax.swing.JCheckBox autoContrastCB; private javax.swing.JCheckBox autoExpCB; private javax.swing.JSpinner autoshotThresholdSp; private net.sf.jaer.biasgen.PotTweaker bandwidthTweaker; private javax.swing.JCheckBox captureEventsCB; private javax.swing.JCheckBox captureFramesCheckBox; private javax.swing.JSpinner contrastSp; private javax.swing.JCheckBox displayEventsCheckBox; private javax.swing.JCheckBox displayFramesCheckBox; private javax.swing.ButtonGroup dvsColorButGrp; private javax.swing.JLabel dvsContLabel; private javax.swing.JSpinner dvsContSp; private javax.swing.JRadioButton dvsGrayRB; private javax.swing.JPanel dvsPanel; private javax.swing.JPanel dvsPixControl; private javax.swing.JRadioButton dvsRedGrRB; private javax.swing.JSpinner edSp; private javax.swing.JTextField exposMsTF; private javax.swing.JSpinner fdSp; private javax.swing.JTextField fpsTF; private javax.swing.JCheckBox glShutterCB; private javax.swing.JCheckBox histCB; private javax.swing.JCheckBox imuEnabledCB; private javax.swing.JPanel imuPanel; private javax.swing.JCheckBox imuVisibleCB; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JScrollPane jScrollPane1; private net.sf.jaer.biasgen.PotTweaker maxFiringRateTweaker; private net.sf.jaer.biasgen.PotTweaker onOffBalanceTweaker; private javax.swing.JButton snapshotButton; private net.sf.jaer.biasgen.PotTweaker thresholdTweaker; // End of variables declaration//GEN-END:variables /** * @return the chip */ public DavisChip getChip() { return chip; } /** * @return the getConfig() */ public DavisDisplayConfigInterface getApsDvsConfig() { return getConfig(); } /** * @return the apsDvsTweaks */ public DVSTweaks getDvsTweaks() { return apsDvsTweaks; } /** * Handles Observable updates from Davis240Config, and inner classes * VideoControl and ApsReadoutControl * * @param o * @param arg */ @Override public void update(final Observable o, final Object arg) { // updates to user friendly controls come from low level properties here if (o == ((DavisBaseCamera) chip).getDavisConfig().getExposureControlRegister()) { edSp.setValue(getConfig().getExposureDelayMs()); } else if (o == ((DavisBaseCamera) chip).getDavisConfig().getFrameDelayControlRegister()) { fdSp.setValue(getConfig().getFrameDelayMs()); } else if (o == videoControl) { displayFramesCheckBox.setSelected(getConfig().isDisplayFrames()); displayEventsCheckBox.setSelected(getConfig().isDisplayEvents()); } else if (o == contrastController) { autoContrastCB.setSelected(contrastController.isUseAutoContrast()); contrastSp.setEnabled(!contrastController.isUseAutoContrast()); contrastSp.setValue(contrastController.getContrast()); } } }
lgpl-2.1
geotools/geotools
modules/plugin/jdbc/jdbc-postgis/src/test/java/org/geotools/data/postgis/PostgisSimplifiedGeometryPreparedTest.java
1022
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2020, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ package org.geotools.data.postgis; import org.geotools.data.postgis.ps.PostGISPSTestSetup; import org.geotools.jdbc.JDBCTestSetup; public class PostgisSimplifiedGeometryPreparedTest extends PostgisSimplifiedGeometryTest { @Override protected JDBCTestSetup createTestSetup() { return new PostgisSimplifiedGeometryTestSetup(new PostGISPSTestSetup()); } }
lgpl-2.1
geotools/geotools
modules/extension/xsd/xsd-gml3/src/main/java/org/geotools/gml3/bindings/AbstractGeometryTypeBinding.java
5890
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2015, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.gml3.bindings; import javax.xml.namespace.QName; import org.geotools.geometry.jts.JTS; import org.geotools.gml2.SrsSyntax; import org.geotools.gml2.bindings.GML2EncodingUtils; import org.geotools.gml3.GML; import org.geotools.xsd.AbstractComplexBinding; import org.geotools.xsd.Configuration; import org.geotools.xsd.ElementInstance; import org.geotools.xsd.Node; import org.locationtech.jts.geom.Geometry; import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * Binding object for the type http://www.opengis.net/gml:AbstractGeometryType. * * <p> * * <pre> * <code> * &lt;complexType abstract="true" name="AbstractGeometryType"&gt; * &lt;annotation&gt; * &lt;documentation&gt;All geometry elements are derived directly or indirectly from this abstract supertype. A geometry element may * have an identifying attribute ("gml:id"), a name (attribute "name") and a description (attribute "description"). It may be associated * with a spatial reference system (attribute "srsName"). The following rules shall be adhered: - Every geometry type shall derive * from this abstract type. - Every geometry element (i.e. an element of a geometry type) shall be directly or indirectly in the * substitution group of _Geometry.&lt;/documentation&gt; * &lt;/annotation&gt; * &lt;complexContent&gt; * &lt;extension base="gml:AbstractGMLType"&gt; * &lt;attribute name="gid" type="string" use="optional"&gt; * &lt;annotation&gt; * &lt;documentation&gt;This attribute is included for backward compatibility with GML 2 and is deprecated with GML 3. * This identifer is superceded by "gml:id" inherited from AbstractGMLType. The attribute "gid" should not be used * anymore and may be deleted in future versions of GML without further notice.&lt;/documentation&gt; * &lt;/annotation&gt; * &lt;/attribute&gt; * &lt;attributeGroup ref="gml:SRSReferenceGroup"/&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * * </code> * </pre> * * @generated */ public class AbstractGeometryTypeBinding extends AbstractComplexBinding { Configuration config; SrsSyntax srsSyntax; public AbstractGeometryTypeBinding(Configuration config, SrsSyntax srsSyntax) { this.config = config; this.srsSyntax = srsSyntax; } public void setConfiguration(Configuration config) { this.config = config; } public void setSrsSyntax(SrsSyntax srsSyntax) { this.srsSyntax = srsSyntax; } /** @generated */ @Override public QName getTarget() { return GML.AbstractGeometryType; } /** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ @Override public Class getType() { return Geometry.class; } /** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ @Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { // set the crs if (value instanceof Geometry) { CoordinateReferenceSystem crs = GML3ParsingUtils.crs(node); if (crs != null) { Geometry geometry = (Geometry) value; geometry.setUserData(crs); } } return value; } @Override public Object getProperty(Object object, QName name) throws Exception { Geometry geometry = (Geometry) object; if ("srsName".equals(name.getLocalPart())) { CoordinateReferenceSystem crs = JTS.getCRS(geometry); if (crs != null) { return GML3EncodingUtils.toURI(crs, srsSyntax); } } if ("srsDimension".equals(name.getLocalPart())) { return GML2EncodingUtils.getGeometryDimension(geometry, config); } // FIXME: should be gml:id, but which GML? // Refactor bindings or introduce a new one for GML 3.2 if ("id".equals(name.getLocalPart())) { return GML3EncodingUtils.getID(geometry); } // FIXME: should be gml:name, but which GML? // Refactor bindings or introduce a new one for GML 3.2 if ("name".equals(name.getLocalPart())) { return GML3EncodingUtils.getName(geometry); } // FIXME: should be gml:description, but which GML? // Refactor bindings or introduce a new one for GML 3.2 if ("description".equals(name.getLocalPart())) { return GML3EncodingUtils.getDescription(geometry); } if ("uomLabels".equals(name.getLocalPart())) { return GML3EncodingUtils.getUomLabels(geometry); } if ("axisLabels".equals(name.getLocalPart())) { return GML3EncodingUtils.getAxisLabels(geometry); } return null; } }
lgpl-2.1
0x0000-dot-ru/jcommune
jcommune-service/src/main/java/org/jtalks/jcommune/service/UserContactsService.java
1993
/** * Copyright (C) 2011 JTalks.org Team * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jtalks.jcommune.service; import org.jtalks.jcommune.model.entity.JCUser; import org.jtalks.jcommune.model.entity.UserContact; import org.jtalks.jcommune.model.entity.UserContactType; import org.jtalks.jcommune.service.dto.UserContactContainer; import org.jtalks.jcommune.service.exceptions.NotFoundException; import java.util.List; /** * This interface should have methods which give us more abilities in manipulating UserContactType persistent entity. * * @author Michael Gamov */ public interface UserContactsService extends EntityService<UserContactType> { /** * Returns a list of contact types permitted in the current configuration. * These types are to be configured from Poulpe. * * @return valid contact type list, e.g (skype, icq, jabber, mail, cell) */ List<UserContactType> getAvailableContactTypes(); /** * Update user contacts. * * @param editedUserId an identifier of edited user * @return updated contacts * @throws NotFoundException if edited user or contacts don't exists in system */ JCUser saveEditedUserContacts(long editedUserId, List<UserContactContainer> contacts) throws NotFoundException; }
lgpl-2.1
santufunes/MinecraftMod
src/main/java/com/example/examplemod/ExampleMod.java
636
package com.example.examplemod; import net.minecraft.init.Blocks; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; //@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION) //public class ExampleMod //{ // public static final String MODID = "examplemod"; // public static final String VERSION = "1.0"; // // @EventHandler // public void init(FMLInitializationEvent event) // { // // some example code // System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); // } //}
lgpl-2.1
fbettag/geoip-akka
src/main/java/com/maxmind/geoip/timeZone.java
58953
package com.maxmind.geoip; // generated automatically from admin/generate_timeZone.pl public class timeZone { static public String timeZoneByCountryAndRegion(String country,String region) { String timezone = null; if (country == null) { return null; } if (region == null) { region = ""; } if (country.equals("US") == true) { if (region.equals("AL") == true) { timezone = "America/Chicago"; } else if (region.equals("AK") == true) { timezone = "America/Anchorage"; } else if (region.equals("AZ") == true) { timezone = "America/Phoenix"; } else if (region.equals("AR") == true) { timezone = "America/Chicago"; } else if (region.equals("CA") == true) { timezone = "America/Los_Angeles"; } else if (region.equals("CO") == true) { timezone = "America/Denver"; } else if (region.equals("CT") == true) { timezone = "America/New_York"; } else if (region.equals("DE") == true) { timezone = "America/New_York"; } else if (region.equals("DC") == true) { timezone = "America/New_York"; } else if (region.equals("FL") == true) { timezone = "America/New_York"; } else if (region.equals("GA") == true) { timezone = "America/New_York"; } else if (region.equals("HI") == true) { timezone = "Pacific/Honolulu"; } else if (region.equals("ID") == true) { timezone = "America/Denver"; } else if (region.equals("IL") == true) { timezone = "America/Chicago"; } else if (region.equals("IN") == true) { timezone = "America/Indianapolis"; } else if (region.equals("IA") == true) { timezone = "America/Chicago"; } else if (region.equals("KS") == true) { timezone = "America/Chicago"; } else if (region.equals("KY") == true) { timezone = "America/New_York"; } else if (region.equals("LA") == true) { timezone = "America/Chicago"; } else if (region.equals("ME") == true) { timezone = "America/New_York"; } else if (region.equals("MD") == true) { timezone = "America/New_York"; } else if (region.equals("MA") == true) { timezone = "America/New_York"; } else if (region.equals("MI") == true) { timezone = "America/New_York"; } else if (region.equals("MN") == true) { timezone = "America/Chicago"; } else if (region.equals("MS") == true) { timezone = "America/Chicago"; } else if (region.equals("MO") == true) { timezone = "America/Chicago"; } else if (region.equals("MT") == true) { timezone = "America/Denver"; } else if (region.equals("NE") == true) { timezone = "America/Chicago"; } else if (region.equals("NV") == true) { timezone = "America/Los_Angeles"; } else if (region.equals("NH") == true) { timezone = "America/New_York"; } else if (region.equals("NJ") == true) { timezone = "America/New_York"; } else if (region.equals("NM") == true) { timezone = "America/Denver"; } else if (region.equals("NY") == true) { timezone = "America/New_York"; } else if (region.equals("NC") == true) { timezone = "America/New_York"; } else if (region.equals("ND") == true) { timezone = "America/Chicago"; } else if (region.equals("OH") == true) { timezone = "America/New_York"; } else if (region.equals("OK") == true) { timezone = "America/Chicago"; } else if (region.equals("OR") == true) { timezone = "America/Los_Angeles"; } else if (region.equals("PA") == true) { timezone = "America/New_York"; } else if (region.equals("RI") == true) { timezone = "America/New_York"; } else if (region.equals("SC") == true) { timezone = "America/New_York"; } else if (region.equals("SD") == true) { timezone = "America/Chicago"; } else if (region.equals("TN") == true) { timezone = "America/Chicago"; } else if (region.equals("TX") == true) { timezone = "America/Chicago"; } else if (region.equals("UT") == true) { timezone = "America/Denver"; } else if (region.equals("VT") == true) { timezone = "America/New_York"; } else if (region.equals("VA") == true) { timezone = "America/New_York"; } else if (region.equals("WA") == true) { timezone = "America/Los_Angeles"; } else if (region.equals("WV") == true) { timezone = "America/New_York"; } else if (region.equals("WI") == true) { timezone = "America/Chicago"; } else if (region.equals("WY") == true) { timezone = "America/Denver"; } } else if (country.equals("CA") == true) { if (region.equals("AB") == true) { timezone = "America/Edmonton"; } else if (region.equals("BC") == true) { timezone = "America/Vancouver"; } else if (region.equals("MB") == true) { timezone = "America/Winnipeg"; } else if (region.equals("NB") == true) { timezone = "America/Halifax"; } else if (region.equals("NL") == true) { timezone = "America/St_Johns"; } else if (region.equals("NT") == true) { timezone = "America/Yellowknife"; } else if (region.equals("NS") == true) { timezone = "America/Halifax"; } else if (region.equals("NU") == true) { timezone = "America/Rankin_Inlet"; } else if (region.equals("ON") == true) { timezone = "America/Rainy_River"; } else if (region.equals("PE") == true) { timezone = "America/Halifax"; } else if (region.equals("QC") == true) { timezone = "America/Montreal"; } else if (region.equals("SK") == true) { timezone = "America/Regina"; } else if (region.equals("YT") == true) { timezone = "America/Whitehorse"; } } else if (country.equals("AU") == true) { if (region.equals("01") == true) { timezone = "Australia/Canberra"; } else if (region.equals("02") == true) { timezone = "Australia/NSW"; } else if (region.equals("03") == true) { timezone = "Australia/North"; } else if (region.equals("04") == true) { timezone = "Australia/Queensland"; } else if (region.equals("05") == true) { timezone = "Australia/South"; } else if (region.equals("06") == true) { timezone = "Australia/Tasmania"; } else if (region.equals("07") == true) { timezone = "Australia/Victoria"; } else if (region.equals("08") == true) { timezone = "Australia/West"; } } else if (country.equals("AS") == true) { timezone = "US/Samoa"; } else if (country.equals("CI") == true) { timezone = "Africa/Abidjan"; } else if (country.equals("GH") == true) { timezone = "Africa/Accra"; } else if (country.equals("DZ") == true) { timezone = "Africa/Algiers"; } else if (country.equals("ER") == true) { timezone = "Africa/Asmera"; } else if (country.equals("ML") == true) { timezone = "Africa/Bamako"; } else if (country.equals("CF") == true) { timezone = "Africa/Bangui"; } else if (country.equals("GM") == true) { timezone = "Africa/Banjul"; } else if (country.equals("GW") == true) { timezone = "Africa/Bissau"; } else if (country.equals("CG") == true) { timezone = "Africa/Brazzaville"; } else if (country.equals("BI") == true) { timezone = "Africa/Bujumbura"; } else if (country.equals("EG") == true) { timezone = "Africa/Cairo"; } else if (country.equals("MA") == true) { timezone = "Africa/Casablanca"; } else if (country.equals("GN") == true) { timezone = "Africa/Conakry"; } else if (country.equals("SN") == true) { timezone = "Africa/Dakar"; } else if (country.equals("DJ") == true) { timezone = "Africa/Djibouti"; } else if (country.equals("SL") == true) { timezone = "Africa/Freetown"; } else if (country.equals("BW") == true) { timezone = "Africa/Gaborone"; } else if (country.equals("ZW") == true) { timezone = "Africa/Harare"; } else if (country.equals("ZA") == true) { timezone = "Africa/Johannesburg"; } else if (country.equals("UG") == true) { timezone = "Africa/Kampala"; } else if (country.equals("SD") == true) { timezone = "Africa/Khartoum"; } else if (country.equals("RW") == true) { timezone = "Africa/Kigali"; } else if (country.equals("NG") == true) { timezone = "Africa/Lagos"; } else if (country.equals("GA") == true) { timezone = "Africa/Libreville"; } else if (country.equals("TG") == true) { timezone = "Africa/Lome"; } else if (country.equals("AO") == true) { timezone = "Africa/Luanda"; } else if (country.equals("ZM") == true) { timezone = "Africa/Lusaka"; } else if (country.equals("GQ") == true) { timezone = "Africa/Malabo"; } else if (country.equals("MZ") == true) { timezone = "Africa/Maputo"; } else if (country.equals("LS") == true) { timezone = "Africa/Maseru"; } else if (country.equals("SZ") == true) { timezone = "Africa/Mbabane"; } else if (country.equals("SO") == true) { timezone = "Africa/Mogadishu"; } else if (country.equals("LR") == true) { timezone = "Africa/Monrovia"; } else if (country.equals("KE") == true) { timezone = "Africa/Nairobi"; } else if (country.equals("TD") == true) { timezone = "Africa/Ndjamena"; } else if (country.equals("NE") == true) { timezone = "Africa/Niamey"; } else if (country.equals("MR") == true) { timezone = "Africa/Nouakchott"; } else if (country.equals("BF") == true) { timezone = "Africa/Ouagadougou"; } else if (country.equals("ST") == true) { timezone = "Africa/Sao_Tome"; } else if (country.equals("LY") == true) { timezone = "Africa/Tripoli"; } else if (country.equals("TN") == true) { timezone = "Africa/Tunis"; } else if (country.equals("AI") == true) { timezone = "America/Anguilla"; } else if (country.equals("AG") == true) { timezone = "America/Antigua"; } else if (country.equals("AW") == true) { timezone = "America/Aruba"; } else if (country.equals("BB") == true) { timezone = "America/Barbados"; } else if (country.equals("BZ") == true) { timezone = "America/Belize"; } else if (country.equals("CO") == true) { timezone = "America/Bogota"; } else if (country.equals("VE") == true) { timezone = "America/Caracas"; } else if (country.equals("KY") == true) { timezone = "America/Cayman"; } else if (country.equals("CR") == true) { timezone = "America/Costa_Rica"; } else if (country.equals("DM") == true) { timezone = "America/Dominica"; } else if (country.equals("SV") == true) { timezone = "America/El_Salvador"; } else if (country.equals("GD") == true) { timezone = "America/Grenada"; } else if (country.equals("FR") == true) { timezone = "Europe/Paris"; } else if (country.equals("GP") == true) { timezone = "America/Guadeloupe"; } else if (country.equals("GT") == true) { timezone = "America/Guatemala"; } else if (country.equals("GY") == true) { timezone = "America/Guyana"; } else if (country.equals("CU") == true) { timezone = "America/Havana"; } else if (country.equals("JM") == true) { timezone = "America/Jamaica"; } else if (country.equals("BO") == true) { timezone = "America/La_Paz"; } else if (country.equals("PE") == true) { timezone = "America/Lima"; } else if (country.equals("NI") == true) { timezone = "America/Managua"; } else if (country.equals("MQ") == true) { timezone = "America/Martinique"; } else if (country.equals("UY") == true) { timezone = "America/Montevideo"; } else if (country.equals("MS") == true) { timezone = "America/Montserrat"; } else if (country.equals("BS") == true) { timezone = "America/Nassau"; } else if (country.equals("PA") == true) { timezone = "America/Panama"; } else if (country.equals("SR") == true) { timezone = "America/Paramaribo"; } else if (country.equals("PR") == true) { timezone = "America/Puerto_Rico"; } else if (country.equals("KN") == true) { timezone = "America/St_Kitts"; } else if (country.equals("LC") == true) { timezone = "America/St_Lucia"; } else if (country.equals("VC") == true) { timezone = "America/St_Vincent"; } else if (country.equals("HN") == true) { timezone = "America/Tegucigalpa"; } else if (country.equals("YE") == true) { timezone = "Asia/Aden"; } else if (country.equals("JO") == true) { timezone = "Asia/Amman"; } else if (country.equals("TM") == true) { timezone = "Asia/Ashgabat"; } else if (country.equals("IQ") == true) { timezone = "Asia/Baghdad"; } else if (country.equals("BH") == true) { timezone = "Asia/Bahrain"; } else if (country.equals("AZ") == true) { timezone = "Asia/Baku"; } else if (country.equals("TH") == true) { timezone = "Asia/Bangkok"; } else if (country.equals("LB") == true) { timezone = "Asia/Beirut"; } else if (country.equals("KG") == true) { timezone = "Asia/Bishkek"; } else if (country.equals("BN") == true) { timezone = "Asia/Brunei"; } else if (country.equals("IN") == true) { timezone = "Asia/Calcutta"; } else if (country.equals("MN") == true) { timezone = "Asia/Choibalsan"; } else if (country.equals("LK") == true) { timezone = "Asia/Colombo"; } else if (country.equals("BD") == true) { timezone = "Asia/Dhaka"; } else if (country.equals("AE") == true) { timezone = "Asia/Dubai"; } else if (country.equals("TJ") == true) { timezone = "Asia/Dushanbe"; } else if (country.equals("HK") == true) { timezone = "Asia/Hong_Kong"; } else if (country.equals("TR") == true) { timezone = "Asia/Istanbul"; } else if (country.equals("IL") == true) { timezone = "Asia/Jerusalem"; } else if (country.equals("AF") == true) { timezone = "Asia/Kabul"; } else if (country.equals("PK") == true) { timezone = "Asia/Karachi"; } else if (country.equals("NP") == true) { timezone = "Asia/Katmandu"; } else if (country.equals("KW") == true) { timezone = "Asia/Kuwait"; } else if (country.equals("MO") == true) { timezone = "Asia/Macao"; } else if (country.equals("PH") == true) { timezone = "Asia/Manila"; } else if (country.equals("OM") == true) { timezone = "Asia/Muscat"; } else if (country.equals("CY") == true) { timezone = "Asia/Nicosia"; } else if (country.equals("KP") == true) { timezone = "Asia/Pyongyang"; } else if (country.equals("QA") == true) { timezone = "Asia/Qatar"; } else if (country.equals("MM") == true) { timezone = "Asia/Rangoon"; } else if (country.equals("SA") == true) { timezone = "Asia/Riyadh"; } else if (country.equals("KR") == true) { timezone = "Asia/Seoul"; } else if (country.equals("SG") == true) { timezone = "Asia/Singapore"; } else if (country.equals("TW") == true) { timezone = "Asia/Taipei"; } else if (country.equals("GE") == true) { timezone = "Asia/Tbilisi"; } else if (country.equals("BT") == true) { timezone = "Asia/Thimphu"; } else if (country.equals("JP") == true) { timezone = "Asia/Tokyo"; } else if (country.equals("LA") == true) { timezone = "Asia/Vientiane"; } else if (country.equals("AM") == true) { timezone = "Asia/Yerevan"; } else if (country.equals("BM") == true) { timezone = "Atlantic/Bermuda"; } else if (country.equals("CV") == true) { timezone = "Atlantic/Cape_Verde"; } else if (country.equals("FO") == true) { timezone = "Atlantic/Faeroe"; } else if (country.equals("IS") == true) { timezone = "Atlantic/Reykjavik"; } else if (country.equals("GS") == true) { timezone = "Atlantic/South_Georgia"; } else if (country.equals("SH") == true) { timezone = "Atlantic/St_Helena"; } else if (country.equals("CL") == true) { timezone = "Chile/Continental"; } else if (country.equals("NL") == true) { timezone = "Europe/Amsterdam"; } else if (country.equals("AD") == true) { timezone = "Europe/Andorra"; } else if (country.equals("GR") == true) { timezone = "Europe/Athens"; } else if (country.equals("YU") == true) { timezone = "Europe/Belgrade"; } else if (country.equals("DE") == true) { timezone = "Europe/Berlin"; } else if (country.equals("SK") == true) { timezone = "Europe/Bratislava"; } else if (country.equals("BE") == true) { timezone = "Europe/Brussels"; } else if (country.equals("RO") == true) { timezone = "Europe/Bucharest"; } else if (country.equals("HU") == true) { timezone = "Europe/Budapest"; } else if (country.equals("DK") == true) { timezone = "Europe/Copenhagen"; } else if (country.equals("IE") == true) { timezone = "Europe/Dublin"; } else if (country.equals("GI") == true) { timezone = "Europe/Gibraltar"; } else if (country.equals("FI") == true) { timezone = "Europe/Helsinki"; } else if (country.equals("SI") == true) { timezone = "Europe/Ljubljana"; } else if (country.equals("GB") == true) { timezone = "Europe/London"; } else if (country.equals("LU") == true) { timezone = "Europe/Luxembourg"; } else if (country.equals("MT") == true) { timezone = "Europe/Malta"; } else if (country.equals("BY") == true) { timezone = "Europe/Minsk"; } else if (country.equals("MC") == true) { timezone = "Europe/Monaco"; } else if (country.equals("NO") == true) { timezone = "Europe/Oslo"; } else if (country.equals("CZ") == true) { timezone = "Europe/Prague"; } else if (country.equals("LV") == true) { timezone = "Europe/Riga"; } else if (country.equals("IT") == true) { timezone = "Europe/Rome"; } else if (country.equals("SM") == true) { timezone = "Europe/San_Marino"; } else if (country.equals("BA") == true) { timezone = "Europe/Sarajevo"; } else if (country.equals("MK") == true) { timezone = "Europe/Skopje"; } else if (country.equals("BG") == true) { timezone = "Europe/Sofia"; } else if (country.equals("SE") == true) { timezone = "Europe/Stockholm"; } else if (country.equals("EE") == true) { timezone = "Europe/Tallinn"; } else if (country.equals("AL") == true) { timezone = "Europe/Tirane"; } else if (country.equals("LI") == true) { timezone = "Europe/Vaduz"; } else if (country.equals("VA") == true) { timezone = "Europe/Vatican"; } else if (country.equals("AT") == true) { timezone = "Europe/Vienna"; } else if (country.equals("LT") == true) { timezone = "Europe/Vilnius"; } else if (country.equals("PL") == true) { timezone = "Europe/Warsaw"; } else if (country.equals("HR") == true) { timezone = "Europe/Zagreb"; } else if (country.equals("IR") == true) { timezone = "Asia/Tehran"; } else if (country.equals("MG") == true) { timezone = "Indian/Antananarivo"; } else if (country.equals("CX") == true) { timezone = "Indian/Christmas"; } else if (country.equals("CC") == true) { timezone = "Indian/Cocos"; } else if (country.equals("KM") == true) { timezone = "Indian/Comoro"; } else if (country.equals("MV") == true) { timezone = "Indian/Maldives"; } else if (country.equals("MU") == true) { timezone = "Indian/Mauritius"; } else if (country.equals("YT") == true) { timezone = "Indian/Mayotte"; } else if (country.equals("RE") == true) { timezone = "Indian/Reunion"; } else if (country.equals("FJ") == true) { timezone = "Pacific/Fiji"; } else if (country.equals("TV") == true) { timezone = "Pacific/Funafuti"; } else if (country.equals("GU") == true) { timezone = "Pacific/Guam"; } else if (country.equals("NR") == true) { timezone = "Pacific/Nauru"; } else if (country.equals("NU") == true) { timezone = "Pacific/Niue"; } else if (country.equals("NF") == true) { timezone = "Pacific/Norfolk"; } else if (country.equals("PW") == true) { timezone = "Pacific/Palau"; } else if (country.equals("PN") == true) { timezone = "Pacific/Pitcairn"; } else if (country.equals("CK") == true) { timezone = "Pacific/Rarotonga"; } else if (country.equals("WS") == true) { timezone = "Pacific/Samoa"; } else if (country.equals("KI") == true) { timezone = "Pacific/Tarawa"; } else if (country.equals("TO") == true) { timezone = "Pacific/Tongatapu"; } else if (country.equals("WF") == true) { timezone = "Pacific/Wallis"; } else if (country.equals("TZ") == true) { timezone = "Africa/Dar_es_Salaam"; } else if (country.equals("VN") == true) { timezone = "Asia/Phnom_Penh"; } else if (country.equals("KH") == true) { timezone = "Asia/Phnom_Penh"; } else if (country.equals("CM") == true) { timezone = "Africa/Lagos"; } else if (country.equals("DO") == true) { timezone = "America/Santo_Domingo"; } else if (country.equals("ET") == true) { timezone = "Africa/Addis_Ababa"; } else if (country.equals("FX") == true) { timezone = "Europe/Paris"; } else if (country.equals("HT") == true) { timezone = "America/Port-au-Prince"; } else if (country.equals("CH") == true) { timezone = "Europe/Zurich"; } else if (country.equals("AN") == true) { timezone = "America/Curacao"; } else if (country.equals("BJ") == true) { timezone = "Africa/Porto-Novo"; } else if (country.equals("EH") == true) { timezone = "Africa/El_Aaiun"; } else if (country.equals("FK") == true) { timezone = "Atlantic/Stanley"; } else if (country.equals("GF") == true) { timezone = "America/Cayenne"; } else if (country.equals("IO") == true) { timezone = "Indian/Chagos"; } else if (country.equals("MD") == true) { timezone = "Europe/Chisinau"; } else if (country.equals("MP") == true) { timezone = "Pacific/Saipan"; } else if (country.equals("MW") == true) { timezone = "Africa/Blantyre"; } else if (country.equals("NA") == true) { timezone = "Africa/Windhoek"; } else if (country.equals("NC") == true) { timezone = "Pacific/Noumea"; } else if (country.equals("PG") == true) { timezone = "Pacific/Port_Moresby"; } else if (country.equals("PM") == true) { timezone = "America/Miquelon"; } else if (country.equals("PS") == true) { timezone = "Asia/Gaza"; } else if (country.equals("PY") == true) { timezone = "America/Asuncion"; } else if (country.equals("SB") == true) { timezone = "Pacific/Guadalcanal"; } else if (country.equals("SC") == true) { timezone = "Indian/Mahe"; } else if (country.equals("SJ") == true) { timezone = "Arctic/Longyearbyen"; } else if (country.equals("SY") == true) { timezone = "Asia/Damascus"; } else if (country.equals("TC") == true) { timezone = "America/Grand_Turk"; } else if (country.equals("TF") == true) { timezone = "Indian/Kerguelen"; } else if (country.equals("TK") == true) { timezone = "Pacific/Fakaofo"; } else if (country.equals("TT") == true) { timezone = "America/Port_of_Spain"; } else if (country.equals("VG") == true) { timezone = "America/Tortola"; } else if (country.equals("VI") == true) { timezone = "America/St_Thomas"; } else if (country.equals("VU") == true) { timezone = "Pacific/Efate"; } else if (country.equals("RS") == true) { timezone = "Europe/Belgrade"; } else if (country.equals("ME") == true) { timezone = "Europe/Podgorica"; } else if (country.equals("AX") == true) { timezone = "Europe/Mariehamn"; } else if (country.equals("GG") == true) { timezone = "Europe/Guernsey"; } else if (country.equals("IM") == true) { timezone = "Europe/Isle_of_Man"; } else if (country.equals("JE") == true) { timezone = "Europe/Jersey"; } else if (country.equals("BL") == true) { timezone = "America/St_Barthelemy"; } else if (country.equals("MF") == true) { timezone = "America/Marigot"; } else if (country.equals("AR") == true) { if (region.equals("01") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("02") == true) { timezone = "America/Argentina/Catamarca"; } else if (region.equals("03") == true) { timezone = "America/Argentina/Tucuman"; } else if (region.equals("04") == true) { timezone = "America/Argentina/Rio_Gallegos"; } else if (region.equals("05") == true) { timezone = "America/Argentina/Cordoba"; } else if (region.equals("06") == true) { timezone = "America/Argentina/Tucuman"; } else if (region.equals("07") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("08") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("09") == true) { timezone = "America/Argentina/Tucuman"; } else if (region.equals("10") == true) { timezone = "America/Argentina/Jujuy"; } else if (region.equals("11") == true) { timezone = "America/Argentina/San_Luis"; } else if (region.equals("12") == true) { timezone = "America/Argentina/La_Rioja"; } else if (region.equals("13") == true) { timezone = "America/Argentina/Mendoza"; } else if (region.equals("14") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("15") == true) { timezone = "America/Argentina/San_Luis"; } else if (region.equals("16") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("17") == true) { timezone = "America/Argentina/Salta"; } else if (region.equals("18") == true) { timezone = "America/Argentina/San_Juan"; } else if (region.equals("19") == true) { timezone = "America/Argentina/San_Luis"; } else if (region.equals("20") == true) { timezone = "America/Argentina/Rio_Gallegos"; } else if (region.equals("21") == true) { timezone = "America/Argentina/Buenos_Aires"; } else if (region.equals("22") == true) { timezone = "America/Argentina/Catamarca"; } else if (region.equals("23") == true) { timezone = "America/Argentina/Ushuaia"; } else if (region.equals("24") == true) { timezone = "America/Argentina/Tucuman"; } } else if (country.equals("BR") == true) { if (region.equals("01") == true) { timezone = "America/Rio_Branco"; } else if (region.equals("02") == true) { timezone = "America/Maceio"; } else if (region.equals("03") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("04") == true) { timezone = "America/Manaus"; } else if (region.equals("05") == true) { timezone = "America/Bahia"; } else if (region.equals("06") == true) { timezone = "America/Fortaleza"; } else if (region.equals("07") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("08") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("11") == true) { timezone = "America/Campo_Grande"; } else if (region.equals("13") == true) { timezone = "America/Belem"; } else if (region.equals("14") == true) { timezone = "America/Cuiaba"; } else if (region.equals("15") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("16") == true) { timezone = "America/Belem"; } else if (region.equals("17") == true) { timezone = "America/Recife"; } else if (region.equals("18") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("20") == true) { timezone = "America/Fortaleza"; } else if (region.equals("21") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("22") == true) { timezone = "America/Recife"; } else if (region.equals("23") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("24") == true) { timezone = "America/Porto_Velho"; } else if (region.equals("25") == true) { timezone = "America/Boa_Vista"; } else if (region.equals("26") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("27") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("28") == true) { timezone = "America/Maceio"; } else if (region.equals("29") == true) { timezone = "America/Sao_Paulo"; } else if (region.equals("30") == true) { timezone = "America/Recife"; } else if (region.equals("31") == true) { timezone = "America/Araguaina"; } } else if (country.equals("CD") == true) { if (region.equals("02") == true) { timezone = "Africa/Kinshasa"; } else if (region.equals("05") == true) { timezone = "Africa/Lubumbashi"; } else if (region.equals("06") == true) { timezone = "Africa/Kinshasa"; } else if (region.equals("08") == true) { timezone = "Africa/Kinshasa"; } else if (region.equals("10") == true) { timezone = "Africa/Lubumbashi"; } else if (region.equals("11") == true) { timezone = "Africa/Lubumbashi"; } else if (region.equals("12") == true) { timezone = "Africa/Lubumbashi"; } } else if (country.equals("CN") == true) { if (region.equals("01") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("02") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("03") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("04") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("05") == true) { timezone = "Asia/Harbin"; } else if (region.equals("06") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("07") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("08") == true) { timezone = "Asia/Harbin"; } else if (region.equals("09") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("10") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("11") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("12") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("13") == true) { timezone = "Asia/Urumqi"; } else if (region.equals("14") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("15") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("16") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("18") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("19") == true) { timezone = "Asia/Harbin"; } else if (region.equals("20") == true) { timezone = "Asia/Harbin"; } else if (region.equals("21") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("22") == true) { timezone = "Asia/Harbin"; } else if (region.equals("23") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("24") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("25") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("26") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("28") == true) { timezone = "Asia/Shanghai"; } else if (region.equals("29") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("30") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("31") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("32") == true) { timezone = "Asia/Chongqing"; } else if (region.equals("33") == true) { timezone = "Asia/Chongqing"; } } else if (country.equals("EC") == true) { if (region.equals("01") == true) { timezone = "Pacific/Galapagos"; } else if (region.equals("02") == true) { timezone = "America/Guayaquil"; } else if (region.equals("03") == true) { timezone = "America/Guayaquil"; } else if (region.equals("04") == true) { timezone = "America/Guayaquil"; } else if (region.equals("05") == true) { timezone = "America/Guayaquil"; } else if (region.equals("06") == true) { timezone = "America/Guayaquil"; } else if (region.equals("07") == true) { timezone = "America/Guayaquil"; } else if (region.equals("08") == true) { timezone = "America/Guayaquil"; } else if (region.equals("09") == true) { timezone = "America/Guayaquil"; } else if (region.equals("10") == true) { timezone = "America/Guayaquil"; } else if (region.equals("11") == true) { timezone = "America/Guayaquil"; } else if (region.equals("12") == true) { timezone = "America/Guayaquil"; } else if (region.equals("13") == true) { timezone = "America/Guayaquil"; } else if (region.equals("14") == true) { timezone = "America/Guayaquil"; } else if (region.equals("15") == true) { timezone = "America/Guayaquil"; } else if (region.equals("17") == true) { timezone = "America/Guayaquil"; } else if (region.equals("18") == true) { timezone = "America/Guayaquil"; } else if (region.equals("19") == true) { timezone = "America/Guayaquil"; } else if (region.equals("20") == true) { timezone = "America/Guayaquil"; } else if (region.equals("22") == true) { timezone = "America/Guayaquil"; } } else if (country.equals("ES") == true) { if (region.equals("07") == true) { timezone = "Europe/Madrid"; } else if (region.equals("27") == true) { timezone = "Europe/Madrid"; } else if (region.equals("29") == true) { timezone = "Europe/Madrid"; } else if (region.equals("31") == true) { timezone = "Europe/Madrid"; } else if (region.equals("32") == true) { timezone = "Europe/Madrid"; } else if (region.equals("34") == true) { timezone = "Europe/Madrid"; } else if (region.equals("39") == true) { timezone = "Europe/Madrid"; } else if (region.equals("51") == true) { timezone = "Africa/Ceuta"; } else if (region.equals("52") == true) { timezone = "Europe/Madrid"; } else if (region.equals("53") == true) { timezone = "Atlantic/Canary"; } else if (region.equals("54") == true) { timezone = "Europe/Madrid"; } else if (region.equals("55") == true) { timezone = "Europe/Madrid"; } else if (region.equals("56") == true) { timezone = "Europe/Madrid"; } else if (region.equals("57") == true) { timezone = "Europe/Madrid"; } else if (region.equals("58") == true) { timezone = "Europe/Madrid"; } else if (region.equals("59") == true) { timezone = "Europe/Madrid"; } else if (region.equals("60") == true) { timezone = "Europe/Madrid"; } } else if (country.equals("GL") == true) { if (region.equals("01") == true) { timezone = "America/Thule"; } else if (region.equals("02") == true) { timezone = "America/Godthab"; } else if (region.equals("03") == true) { timezone = "America/Godthab"; } } else if (country.equals("ID") == true) { if (region.equals("01") == true) { timezone = "Asia/Pontianak"; } else if (region.equals("02") == true) { timezone = "Asia/Makassar"; } else if (region.equals("03") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("04") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("05") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("06") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("07") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("08") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("09") == true) { timezone = "Asia/Jayapura"; } else if (region.equals("10") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("11") == true) { timezone = "Asia/Pontianak"; } else if (region.equals("12") == true) { timezone = "Asia/Makassar"; } else if (region.equals("13") == true) { timezone = "Asia/Makassar"; } else if (region.equals("14") == true) { timezone = "Asia/Makassar"; } else if (region.equals("15") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("16") == true) { timezone = "Asia/Makassar"; } else if (region.equals("17") == true) { timezone = "Asia/Makassar"; } else if (region.equals("18") == true) { timezone = "Asia/Makassar"; } else if (region.equals("19") == true) { timezone = "Asia/Pontianak"; } else if (region.equals("20") == true) { timezone = "Asia/Makassar"; } else if (region.equals("21") == true) { timezone = "Asia/Makassar"; } else if (region.equals("22") == true) { timezone = "Asia/Makassar"; } else if (region.equals("23") == true) { timezone = "Asia/Makassar"; } else if (region.equals("24") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("25") == true) { timezone = "Asia/Pontianak"; } else if (region.equals("26") == true) { timezone = "Asia/Pontianak"; } else if (region.equals("30") == true) { timezone = "Asia/Jakarta"; } else if (region.equals("31") == true) { timezone = "Asia/Makassar"; } else if (region.equals("33") == true) { timezone = "Asia/Jakarta"; } } else if (country.equals("KZ") == true) { if (region.equals("01") == true) { timezone = "Asia/Almaty"; } else if (region.equals("02") == true) { timezone = "Asia/Almaty"; } else if (region.equals("03") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("04") == true) { timezone = "Asia/Aqtobe"; } else if (region.equals("05") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("06") == true) { timezone = "Asia/Aqtau"; } else if (region.equals("07") == true) { timezone = "Asia/Oral"; } else if (region.equals("08") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("09") == true) { timezone = "Asia/Aqtau"; } else if (region.equals("10") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("11") == true) { timezone = "Asia/Almaty"; } else if (region.equals("12") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("13") == true) { timezone = "Asia/Aqtobe"; } else if (region.equals("14") == true) { timezone = "Asia/Qyzylorda"; } else if (region.equals("15") == true) { timezone = "Asia/Almaty"; } else if (region.equals("16") == true) { timezone = "Asia/Aqtobe"; } else if (region.equals("17") == true) { timezone = "Asia/Almaty"; } } else if (country.equals("MX") == true) { if (region.equals("01") == true) { timezone = "America/Mexico_City"; } else if (region.equals("02") == true) { timezone = "America/Tijuana"; } else if (region.equals("03") == true) { timezone = "America/Hermosillo"; } else if (region.equals("04") == true) { timezone = "America/Merida"; } else if (region.equals("05") == true) { timezone = "America/Mexico_City"; } else if (region.equals("06") == true) { timezone = "America/Chihuahua"; } else if (region.equals("07") == true) { timezone = "America/Monterrey"; } else if (region.equals("08") == true) { timezone = "America/Mexico_City"; } else if (region.equals("09") == true) { timezone = "America/Mexico_City"; } else if (region.equals("10") == true) { timezone = "America/Mazatlan"; } else if (region.equals("11") == true) { timezone = "America/Mexico_City"; } else if (region.equals("12") == true) { timezone = "America/Mexico_City"; } else if (region.equals("13") == true) { timezone = "America/Mexico_City"; } else if (region.equals("14") == true) { timezone = "America/Mazatlan"; } else if (region.equals("15") == true) { timezone = "America/Chihuahua"; } else if (region.equals("16") == true) { timezone = "America/Mexico_City"; } else if (region.equals("17") == true) { timezone = "America/Mexico_City"; } else if (region.equals("18") == true) { timezone = "America/Mazatlan"; } else if (region.equals("19") == true) { timezone = "America/Monterrey"; } else if (region.equals("20") == true) { timezone = "America/Mexico_City"; } else if (region.equals("21") == true) { timezone = "America/Mexico_City"; } else if (region.equals("22") == true) { timezone = "America/Mexico_City"; } else if (region.equals("23") == true) { timezone = "America/Cancun"; } else if (region.equals("24") == true) { timezone = "America/Mexico_City"; } else if (region.equals("25") == true) { timezone = "America/Mazatlan"; } else if (region.equals("26") == true) { timezone = "America/Hermosillo"; } else if (region.equals("27") == true) { timezone = "America/Merida"; } else if (region.equals("28") == true) { timezone = "America/Monterrey"; } else if (region.equals("29") == true) { timezone = "America/Mexico_City"; } else if (region.equals("30") == true) { timezone = "America/Mexico_City"; } else if (region.equals("31") == true) { timezone = "America/Merida"; } else if (region.equals("32") == true) { timezone = "America/Monterrey"; } } else if (country.equals("MY") == true) { if (region.equals("01") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("02") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("03") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("04") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("05") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("06") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("07") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("08") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("09") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("11") == true) { timezone = "Asia/Kuching"; } else if (region.equals("12") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("13") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("14") == true) { timezone = "Asia/Kuala_Lumpur"; } else if (region.equals("15") == true) { timezone = "Asia/Kuching"; } else if (region.equals("16") == true) { timezone = "Asia/Kuching"; } } else if (country.equals("NZ") == true) { if (region.equals("85") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("E7") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("E8") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("E9") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F1") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F2") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F3") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F4") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F5") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F7") == true) { timezone = "Pacific/Chatham"; } else if (region.equals("F8") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("F9") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("G1") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("G2") == true) { timezone = "Pacific/Auckland"; } else if (region.equals("G3") == true) { timezone = "Pacific/Auckland"; } } else if (country.equals("PT") == true) { if (region.equals("02") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("03") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("04") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("05") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("06") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("07") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("08") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("09") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("10") == true) { timezone = "Atlantic/Madeira"; } else if (region.equals("11") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("13") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("14") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("16") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("17") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("18") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("19") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("20") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("21") == true) { timezone = "Europe/Lisbon"; } else if (region.equals("22") == true) { timezone = "Europe/Lisbon"; } } else if (country.equals("RU") == true) { if (region.equals("01") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("02") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("03") == true) { timezone = "Asia/Novokuznetsk"; } else if (region.equals("04") == true) { timezone = "Asia/Novosibirsk"; } else if (region.equals("05") == true) { timezone = "Asia/Vladivostok"; } else if (region.equals("06") == true) { timezone = "Europe/Moscow"; } else if (region.equals("07") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("08") == true) { timezone = "Europe/Samara"; } else if (region.equals("09") == true) { timezone = "Europe/Moscow"; } else if (region.equals("10") == true) { timezone = "Europe/Moscow"; } else if (region.equals("11") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("13") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("14") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("15") == true) { timezone = "Asia/Anadyr"; } else if (region.equals("16") == true) { timezone = "Europe/Samara"; } else if (region.equals("17") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("18") == true) { timezone = "Asia/Krasnoyarsk"; } else if (region.equals("20") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("21") == true) { timezone = "Europe/Moscow"; } else if (region.equals("22") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("23") == true) { timezone = "Europe/Kaliningrad"; } else if (region.equals("24") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("25") == true) { timezone = "Europe/Moscow"; } else if (region.equals("26") == true) { timezone = "Asia/Kamchatka"; } else if (region.equals("27") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("28") == true) { timezone = "Europe/Moscow"; } else if (region.equals("29") == true) { timezone = "Asia/Novokuznetsk"; } else if (region.equals("30") == true) { timezone = "Asia/Vladivostok"; } else if (region.equals("31") == true) { timezone = "Asia/Krasnoyarsk"; } else if (region.equals("32") == true) { timezone = "Asia/Omsk"; } else if (region.equals("33") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("34") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("35") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("36") == true) { timezone = "Asia/Anadyr"; } else if (region.equals("37") == true) { timezone = "Europe/Moscow"; } else if (region.equals("38") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("39") == true) { timezone = "Asia/Krasnoyarsk"; } else if (region.equals("40") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("41") == true) { timezone = "Europe/Moscow"; } else if (region.equals("42") == true) { timezone = "Europe/Moscow"; } else if (region.equals("43") == true) { timezone = "Europe/Moscow"; } else if (region.equals("44") == true) { timezone = "Asia/Magadan"; } else if (region.equals("45") == true) { timezone = "Europe/Samara"; } else if (region.equals("46") == true) { timezone = "Europe/Samara"; } else if (region.equals("47") == true) { timezone = "Europe/Moscow"; } else if (region.equals("48") == true) { timezone = "Europe/Moscow"; } else if (region.equals("49") == true) { timezone = "Europe/Moscow"; } else if (region.equals("50") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("51") == true) { timezone = "Europe/Moscow"; } else if (region.equals("52") == true) { timezone = "Europe/Moscow"; } else if (region.equals("53") == true) { timezone = "Asia/Novosibirsk"; } else if (region.equals("54") == true) { timezone = "Asia/Omsk"; } else if (region.equals("55") == true) { timezone = "Europe/Samara"; } else if (region.equals("56") == true) { timezone = "Europe/Moscow"; } else if (region.equals("57") == true) { timezone = "Europe/Samara"; } else if (region.equals("58") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("59") == true) { timezone = "Asia/Vladivostok"; } else if (region.equals("60") == true) { timezone = "Europe/Kaliningrad"; } else if (region.equals("61") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("62") == true) { timezone = "Europe/Moscow"; } else if (region.equals("63") == true) { timezone = "Asia/Yakutsk"; } else if (region.equals("64") == true) { timezone = "Asia/Sakhalin"; } else if (region.equals("65") == true) { timezone = "Europe/Samara"; } else if (region.equals("66") == true) { timezone = "Europe/Moscow"; } else if (region.equals("67") == true) { timezone = "Europe/Samara"; } else if (region.equals("68") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("69") == true) { timezone = "Europe/Moscow"; } else if (region.equals("70") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("71") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("72") == true) { timezone = "Europe/Moscow"; } else if (region.equals("73") == true) { timezone = "Europe/Samara"; } else if (region.equals("74") == true) { timezone = "Asia/Krasnoyarsk"; } else if (region.equals("75") == true) { timezone = "Asia/Novosibirsk"; } else if (region.equals("76") == true) { timezone = "Europe/Moscow"; } else if (region.equals("77") == true) { timezone = "Europe/Moscow"; } else if (region.equals("78") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("79") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("80") == true) { timezone = "Asia/Yekaterinburg"; } else if (region.equals("81") == true) { timezone = "Europe/Samara"; } else if (region.equals("82") == true) { timezone = "Asia/Irkutsk"; } else if (region.equals("83") == true) { timezone = "Europe/Moscow"; } else if (region.equals("84") == true) { timezone = "Europe/Volgograd"; } else if (region.equals("85") == true) { timezone = "Europe/Moscow"; } else if (region.equals("86") == true) { timezone = "Europe/Moscow"; } else if (region.equals("87") == true) { timezone = "Asia/Novosibirsk"; } else if (region.equals("88") == true) { timezone = "Europe/Moscow"; } else if (region.equals("89") == true) { timezone = "Asia/Vladivostok"; } } else if (country.equals("UA") == true) { if (region.equals("01") == true) { timezone = "Europe/Kiev"; } else if (region.equals("02") == true) { timezone = "Europe/Kiev"; } else if (region.equals("03") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("04") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("05") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("06") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("07") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("08") == true) { timezone = "Europe/Simferopol"; } else if (region.equals("09") == true) { timezone = "Europe/Kiev"; } else if (region.equals("10") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("11") == true) { timezone = "Europe/Simferopol"; } else if (region.equals("13") == true) { timezone = "Europe/Kiev"; } else if (region.equals("14") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("15") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("16") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("17") == true) { timezone = "Europe/Simferopol"; } else if (region.equals("18") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("19") == true) { timezone = "Europe/Kiev"; } else if (region.equals("20") == true) { timezone = "Europe/Simferopol"; } else if (region.equals("21") == true) { timezone = "Europe/Kiev"; } else if (region.equals("22") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("23") == true) { timezone = "Europe/Kiev"; } else if (region.equals("24") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("25") == true) { timezone = "Europe/Uzhgorod"; } else if (region.equals("26") == true) { timezone = "Europe/Zaporozhye"; } else if (region.equals("27") == true) { timezone = "Europe/Kiev"; } } else if (country.equals("UZ") == true) { if (region.equals("01") == true) { timezone = "Asia/Tashkent"; } else if (region.equals("02") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("03") == true) { timezone = "Asia/Tashkent"; } else if (region.equals("06") == true) { timezone = "Asia/Tashkent"; } else if (region.equals("07") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("08") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("09") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("10") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("12") == true) { timezone = "Asia/Samarkand"; } else if (region.equals("13") == true) { timezone = "Asia/Tashkent"; } else if (region.equals("14") == true) { timezone = "Asia/Tashkent"; } } else if (country.equals("TL") == true) { timezone = "Asia/Dili"; } else if (country.equals("PF") == true) { timezone = "Pacific/Marquesas"; } else if (country.equals("SX") == true) { timezone = "America/Curacao"; } else if (country.equals("BQ") == true) { timezone = "America/Curacao"; } else if (country.equals("CW") == true) { timezone = "America/Curacao"; } return timezone; } }
lgpl-2.1
jzuijlek/Lucee
core/src/main/java/lucee/runtime/functions/other/IsNotMap.java
1105
/** * * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * **/ /** * Implements the CFML Function isnotmap */ package lucee.runtime.functions.other; import java.util.Map; import lucee.runtime.PageContext; import lucee.runtime.ext.function.Function; public final class IsNotMap implements Function { public static boolean call(PageContext pc, Object object) { return !(object instanceof Map); } }
lgpl-2.1
sanyaade-mediadev/vars
vars-shared-ui/src/main/java/vars/shared/ui/tree/ConceptTreeCellRenderer.java
5439
/* * @(#)ConceptTreeCellRenderer.java 2009.11.04 at 02:32:08 PST * * Copyright 2009 MBARI * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package vars.shared.ui.tree; import java.awt.Color; import java.awt.Component; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Vector; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import org.mbari.swing.SpinningDial; import vars.knowledgebase.Concept; import vars.knowledgebase.ConceptName; /** * * @author brian */ public class ConceptTreeCellRenderer extends DefaultTreeCellRenderer { private static final String DEFAULT = "/vars/images/16/nav_plain_blue.png"; private static final String DEFAULT_WITH_IMAGE = "/vars/images/16/nav_plain_blue_square_glass_grey.png"; private static final String PENDING = "/vars/images/16/nav_plain_red.png"; private static final String PENDING_WITH_IMAGE = "/vars/images/16/nav_plain_red_square_glass_grey.png"; private static final long serialVersionUID = -7382528013502852004L; private static final Color pendingTextColor = Color.RED.brighter().brighter(); private static final Color loadingTextColor = Color.GRAY; // Buffer for text label private final StringBuffer textBuf = new StringBuffer(); //private final List<ConceptName> secondaryNames = Collections.synchronizedList(new ArrayList<ConceptName>()); private final Comparator<ConceptName> comparator = new Comparator<ConceptName>() { public int compare(ConceptName o1, ConceptName o2) { final String s1 = o1.getName(); final String s2 = o2.getName(); return s1.compareToIgnoreCase(s2); } }; private final ImageIcon defaultIcon; private final ImageIcon defaultWithImageIcon; private final Icon loadingIcon; private final ImageIcon pendingIcon; private final ImageIcon pendingWithImageIcon; /** * Constructs ... * */ public ConceptTreeCellRenderer() { super(); defaultIcon = new ImageIcon(getClass().getResource(DEFAULT)); defaultWithImageIcon = new ImageIcon(getClass().getResource(DEFAULT_WITH_IMAGE)); pendingIcon = new ImageIcon(getClass().getResource(PENDING)); pendingWithImageIcon = new ImageIcon(getClass().getResource(PENDING_WITH_IMAGE)); loadingIcon = new SpinningDial(18, 18, 8); } /** * <p><!-- Method description --></p> * * * @param tree * @param value * @param isSelected * @param isExpanded * @param isLeaf * @param row * @param hasFocus * * @return */ @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean isSelected, boolean isExpanded, boolean isLeaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, isSelected, isExpanded, isLeaf, row, hasFocus); //secondaryNames.clear(); // Get the name from the Object contained in this node ConceptTreeNode node = (ConceptTreeNode) value; Concept concept = (Concept) node.getUserObject(); /* * if the user object is a boolean value, then that means that * the concept nodes at this level are currently be retrieved. */ if (concept instanceof ConceptTreeConcept) { setText("Retrieving Concepts..."); setIcon(loadingIcon); setForeground(loadingTextColor); } else { ImageIcon imageIcon = defaultIcon; if (concept.getConceptMetadata().isPendingApproval()) { imageIcon = (concept.getConceptMetadata().getPrimaryImage() == null) ? pendingIcon : pendingWithImageIcon; setForeground(pendingTextColor); } else { imageIcon = (concept.getConceptMetadata().getPrimaryImage() == null) ? defaultIcon : defaultWithImageIcon; } setIcon(imageIcon); // Put the primary ConceptName in first textBuf.replace(0, textBuf.length(), concept.getPrimaryConceptName().getName()); // now add the aliases final List<ConceptName> secondaryNames = new ArrayList<ConceptName>(); secondaryNames.addAll(concept.getConceptNames()); secondaryNames.remove(concept.getPrimaryConceptName()); if (secondaryNames.size() > 0) { Collections.sort(secondaryNames, comparator); textBuf.append(" ("); for (int i = 0; i < secondaryNames.size(); i++) { textBuf.append(secondaryNames.get(i).getName()); if ((secondaryNames.size() - 1) != i) { textBuf.append(", "); } } textBuf.append(")"); } setText(textBuf.toString()); } return this; } }
lgpl-2.1
jfree/jfreechart
src/main/java/org/jfree/chart/swing/editor/DefaultAxisEditor.java
17216
/* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2022, by David Gilbert and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners.] * * ---------------------- * DefaultAxisEditor.java * ---------------------- * (C) Copyright 2005-2022, by David Gilbert and Contributors. * * Original Author: David Gilbert; * Contributor(s): Andrzej Porebski; * Arnaud Lelievre; * */ package org.jfree.chart.swing.editor; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.Paint; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ResourceBundle; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JColorChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.JTextField; import org.jfree.chart.axis.Axis; import org.jfree.chart.axis.LogAxis; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.api.RectangleInsets; /** * A panel for editing the properties of an axis. */ class DefaultAxisEditor extends JPanel implements ActionListener { /** The axis label. */ private final JTextField label; /** The label font. */ private Font labelFont; /** The label paint. */ private final PaintSample labelPaintSample; /** A field showing a description of the label font. */ private final JTextField labelFontField; /** The font for displaying tick labels on the axis. */ private Font tickLabelFont; /** * A field containing a description of the font for displaying tick labels * on the axis. */ private final JTextField tickLabelFontField; /** The paint (color) for the tick labels. */ private final PaintSample tickLabelPaintSample; /** * An empty sub-panel for extending the user interface to handle more * complex axes. */ private JPanel slot1; /** * An empty sub-panel for extending the user interface to handle more * complex axes. */ private JPanel slot2; /** A flag that indicates whether or not the tick labels are visible. */ private final JCheckBox showTickLabelsCheckBox; /** A flag that indicates whether or not the tick marks are visible. */ private final JCheckBox showTickMarksCheckBox; // /** Insets text field. */ // private InsetsTextField tickLabelInsetsTextField; // // /** Label insets text field. */ // private InsetsTextField labelInsetsTextField; /** The tick label insets. */ private final RectangleInsets tickLabelInsets; /** The label insets. */ private final RectangleInsets labelInsets; /** A tabbed pane for... */ private final JTabbedPane otherTabs; /** The resourceBundle for the localization. */ protected static ResourceBundle localizationResources = ResourceBundle.getBundle("org.jfree.chart.editor.LocalizationBundle"); /** * A static method that returns a panel that is appropriate for the axis * type. * * @param axis the axis whose properties are to be displayed/edited in * the panel. * * @return A panel or {@code null} if axis is {@code null}. */ public static DefaultAxisEditor getInstance(Axis axis) { if (axis != null) { // figure out what type of axis we have and instantiate the // appropriate panel if (axis instanceof NumberAxis) { return new DefaultNumberAxisEditor((NumberAxis) axis); } if (axis instanceof LogAxis) { return new DefaultLogAxisEditor((LogAxis) axis); } else { return new DefaultAxisEditor(axis); } } else { return null; } } /** * Standard constructor: builds a panel for displaying/editing the * properties of the specified axis. * * @param axis the axis whose properties are to be displayed/edited in * the panel. */ public DefaultAxisEditor(Axis axis) { this.labelFont = axis.getLabelFont(); this.labelPaintSample = new PaintSample(axis.getLabelPaint()); this.tickLabelFont = axis.getTickLabelFont(); this.tickLabelPaintSample = new PaintSample(axis.getTickLabelPaint()); // Insets values this.tickLabelInsets = axis.getTickLabelInsets(); this.labelInsets = axis.getLabelInsets(); setLayout(new BorderLayout()); JPanel general = new JPanel(new BorderLayout()); general.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), localizationResources.getString("General") ) ); JPanel interior = new JPanel(new LCBLayout(5)); interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); interior.add(new JLabel(localizationResources.getString("Label"))); this.label = new JTextField(axis.getLabel()); interior.add(this.label); interior.add(new JPanel()); interior.add(new JLabel(localizationResources.getString("Font"))); this.labelFontField = new FontDisplayField(this.labelFont); interior.add(this.labelFontField); JButton b = new JButton(localizationResources.getString("Select...")); b.setActionCommand("SelectLabelFont"); b.addActionListener(this); interior.add(b); interior.add(new JLabel(localizationResources.getString("Paint"))); interior.add(this.labelPaintSample); b = new JButton(localizationResources.getString("Select...")); b.setActionCommand("SelectLabelPaint"); b.addActionListener(this); interior.add(b); // interior.add( // new JLabel(localizationResources.getString("Label_Insets")) // ); // b = new JButton(localizationResources.getString("Edit...")); // b.setActionCommand("LabelInsets"); // b.addActionListener(this); // this.labelInsetsTextField = new InsetsTextField(this.labelInsets); // interior.add(this.labelInsetsTextField); // interior.add(b); // // interior.add( // new JLabel(localizationResources.getString("Tick_Label_Insets")) // ); // b = new JButton(localizationResources.getString("Edit...")); // b.setActionCommand("TickLabelInsets"); // b.addActionListener(this); // this.tickLabelInsetsTextField // = new InsetsTextField(this.tickLabelInsets); // interior.add(this.tickLabelInsetsTextField); // interior.add(b); general.add(interior); add(general, BorderLayout.NORTH); this.slot1 = new JPanel(new BorderLayout()); JPanel other = new JPanel(new BorderLayout()); other.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), localizationResources.getString("Other"))); this.otherTabs = new JTabbedPane(); this.otherTabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); JPanel ticks = new JPanel(new LCBLayout(3)); ticks.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.showTickLabelsCheckBox = new JCheckBox( localizationResources.getString("Show_tick_labels"), axis.isTickLabelsVisible() ); ticks.add(this.showTickLabelsCheckBox); ticks.add(new JPanel()); ticks.add(new JPanel()); ticks.add( new JLabel(localizationResources.getString("Tick_label_font")) ); this.tickLabelFontField = new FontDisplayField(this.tickLabelFont); ticks.add(this.tickLabelFontField); b = new JButton(localizationResources.getString("Select...")); b.setActionCommand("SelectTickLabelFont"); b.addActionListener(this); ticks.add(b); this.showTickMarksCheckBox = new JCheckBox( localizationResources.getString("Show_tick_marks"), axis.isTickMarksVisible() ); ticks.add(this.showTickMarksCheckBox); ticks.add(new JPanel()); ticks.add(new JPanel()); this.otherTabs.add(localizationResources.getString("Ticks"), ticks); other.add(this.otherTabs); this.slot1.add(other); this.slot2 = new JPanel(new BorderLayout()); this.slot2.add(this.slot1, BorderLayout.NORTH); add(this.slot2); } /** * Returns the current axis label. * * @return The current axis label. */ public String getLabel() { return this.label.getText(); } /** * Returns the current label font. * * @return The current label font. */ public Font getLabelFont() { return this.labelFont; } /** * Returns the current label paint. * * @return The current label paint. */ public Paint getLabelPaint() { return this.labelPaintSample.getPaint(); } /** * Returns a flag that indicates whether or not the tick labels are visible. * * @return {@code true} if tick mark labels are visible. */ public boolean isTickLabelsVisible() { return this.showTickLabelsCheckBox.isSelected(); } /** * Returns the font used to draw the tick labels (if they are showing). * * @return The font used to draw the tick labels. */ public Font getTickLabelFont() { return this.tickLabelFont; } /** * Returns the current tick label paint. * * @return The current tick label paint. */ public Paint getTickLabelPaint() { return this.tickLabelPaintSample.getPaint(); } /** * Returns the current value of the flag that determines whether or not * tick marks are visible. * * @return {@code true} if tick marks are visible. */ public boolean isTickMarksVisible() { return this.showTickMarksCheckBox.isSelected(); } /** * Returns the current tick label insets value * * @return The current tick label insets value. */ public RectangleInsets getTickLabelInsets() { return (this.tickLabelInsets == null) ? new RectangleInsets(0, 0, 0, 0) : this.tickLabelInsets; } /** * Returns the current label insets value * * @return The current label insets value. */ public RectangleInsets getLabelInsets() { return (this.labelInsets == null) ? new RectangleInsets(0, 0, 0, 0) : this.labelInsets; } /** * Returns a reference to the tabbed pane. * * @return A reference to the tabbed pane. */ public JTabbedPane getOtherTabs() { return this.otherTabs; } /** * Handles user interaction with the property panel. * * @param event information about the event that triggered the call to * this method. */ @Override public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("SelectLabelFont")) { attemptLabelFontSelection(); } else if (command.equals("SelectLabelPaint")) { attemptModifyLabelPaint(); } else if (command.equals("SelectTickLabelFont")) { attemptTickLabelFontSelection(); } // else if (command.equals("LabelInsets")) { // editLabelInsets(); // } // else if (command.equals("TickLabelInsets")) { // editTickLabelInsets(); // } } /** * Presents a font selection dialog to the user. */ private void attemptLabelFontSelection() { FontChooserPanel panel = new FontChooserPanel(this.labelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.labelFont = panel.getSelectedFont(); this.labelFontField.setText( this.labelFont.getFontName() + " " + this.labelFont.getSize() ); } } /** * Allows the user the opportunity to change the outline paint. */ private void attemptModifyLabelPaint() { Color c; c = JColorChooser.showDialog( this, localizationResources.getString("Label_Color"), Color.BLUE ); if (c != null) { this.labelPaintSample.setPaint(c); } } /** * Presents a tick label font selection dialog to the user. */ public void attemptTickLabelFontSelection() { FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.tickLabelFont = panel.getSelectedFont(); this.tickLabelFontField.setText( this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize() ); } } // /** // * Presents insets chooser panel allowing user to modify tick label's // * individual insets values. Updates the current insets text field if // * edit is accepted. // */ // private void editTickLabelInsets() { // InsetsChooserPanel panel = new InsetsChooserPanel( // this.tickLabelInsets); // int result = JOptionPane.showConfirmDialog( // this, panel, localizationResources.getString("Edit_Insets"), // JOptionPane.PLAIN_MESSAGE // ); // // if (result == JOptionPane.OK_OPTION) { // this.tickLabelInsets = panel.getInsets(); // this.tickLabelInsetsTextField.setInsets(this.tickLabelInsets); // } // } // // /** // * Presents insets chooser panel allowing user to modify label's // * individual insets values. Updates the current insets text field if edit // * is accepted. // */ // private void editLabelInsets() { // InsetsChooserPanel panel = new InsetsChooserPanel(this.labelInsets); // int result = JOptionPane.showConfirmDialog( // this, panel, localizationResources.getString("Edit_Insets"), // JOptionPane.PLAIN_MESSAGE // ); // // if (result == JOptionPane.OK_OPTION) { // this.labelInsets = panel.getInsets(); // this.labelInsetsTextField.setInsets(this.labelInsets); // } // } /** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { axis.setLabel(getLabel()); axis.setLabelFont(getLabelFont()); axis.setLabelPaint(getLabelPaint()); axis.setTickMarksVisible(isTickMarksVisible()); // axis.setTickMarkStroke(getTickMarkStroke()); axis.setTickLabelsVisible(isTickLabelsVisible()); axis.setTickLabelFont(getTickLabelFont()); axis.setTickLabelPaint(getTickLabelPaint()); axis.setTickLabelInsets(getTickLabelInsets()); axis.setLabelInsets(getLabelInsets()); } }
lgpl-2.1
liscju/checkstyle
src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java
9115
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2017 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.checks; import static com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.MSG_KEY_NO_NEWLINE_EOF; import static com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.MSG_KEY_UNABLE_OPEN; import static java.util.Locale.ENGLISH; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.powermock.api.mockito.PowerMockito.mock; import static org.powermock.api.mockito.PowerMockito.when; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import org.junit.Test; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.FileText; import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; import com.puppycrawl.tools.checkstyle.utils.CommonUtils; public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/misc/newlineatendoffile"; } @Test public void testNewlineLfAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF.toString()); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify( createChecker(checkConfig), getPath("InputNewlineLfAtEndOfFile.java"), expected); } @Test public void testNewlineCrlfAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.CRLF.toString()); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify( createChecker(checkConfig), getPath("InputNewlineCrlfAtEndOfFile.java"), expected); } @Test public void testNewlineCrAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.CR.toString()); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify( createChecker(checkConfig), getPath("InputNewlineCrAtEndOfFile.java"), expected); } @Test public void testAnyNewlineAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF_CR_CRLF.toString()); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify( createChecker(checkConfig), getPath("InputNewlineCrlfAtEndOfFile.java"), expected); verify( createChecker(checkConfig), getPath("InputNewlineLfAtEndOfFile.java"), expected); verify( createChecker(checkConfig), getPath("InputNewlineCrAtEndOfFile.java"), expected); } @Test public void testNoNewlineLfAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF.toString()); final String[] expected = { "0: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), }; verify( createChecker(checkConfig), getPath("InputNoNewlineAtEndOfFile.java"), expected); } @Test public void testNoNewlineAtEndOfFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF_CR_CRLF.toString()); final String[] expected = { "0: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), }; verify( createChecker(checkConfig), getPath("InputNoNewlineAtEndOfFile.java"), expected); } @Test public void testSetLineSeparatorFailure() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", "ct"); try { createChecker(checkConfig); fail("exception expected"); } catch (CheckstyleException ex) { assertTrue("Error message is unexpected", ex.getMessage().startsWith( "cannot initialize module com.puppycrawl.tools.checkstyle." + "checks.NewlineAtEndOfFileCheck - " + "Cannot set property 'lineSeparator' to 'ct' in module")); } } @Test public void testEmptyFileFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); checkConfig.addAttribute("lineSeparator", LineSeparatorOption.LF.toString()); final String[] expected = { "0: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), }; verify( createChecker(checkConfig), getPath("InputEmptyFile.txt"), expected); } @Test public void testWrongFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); final NewlineAtEndOfFileCheck check = new NewlineAtEndOfFileCheck(); check.configure(checkConfig); final List<String> lines = new ArrayList<>(1); lines.add("txt"); final File impossibleFile = new File(""); final FileText fileText = new FileText(impossibleFile, lines); final Set<LocalizedMessage> messages = check.process(impossibleFile, fileText); assertEquals("Ammount of messages is unexpected", 1, messages.size()); final Iterator<LocalizedMessage> iterator = messages.iterator(); assertEquals("Violation message differs from expected", getCheckMessage(MSG_KEY_UNABLE_OPEN, ""), iterator.next().getMessage()); } @Test public void testWrongSeparatorLength() throws Exception { final NewlineAtEndOfFileCheck check = new NewlineAtEndOfFileCheck(); final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); check.configure(checkConfig); final Method method = NewlineAtEndOfFileCheck.class .getDeclaredMethod("endsWithNewline", RandomAccessFile.class); method.setAccessible(true); final RandomAccessFile file = mock(RandomAccessFile.class); when(file.length()).thenReturn(2_000_000L); try { method.invoke(new NewlineAtEndOfFileCheck(), file); } catch (InvocationTargetException ex) { assertTrue("Error type is unexpected", ex.getCause() instanceof IOException); if (System.getProperty("os.name").toLowerCase(ENGLISH).startsWith("windows")) { assertEquals("Error message is unexpected", "Unable to read 2 bytes, got 0", ex.getCause().getMessage()); } else { assertEquals("Error message is unexpected", "Unable to read 1 bytes, got 0", ex.getCause().getMessage()); } } } }
lgpl-2.1
serrapos/opencms-core
src/org/opencms/db/jpa/CmsVfsDriver.java
188123
/* * This library is part of OpenCms - * the Open Source Content Management System * * Copyright (c) Alkacon Software GmbH (http://www.alkacon.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * For further information about Alkacon Software, please see the * company website: http://www.alkacon.com * * For further information about OpenCms, please see the * project website: http://www.opencms.org * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.opencms.db.jpa; import org.opencms.configuration.CmsConfigurationManager; import org.opencms.configuration.CmsParameterConfiguration; import org.opencms.db.CmsDbConsistencyException; import org.opencms.db.CmsDbContext; import org.opencms.db.CmsDbEntryNotFoundException; import org.opencms.db.CmsDbSqlException; import org.opencms.db.CmsDriverManager; import org.opencms.db.CmsResourceState; import org.opencms.db.CmsVfsOnlineResourceAlreadyExistsException; import org.opencms.db.I_CmsDriver; import org.opencms.db.I_CmsProjectDriver; import org.opencms.db.I_CmsVfsDriver; import org.opencms.db.jpa.persistence.CmsDAOContents; import org.opencms.db.jpa.persistence.CmsDAOCounters; import org.opencms.db.jpa.persistence.CmsDAOOfflineContents; import org.opencms.db.jpa.persistence.CmsDAOOfflineProperties; import org.opencms.db.jpa.persistence.CmsDAOOfflinePropertyDef; import org.opencms.db.jpa.persistence.CmsDAOOfflineResourceRelations; import org.opencms.db.jpa.persistence.CmsDAOOfflineResources; import org.opencms.db.jpa.persistence.CmsDAOOfflineStructure; import org.opencms.db.jpa.persistence.CmsDAOOfflineUrlNameMappings; import org.opencms.db.jpa.persistence.CmsDAOOnlineProperties; import org.opencms.db.jpa.persistence.CmsDAOOnlinePropertyDef; import org.opencms.db.jpa.persistence.CmsDAOOnlineResourceRelations; import org.opencms.db.jpa.persistence.CmsDAOOnlineResources; import org.opencms.db.jpa.persistence.CmsDAOOnlineStructure; import org.opencms.db.jpa.persistence.CmsDAOOnlineUrlNameMappings; import org.opencms.db.jpa.persistence.I_CmsDAOProperties; import org.opencms.db.jpa.persistence.I_CmsDAOPropertyDef; import org.opencms.db.jpa.persistence.I_CmsDAOResourceRelations; import org.opencms.db.jpa.persistence.I_CmsDAOResources; import org.opencms.db.jpa.persistence.I_CmsDAOStructure; import org.opencms.db.jpa.persistence.I_CmsDAOUrlNameMappings; import org.opencms.db.jpa.utils.CmsQueryIntParameter; import org.opencms.db.jpa.utils.CmsQueryStringParameter; import org.opencms.db.jpa.utils.I_CmsQueryParameter; import org.opencms.db.urlname.CmsUrlNameMappingEntry; import org.opencms.db.urlname.CmsUrlNameMappingFilter; import org.opencms.file.CmsDataAccessException; import org.opencms.file.CmsFile; import org.opencms.file.CmsFolder; import org.opencms.file.CmsProject; import org.opencms.file.CmsProperty; import org.opencms.file.CmsPropertyDefinition; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.file.CmsVfsException; import org.opencms.file.CmsVfsResourceAlreadyExistsException; import org.opencms.file.CmsVfsResourceNotFoundException; import org.opencms.file.I_CmsResource; import org.opencms.file.history.I_CmsHistoryResource; import org.opencms.file.types.CmsResourceTypeJsp; import org.opencms.main.CmsEvent; import org.opencms.main.CmsException; import org.opencms.main.CmsLog; import org.opencms.main.I_CmsEventListener; import org.opencms.main.OpenCms; import org.opencms.relations.CmsRelation; import org.opencms.relations.CmsRelationFilter; import org.opencms.relations.CmsRelationType; import org.opencms.security.CmsOrganizationalUnit; import org.opencms.security.CmsPermissionSet; import org.opencms.util.CmsDataTypeUtil; import org.opencms.util.CmsFileUtil; import org.opencms.util.CmsPair; import org.opencms.util.CmsStringUtil; import org.opencms.util.CmsUUID; import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import javax.persistence.NoResultException; import javax.persistence.PersistenceException; import javax.persistence.Query; import org.apache.commons.logging.Log; /** * JPA database server implementation of the vfs driver methods.<p> * * @since 8.0.0 */ public class CmsVfsDriver implements I_CmsDriver, I_CmsVfsDriver { /** Internal presentation of empty binary content. */ public static final byte[] EMPTY_BLOB = new byte[0]; /** Query key. */ private static final String C_DELETE_RELATIONS = "C_DELETE_RELATIONS"; /** Query key. */ private static final String C_DELETE_URLNAME_MAPPINGS = "C_DELETE_URLNAME_MAPPINGS"; /** Query key. */ private static final String C_HISTORY_CONTENTS_UPDATE = "C_HISTORY_CONTENTS_UPDATE"; /** Query key. */ private static final String C_MOVE_RELATIONS_SOURCE = "C_MOVE_RELATIONS_SOURCE"; /** Query key. */ private static final String C_MOVE_RELATIONS_TARGET = "C_MOVE_RELATIONS_TARGET"; /** Query key. */ private static final String C_OFFLINE_CONTENTS_UPDATE = "C_OFFLINE_CONTENTS_UPDATE"; /** Query key. */ private static final String C_OFFLINE_FILE_CONTENT_DELETE = "C_OFFLINE_FILE_CONTENT_DELETE"; /** Query key. */ private static final String C_ONLINE_CONTENTS_DELETE = "C_ONLINE_CONTENTS_DELETE"; /** Query key. */ private static final String C_ONLINE_CONTENTS_HISTORY = "C_ONLINE_CONTENTS_HISTORY"; /** Query key. */ private static final String C_ONLINE_FILES_CONTENT = "C_ONLINE_FILES_CONTENT"; /** Query key. */ private static final String C_PROPERTIES_DELETE = "C_PROPERTIES_DELETE"; /** Query key. */ private static final String C_PROPERTIES_DELETE_ALL_STRUCTURE_AND_RESOURCE_VALUES = "C_PROPERTIES_DELETE_ALL_STRUCTURE_AND_RESOURCE_VALUES"; /** Query key. */ private static final String C_PROPERTIES_DELETE_ALL_VALUES_FOR_MAPPING_TYPE = "C_PROPERTIES_DELETE_ALL_VALUES_FOR_MAPPING_TYPE"; /** Query key. */ private static final String C_PROPERTIES_READ = "C_PROPERTIES_READ"; /** Query key. */ private static final String C_PROPERTIES_READALL = "C_PROPERTIES_READALL"; /** Query key. */ private static final String C_PROPERTIES_READALL_COUNT = "C_PROPERTIES_READALL_COUNT"; /** Query key. */ private static final String C_PROPERTIES_UPDATE = "C_PROPERTIES_UPDATE"; /** Query key. */ private static final String C_PROPERTYDEF_DELETE = "C_PROPERTYDEF_DELETE"; /** Query key. */ private static final String C_PROPERTYDEF_READ = "C_PROPERTYDEF_READ"; /** Query key. */ private static final String C_PROPERTYDEF_READALL = "C_PROPERTYDEF_READALL"; /** Query key. */ private static final String C_READ_RELATIONS = "C_READ_RELATIONS"; /** Query key. */ private static final String C_READ_RESOURCE_OUS = "C_READ_RESOURCE_OUS"; /** Query key. */ private static final String C_READ_RESOURCE_STATE = "C_READ_RESOURCE_STATE"; /** Query key. */ private static final String C_READ_STRUCTURE_STATE = "C_READ_STRUCTURE_STATE"; /** Query key. */ private static final String C_READ_URLNAME_MAPPINGS = "C_READ_URLNAME_MAPPINGS"; /** Query key. */ private static final String C_RELATION_FILTER_SOURCE_ID = "C_RELATION_FILTER_SOURCE_ID"; /** Query key. */ private static final String C_RELATION_FILTER_SOURCE_PATH = "C_RELATION_FILTER_SOURCE_PATH"; /** Query key. */ private static final String C_RELATION_FILTER_TARGET_ID = "C_RELATION_FILTER_TARGET_ID"; /** Query key. */ private static final String C_RELATION_FILTER_TARGET_PATH = "C_RELATION_FILTER_TARGET_PATH"; /** Query key. */ private static final String C_RELATION_FILTER_TYPE = "C_RELATION_FILTER_TYPE"; /** Query key. */ private static final String C_RELATIONS_REPAIR_BROKEN = "C_RELATIONS_REPAIR_BROKEN"; /** Query key. */ private static final String C_RELATIONS_UPDATE_BROKEN = "C_RELATIONS_UPDATE_BROKEN"; /** Query key. */ private static final String C_RESOURCE_REPLACE = "C_RESOURCE_REPLACE"; /** Query key. */ private static final String C_RESOURCES_COUNT_SIBLINGS = "C_RESOURCES_COUNT_SIBLINGS"; /** Query key. */ private static final String C_RESOURCES_DELETE_BY_RESOURCEID = "C_RESOURCES_DELETE_BY_RESOURCEID"; /** Query key. */ private static final String C_RESOURCES_GET_RESOURCE_IN_PROJECT_IGNORE_STATE = "C_RESOURCES_GET_RESOURCE_IN_PROJECT_IGNORE_STATE"; /** Query key. */ private static final String C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITH_STATE = "C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITH_STATE"; /** Query key. */ private static final String C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITHOUT_STATE = "C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITHOUT_STATE"; /** Query key. */ private static final String C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF = "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF"; /** Query key. */ private static final String C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF_VALUE = "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF_VALUE"; /** Query key. */ private static final String C_RESOURCES_GET_SUBRESOURCES = "C_RESOURCES_GET_SUBRESOURCES"; /** Query key. */ private static final String C_RESOURCES_GET_SUBRESOURCES_GET_FILES = "C_RESOURCES_GET_SUBRESOURCES_GET_FILES"; /** Query key. */ private static final String C_RESOURCES_GET_SUBRESOURCES_GET_FOLDERS = "C_RESOURCES_GET_SUBRESOURCES_GET_FOLDERS"; /** Query key. */ private static final String C_RESOURCES_MOVE = "C_RESOURCES_MOVE"; /** Query key. */ private static final String C_RESOURCES_ORDER_BY_PATH = "C_RESOURCES_ORDER_BY_PATH"; /** Query key. */ private static final String C_RESOURCES_READ = "C_RESOURCES_READ"; /** Query key. */ private static final String C_RESOURCES_READ_PARENT_BY_ID = "C_RESOURCES_READ_PARENT_BY_ID"; /** Query key. */ private static final String C_RESOURCES_READ_PARENT_STRUCTURE_ID = "C_RESOURCES_READ_PARENT_STRUCTURE_ID"; /** Query key. */ private static final String C_RESOURCES_READ_RESOURCE_STATE = "C_RESOURCES_READ_RESOURCE_STATE"; /** Query key. */ private static final String C_RESOURCES_READ_TREE = "C_RESOURCES_READ_TREE"; /** Query key. */ private static final String C_RESOURCES_READ_VERSION_RES = "C_RESOURCES_READ_VERSION_RES"; /** Query key. */ private static final String C_RESOURCES_READ_VERSION_STR = "C_RESOURCES_READ_VERSION_STR"; /** Query key. */ private static final String C_RESOURCES_READ_WITH_ACE_1 = "C_RESOURCES_READ_WITH_ACE_1"; /** Query key. */ private static final String C_RESOURCES_READBYID = "C_RESOURCES_READBYID"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_AFTER = "C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_AFTER"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_BEFORE = "C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_BEFORE"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_PARENT_UUID = "C_RESOURCES_SELECT_BY_PARENT_UUID"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_PATH_PREFIX = "C_RESOURCES_SELECT_BY_PATH_PREFIX"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_PROJECT_LASTMODIFIED = "C_RESOURCES_SELECT_BY_PROJECT_LASTMODIFIED"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_RESOURCE_STATE = "C_RESOURCES_SELECT_BY_RESOURCE_STATE"; /** Query key. */ private static final String C_RESOURCES_SELECT_BY_RESOURCE_TYPE = "C_RESOURCES_SELECT_BY_RESOURCE_TYPE"; /** Query key. */ private static final String C_RESOURCES_SELECT_ONLY_FILES = "C_RESOURCES_SELECT_ONLY_FILES"; /** Query key. */ private static final String C_RESOURCES_SELECT_ONLY_FOLDERS = "C_RESOURCES_SELECT_ONLY_FOLDERS"; /** Query key. */ private static final String C_RESOURCES_SELECT_STRUCTURE_ID = "C_RESOURCES_SELECT_STRUCTURE_ID"; /** Query key. */ private static final String C_RESOURCES_TRANSFER_RESOURCE = "C_RESOURCES_TRANSFER_RESOURCE"; /** Query key. */ private static final String C_RESOURCES_UPDATE_FLAGS = "C_RESOURCES_UPDATE_FLAGS"; /** Query key. */ private static final String C_RESOURCES_UPDATE_PROJECT_LASTMODIFIED = "C_RESOURCES_UPDATE_PROJECT_LASTMODIFIED"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RELEASE_EXPIRED = "C_RESOURCES_UPDATE_RELEASE_EXPIRED"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCE_PROJECT = "C_RESOURCES_UPDATE_RESOURCE_PROJECT"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCE_STATE = "C_RESOURCES_UPDATE_RESOURCE_STATE"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCE_STATELASTMODIFIED = "C_RESOURCES_UPDATE_RESOURCE_STATELASTMODIFIED"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCE_VERSION = "C_RESOURCES_UPDATE_RESOURCE_VERSION"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCES = "C_RESOURCES_UPDATE_RESOURCES"; /** Query key. */ private static final String C_RESOURCES_UPDATE_RESOURCES_WITHOUT_STATE = "C_RESOURCES_UPDATE_RESOURCES_WITHOUT_STATE"; /** Query key. */ private static final String C_RESOURCES_UPDATE_SIBLING_COUNT = "C_RESOURCES_UPDATE_SIBLING_COUNT"; /** Query key. */ private static final String C_RESOURCES_UPDATE_STRUCTURE = "C_RESOURCES_UPDATE_STRUCTURE"; /** Query key. */ private static final String C_RESOURCES_UPDATE_STRUCTURE_STATE = "C_RESOURCES_UPDATE_STRUCTURE_STATE"; /** Query key. */ private static final String C_RESOURCES_UPDATE_STRUCTURE_VERSION = "C_RESOURCES_UPDATE_STRUCTURE_VERSION"; /** Query key. */ private static final String C_SELECT_NONDELETED_VFS_SIBLINGS = "C_SELECT_NONDELETED_VFS_SIBLINGS"; /** Query key. */ private static final String C_SELECT_RESOURCES_FOR_PRINCIPAL_ACE = "C_SELECT_RESOURCES_FOR_PRINCIPAL_ACE"; /** Query key. */ private static final String C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR1 = "C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR1"; /** Query key. */ private static final String C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR2 = "C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR2"; /** Query key. */ private static final String C_SELECT_VFS_SIBLINGS = "C_SELECT_VFS_SIBLINGS"; /** Query key. */ private static final String C_STRUCTURE_DELETE_BY_STRUCTUREID = "C_STRUCTURE_DELETE_BY_STRUCTUREID"; /** Query key. */ private static final String C_STRUCTURE_SELECT_BY_DATE_EXPIRED_AFTER = "C_STRUCTURE_SELECT_BY_DATE_EXPIRED_AFTER"; /** Query key. */ private static final String C_STRUCTURE_SELECT_BY_DATE_EXPIRED_BEFORE = "C_STRUCTURE_SELECT_BY_DATE_EXPIRED_BEFORE"; /** Query key. */ private static final String C_STRUCTURE_SELECT_BY_DATE_RELEASED_AFTER = "C_STRUCTURE_SELECT_BY_DATE_RELEASED_AFTER"; /** Query key. */ private static final String C_STRUCTURE_SELECT_BY_DATE_RELEASED_BEFORE = "C_STRUCTURE_SELECT_BY_DATE_RELEASED_BEFORE"; /** The log object for this class. */ private static final Log LOG = CmsLog.getLog(org.opencms.db.jpa.CmsVfsDriver.class); /** The driver manager. */ protected CmsDriverManager m_driverManager; /** * This field is temporarily used to compute the versions during publishing.<p> * * @see #publishVersions(CmsDbContext, CmsResource, boolean) */ protected List<CmsUUID> m_resOp = new ArrayList<CmsUUID>(); /** The sql manager. */ protected CmsSqlManager m_sqlManager; /** * Escapes the database wildcards within the resource path.<p> * * This method is required to ensure chars in the resource path that have a special * meaning in SQL (for example "_", which is the "any char" operator) are escaped.<p> * * It will escape the following chars: * <ul> * <li>"_" to "|_"</li> * </ul> * * @param path the resource path * @return the escaped resource path */ public static String escapeDbWildcard(String path) { return CmsStringUtil.substitute(path, "_", "|_"); } /** * This method prepares the JPQL conditions for mapping entries for a given URL name mapping filter.<p> * * @param filter the filter from which the JPQL conditions should be generated * * @return a pair consisting of an JPQL string and a list of the query parameters for the JPQL */ public static CmsPair<String, List<I_CmsQueryParameter>> prepareUrlNameMappingConditions( CmsUrlNameMappingFilter filter) { List<String> sqlConditions = new ArrayList<String>(); List<I_CmsQueryParameter> parameters = new ArrayList<I_CmsQueryParameter>(); if (filter.getName() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_name = ?"); parameters.add(new CmsQueryStringParameter(filter.getName())); } if (filter.getStructureId() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_structureId = ?"); parameters.add(new CmsQueryStringParameter(filter.getStructureId().toString())); } if (filter.getNamePattern() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_name LIKE ? "); parameters.add(new CmsQueryStringParameter(filter.getNamePattern())); } if (filter.getState() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_state = ?"); parameters.add(new CmsQueryIntParameter(filter.getState().intValue())); } if (filter.getRejectStructureId() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_structureId <> ? "); parameters.add(new CmsQueryStringParameter(filter.getRejectStructureId().toString())); } if (filter.getLocale() != null) { sqlConditions.add("T_CmsDAO%(PROJECT)UrlNameMappings.m_locale = ? "); parameters.add(new CmsQueryStringParameter(filter.getLocale())); } String conditionString = CmsStringUtil.listAsString(sqlConditions, " AND "); return CmsPair.create(conditionString, parameters); } /** * @see org.opencms.db.I_CmsVfsDriver#addUrlNameMappingEntry(org.opencms.db.CmsDbContext, boolean, org.opencms.db.urlname.CmsUrlNameMappingEntry) */ public void addUrlNameMappingEntry(CmsDbContext dbc, boolean online, CmsUrlNameMappingEntry entry) { I_CmsDAOUrlNameMappings m = online ? new CmsDAOOnlineUrlNameMappings() : new CmsDAOOfflineUrlNameMappings(); m.setName(entry.getName()); m.setStructureId(entry.getStructureId().toString()); m.setState(entry.getState()); m.setDateChanged(entry.getDateChanged()); m.setLocale(entry.getLocale()); m_sqlManager.persist(dbc, m); } /** * Counts the number of siblings of a resource.<p> * * @param dbc the current database context * @param projectId the current project id * @param resourceId the resource id to count the number of siblings from * * @return number of siblings * @throws CmsDataAccessException if something goes wrong */ public int countSiblings(CmsDbContext dbc, CmsUUID projectId, CmsUUID resourceId) throws CmsDataAccessException { int count = 0; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_COUNT_SIBLINGS); q.setParameter(1, resourceId.toString()); try { count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return count; } /** * @see org.opencms.db.I_CmsVfsDriver#createContent(CmsDbContext, CmsUUID, CmsUUID, byte[]) */ public void createContent(CmsDbContext dbc, CmsUUID projectId, CmsUUID resourceId, byte[] content) throws CmsDataAccessException { try { CmsDAOOfflineContents oc = new CmsDAOOfflineContents(); oc.setResourceId(resourceId.toString()); oc.setFileContent(content); m_sqlManager.persist(dbc, oc); } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Creates a {@link CmsFile} instance from a jpa ResultSet.<p> * * @param o the jpa ResultSet * @param projectId the project id * @param hasFileContentInResultSet flag to include the file content * * @return the created file */ public CmsFile createFile(Object[] o, CmsUUID projectId, boolean hasFileContentInResultSet) { I_CmsDAOResources r = (I_CmsDAOResources)o[0]; I_CmsDAOStructure s = (I_CmsDAOStructure)o[1]; String lockedInProjectParameter = (String)o[2]; byte[] content = null; CmsUUID resProjectId = null; CmsUUID structureId = new CmsUUID(s.getStructureId()); CmsUUID resourceId = new CmsUUID(r.getResourceId()); String resourcePath = s.getResourcePath(); int resourceType = r.getResourceType(); int resourceFlags = r.getResourceFlags(); int resourceState = r.getResourceState(); int structureState = s.getStructureState(); long dateCreated = r.getDateCreated(); long dateLastModified = r.getDateLastModified(); long dateReleased = s.getDateReleased(); long dateExpired = s.getDateExpired(); int resourceSize = r.getResourceSize(); CmsUUID userCreated = new CmsUUID(r.getUserCreated()); CmsUUID userLastModified = new CmsUUID(r.getUserLastModified()); CmsUUID lockedInProject = new CmsUUID(lockedInProjectParameter); int siblingCount = r.getSiblingCount(); long dateContent = r.getDateContent(); int resourceVersion = r.getResourceVersion(); int structureVersion = s.getStructureVersion(); // in case of folder type ensure, that the root path has a trailing slash if (CmsFolder.isFolderType(resourceType)) { resourcePath = CmsFileUtil.addTrailingSeparator(resourcePath); } if (hasFileContentInResultSet) { //content = m_sqlManager.getBytes(res, m_sqlManager.readQuery("C_RESOURCES_FILE_CONTENT")); throw new RuntimeException( "CCmsVfsDriver: public CmsFile createFile(Object[] o, CmsUUID projectId, boolean hasFileContentInResultSet) throws SQLException "); } resProjectId = lockedInProject; int newState = (structureState > resourceState) ? structureState : resourceState; return new CmsFile( structureId, resourceId, resourcePath, resourceType, resourceFlags, resProjectId, CmsResourceState.valueOf(newState), dateCreated, userCreated, dateLastModified, userLastModified, dateReleased, dateExpired, siblingCount, resourceSize, dateContent, resourceVersion + structureVersion, content); } /** * @see org.opencms.db.I_CmsVfsDriver#createFile(java.sql.ResultSet, org.opencms.util.CmsUUID) */ public CmsFile createFile(ResultSet res, CmsUUID projectId) { LOG.error("This method is not implemented!"); return null; } /** * @see org.opencms.db.I_CmsVfsDriver#createFile(java.sql.ResultSet, org.opencms.util.CmsUUID, boolean) */ public CmsFile createFile(ResultSet res, CmsUUID projectId, boolean hasFileContentInResultSet) { LOG.error("This method is not implemented!"); return null; } /** * Creates a {@link CmsFolder} instance from a jpa ResultSet.<p> * * @param o the JDBC ResultSet * @param projectId the ID of the current project * @param hasProjectIdInResultSet true if the SQL select query includes the PROJECT_ID table attribute * * @return the created folder */ public CmsFolder createFolder(Object[] o, CmsUUID projectId, boolean hasProjectIdInResultSet) { I_CmsDAOResources r = (I_CmsDAOResources)o[0]; I_CmsDAOStructure s = (I_CmsDAOStructure)o[1]; String lockedInProjectParameter = (String)o[2]; CmsUUID structureId = new CmsUUID(s.getStructureId()); CmsUUID resourceId = new CmsUUID(r.getResourceId()); String resourcePath = s.getResourcePath(); int resourceType = r.getResourceType(); int resourceFlags = r.getResourceFlags(); int resourceState = r.getResourceState(); int structureState = s.getStructureState(); long dateCreated = r.getDateCreated(); long dateLastModified = r.getDateLastModified(); long dateReleased = s.getDateReleased(); long dateExpired = s.getDateExpired(); CmsUUID userCreated = new CmsUUID(r.getUserCreated()); CmsUUID userLastModified = new CmsUUID(r.getUserLastModified()); CmsUUID resProjectId = new CmsUUID(lockedInProjectParameter); int resourceVersion = r.getResourceVersion(); int structureVersion = s.getStructureVersion(); int resourceSize = r.getResourceSize(); // in case of folder type ensure, that the root path has a trailing slash if (CmsFolder.isFolderSize(resourceSize)) { resourcePath = CmsFileUtil.addTrailingSeparator(resourcePath); } int newState = (structureState > resourceState) ? structureState : resourceState; return new CmsFolder( structureId, resourceId, resourcePath, resourceType, resourceFlags, resProjectId, CmsResourceState.valueOf(newState), dateCreated, userCreated, dateLastModified, userLastModified, dateReleased, dateExpired, resourceVersion + structureVersion); } /** * @see org.opencms.db.I_CmsVfsDriver#createFolder(java.sql.ResultSet, org.opencms.util.CmsUUID, boolean) */ public CmsFolder createFolder(ResultSet res, CmsUUID projectId, boolean hasProjectIdInResultSet) { LOG.error("This method is not implemented!"); return null; } /** * @see org.opencms.db.I_CmsVfsDriver#createOnlineContent(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, byte[], int, boolean, boolean) */ public void createOnlineContent( CmsDbContext dbc, CmsUUID resourceId, byte[] contents, int publishTag, boolean keepOnline, boolean needToUpdateContent) throws CmsDataAccessException { try { boolean dbcHasProjectId = (dbc.getProjectId() != null) && !dbc.getProjectId().isNullUUID(); if (needToUpdateContent || dbcHasProjectId) { if (dbcHasProjectId || !OpenCms.getSystemInfo().isHistoryEnabled()) { // remove the online content for this resource id Query q = m_sqlManager.createQuery(dbc, "C_ONLINE_CONTENTS_DELETE"); q.setParameter(1, resourceId.toString()); q.executeUpdate(); } else { // put the online content in the history, only if explicit requested Query q = m_sqlManager.createQuery(dbc, "C_ONLINE_CONTENTS_HISTORY"); q.setParameter(1, resourceId.toString()); @SuppressWarnings("unchecked") List<CmsDAOContents> res = q.getResultList(); for (CmsDAOContents c : res) { c.setOnlineFlag(0); } } // create new online content CmsDAOContents c = new CmsDAOContents(); c.setResourceId(resourceId.toString()); c.setFileContent(contents); c.setPublishTagFrom(publishTag); c.setPublishTagTo(publishTag); c.setOnlineFlag(keepOnline ? 1 : 0); m_sqlManager.persist(dbc, c); } else { // update old content entry Query q = m_sqlManager.createQuery(dbc, C_HISTORY_CONTENTS_UPDATE); q.setParameter(1, resourceId.toString()); @SuppressWarnings("unchecked") List<CmsDAOContents> res = q.getResultList(); for (CmsDAOContents c : res) { c.setPublishTagTo(publishTag); } if (!keepOnline) { // put the online content in the history q = m_sqlManager.createQuery(dbc, C_ONLINE_CONTENTS_HISTORY); q.setParameter(1, resourceId.toString()); @SuppressWarnings("unchecked") List<CmsDAOContents> res1 = q.getResultList(); for (CmsDAOContents c : res1) { c.setOnlineFlag(0); } } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#createPropertyDefinition(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, java.lang.String, org.opencms.file.CmsPropertyDefinition.CmsPropertyType) */ public CmsPropertyDefinition createPropertyDefinition( CmsDbContext dbc, CmsUUID projectId, String name, CmsPropertyDefinition.CmsPropertyType type) throws CmsDataAccessException { try { I_CmsDAOPropertyDef pd = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlinePropertyDef() : new CmsDAOOfflinePropertyDef(); pd.setPropertyDefId(new CmsUUID().toString()); pd.setPropertyDefName(name); pd.setPropertyDefType(type.getMode()); m_sqlManager.persist(dbc, pd); } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return readPropertyDefinition(dbc, name, projectId); } /** * @see org.opencms.db.I_CmsVfsDriver#createRelation(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.relations.CmsRelation) */ public void createRelation(CmsDbContext dbc, CmsUUID projectId, CmsRelation relation) throws CmsDataAccessException { try { I_CmsDAOResourceRelations rr = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); rr.setRelationSourceId(relation.getSourceId().toString()); rr.setRelationSourcePath(relation.getSourcePath()); rr.setRelationTargetId(relation.getTargetId().toString()); rr.setRelationTargetPath(relation.getTargetPath()); rr.setRelationType(relation.getType().getId()); m_sqlManager.persist(dbc, rr); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key( Messages.LOG_CREATE_RELATION_2, String.valueOf(projectId), relation)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#createResource(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsResource, byte[]) */ public CmsResource createResource(CmsDbContext dbc, CmsUUID projectId, CmsResource resource, byte[] content) throws CmsDataAccessException { CmsUUID newStructureId = null; // check the resource path String resourcePath = CmsFileUtil.removeTrailingSeparator(resource.getRootPath()); if (resourcePath.length() > CmsDriverManager.MAX_VFS_RESOURCE_PATH_LENGTH) { throw new CmsDataAccessException(Messages.get().container( Messages.ERR_RESOURCENAME_TOO_LONG_2, resourcePath, new Integer(CmsDriverManager.MAX_VFS_RESOURCE_PATH_LENGTH))); } // check if the parent folder of the resource exists and if is not deleted if (!resource.getRootPath().equals("/")) { String parentFolderName = CmsResource.getParentFolder(resource.getRootPath()); CmsFolder parentFolder = m_driverManager.getVfsDriver(dbc).readFolder(dbc, projectId, parentFolderName); if (parentFolder.getState().isDeleted()) { throw new CmsDbEntryNotFoundException(Messages.get().container( Messages.ERR_PARENT_FOLDER_DELETED_1, resource.getRootPath())); } } // validate the resource length internalValidateResourceLength(resource); // set the resource state and modification dates CmsResourceState newState; long dateModified; long dateCreated; long dateContent = System.currentTimeMillis(); if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { newState = CmsResource.STATE_UNCHANGED; dateCreated = resource.getDateCreated(); dateModified = resource.getDateLastModified(); } else { newState = CmsResource.STATE_NEW; if (resource.isTouched()) { dateCreated = resource.getDateCreated(); dateModified = resource.getDateLastModified(); } else { dateCreated = System.currentTimeMillis(); dateModified = dateCreated; } } // check if the resource already exists newStructureId = resource.getStructureId(); try { CmsResource existingResource = m_driverManager.getVfsDriver().readResource( dbc, dbc.getProjectId().isNullUUID() ? projectId : dbc.getProjectId(), resourcePath, true); if (existingResource.getState().isDeleted()) { // if an existing resource is deleted, it will be finally removed now. // but we have to reuse its id in order to avoid orphans in the online project newStructureId = existingResource.getStructureId(); newState = CmsResource.STATE_CHANGED; // remove the existing file and it's properties List<CmsResource> modifiedResources = m_driverManager.getVfsDriver(dbc).readSiblings( dbc, projectId, existingResource, false); int propertyDeleteOption = (existingResource.getSiblingCount() > 1) ? CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_VALUES : CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES; deletePropertyObjects(dbc, projectId, existingResource, propertyDeleteOption); removeFile(dbc, projectId, existingResource); OpenCms.fireCmsEvent(new CmsEvent( I_CmsEventListener.EVENT_RESOURCES_MODIFIED, Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCES, modifiedResources))); OpenCms.fireCmsEvent(new CmsEvent( I_CmsEventListener.EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCE, existingResource))); } else { // we have a collision: there exists already a resource with the same path/name which cannot be removed throw new CmsVfsResourceAlreadyExistsException(Messages.get().container( Messages.ERR_RESOURCE_WITH_NAME_ALREADY_EXISTS_1, dbc.removeSiteRoot(resource.getRootPath()))); } } catch (CmsVfsResourceNotFoundException e) { // that's what we want in the best case- anything else should be thrown } try { // read the parent id String parentId = internalReadParentId(dbc, projectId, resourcePath); // use consistent version numbers if the file is being restored int lastVersion = m_driverManager.getHistoryDriver(dbc).readLastVersion(dbc, newStructureId); int newStrVersion = 0; int newResVersion = 0; if (lastVersion > 0) { I_CmsHistoryResource histRes = m_driverManager.getHistoryDriver(dbc).readResource( dbc, newStructureId, lastVersion); newStrVersion = histRes.getStructureVersion(); newResVersion = histRes.getResourceVersion(); } // write the structure I_CmsDAOStructure s = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineStructure() : new CmsDAOOfflineStructure(); s.setStructureId(newStructureId.toString()); s.setResourceId(resource.getResourceId().toString()); s.setResourcePath(resourcePath); s.setStructureState(newState.getState()); s.setDateReleased(resource.getDateReleased()); s.setDateExpired(resource.getDateExpired()); s.setParentId(parentId); s.setStructureVersion(newStrVersion); m_sqlManager.persist(dbc, s); if (!validateResourceIdExists(dbc, projectId, resource.getResourceId())) { // create the resource record I_CmsDAOResources r = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResources() : new CmsDAOOfflineResources(); r.setResourceId(resource.getResourceId().toString()); r.setResourceType(resource.getTypeId()); r.setResourceFlags(resource.getFlags()); r.setDateCreated(dateCreated); r.setUserCreated(resource.getUserCreated().toString()); r.setDateLastModified(dateModified); r.setUserLastModified(resource.getUserLastModified().toString()); r.setResourceState(newState.getState()); r.setResourceSize(resource.getLength()); r.setDateContent(dateContent); r.setProjectLastModified(projectId.toString()); r.setSiblingCount(1); r.setResourceVersion(newResVersion); m_sqlManager.persist(dbc, r); if (resource.isFile() && (content != null)) { // create the file content createContent(dbc, projectId, resource.getResourceId(), content); } } else { if ((content != null) || !resource.getState().isKeep()) { CmsUUID projLastMod = projectId; CmsResourceState state = CmsResource.STATE_CHANGED; if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { // in case a sibling is being published projLastMod = resource.getProjectLastModified(); state = CmsResource.STATE_UNCHANGED; } // update the resource record only if state has changed or new content is provided Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_RESOURCES); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceType(resource.getTypeId()); r.setResourceFlags(resource.getFlags()); r.setDateLastModified(dateModified); r.setUserLastModified(resource.getUserLastModified().toString()); r.setResourceState(state.getState()); r.setResourceSize(resource.getLength()); r.setDateContent(resource.getDateContent()); r.setProjectLastModified(projLastMod.toString()); r.setSiblingCount(countSiblings(dbc, projectId, resource.getResourceId())); } } if (resource.isFile()) { if (content != null) { // update the file content writeContent(dbc, resource.getResourceId(), content); } else if (resource.getState().isKeep()) { // special case sibling creation - update the link Count Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_SIBLING_COUNT); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setSiblingCount(countSiblings(dbc, projectId, resource.getResourceId())); } // update the resource flags q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_FLAGS); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> resf = q.getResultList(); for (I_CmsDAOResources r : resf) { r.setResourceFlags(resource.getFlags()); } } } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } repairBrokenRelations(dbc, projectId, resource.getStructureId(), resource.getRootPath()); return readResource(dbc, projectId, newStructureId, false); } /** * Creates a CmsResource instance from a jpa ResultSet.<p> * * @param o the jpa ResultSet * @param projectId the ID of the current project to adjust the modification date in case the resource is a VFS link * * @return the created resource */ public CmsResource createResource(Object[] o, CmsUUID projectId) { I_CmsDAOResources r = (I_CmsDAOResources)o[0]; I_CmsDAOStructure s = (I_CmsDAOStructure)o[1]; CmsUUID structureId = new CmsUUID(s.getStructureId()); CmsUUID resourceId = new CmsUUID(r.getResourceId()); String resourcePath = s.getResourcePath(); int resourceType = r.getResourceType(); int resourceFlags = r.getResourceFlags(); CmsUUID resourceProjectLastModified = new CmsUUID(r.getProjectLastModified()); int resourceState = r.getResourceState(); int structureState = s.getStructureState(); long dateCreated = r.getDateCreated(); long dateLastModified = r.getDateLastModified(); long dateReleased = s.getDateReleased(); long dateExpired = s.getDateExpired(); int resourceSize = r.getResourceSize(); boolean isFolder = CmsFolder.isFolderSize(resourceSize); if (isFolder) { // in case of folder type ensure, that the root path has a trailing slash resourcePath = CmsFileUtil.addTrailingSeparator(resourcePath); } long dateContent = isFolder ? -1 : r.getDateContent(); CmsUUID userCreated = new CmsUUID(r.getUserCreated()); CmsUUID userLastModified = new CmsUUID(r.getUserLastModified()); int siblingCount = r.getSiblingCount(); int resourceVersion = r.getResourceVersion(); int structureVersion = s.getStructureVersion(); int newState = (structureState > resourceState) ? structureState : resourceState; // if there is a change increase the version number int newVersion = resourceVersion + structureVersion + (newState > 0 ? 1 : 0); CmsResource newResource = new CmsResource( structureId, resourceId, resourcePath, resourceType, isFolder, resourceFlags, resourceProjectLastModified, CmsResourceState.valueOf(newState), dateCreated, userCreated, dateLastModified, userLastModified, dateReleased, dateExpired, siblingCount, resourceSize, dateContent, newVersion); return newResource; } /** * @see org.opencms.db.I_CmsVfsDriver#createResource(java.sql.ResultSet, org.opencms.util.CmsUUID) */ public CmsResource createResource(ResultSet res, CmsUUID projectId) { LOG.error("This method is not implemented!"); return null; } /** * @see org.opencms.db.I_CmsVfsDriver#createSibling(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource) */ public void createSibling(CmsDbContext dbc, CmsProject project, CmsResource resource) throws CmsDataAccessException { if (!project.getUuid().equals(CmsProject.ONLINE_PROJECT_ID)) { // this method is only intended to be used during publishing return; } // check if the resource already exists CmsResource existingSibling = null; CmsUUID newStructureId = resource.getStructureId(); try { existingSibling = readResource(dbc, project.getUuid(), resource.getRootPath(), true); if (existingSibling.getState().isDeleted()) { // if an existing resource is deleted, it will be finally removed now. // but we have to reuse its id in order to avoid orphans in the online project. newStructureId = existingSibling.getStructureId(); // remove the existing file and it's properties List<CmsResource> modifiedResources = readSiblings(dbc, project.getUuid(), existingSibling, false); int propertyDeleteOption = (existingSibling.getSiblingCount() > 1) ? CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_VALUES : CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES; deletePropertyObjects(dbc, project.getUuid(), existingSibling, propertyDeleteOption); removeFile(dbc, project.getUuid(), existingSibling); OpenCms.fireCmsEvent(new CmsEvent( I_CmsEventListener.EVENT_RESOURCES_MODIFIED, Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCES, modifiedResources))); OpenCms.fireCmsEvent(new CmsEvent( I_CmsEventListener.EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, Collections.<String, Object> singletonMap(I_CmsEventListener.KEY_RESOURCE, existingSibling))); } else { // we have a collision: there exists already a resource with the same path/name which could not be removed throw new CmsVfsResourceAlreadyExistsException(Messages.get().container( Messages.ERR_RESOURCE_WITH_NAME_ALREADY_EXISTS_1, dbc.removeSiteRoot(resource.getRootPath()))); } } catch (CmsVfsResourceNotFoundException e) { // that's what we want in the best case- anything else should be thrown } // check if a resource with the specified ID already exists if (!validateResourceIdExists(dbc, project.getUuid(), resource.getResourceId())) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_CREATE_SIBLING_FILE_NOT_FOUND_1, dbc.removeSiteRoot(resource.getRootPath()))); } // write a new structure referring to the resource try { // use consistent version numbers if the file is being restored int lastVersion = m_driverManager.getHistoryDriver(dbc).readLastVersion(dbc, newStructureId); int newStrVersion = 0; if (lastVersion > 0) { I_CmsHistoryResource histRes = m_driverManager.getHistoryDriver(dbc).readResource( dbc, newStructureId, lastVersion); newStrVersion = histRes.getStructureVersion(); } // read the parent id String parentId = internalReadParentId(dbc, project.getUuid(), resource.getRootPath()); // write the structure I_CmsDAOStructure s = CmsProject.isOnlineProject(project.getUuid()) ? new CmsDAOOnlineStructure() : new CmsDAOOfflineStructure(); s.setStructureId(newStructureId.toString()); s.setResourceId(resource.getResourceId().toString()); s.setResourcePath(resource.getRootPath()); s.setStructureState(CmsResource.STATE_UNCHANGED.getState()); s.setDateReleased(resource.getDateReleased()); s.setDateExpired(resource.getDateExpired()); s.setParentId(parentId); s.setStructureVersion(newStrVersion); m_sqlManager.persist(dbc, s); // update the link Count Query q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_SIBLING_COUNT); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setSiblingCount(countSiblings(dbc, project.getUuid(), resource.getResourceId())); } // update the project last modified and flags q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_RESOURCE_PROJECT); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> resr = q.getResultList(); for (I_CmsDAOResources r : resr) { r.setResourceFlags(resource.getFlags()); r.setProjectLastModified(resource.getProjectLastModified().toString()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } repairBrokenRelations(dbc, project.getUuid(), resource.getStructureId(), resource.getRootPath()); } /** * @see org.opencms.db.I_CmsVfsDriver#deletePropertyDefinition(org.opencms.db.CmsDbContext, org.opencms.file.CmsPropertyDefinition) */ public void deletePropertyDefinition(CmsDbContext dbc, CmsPropertyDefinition metadef) throws CmsDataAccessException { try { if ((internalCountProperties(dbc, metadef, CmsProject.ONLINE_PROJECT_ID) != 0) || (internalCountProperties(dbc, metadef, CmsUUID.getOpenCmsUUID()) != 0)) { // HACK: to get an offline project throw new CmsDataAccessException(Messages.get().container( Messages.ERR_DELETE_USED_PROPERTY_1, metadef.getName())); } Query q; for (int i = 0; i < 2; i++) { if (i == 0) { // delete the offline property definition q = m_sqlManager.createQuery(dbc, CmsUUID.getOpenCmsUUID(), C_PROPERTYDEF_DELETE); // HACK: to get an offline project } else { // delete the online property definition q = m_sqlManager.createQuery(dbc, CmsProject.ONLINE_PROJECT_ID, C_PROPERTYDEF_DELETE); } q.setParameter(1, metadef.getId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOPropertyDef> res = q.getResultList(); for (I_CmsDAOPropertyDef pd : res) { m_sqlManager.remove(dbc, pd); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#deletePropertyObjects(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsResource, int) */ public void deletePropertyObjects(CmsDbContext dbc, CmsUUID projectId, CmsResource resource, int deleteOption) throws CmsDataAccessException { try { Query q; if (deleteOption == CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES) { // delete both the structure and resource property values mapped to the specified resource q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_DELETE_ALL_STRUCTURE_AND_RESOURCE_VALUES); q.setParameter(1, resource.getResourceId().toString()); q.setParameter(2, Integer.valueOf(CmsProperty.RESOURCE_RECORD_MAPPING)); q.setParameter(3, String.valueOf(resource.getStructureId())); q.setParameter(4, Integer.valueOf(CmsProperty.STRUCTURE_RECORD_MAPPING)); } else if (deleteOption == CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_VALUES) { // delete the structure values mapped to the specified resource q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_DELETE_ALL_VALUES_FOR_MAPPING_TYPE); q.setParameter(1, resource.getStructureId().toString()); q.setParameter(2, Integer.valueOf(CmsProperty.STRUCTURE_RECORD_MAPPING)); } else if (deleteOption == CmsProperty.DELETE_OPTION_DELETE_RESOURCE_VALUES) { // delete the resource property values mapped to the specified resource q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_DELETE_ALL_VALUES_FOR_MAPPING_TYPE); q.setParameter(1, resource.getResourceId().toString()); q.setParameter(2, Integer.valueOf(CmsProperty.RESOURCE_RECORD_MAPPING)); } else { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_INVALID_DELETE_OPTION_1)); } @SuppressWarnings("unchecked") List<I_CmsDAOProperties> res = q.getResultList(); for (I_CmsDAOProperties p : res) { m_sqlManager.remove(dbc, p); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#deleteRelations(org.opencms.db.CmsDbContext, CmsUUID, CmsResource, org.opencms.relations.CmsRelationFilter) */ public void deleteRelations(CmsDbContext dbc, CmsUUID projectId, CmsResource resource, CmsRelationFilter filter) throws CmsDataAccessException { try { if (filter.isSource()) { List params = new ArrayList(7); StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_DELETE_RELATIONS)); queryBuf.append(prepareRelationConditions(projectId, filter, resource, params, true)); Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { q.setParameter(i + 1, params.get(i)); } @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); for (I_CmsDAOResourceRelations rr : res) { m_sqlManager.remove(dbc, rr); } } if (filter.isTarget()) { List params = new ArrayList(7); StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_DELETE_RELATIONS)); queryBuf.append(prepareRelationConditions(projectId, filter, resource, params, false)); Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { q.setParameter(i + 1, params.get(i)); } @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); for (I_CmsDAOResourceRelations rr : res) { m_sqlManager.remove(dbc, rr); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } // update broken remaining relations updateBrokenRelations(dbc, projectId, resource.getRootPath()); } /** * @see org.opencms.db.I_CmsVfsDriver#deleteUrlNameMappingEntries(org.opencms.db.CmsDbContext, boolean, org.opencms.db.urlname.CmsUrlNameMappingFilter) */ public void deleteUrlNameMappingEntries(CmsDbContext dbc, boolean online, CmsUrlNameMappingFilter filter) throws CmsDataAccessException { try { String query = m_sqlManager.readQuery(C_DELETE_URLNAME_MAPPINGS); query = replaceProject(query, online); Query q = getQueryForFilter(dbc, query, filter, online); @SuppressWarnings("unchecked") List<I_CmsDAOUrlNameMappings> res = q.getResultList(); for (I_CmsDAOUrlNameMappings m : res) { m_sqlManager.remove(dbc, m); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#destroy() */ public void destroy() throws Throwable { m_sqlManager = null; m_driverManager = null; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SHUTDOWN_DRIVER_1, getClass().getName())); } } /** * Returns all organizational units for the given resource.<p> * * @param dbc the database context * @param projectId the id of the project * @param resource the resource * * @return a list of {@link org.opencms.security.CmsOrganizationalUnit} objects * * @throws CmsDataAccessException */ public List<CmsOrganizationalUnit> getResourceOus(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsDataAccessException { List<CmsOrganizationalUnit> ous = new ArrayList<CmsOrganizationalUnit>(); String resName = resource.getRootPath(); if (resource.isFolder() && !resName.endsWith("/")) { resName += "/"; } try { Query q = m_sqlManager.createQuery(dbc, projectId, C_READ_RESOURCE_OUS); q.setParameter(1, Integer.valueOf(CmsRelationType.OU_RESOURCE.getId())); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = internalResourceOus(q.getResultList(), resName); for (I_CmsDAOResourceRelations rr : res) { CmsRelation rel = internalReadRelation(rr); try { ous.add(m_driverManager.readOrganizationalUnit( dbc, rel.getSourcePath().substring(CmsUserDriver.ORGUNIT_BASE_FOLDER.length()))); } catch (CmsException e) { // should never happen if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return ous; } /** * @see org.opencms.db.I_CmsVfsDriver#getSqlManager() */ public CmsSqlManager getSqlManager() { return m_sqlManager; } /** * @see org.opencms.db.I_CmsVfsDriver#incrementCounter(org.opencms.db.CmsDbContext, java.lang.String) */ public int incrementCounter(CmsDbContext dbc, String name) { CmsDAOCounters c = m_sqlManager.find(dbc, CmsDAOCounters.class, name); int result = 0; if (c != null) { result = c.getCounter(); c.setCounter(c.getCounter() + 1); } else { c = new CmsDAOCounters(); c.setName(name); c.setCounter(1); m_sqlManager.persist(dbc, c); } return result; } /** * @see org.opencms.db.I_CmsDriver#init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager) */ public void init( CmsDbContext dbc, CmsConfigurationManager configurationManager, List<String> successiveDrivers, CmsDriverManager driverManager) { CmsParameterConfiguration config = configurationManager.getConfiguration(); String poolUrl = config.get("db.vfs.pool"); String classname = config.get("db.vfs.sqlmanager"); m_sqlManager = this.initSqlManager(classname); m_driverManager = driverManager; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_ASSIGNED_POOL_1, poolUrl)); } if ((successiveDrivers != null) && !successiveDrivers.isEmpty()) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key( Messages.LOG_SUCCESSIVE_DRIVERS_UNSUPPORTED_1, getClass().getName())); } } } /** * @see org.opencms.db.I_CmsVfsDriver#initSqlManager(String) */ public CmsSqlManager initSqlManager(String classname) { return CmsSqlManager.getInstance(classname); } /** * @see org.opencms.db.I_CmsVfsDriver#moveResource(CmsDbContext, CmsUUID, CmsResource, String) */ public void moveResource(CmsDbContext dbc, CmsUUID projectId, CmsResource source, String destinationPath) throws CmsDataAccessException { if ((dbc.getRequestContext() != null) && (dbc.getRequestContext().getAttribute(REQ_ATTR_CHECK_PERMISSIONS) != null)) { // only check write permissions checkWritePermissionsInFolder(dbc, source); return; } // determine destination folder String destinationFoldername = CmsResource.getParentFolder(destinationPath); // read the destination folder (will also check read permissions) CmsFolder destinationFolder = m_driverManager.readFolder(dbc, destinationFoldername, CmsResourceFilter.ALL); if (!projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { // check online resource try { CmsResource onlineResource = m_driverManager.getVfsDriver(dbc).readResource( dbc, CmsProject.ONLINE_PROJECT_ID, destinationPath, true); if (!onlineResource.getStructureId().equals(source.getStructureId())) { // source resource has been moved and it is not the // same as the resource that is being trying to move back CmsResource offlineResource = null; try { // read new location in offline project offlineResource = readResource( dbc, dbc.getRequestContext().getCurrentProject().getUuid(), onlineResource.getStructureId(), true); } catch (CmsException e) { // should never happen if (LOG.isErrorEnabled()) { LOG.error(e.getMessage(), e); } } throw new CmsVfsOnlineResourceAlreadyExistsException(Messages.get().container( Messages.ERR_OVERWRITE_MOVED_RESOURCE_3, dbc.removeSiteRoot(source.getRootPath()), dbc.removeSiteRoot(destinationPath), dbc.removeSiteRoot(offlineResource == null ? "__ERROR__" : offlineResource.getRootPath()))); } } catch (CmsVfsResourceNotFoundException e) { // ok, no online resource } } try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_MOVE); q.setParameter(1, source.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setResourcePath(CmsFileUtil.removeTrailingSeparator(destinationPath)); // must remove trailing slash s.setParentId(destinationFolder.getStructureId().toString()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } moveRelations(dbc, projectId, source.getStructureId(), destinationPath); repairBrokenRelations(dbc, projectId, source.getStructureId(), destinationPath); try { m_driverManager.repairCategories(dbc, projectId, readResource(dbc, projectId, destinationPath, true)); } catch (CmsException e) { throw new CmsDataAccessException(e.getMessageContainer(), e); } // repair project resources if (!projectId.equals(CmsProject.ONLINE_PROJECT_ID) && (dbc.getRequestContext() != null)) { String deletedResourceRootPath = source.getRootPath(); dbc.getRequestContext().setAttribute(CmsProjectDriver.DBC_ATTR_READ_PROJECT_FOR_RESOURCE, Boolean.TRUE); I_CmsProjectDriver projectDriver = m_driverManager.getProjectDriver(dbc); Iterator<CmsProject> itProjects = projectDriver.readProjects(dbc, deletedResourceRootPath).iterator(); while (itProjects.hasNext()) { CmsProject project = itProjects.next(); projectDriver.deleteProjectResource(dbc, project.getUuid(), deletedResourceRootPath); projectDriver.createProjectResource(dbc, project.getUuid(), destinationPath); } } } /** * @see org.opencms.db.I_CmsVfsDriver#publishResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, org.opencms.file.CmsResource) */ public void publishResource( CmsDbContext dbc, CmsProject onlineProject, CmsResource onlineResource, CmsResource offlineResource) throws CmsDataAccessException { // validate the resource length internalValidateResourceLength(offlineResource); int resourceSize = offlineResource.getLength(); String resourcePath = CmsFileUtil.removeTrailingSeparator(offlineResource.getRootPath()); Query q; try { boolean resourceExists = validateResourceIdExists( dbc, onlineProject.getUuid(), offlineResource.getResourceId()); if (resourceExists) { // the resource record exists online already // update the online resource record q = m_sqlManager.createQuery(dbc, onlineProject, C_RESOURCES_UPDATE_RESOURCES); q.setParameter(1, offlineResource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceType(offlineResource.getTypeId()); r.setResourceFlags(offlineResource.getFlags()); r.setDateLastModified(offlineResource.getDateLastModified()); r.setUserLastModified(offlineResource.getUserLastModified().toString()); r.setResourceState(CmsResource.STATE_UNCHANGED.getState()); r.setResourceSize(resourceSize); r.setDateContent(offlineResource.getDateContent()); r.setProjectLastModified(offlineResource.getProjectLastModified().toString()); r.setSiblingCount(countSiblings(dbc, onlineProject.getUuid(), onlineResource.getResourceId())); } } else { // the resource record does NOT exist online yet // create the resource record online I_CmsDAOResources r = CmsProject.isOnlineProject(onlineProject.getUuid()) ? new CmsDAOOnlineResources() : new CmsDAOOfflineResources(); r.setResourceId(offlineResource.getResourceId().toString()); r.setResourceType(offlineResource.getTypeId()); r.setResourceFlags(offlineResource.getFlags()); r.setDateCreated(offlineResource.getDateCreated()); r.setUserCreated(offlineResource.getUserCreated().toString()); r.setDateLastModified(offlineResource.getDateLastModified()); r.setUserLastModified(offlineResource.getUserLastModified().toString()); r.setResourceState(CmsResource.STATE_UNCHANGED.getState()); r.setResourceSize(resourceSize); r.setDateContent(offlineResource.getDateContent()); r.setProjectLastModified(offlineResource.getProjectLastModified().toString()); r.setSiblingCount(1); // initial siblings count r.setResourceVersion(1); // initial resource version m_sqlManager.persist(dbc, r); } // read the parent id String parentId = internalReadParentId(dbc, onlineProject.getUuid(), resourcePath); if (validateStructureIdExists(dbc, onlineProject.getUuid(), offlineResource.getStructureId())) { // update the online structure record q = m_sqlManager.createQuery(dbc, onlineProject, C_RESOURCES_UPDATE_STRUCTURE); q.setParameter(1, offlineResource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setResourceId(offlineResource.getResourceId().toString()); s.setResourcePath(resourcePath); s.setStructureState(CmsResource.STATE_UNCHANGED.getState()); s.setDateReleased(offlineResource.getDateReleased()); s.setDateExpired(offlineResource.getDateExpired()); s.setParentId(parentId); } } else { I_CmsDAOStructure s = CmsProject.isOnlineProject(onlineProject.getUuid()) ? new CmsDAOOnlineStructure() : new CmsDAOOfflineStructure(); s.setStructureId(offlineResource.getStructureId().toString()); s.setResourceId(offlineResource.getResourceId().toString()); s.setResourcePath(resourcePath); s.setStructureState(CmsResource.STATE_UNCHANGED.getState()); s.setDateReleased(offlineResource.getDateReleased()); s.setDateExpired(offlineResource.getDateExpired()); s.setParentId(parentId); s.setStructureVersion(resourceExists ? 1 : 0); // new resources start with 0, new siblings with 1 m_sqlManager.persist(dbc, s); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#publishVersions(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, boolean) */ public void publishVersions(CmsDbContext dbc, CmsResource resource, boolean firstSibling) throws CmsDataAccessException { // if resource is null just flush the internal cache if (resource == null) { m_resOp.clear(); return; } if (!dbc.getProjectId().isNullUUID() || dbc.currentProject().isOnlineProject()) { // this method is supposed to be used only in the offline project return; } if (firstSibling) { // reset the resource operation flag m_resOp.remove(resource.getResourceId()); } boolean resOp = false; // assume structure operation CmsResourceState resState = internalReadResourceState(dbc, dbc.currentProject().getUuid(), resource); CmsResourceState strState = internalReadStructureState(dbc, dbc.currentProject().getUuid(), resource); if (!resState.isUnchanged()) { if (strState.isDeleted()) { resOp = (resState.isDeleted() || (resource.getSiblingCount() == 1) || (countSiblings( dbc, dbc.currentProject().getUuid(), resource.getResourceId()) == 1)); } else { resOp = true; } } if (!firstSibling) { if (resOp) { return; } if (m_resOp.contains(resource.getResourceId())) { return; } } // read the offline version numbers Map<String, Integer> versions = readVersions( dbc, dbc.currentProject().getUuid(), resource.getResourceId(), resource.getStructureId()); int strVersion = versions.get("structure").intValue(); int resVersion = versions.get("resource").intValue(); if (resOp) { if (resource.getSiblingCount() > 1) { m_resOp.add(resource.getResourceId()); } resVersion++; } if (!resOp) { strVersion++; } try { if (resOp) { // update the resource version Query q = m_sqlManager.createQuery( dbc, CmsProject.ONLINE_PROJECT_ID, C_RESOURCES_UPDATE_RESOURCE_VERSION); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceVersion(resVersion); } } if (!resOp || strState.isNew()) { // update the structure version Query q = m_sqlManager.createQuery( dbc, CmsProject.ONLINE_PROJECT_ID, C_RESOURCES_UPDATE_STRUCTURE_VERSION); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setStructureVersion(strVersion); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#readChildResources(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, boolean, boolean) */ public List<CmsResource> readChildResources( CmsDbContext dbc, CmsProject currentProject, CmsResource resource, boolean getFolders, boolean getFiles) throws CmsDataAccessException { List<CmsResource> result = new ArrayList<CmsResource>(); CmsUUID projectId = currentProject.getUuid(); String resourceTypeClause; if (getFolders && getFiles) { resourceTypeClause = null; } else if (getFolders) { resourceTypeClause = m_sqlManager.readQuery(projectId, C_RESOURCES_GET_SUBRESOURCES_GET_FOLDERS); } else { resourceTypeClause = m_sqlManager.readQuery(projectId, C_RESOURCES_GET_SUBRESOURCES_GET_FILES); } StringBuffer query = new StringBuffer(); query.append(m_sqlManager.readQuery(projectId, C_RESOURCES_GET_SUBRESOURCES)); if (resourceTypeClause != null) { query.append(' '); query.append(resourceTypeClause); } try { Query q = m_sqlManager.createQueryFromJPQL(dbc, query.toString()); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); I_CmsDAOResources r; for (Object[] o : res) { r = (I_CmsDAOResources)o[0]; long size = r.getResourceSize(); if (CmsFolder.isFolderSize(size)) { result.add(createFolder(o, projectId, false)); } else { result.add(createFile(o, projectId, false)); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } // sort result in memory, this is to avoid DB dependencies in the result order Collections.sort(result, I_CmsResource.COMPARE_ROOT_PATH_IGNORE_CASE_FOLDERS_FIRST); return result; } /** * @see org.opencms.db.I_CmsVfsDriver#readContent(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID) */ public byte[] readContent(CmsDbContext dbc, CmsUUID projectId, CmsUUID resourceId) throws CmsDataAccessException { byte[] byteRes = null; boolean resourceExists = false; try { if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { // ONLINE PROJECT Query q = m_sqlManager.createQuery(dbc, projectId, C_ONLINE_FILES_CONTENT); q.setParameter(1, resourceId.toString()); try { byteRes = ((CmsDAOContents)q.getSingleResult()).getFileContent(); resourceExists = true; } catch (NoResultException e) { // do nothing } } else { // OFFLINE PROJECT CmsDAOOfflineContents c = m_sqlManager.find(dbc, CmsDAOOfflineContents.class, resourceId.toString()); if (c != null) { byteRes = c.getFileContent(); resourceExists = true; } } if (!resourceExists) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_CONTENT_WITH_RESOURCE_ID_2, resourceId, Boolean.valueOf(projectId.equals(CmsProject.ONLINE_PROJECT_ID)))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return byteRes == null ? EMPTY_BLOB : byteRes; } /** * @see org.opencms.db.I_CmsVfsDriver#readFolder(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID) */ public CmsFolder readFolder(CmsDbContext dbc, CmsUUID projectId, CmsUUID folderId) throws CmsDataAccessException { CmsFolder folder = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READBYID); q.setParameter(1, folderId.toString()); try { Object[] o = (Object[])q.getSingleResult(); folder = createFolder(o, projectId, true); } catch (NoResultException e) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_FOLDER_WITH_ID_1, folderId)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return folder; } /** * @see org.opencms.db.I_CmsVfsDriver#readFolder(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String) */ public CmsFolder readFolder(CmsDbContext dbc, CmsUUID projectId, String folderPath) throws CmsDataAccessException { CmsFolder folder = null; folderPath = CmsFileUtil.removeTrailingSeparator(folderPath); try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ); q.setParameter(1, folderPath); try { Object[] o = (Object[])q.getSingleResult(); folder = createFolder(o, projectId, true); } catch (NoResultException e) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_FOLDER_1, dbc.removeSiteRoot(folderPath))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return folder; } /** * @see org.opencms.db.I_CmsVfsDriver#readParentFolder(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID) */ public CmsFolder readParentFolder(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId) throws CmsDataAccessException { CmsFolder parent = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_PARENT_BY_ID); q.setParameter(1, structureId.toString()); try { Object[] o = (Object[])q.getSingleResult(); parent = new CmsFolder(createResource(o, projectId)); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return parent; } /** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String, CmsUUID) */ public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, String name, CmsUUID projectId) throws CmsDataAccessException { CmsPropertyDefinition propDef = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTYDEF_READ); q.setParameter(1, name); try { I_CmsDAOPropertyDef pd = (I_CmsDAOPropertyDef)q.getSingleResult(); propDef = new CmsPropertyDefinition( new CmsUUID(pd.getPropertyDefId()), pd.getPropertyDefName(), CmsPropertyDefinition.CmsPropertyType.valueOf(pd.getPropertyDefType())); } catch (NoResultException e) { throw new CmsDbEntryNotFoundException(Messages.get().container( Messages.ERR_NO_PROPERTYDEF_WITH_NAME_1, name)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return propDef; } /** * @see org.opencms.db.I_CmsVfsDriver#readPropertyDefinitions(org.opencms.db.CmsDbContext, CmsUUID) */ public List<CmsPropertyDefinition> readPropertyDefinitions(CmsDbContext dbc, CmsUUID projectId) throws CmsDataAccessException { ArrayList<CmsPropertyDefinition> propertyDefinitions = new ArrayList<CmsPropertyDefinition>(); try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTYDEF_READALL); @SuppressWarnings("unchecked") List<I_CmsDAOPropertyDef> res = q.getResultList(); for (I_CmsDAOPropertyDef pd : res) { propertyDefinitions.add(new CmsPropertyDefinition( new CmsUUID(pd.getPropertyDefId()), pd.getPropertyDefName(), CmsPropertyDefinition.CmsPropertyType.valueOf(pd.getPropertyDefType()))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return propertyDefinitions; } /** * @see org.opencms.db.I_CmsVfsDriver#readPropertyObject(org.opencms.db.CmsDbContext, java.lang.String, org.opencms.file.CmsProject, org.opencms.file.CmsResource) */ public CmsProperty readPropertyObject(CmsDbContext dbc, String key, CmsProject project, CmsResource resource) throws CmsDataAccessException { CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID()) ? project.getUuid() : dbc.getProjectId(); String propertyValue = null; int mappingType = -1; CmsProperty property = null; int resultSize = 0; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_READ); q.setParameter(1, key); q.setParameter(2, resource.getStructureId().toString()); q.setParameter(3, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOProperties> res = q.getResultList(); for (I_CmsDAOProperties o : res) { if (resultSize >= 2) { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_TOO_MANY_PROPERTIES_3, key, resource.getRootPath(), new Integer(resultSize))); } if (property == null) { property = new CmsProperty(); property.setName(key); } propertyValue = o.getPropertyValue(); mappingType = o.getPropertyMappingType(); if (mappingType == CmsProperty.STRUCTURE_RECORD_MAPPING) { property.setStructureValue(propertyValue); } else if (mappingType == CmsProperty.RESOURCE_RECORD_MAPPING) { property.setResourceValue(propertyValue); } else { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(), new Integer(mappingType), key)); } resultSize++; } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return (property != null) ? property : CmsProperty.getNullProperty(); } /** * @see org.opencms.db.I_CmsVfsDriver#readPropertyObjects(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource) */ public List<CmsProperty> readPropertyObjects(CmsDbContext dbc, CmsProject project, CmsResource resource) throws CmsDataAccessException { CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID()) ? project.getUuid() : dbc.getProjectId(); int mappingType = -1; Map<String, CmsProperty> propertyMap = new HashMap<String, CmsProperty>(); String propertyKey; String propertyValue; CmsProperty property; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_READALL); q.setParameter(1, resource.getStructureId().toString()); q.setParameter(2, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { propertyKey = null; propertyValue = null; mappingType = -1; propertyKey = ((I_CmsDAOPropertyDef)o[0]).getPropertyDefName(); propertyValue = ((I_CmsDAOProperties)o[1]).getPropertyValue(); mappingType = ((I_CmsDAOProperties)o[1]).getPropertyMappingType(); property = propertyMap.get(propertyKey); if (property == null) { // there doesn't exist a property object for this key yet property = new CmsProperty(); property.setName(propertyKey); propertyMap.put(propertyKey, property); } if (mappingType == CmsProperty.STRUCTURE_RECORD_MAPPING) { // this property value is mapped to a structure record property.setStructureValue(propertyValue); } else if (mappingType == CmsProperty.RESOURCE_RECORD_MAPPING) { // this property value is mapped to a resource record property.setResourceValue(propertyValue); } else { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_UNKNOWN_PROPERTY_VALUE_MAPPING_3, resource.getRootPath(), new Integer(mappingType), propertyKey)); } property.setOrigin(resource.getRootPath()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return new ArrayList<CmsProperty>(propertyMap.values()); } /** * @see org.opencms.db.I_CmsVfsDriver#readRelations(org.opencms.db.CmsDbContext, CmsUUID, CmsResource, org.opencms.relations.CmsRelationFilter) */ public List<CmsRelation> readRelations( CmsDbContext dbc, CmsUUID projectId, CmsResource resource, CmsRelationFilter filter) throws CmsDataAccessException { Set<CmsRelation> relations = new HashSet<CmsRelation>(); try { if (filter.isSource()) { List<String> params = new ArrayList<String>(7); StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_READ_RELATIONS)); queryBuf.append(prepareRelationConditions(projectId, filter, resource, params, true)); if (LOG.isDebugEnabled()) { LOG.debug(queryBuf.toString()); } Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { q.setParameter(i + 1, params.get(i)); } @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); for (I_CmsDAOResourceRelations rr : res) { relations.add(internalReadRelation(rr)); } } if (filter.isTarget()) { List<String> params = new ArrayList<String>(7); StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_READ_RELATIONS)); queryBuf.append(prepareRelationConditions(projectId, filter, resource, params, false)); if (LOG.isDebugEnabled()) { LOG.debug(queryBuf.toString()); } Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { q.setParameter(i + 1, params.get(i)); } @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); for (I_CmsDAOResourceRelations rr : res) { relations.add(internalReadRelation(rr)); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } List<CmsRelation> result = new ArrayList<CmsRelation>(relations); Collections.sort(result, CmsRelation.COMPARATOR); return result; } /** * @see org.opencms.db.I_CmsVfsDriver#readResource(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID, boolean) */ public CmsResource readResource(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId, boolean includeDeleted) throws CmsDataAccessException { CmsResource resource = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READBYID); q.setParameter(1, structureId.toString()); try { Object[] o = (Object[])q.getSingleResult(); resource = createResource(o, projectId); } catch (NoResultException e) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_RESOURCE_WITH_ID_1, structureId)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } // check if this resource is marked as deleted and if we are allowed to return a deleted resource if ((resource != null) && resource.getState().isDeleted() && !includeDeleted) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_DELETED_RESOURCE_1, dbc.removeSiteRoot(resource.getRootPath()))); } return resource; } /** * @see org.opencms.db.I_CmsVfsDriver#readResource(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String, boolean) */ public CmsResource readResource(CmsDbContext dbc, CmsUUID projectId, String path, boolean includeDeleted) throws CmsDataAccessException { CmsResource resource = null; // must remove trailing slash path = CmsFileUtil.removeTrailingSeparator(path); boolean endsWithSlash = path.endsWith("/"); try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ); q.setParameter(1, path); try { Object[] o = (Object[])q.getSingleResult(); resource = createResource(o, projectId); // check if the resource is a file, it is not allowed to end with a "/" then if (endsWithSlash && resource.isFile()) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_RESOURCE_1, dbc.removeSiteRoot(path + "/"))); } } catch (NoResultException e) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_RESOURCE_1, dbc.removeSiteRoot(path))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } // check if this resource is marked as deleted and if we are allowed to return a deleted resource if ((resource != null) && resource.getState().isDeleted() && !includeDeleted) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_DELETED_RESOURCE_1, dbc.removeSiteRoot(resource.getRootPath()))); } return resource; } /** * @see org.opencms.db.I_CmsVfsDriver#readResources(org.opencms.db.CmsDbContext, CmsUUID, CmsResourceState, int) */ public List<CmsResource> readResources(CmsDbContext dbc, CmsUUID projectId, CmsResourceState state, int mode) throws CmsDataAccessException { List<CmsResource> result = new ArrayList<CmsResource>(); Query q; try { if (mode == CmsDriverManager.READMODE_MATCHSTATE) { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITH_STATE); q.setParameter(1, projectId.toString()); q.setParameter(2, Integer.valueOf(state.getState())); q.setParameter(3, Integer.valueOf(state.getState())); q.setParameter(4, Integer.valueOf(state.getState())); q.setParameter(5, Integer.valueOf(state.getState())); } else if (mode == CmsDriverManager.READMODE_UNMATCHSTATE) { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_GET_RESOURCE_IN_PROJECT_WITHOUT_STATE); q.setParameter(1, projectId.toString()); q.setParameter(2, Integer.valueOf(state.getState())); q.setParameter(3, Integer.valueOf(state.getState())); } else { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_GET_RESOURCE_IN_PROJECT_IGNORE_STATE); q.setParameter(1, projectId.toString()); } @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { CmsResource resource = createResource(o, projectId); result.add(resource); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return result; } /** * @see org.opencms.db.I_CmsVfsDriver#readResourcesForPrincipalACE(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID) */ public List<CmsResource> readResourcesForPrincipalACE(CmsDbContext dbc, CmsProject project, CmsUUID principalId) throws CmsDataAccessException { CmsResource currentResource = null; List<CmsResource> resources = new ArrayList<CmsResource>(); try { Query q = m_sqlManager.createQuery(dbc, project, C_SELECT_RESOURCES_FOR_PRINCIPAL_ACE); q.setParameter(1, principalId.toString()); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { currentResource = createFile(o, project.getUuid(), false); resources.add(currentResource); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return resources; } /** * @see org.opencms.db.I_CmsVfsDriver#readResourcesForPrincipalAttr(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.util.CmsUUID) */ public List<CmsResource> readResourcesForPrincipalAttr(CmsDbContext dbc, CmsProject project, CmsUUID principalId) throws CmsDataAccessException { CmsResource currentResource = null; List<CmsResource> resources = new ArrayList<CmsResource>(); try { // JPQL does not support UNION clause String[] queries = {C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR1, C_SELECT_RESOURCES_FOR_PRINCIPAL_ATTR2}; String[] parameters = {principalId.toString(), principalId.toString()}; Query q; for (int i = 0; i < queries.length; i++) { q = m_sqlManager.createQuery(dbc, project, queries[i]); q.setParameter(1, parameters[i]); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { currentResource = createFile(o, project.getUuid(), false); resources.add(currentResource); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return resources; } /** * @see org.opencms.db.I_CmsVfsDriver#readResourcesWithProperty(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID, String, String) */ public List<CmsResource> readResourcesWithProperty( CmsDbContext dbc, CmsUUID projectId, CmsUUID propertyDef, String path, String value) throws CmsDataAccessException { List<CmsResource> resources = new ArrayList<CmsResource>(); Query q; List<Object[]> res = new ArrayList<Object[]>(); try { if (value == null) { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF); q.setParameter(1, propertyDef.toString()); q.setParameter(2, escapeDbWildcard(path + "%")); res.addAll(q.getResultList()); } else { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF_VALUE); q.setParameter(1, propertyDef.toString()); q.setParameter(2, escapeDbWildcard(path + "%")); q.setParameter(3, "%" + value + "%"); q.setParameter(4, escapeDbWildcard(path + "%")); q.setParameter(5, "%" + value + "%"); res.addAll(q.getResultList()); } for (Object[] o : res) { CmsResource resource = createResource(o, projectId); resources.add(resource); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return resources; } /** * @see org.opencms.db.I_CmsVfsDriver#readResourceTree(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String, int, CmsResourceState, long, long, long, long, long, long, int) */ public List<CmsResource> readResourceTree( CmsDbContext dbc, CmsUUID projectId, String parentPath, int type, CmsResourceState state, long lastModifiedAfter, long lastModifiedBefore, long releasedAfter, long releasedBefore, long expiredAfter, long expiredBefore, int mode) throws CmsDataAccessException { List<CmsResource> result = new ArrayList<CmsResource>(); StringBuffer conditions = new StringBuffer(); List params = new ArrayList(5); // prepare the selection criteria prepareProjectCondition(projectId, mode, conditions, params); prepareResourceCondition(projectId, mode, conditions); prepareTypeCondition(projectId, type, mode, conditions, params); prepareTimeRangeCondition(projectId, lastModifiedAfter, lastModifiedBefore, conditions, params); prepareReleasedTimeRangeCondition(projectId, releasedAfter, releasedBefore, conditions, params); prepareExpiredTimeRangeCondition(projectId, expiredAfter, expiredBefore, conditions, params); preparePathCondition(projectId, parentPath, mode, conditions, params); prepareStateCondition(projectId, state, mode, conditions, params); // now read matching resources within the subtree try { StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_RESOURCES_READ_TREE)); queryBuf.append(conditions); queryBuf.append(" "); queryBuf.append(m_sqlManager.readQuery(projectId, C_RESOURCES_ORDER_BY_PATH)); Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { q.setParameter(i + 1, params.get(i)); } @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { CmsResource resource = createResource(o, projectId); result.add(resource); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return result; } /** * @see org.opencms.db.I_CmsVfsDriver#readSiblings(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsResource, boolean) */ public List<CmsResource> readSiblings( CmsDbContext dbc, CmsUUID projectId, CmsResource resource, boolean includeDeleted) throws CmsDataAccessException { CmsResource currentResource = null; List<CmsResource> vfsLinks = new ArrayList<CmsResource>(); Query q; try { if (includeDeleted) { q = m_sqlManager.createQuery(dbc, projectId, C_SELECT_VFS_SIBLINGS); } else { q = m_sqlManager.createQuery(dbc, projectId, C_SELECT_NONDELETED_VFS_SIBLINGS); } q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { currentResource = createFile(o, projectId, false); vfsLinks.add(currentResource); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return vfsLinks; } /** * @see org.opencms.db.I_CmsVfsDriver#readUrlNameMappingEntries(org.opencms.db.CmsDbContext, boolean, org.opencms.db.urlname.CmsUrlNameMappingFilter) */ public List<CmsUrlNameMappingEntry> readUrlNameMappingEntries( CmsDbContext dbc, boolean online, CmsUrlNameMappingFilter filter) throws CmsDataAccessException { List<CmsUrlNameMappingEntry> result = new ArrayList<CmsUrlNameMappingEntry>(); try { String query = m_sqlManager.readQuery(C_READ_URLNAME_MAPPINGS); Query q = getQueryForFilter(dbc, query, filter, online); @SuppressWarnings("unchecked") List<I_CmsDAOUrlNameMappings> res = q.getResultList(); for (I_CmsDAOUrlNameMappings m : res) { CmsUrlNameMappingEntry entry = internalCreateUrlNameMappingEntry(m); result.add(entry); } return result; } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#readVersions(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID) */ public Map<String, Integer> readVersions( CmsDbContext dbc, CmsUUID projectId, CmsUUID resourceId, CmsUUID structureId) throws CmsDataAccessException { int structureVersion = -1; int resourceVersion = -1; Query q; try { // read the offline version numbers, first for the resource entry q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_VERSION_RES); q.setParameter(1, resourceId.toString()); try { resourceVersion = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { // do nothing } // then for the structure entry q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_VERSION_STR); q.setParameter(1, structureId.toString()); try { structureVersion = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } Map<String, Integer> result = new HashMap<String, Integer>(); result.put("structure", new Integer(structureVersion)); result.put(I_CmsEventListener.KEY_RESOURCE, new Integer(resourceVersion)); return result; } /** * @see org.opencms.db.I_CmsVfsDriver#removeFile(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsResource) */ public void removeFile(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsDataAccessException { int siblingCount = 0; try { // delete the structure record Query q = m_sqlManager.createQuery(dbc, projectId, C_STRUCTURE_DELETE_BY_STRUCTUREID); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure ps : res) { m_sqlManager.remove(dbc, ps); } // count the references to the resource siblingCount = countSiblings(dbc, projectId, resource.getResourceId()); if (siblingCount > 0) { // update the link Count q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_SIBLING_COUNT); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> ress = q.getResultList(); for (I_CmsDAOResources r : ress) { r.setSiblingCount(siblingCount); } // update the resource flags q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_FLAGS); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> resf = q.getResultList(); for (I_CmsDAOResources r : resf) { r.setResourceFlags(resource.getFlags()); } } else { // if not referenced any longer, also delete the resource and the content record q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_DELETE_BY_RESOURCEID); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res1 = q.getResultList(); for (I_CmsDAOResources pr : res1) { m_sqlManager.remove(dbc, pr); } boolean dbcHasProjectId = (dbc.getProjectId() != null) && !dbc.getProjectId().isNullUUID(); // if online we have to keep historical content if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { // put the online content in the history q = m_sqlManager.createQuery(dbc, C_ONLINE_CONTENTS_HISTORY); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<CmsDAOContents> res2 = q.getResultList(); for (CmsDAOContents c : res2) { c.setOnlineFlag(0); } } else if (dbcHasProjectId) { // remove current online version q = m_sqlManager.createQuery(dbc, C_ONLINE_CONTENTS_DELETE); q.setParameter(1, resource.getResourceId().toString()); q.executeUpdate(); } else { // delete content records with this resource id q = m_sqlManager.createQuery(dbc, C_OFFLINE_FILE_CONTENT_DELETE); q.setParameter(1, resource.getResourceId().toString()); q.executeUpdate(); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#removeFolder(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource) */ public void removeFolder(CmsDbContext dbc, CmsProject currentProject, CmsResource resource) throws CmsDataAccessException { if ((dbc.getRequestContext() != null) && (dbc.getRequestContext().getAttribute(REQ_ATTR_CHECK_PERMISSIONS) != null)) { // only check write permissions checkWritePermissionsInFolder(dbc, resource); return; } // check if the folder has any resources in it Iterator<CmsResource> childResources = readChildResources(dbc, currentProject, resource, true, true).iterator(); CmsUUID projectId = CmsProject.ONLINE_PROJECT_ID; if (currentProject.isOnlineProject()) { projectId = CmsUUID.getOpenCmsUUID(); // HACK: to get an offline project id } // collect the names of the resources inside the folder, excluding the moved resources StringBuffer errorResNames = new StringBuffer(128); while (childResources.hasNext()) { CmsResource errorRes = childResources.next(); // if deleting offline, or not moved, or just renamed inside the deleted folder // so, it may remain some orphan online entries for moved resources // which will be fixed during the publishing of the moved resources boolean error = !currentProject.isOnlineProject(); if (!error) { try { String originalPath = m_driverManager.getVfsDriver().readResource( dbc, projectId, errorRes.getRootPath(), true).getRootPath(); error = originalPath.equals(errorRes.getRootPath()) || originalPath.startsWith(resource.getRootPath()); } catch (CmsVfsResourceNotFoundException e) { // ignore } } if (error) { if (errorResNames.length() != 0) { errorResNames.append(", "); } errorResNames.append("[" + dbc.removeSiteRoot(errorRes.getRootPath()) + "]"); } } // the current implementation only deletes empty folders if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(errorResNames.toString())) { throw new CmsVfsException(Messages.get().container( Messages.ERR_DELETE_NONEMTY_FOLDER_2, dbc.removeSiteRoot(resource.getRootPath()), errorResNames.toString())); } internalRemoveFolder(dbc, currentProject, resource); // remove project resources String deletedResourceRootPath = resource.getRootPath(); if (dbc.getRequestContext() != null) { dbc.getRequestContext().setAttribute(CmsProjectDriver.DBC_ATTR_READ_PROJECT_FOR_RESOURCE, Boolean.TRUE); I_CmsProjectDriver projectDriver = m_driverManager.getProjectDriver(dbc); Iterator<CmsProject> itProjects = projectDriver.readProjects(dbc, deletedResourceRootPath).iterator(); while (itProjects.hasNext()) { CmsProject project = itProjects.next(); projectDriver.deleteProjectResource(dbc, project.getUuid(), deletedResourceRootPath); } } } /** * @see org.opencms.db.I_CmsVfsDriver#replaceResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, byte[], int) */ public void replaceResource(CmsDbContext dbc, CmsResource newResource, byte[] resContent, int newResourceType) throws CmsDataAccessException { if (resContent == null) { // nothing to do return; } try { // write the file content writeContent(dbc, newResource.getResourceId(), resContent); // update the resource record Query q = m_sqlManager.createQuery(dbc, dbc.currentProject(), C_RESOURCE_REPLACE); q.setParameter(1, newResource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceType(newResourceType); r.setResourceSize(resContent.length); r.setDateContent(System.currentTimeMillis()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#setDriverManager(org.opencms.db.CmsDriverManager) */ public void setDriverManager(CmsDriverManager driverManager) { m_driverManager = driverManager; } /** * @see org.opencms.db.I_CmsVfsDriver#setSqlManager(org.opencms.db.CmsSqlManager) */ public void setSqlManager(org.opencms.db.CmsSqlManager sqlManager) { m_sqlManager = (CmsSqlManager)sqlManager; } /** * @see org.opencms.db.I_CmsVfsDriver#transferResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID) */ public void transferResource( CmsDbContext dbc, CmsProject project, CmsResource resource, CmsUUID createdUser, CmsUUID lastModifiedUser) throws CmsDataAccessException { if (createdUser == null) { createdUser = resource.getUserCreated(); } if (lastModifiedUser == null) { lastModifiedUser = resource.getUserLastModified(); } try { Query q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_TRANSFER_RESOURCE); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setUserCreated(createdUser.toString()); r.setUserLastModified(lastModifiedUser.toString()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#updateRelations(CmsDbContext, CmsProject, CmsResource) */ public void updateRelations(CmsDbContext dbc, CmsProject onlineProject, CmsResource offlineResource) throws CmsDataAccessException { // delete online relations I_CmsVfsDriver vfsDriver = m_driverManager.getVfsDriver(dbc); vfsDriver.deleteRelations(dbc, onlineProject.getUuid(), offlineResource, CmsRelationFilter.TARGETS); CmsUUID projectId; if (!dbc.getProjectId().isNullUUID()) { projectId = CmsProject.ONLINE_PROJECT_ID; } else { projectId = dbc.currentProject().getUuid(); } // copy offline to online relations CmsUUID dbcProjectId = dbc.getProjectId(); dbc.setProjectId(CmsUUID.getNullUUID()); Iterator<CmsRelation> itRelations = m_driverManager.getVfsDriver(dbc).readRelations( dbc, projectId, offlineResource, CmsRelationFilter.TARGETS).iterator(); dbc.setProjectId(dbcProjectId); while (itRelations.hasNext()) { vfsDriver.createRelation(dbc, onlineProject.getUuid(), itRelations.next()); } } /** * @see org.opencms.db.I_CmsVfsDriver#validateResourceIdExists(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID) */ public boolean validateResourceIdExists(CmsDbContext dbc, CmsUUID projectId, CmsUUID resourceId) throws CmsDataAccessException { boolean exists = false; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_RESOURCE_STATE); q.setParameter(1, resourceId.toString()); try { @SuppressWarnings("unused") int state = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); exists = true; } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return exists; } /** * @see org.opencms.db.I_CmsVfsDriver#validateStructureIdExists(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID) */ public boolean validateStructureIdExists(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId) throws CmsDataAccessException { boolean found = false; int count = 0; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_SELECT_STRUCTURE_ID); q.setParameter(1, structureId.toString()); try { count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); found = (count == 1); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return found; } /** * @see org.opencms.db.I_CmsVfsDriver#writeContent(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, byte[]) */ public void writeContent(CmsDbContext dbc, CmsUUID resourceId, byte[] content) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, dbc.currentProject(), C_OFFLINE_CONTENTS_UPDATE); // update the file content in the database. q.setParameter(1, resourceId.toString()); @SuppressWarnings("unchecked") List<CmsDAOOfflineContents> res = q.getResultList(); for (CmsDAOOfflineContents oc : res) { oc.setFileContent(content); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#writeLastModifiedProjectId(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, CmsUUID, org.opencms.file.CmsResource) */ public void writeLastModifiedProjectId(CmsDbContext dbc, CmsProject project, CmsUUID projectId, CmsResource resource) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_PROJECT_LASTMODIFIED); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setProjectLastModified(projectId.toString()); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#writePropertyObject(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, org.opencms.file.CmsProperty) */ public void writePropertyObject(CmsDbContext dbc, CmsProject project, CmsResource resource, CmsProperty property) throws CmsDataAccessException { CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID()) ? project.getUuid() : dbc.getProjectId(); // TODO: check if we need autocreation for link property definition types too CmsPropertyDefinition propertyDefinition = null; try { // read the property definition propertyDefinition = readPropertyDefinition(dbc, property.getName(), projectId); } catch (CmsDbEntryNotFoundException e) { if (property.autoCreatePropertyDefinition()) { propertyDefinition = createPropertyDefinition( dbc, projectId, property.getName(), CmsPropertyDefinition.TYPE_NORMAL); try { readPropertyDefinition(dbc, property.getName(), CmsProject.ONLINE_PROJECT_ID); } catch (CmsDataAccessException e1) { createPropertyDefinition( dbc, CmsProject.ONLINE_PROJECT_ID, property.getName(), CmsPropertyDefinition.TYPE_NORMAL); } try { m_driverManager.getHistoryDriver(dbc).readPropertyDefinition(dbc, property.getName()); } catch (CmsDataAccessException e1) { m_driverManager.getHistoryDriver(dbc).createPropertyDefinition( dbc, property.getName(), CmsPropertyDefinition.TYPE_NORMAL); } OpenCms.fireCmsEvent(new CmsEvent( I_CmsEventListener.EVENT_PROPERTY_DEFINITION_CREATED, Collections.<String, Object> singletonMap("propertyDefinition", propertyDefinition))); } else { throw new CmsDbEntryNotFoundException(Messages.get().container( Messages.ERR_NO_PROPERTYDEF_WITH_NAME_1, property.getName())); } } try { // read the existing property to test if we need the // insert or update query to write a property value CmsProperty existingProperty = readPropertyObject(dbc, propertyDefinition.getName(), project, resource); if (existingProperty.isIdentical(property)) { // property already has the identical values set, no write required return; } for (int i = 0; i < 2; i++) { int mappingType = -1; String value = null; CmsUUID id = null; boolean existsPropertyValue = false; boolean deletePropertyValue = false; // 1) take any required decisions to choose and fill the correct SQL query if (i == 0) { // write/delete the *structure value* on the first cycle if ((existingProperty.getStructureValue() != null) && property.isDeleteStructureValue()) { // this property value is marked to be deleted deletePropertyValue = true; } else { value = property.getStructureValue(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(value)) { // no structure value set or the structure value is an empty string, // continue with the resource value continue; } } // set the vars to be written to the database mappingType = CmsProperty.STRUCTURE_RECORD_MAPPING; id = resource.getStructureId(); existsPropertyValue = existingProperty.getStructureValue() != null; } else { // write/delete the *resource value* on the second cycle if ((existingProperty.getResourceValue() != null) && property.isDeleteResourceValue()) { // this property value is marked to be deleted deletePropertyValue = true; } else { value = property.getResourceValue(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(value)) { // no resource value set or the resource value is an empty string, // break out of the loop break; } } // set the vars to be written to the database mappingType = CmsProperty.RESOURCE_RECORD_MAPPING; id = resource.getResourceId(); existsPropertyValue = existingProperty.getResourceValue() != null; } // 2) execute the SQL query Query q; if (!deletePropertyValue) { // insert/update the property value if (existsPropertyValue) { // {structure|resource} property value already exists- use update statement q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_UPDATE); q.setParameter(1, id.toString()); q.setParameter(2, Integer.valueOf(mappingType)); q.setParameter(3, propertyDefinition.getId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOProperties> res = q.getResultList(); for (I_CmsDAOProperties p : res) { p.setPropertyValue(m_sqlManager.validateEmpty(value)); } } else { // {structure|resource} property value doesn't exist- use create statement I_CmsDAOProperties p = CmsProject.isOnlineProject(project.getUuid()) ? new CmsDAOOnlineProperties() : new CmsDAOOfflineProperties(); p.setPropertyId(new CmsUUID().toString()); p.setPropertyDefId(propertyDefinition.getId().toString()); p.setPropertyMappingId(id.toString()); p.setPropertyMappingType(mappingType); p.setPropertyValue(m_sqlManager.validateEmpty(value)); m_sqlManager.persist(dbc, p); } } else { // {structure|resource} property value marked as deleted- use delete statement q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_DELETE); q.setParameter(1, propertyDefinition.getId().toString()); q.setParameter(2, id.toString()); q.setParameter(3, Integer.valueOf(mappingType)); @SuppressWarnings("unchecked") List<I_CmsDAOProperties> res = q.getResultList(); for (I_CmsDAOProperties pr : res) { m_sqlManager.remove(dbc, pr); } } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#writePropertyObjects(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, java.util.List) */ public void writePropertyObjects( CmsDbContext dbc, CmsProject project, CmsResource resource, List<CmsProperty> properties) throws CmsDataAccessException { for (CmsProperty property : properties) { writePropertyObject(dbc, project, resource, property); } } /** * @see org.opencms.db.I_CmsVfsDriver#writeResource(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsResource, int) */ public void writeResource(CmsDbContext dbc, CmsUUID projectId, CmsResource resource, int changed) throws CmsDataAccessException { // validate the resource length internalValidateResourceLength(resource); String resourcePath = CmsFileUtil.removeTrailingSeparator(resource.getRootPath()); // this task is split into two statements because some DBs (e.g. Oracle) doesn't support multi-table updates long resourceDateModified; if (resource.isTouched()) { resourceDateModified = resource.getDateLastModified(); } else { resourceDateModified = System.currentTimeMillis(); } CmsResourceState structureState = resource.getState(); CmsResourceState resourceState = resource.getState(); CmsResourceState structureStateOld = internalReadStructureState(dbc, projectId, resource); CmsResourceState resourceStateOld = internalReadResourceState(dbc, projectId, resource); CmsUUID projectLastModified = projectId; if (changed == CmsDriverManager.UPDATE_RESOURCE_STATE) { resourceState = resourceStateOld; resourceState = (resourceState.isNew() ? CmsResource.STATE_NEW : CmsResource.STATE_CHANGED); structureState = structureStateOld; } else if (changed == CmsDriverManager.UPDATE_STRUCTURE_STATE) { structureState = structureStateOld; structureState = (structureState.isNew() ? CmsResource.STATE_NEW : CmsResource.STATE_CHANGED); } else if (changed == CmsDriverManager.NOTHING_CHANGED) { projectLastModified = resource.getProjectLastModified(); } else { resourceState = resourceStateOld; resourceState = (resourceState.isNew() ? CmsResource.STATE_NEW : CmsResource.STATE_CHANGED); structureState = structureStateOld; structureState = (structureState.isNew() ? CmsResource.STATE_NEW : CmsResource.STATE_CHANGED); } try { Query q; if (changed != CmsDriverManager.UPDATE_STRUCTURE_STATE) { // if the resource was unchanged q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_RESOURCES); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceType(resource.getTypeId()); r.setResourceFlags(resource.getFlags()); r.setDateLastModified(resourceDateModified); r.setUserLastModified(resource.getUserLastModified().toString()); r.setResourceState(resourceState.getState()); r.setResourceSize(resource.getLength()); r.setDateContent(resource.getDateContent()); r.setProjectLastModified(projectLastModified.toString()); r.setSiblingCount(countSiblings(dbc, projectId, resource.getResourceId())); } } else { q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_RESOURCES_WITHOUT_STATE); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceType(resource.getTypeId()); r.setResourceFlags(resource.getFlags()); r.setDateLastModified(resourceDateModified); r.setUserLastModified(resource.getUserLastModified().toString()); r.setResourceSize(resource.getLength()); r.setDateContent(resource.getDateContent()); r.setProjectLastModified(projectLastModified.toString()); r.setSiblingCount(countSiblings(dbc, projectId, resource.getResourceId())); } } // read the parent id String parentId = internalReadParentId(dbc, projectId, resourcePath); // update the structure q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_UPDATE_STRUCTURE); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setResourceId(resource.getResourceId().toString()); s.setResourcePath(resourcePath); s.setStructureState(structureState.getState()); s.setDateReleased(resource.getDateReleased()); s.setDateExpired(resource.getDateExpired()); s.setParentId(parentId); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * @see org.opencms.db.I_CmsVfsDriver#writeResourceState(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject, org.opencms.file.CmsResource, int, boolean) */ public void writeResourceState( CmsDbContext dbc, CmsProject project, CmsResource resource, int changed, boolean isPublishing) throws CmsDataAccessException { if (project.getUuid().equals(CmsProject.ONLINE_PROJECT_ID)) { return; } try { Query q; if (changed == CmsDriverManager.UPDATE_RESOURCE_PROJECT) { q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_RESOURCE_PROJECT); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> resr = q.getResultList(); for (I_CmsDAOResources r : resr) { r.setResourceFlags(resource.getFlags()); r.setProjectLastModified(project.getUuid().toString()); } } if (changed == CmsDriverManager.UPDATE_RESOURCE) { q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_RESOURCE_STATELASTMODIFIED); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceState(resource.getState().getState()); r.setDateLastModified(resource.getDateLastModified()); r.setUserLastModified(resource.getUserLastModified().toString()); r.setProjectLastModified(project.getUuid().toString()); } } if ((changed == CmsDriverManager.UPDATE_RESOURCE_STATE) || (changed == CmsDriverManager.UPDATE_ALL)) { q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_RESOURCE_STATE); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceState(resource.getState().getState()); r.setProjectLastModified(project.getUuid().toString()); } } if ((changed == CmsDriverManager.UPDATE_STRUCTURE) || (changed == CmsDriverManager.UPDATE_ALL) || (changed == CmsDriverManager.UPDATE_STRUCTURE_STATE)) { q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_STRUCTURE_STATE); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setStructureState(resource.getState().getState()); } } if ((changed == CmsDriverManager.UPDATE_STRUCTURE) || (changed == CmsDriverManager.UPDATE_ALL)) { q = m_sqlManager.createQuery(dbc, project, C_RESOURCES_UPDATE_RELEASE_EXPIRED); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> res = q.getResultList(); for (I_CmsDAOStructure s : res) { s.setDateReleased(resource.getDateReleased()); s.setDateExpired(resource.getDateExpired()); } } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } if (isPublishing) { internalUpdateVersions(dbc, resource); } } /** * Checks that the current user has write permissions for all subresources of the given folder.<p> * * @param dbc the current database context * @param folder the folder to check * * @throws CmsDataAccessException if something goes wrong */ protected void checkWritePermissionsInFolder(CmsDbContext dbc, CmsResource folder) throws CmsDataAccessException { CmsUUID projectId = dbc.getRequestContext().getCurrentProject().getUuid(); // first read all subresources with ACEs List<CmsResource> resources = new ArrayList<CmsResource>(); try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_WITH_ACE_1); q.setParameter(1, escapeDbWildcard(folder.getRootPath() + "%")); @SuppressWarnings("unchecked") List<Object[]> res = q.getResultList(); for (Object[] o : res) { resources.add(createResource(o, projectId)); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } // check current user write permission for each of these resources Iterator<CmsResource> itResources = resources.iterator(); while (itResources.hasNext()) { CmsResource resource = itResources.next(); try { m_driverManager.getSecurityManager().checkPermissions( dbc.getRequestContext(), resource, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL); } catch (CmsException e) { throw new CmsDataAccessException(e.getMessageContainer(), e); } } // then check for possible jsp pages without permissions CmsResourceFilter filter = CmsResourceFilter.ALL; itResources = readTypesInResourceTree( dbc, projectId, folder.getRootPath(), CmsResourceTypeJsp.getJspResourceTypeIds(), filter.getState(), filter.getModifiedAfter(), filter.getModifiedBefore(), filter.getReleaseAfter(), filter.getReleaseBefore(), filter.getExpireAfter(), filter.getExpireBefore(), CmsDriverManager.READMODE_INCLUDE_TREE).iterator(); while (itResources.hasNext()) { CmsResource resource = itResources.next(); try { m_driverManager.getSecurityManager().checkPermissions( dbc.getRequestContext(), resource, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL); } catch (CmsException e) { throw new CmsDataAccessException(e.getMessageContainer(), e); } } } /** * Returns the count of properties for a property definition.<p> * * @param dbc the current database context * @param propertyDefinition the property definition to test * @param projectId the ID of the current project * * @return the amount of properties for a property definition * @throws CmsDataAccessException if something goes wrong */ protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition propertyDefinition, CmsUUID projectId) throws CmsDataAccessException { int count = 0; try { // create statement Query q = m_sqlManager.createQuery(dbc, projectId, C_PROPERTIES_READALL_COUNT); q.setParameter(1, propertyDefinition.getId().toString()); try { count = CmsDataTypeUtil.numberToInt((Number)q.getSingleResult()); } catch (NoResultException e) { throw new CmsDbConsistencyException(Messages.get().container( Messages.ERR_COUNTING_PROPERTIES_1, propertyDefinition.getName())); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return count; } /** * Creates an URL name mapping entry from a result set.<p> * * @param m a I_CmsDAOUrlNameMappings * @return the URL name mapping entry created from the result set * */ protected CmsUrlNameMappingEntry internalCreateUrlNameMappingEntry(I_CmsDAOUrlNameMappings m) { String name = m.getName(); CmsUUID structureId = new CmsUUID(m.getStructureId()); int state = m.getState(); long dateChanged = m.getDateChanged(); String locale = m.getLocale(); return new CmsUrlNameMappingEntry(name, structureId, state, dateChanged, locale); } /** * Returns the parent id of the given resource.<p> * * @param dbc the current database context * @param projectId the current project id * @param resourcename the resource name to read the parent id for * * @return the parent id of the given resource * * @throws CmsDataAccessException if something goes wrong */ protected String internalReadParentId(CmsDbContext dbc, CmsUUID projectId, String resourcename) throws CmsDataAccessException { if ("/".equalsIgnoreCase(resourcename)) { return CmsUUID.getNullUUID().toString(); } String parent = CmsResource.getParentFolder(resourcename); parent = CmsFileUtil.removeTrailingSeparator(parent); String parentId = null; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RESOURCES_READ_PARENT_STRUCTURE_ID); q.setParameter(1, parent); try { parentId = (String)q.getSingleResult(); } catch (NoResultException e) { throw new CmsVfsResourceNotFoundException(Messages.get().container( Messages.ERR_READ_PARENT_ID_1, dbc.removeSiteRoot(resourcename))); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return parentId; } /** * Creates a new {@link CmsRelation} object from the given result set entry.<p> * * @param rr the resource relation * * @return the new {@link CmsRelation} object */ protected CmsRelation internalReadRelation(I_CmsDAOResourceRelations rr) { CmsUUID sourceId = new CmsUUID(rr.getRelationSourceId()); String sourcePath = rr.getRelationSourcePath(); CmsUUID targetId = new CmsUUID(rr.getRelationTargetId()); String targetPath = rr.getRelationTargetPath(); int type = rr.getRelationType(); return new CmsRelation(sourceId, sourcePath, targetId, targetPath, CmsRelationType.valueOf(type)); } /** * Returns the resource state of the given resource.<p> * * @param dbc the database context * @param projectId the id of the project * @param resource the resource to read the resource state for * * @return the resource state of the given resource * * @throws CmsDataAccessException if something goes wrong */ protected CmsResourceState internalReadResourceState(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsDataAccessException { CmsResourceState state = CmsResource.STATE_KEEP; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_READ_RESOURCE_STATE); q.setParameter(1, resource.getResourceId().toString()); try { state = CmsResourceState.valueOf(CmsDataTypeUtil.numberToInt((Number)q.getSingleResult())); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return state; } /** * Returns the structure state of the given resource.<p> * * @param dbc the database context * @param projectId the id of the project * @param resource the resource to read the structure state for * * @return the structure state of the given resource * * @throws CmsDataAccessException if something goes wrong */ protected CmsResourceState internalReadStructureState(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsDataAccessException { CmsResourceState state = CmsResource.STATE_KEEP; try { Query q = m_sqlManager.createQuery(dbc, projectId, C_READ_STRUCTURE_STATE); q.setParameter(1, resource.getStructureId().toString()); try { state = CmsResourceState.valueOf(CmsDataTypeUtil.numberToInt((Number)q.getSingleResult())); } catch (NoResultException e) { // do nothing } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } return state; } /** * Removes a resource physically in the database.<p> * * @param dbc the current database context * @param currentProject the current project * @param resource the folder to remove * * @throws CmsDataAccessException if something goes wrong */ protected void internalRemoveFolder(CmsDbContext dbc, CmsProject currentProject, CmsResource resource) throws CmsDataAccessException { try { // delete the structure record Query q = m_sqlManager.createQuery(dbc, currentProject, C_STRUCTURE_DELETE_BY_STRUCTUREID); q.setParameter(1, resource.getStructureId().toString()); I_CmsDAOStructure s = (I_CmsDAOStructure)q.getSingleResult(); m_sqlManager.remove(dbc, s); // delete the resource record q = m_sqlManager.createQuery(dbc, currentProject, C_RESOURCES_DELETE_BY_RESOURCEID); q.setParameter(1, resource.getResourceId().toString()); I_CmsDAOResources r = (I_CmsDAOResources)q.getSingleResult(); m_sqlManager.remove(dbc, r); } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Postprocess C_READ_RESOURCE_OUS query, because some databases * do not support indexOf function. * * @param set - result of C_READ_RESOURCE_OUS query * @param resName - string for comparison * * @return - the result of original C_READ_RESOURCE_OUS query */ protected List<I_CmsDAOResourceRelations> internalResourceOus(List<I_CmsDAOResourceRelations> set, String resName) { List<I_CmsDAOResourceRelations> result = new ArrayList<I_CmsDAOResourceRelations>(); if (resName == null) { return result; } for (I_CmsDAOResourceRelations rr : set) { if ((rr.getRelationTargetPath() != null) && (resName.indexOf(rr.getRelationTargetPath()) != -1)) { result.add(rr); } } return result; } /** * Updates the offline version numbers.<p> * * @param dbc the current database context * @param resource the resource to update the version number for * * @throws CmsDataAccessException if something goes wrong */ protected void internalUpdateVersions(CmsDbContext dbc, CmsResource resource) throws CmsDataAccessException { if (dbc.getRequestContext() == null) { // no needed during initialization return; } if (dbc.currentProject().isOnlineProject()) { // this method is supposed to be used only in the offline project return; } // read the online version numbers Map<String, Integer> onlineVersions = readVersions( dbc, CmsProject.ONLINE_PROJECT_ID, resource.getResourceId(), resource.getStructureId()); int onlineStructureVersion = onlineVersions.get("structure").intValue(); int onlineResourceVersion = onlineVersions.get("resource").intValue(); try { // update the resource version Query q = m_sqlManager.createQuery(dbc, dbc.currentProject(), C_RESOURCES_UPDATE_RESOURCE_VERSION); q.setParameter(1, resource.getResourceId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResources> res = q.getResultList(); for (I_CmsDAOResources r : res) { r.setResourceVersion(onlineResourceVersion); } // update the structure version q = m_sqlManager.createQuery(dbc, dbc.currentProject(), C_RESOURCES_UPDATE_STRUCTURE_VERSION); q.setParameter(1, resource.getStructureId().toString()); @SuppressWarnings("unchecked") List<I_CmsDAOStructure> ress = q.getResultList(); for (I_CmsDAOStructure s : ress) { s.setStructureVersion(onlineStructureVersion); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Validates that the length setting of a resource is always correct.<p> * * Files need to have a resource length of >= 0, while folders require * a resource length of -1.<p> * * @param resource the resource to check the length for * * @throws CmsDataAccessException if something goes wrong */ protected void internalValidateResourceLength(CmsResource resource) throws CmsDataAccessException { if (resource.isFolder() && (resource.getLength() == -1)) { return; } if (resource.isFile() && (resource.getLength() >= 0)) { return; } throw new CmsDataAccessException(Messages.get().container( Messages.ERR_INVALID_RESOURCE_LENGTH_2, new Integer(resource.getLength()), resource.getRootPath())); } /** * Moves all relations of a resource to the new path.<p> * * @param dbc the current database context * @param projectId the id of the project to apply the changes * @param structureId the structure id of the resource to apply the changes to * @param rootPath the new root path * * @throws CmsDataAccessException if something goes wrong */ protected void moveRelations(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId, String rootPath) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, projectId, C_MOVE_RELATIONS_SOURCE); q.setParameter(1, structureId.toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); I_CmsDAOResourceRelations newR; for (I_CmsDAOResourceRelations rr : res) { newR = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); newR.setRelationSourceId(rr.getRelationSourceId()); newR.setRelationSourcePath(rootPath); newR.setRelationTargetId(rr.getRelationTargetId()); newR.setRelationTargetPath(rr.getRelationTargetPath()); newR.setRelationType(rr.getRelationType()); m_sqlManager.remove(dbc, rr); m_sqlManager.persist(dbc, newR); } q = m_sqlManager.createQuery(dbc, projectId, C_MOVE_RELATIONS_TARGET); q.setParameter(1, structureId.toString()); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res1 = q.getResultList(); for (I_CmsDAOResourceRelations rr : res1) { newR = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); newR.setRelationSourceId(rr.getRelationSourceId()); newR.setRelationSourcePath(rr.getRelationSourcePath()); newR.setRelationTargetId(rr.getRelationTargetId()); newR.setRelationTargetPath(rootPath); newR.setRelationType(rr.getRelationType()); m_sqlManager.remove(dbc, rr); m_sqlManager.persist(dbc, newR); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Appends the appropriate selection criteria related with the expiration date.<p> * * @param projectId the id of the project of the resources * @param startTime the start time * @param endTime the end time * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareExpiredTimeRangeCondition( CmsUUID projectId, long startTime, long endTime, StringBuffer conditions, List params) { if (startTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match expired date against startTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_EXPIRED_AFTER)); conditions.append(END_CONDITION); params.add(Long.valueOf(startTime)); } if (endTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match expired date against endTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_EXPIRED_BEFORE)); conditions.append(END_CONDITION); params.add(Long.valueOf(endTime)); } } /** * Appends the appropriate selection criteria related with the parentPath.<p> * * @param projectId the id of the project of the resources * @param parent the parent path or UUID (if mode is C_READMODE_EXCLUDE_TREE) * @param mode the selection mode * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void preparePathCondition(CmsUUID projectId, String parent, int mode, StringBuffer conditions, List params) { if (parent == CmsDriverManager.READ_IGNORE_PARENT) { // parent can be ignored return; } if ((mode & CmsDriverManager.READMODE_EXCLUDE_TREE) > 0) { // only return immediate children - use UUID optimization conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_PARENT_UUID)); conditions.append(END_CONDITION); params.add(parent); return; } if ("/".equalsIgnoreCase(parent)) { // if root folder is parent, no additional condition is needed since all resources match anyway return; } // add condition to read path subtree conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_PATH_PREFIX)); conditions.append(END_CONDITION); params.add(CmsFileUtil.addTrailingSeparator(escapeDbWildcard(parent)) + "%"); } /** * Appends the appropriate selection criteria related with the projectId.<p> * * @param projectId the id of the project of the resources * @param mode the selection mode * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareProjectCondition(CmsUUID projectId, int mode, StringBuffer conditions, List params) { if ((mode & CmsDriverManager.READMODE_INCLUDE_PROJECT) > 0) { // C_READMODE_INCLUDE_PROJECT: add condition to match the PROJECT_ID conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_PROJECT_LASTMODIFIED)); conditions.append(END_CONDITION); params.add(String.valueOf(projectId)); } } /** * Build the whole WHERE sql statement part for the given relation filter.<p> * * @param projectId the current project id * @param filter the filter * @param resource the resource (may be null, if you want to delete all relations for the resource in the filter) * @param params the parameter values (return parameter) * @param checkSource if the query is for the source relations * * @return the WHERE sql statement part string */ protected String prepareRelationConditions( CmsUUID projectId, CmsRelationFilter filter, CmsResource resource, List params, boolean checkSource) { StringBuffer conditions = new StringBuffer(128); params.clear(); // be sure the parameters list is clear // source or target filter if (filter.isSource() || filter.isTarget()) { // source or target id filter from resource if (resource != null) { conditions.append(BEGIN_CONDITION); if (filter.isSource() && checkSource) { if (!filter.isIncludeSubresources()) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_TARGET_ID)); params.add(resource.getStructureId().toString()); } else { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_TARGET_PATH)); params.add(resource.getRootPath() + '%'); } } else if (filter.isTarget() && !checkSource) { if (!filter.isIncludeSubresources()) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_SOURCE_ID)); params.add(resource.getStructureId().toString()); } else { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_SOURCE_PATH)); params.add(resource.getRootPath() + '%'); } } conditions.append(END_CONDITION); } // target or source id filter from filter parameter if (filter.getStructureId() != null) { if (conditions.length() == 0) { conditions.append(BEGIN_CONDITION); } else { conditions.append(BEGIN_INCLUDE_CONDITION); } if (filter.isSource() && checkSource) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_SOURCE_ID)); params.add(filter.getStructureId().toString()); } else if (filter.isTarget() && !checkSource) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_TARGET_ID)); params.add(filter.getStructureId().toString()); } conditions.append(END_CONDITION); } // target or source path filter from filter parameter if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter.getPath())) { if (conditions.length() == 0) { conditions.append(BEGIN_CONDITION); } else { conditions.append(BEGIN_INCLUDE_CONDITION); } String queryPath = filter.getPath(); if (filter.isIncludeSubresources()) { queryPath += '%'; } if (filter.isSource() && checkSource) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_SOURCE_PATH)); params.add(queryPath); } else if (filter.isTarget() && !checkSource) { conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_TARGET_PATH)); params.add(queryPath); } conditions.append(END_CONDITION); } } // relation type filter Set types = filter.getTypes(); if (!types.isEmpty()) { if (conditions.length() == 0) { conditions.append(BEGIN_CONDITION); } else { conditions.append(BEGIN_INCLUDE_CONDITION); } conditions.append(m_sqlManager.readQuery(projectId, C_RELATION_FILTER_TYPE)); conditions.append(BEGIN_CONDITION); Iterator it = types.iterator(); while (it.hasNext()) { CmsRelationType type = (CmsRelationType)it.next(); conditions.append("?"); params.add(Integer.valueOf(type.getId())); if (it.hasNext()) { conditions.append(", "); } } conditions.append(END_CONDITION); conditions.append(END_CONDITION); } return conditions.toString(); } /** * Appends the appropriate selection criteria related with the released date.<p> * * @param projectId the id of the project * @param startTime the start time * @param endTime the stop time * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareReleasedTimeRangeCondition( CmsUUID projectId, long startTime, long endTime, StringBuffer conditions, List params) { if (startTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match released date against startTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_AFTER)); conditions.append(END_CONDITION); params.add(Long.valueOf(startTime)); } if (endTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match released date against endTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_BEFORE)); conditions.append(END_CONDITION); params.add(Long.valueOf(endTime)); } } /** * Appends the appropriate selection criteria related with the read mode.<p> * * @param projectId the id of the project of the resources * @param mode the selection mode * @param conditions buffer to append the selection criteria */ protected void prepareResourceCondition(CmsUUID projectId, int mode, StringBuffer conditions) { if ((mode & CmsDriverManager.READMODE_ONLY_FOLDERS) > 0) { // C_READMODE_ONLY_FOLDERS: add condition to match only folders conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_ONLY_FOLDERS)); conditions.append(END_CONDITION); } else if ((mode & CmsDriverManager.READMODE_ONLY_FILES) > 0) { // C_READMODE_ONLY_FILES: add condition to match only files conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_ONLY_FILES)); conditions.append(END_CONDITION); } } /** * Appends the appropriate selection criteria related with the resource state.<p> * * @param projectId the id of the project of the resources * @param state the resource state * @param mode the selection mode * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareStateCondition( CmsUUID projectId, CmsResourceState state, int mode, StringBuffer conditions, List params) { if (state != null) { if ((mode & CmsDriverManager.READMODE_EXCLUDE_STATE) > 0) { // C_READ_MODIFIED_STATES: add condition to match against any state but not given state conditions.append(BEGIN_EXCLUDE_CONDITION); } else { // otherwise add condition to match against given state if necessary conditions.append(BEGIN_INCLUDE_CONDITION); } conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_RESOURCE_STATE)); conditions.append(END_CONDITION); params.add(Integer.valueOf(state.getState())); params.add(Integer.valueOf(state.getState())); } } /** * Appends the appropriate selection criteria related with the date of the last modification.<p> * * @param projectId the id of the project of the resources * @param startTime start of the time range * @param endTime end of the time range * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareTimeRangeCondition( CmsUUID projectId, long startTime, long endTime, StringBuffer conditions, List params) { if (startTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match last modified date against startTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_AFTER)); conditions.append(END_CONDITION); params.add(Long.valueOf(startTime)); } if (endTime > 0L) { // READ_IGNORE_TIME: if NOT set, add condition to match last modified date against endTime conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_DATE_LASTMODIFIED_BEFORE)); conditions.append(END_CONDITION); params.add(Long.valueOf(endTime)); } } /** * Appends the appropriate selection criteria related with the resource type.<p> * * @param projectId the id of the project of the resources * @param type the resource type * @param mode the selection mode * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareTypeCondition(CmsUUID projectId, int type, int mode, StringBuffer conditions, List params) { if (type != CmsDriverManager.READ_IGNORE_TYPE) { if ((mode & CmsDriverManager.READMODE_EXCLUDE_TYPE) > 0) { // C_READ_FILE_TYPES: add condition to match against any type, but not given type conditions.append(BEGIN_EXCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_RESOURCE_TYPE)); conditions.append(END_CONDITION); params.add(Integer.valueOf(type)); } else { //otherwise add condition to match against given type if necessary conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_RESOURCE_TYPE)); conditions.append(END_CONDITION); params.add(Integer.valueOf(type)); } } } /** * Appends the appropriate selection criteria related with the resource type.<p> * * @param projectId the id of the project of the resources * @param types the resource type id's * @param mode the selection mode * @param conditions buffer to append the selection criteria * @param params list to append the selection parameters */ protected void prepareTypesCondition( CmsUUID projectId, List<Integer> types, int mode, StringBuffer conditions, List params) { if ((types == null) || types.isEmpty()) { if ((mode & CmsDriverManager.READMODE_EXCLUDE_TYPE) > 0) { // C_READ_FILE_TYPES: add condition to match against any type, but not given type conditions.append(BEGIN_EXCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_RESOURCE_TYPE)); conditions.append(END_CONDITION); params.add(Integer.valueOf(CmsDriverManager.READ_IGNORE_TYPE)); } else { //otherwise add condition to match against given type if necessary conditions.append(BEGIN_INCLUDE_CONDITION); Iterator<Integer> typeIt = types.iterator(); while (typeIt.hasNext()) { conditions.append(m_sqlManager.readQuery(projectId, C_RESOURCES_SELECT_BY_RESOURCE_TYPE)); params.add(typeIt.next()); if (typeIt.hasNext()) { conditions.append(OR_CONDITION); } } conditions.append(END_CONDITION); } } } /** * Reads all resources inside a given project matching the criteria specified by parameter values.<p> * * Important: If {@link CmsDriverManager#READMODE_EXCLUDE_TREE} is true (or {@link CmsDriverManager#READMODE_INCLUDE_TREE} is false), * the provided parent String must be the UUID of the parent folder, NOT the parent folder path.<p> * * @param dbc the current database context * @param projectId the project id for matching resources * @param parentPath the path to the resource used as root of the searched subtree or {@link CmsDriverManager#READ_IGNORE_PARENT}, * {@link CmsDriverManager#READMODE_EXCLUDE_TREE} means to read immediate children only * @param types the resource types of matching resources or <code>null</code> (meaning inverted by {@link CmsDriverManager#READMODE_EXCLUDE_TYPE} * @param state the state of matching resources (meaning inverted by {@link CmsDriverManager#READMODE_EXCLUDE_STATE} or <code>null</code> to ignore * @param lastModifiedAfter the start of the time range for the last modification date of matching resources or READ_IGNORE_TIME * @param lastModifiedBefore the end of the time range for the last modification date of matching resources or READ_IGNORE_TIME * @param releasedAfter the start of the time range for the release date of matching resources * @param releasedBefore the end of the time range for the release date of matching resources * @param expiredAfter the start of the time range for the expire date of matching resources * @param expiredBefore the end of the time range for the expire date of matching resources * @param mode additional mode flags: * <ul> * <li>{@link CmsDriverManager#READMODE_INCLUDE_TREE} * <li>{@link CmsDriverManager#READMODE_EXCLUDE_TREE} * <li>{@link CmsDriverManager#READMODE_INCLUDE_PROJECT} * <li>{@link CmsDriverManager#READMODE_EXCLUDE_TYPE} * <li>{@link CmsDriverManager#READMODE_EXCLUDE_STATE} * </ul> * * @return a list of CmsResource objects matching the given criteria * * @throws CmsDataAccessException if something goes wrong */ protected List<CmsResource> readTypesInResourceTree( CmsDbContext dbc, CmsUUID projectId, String parentPath, List<Integer> types, CmsResourceState state, long lastModifiedAfter, long lastModifiedBefore, long releasedAfter, long releasedBefore, long expiredAfter, long expiredBefore, int mode) throws CmsDataAccessException { List<CmsResource> result = new ArrayList<CmsResource>(); StringBuffer conditions = new StringBuffer(); List params = new ArrayList(5); // prepare the selection criteria prepareProjectCondition(projectId, mode, conditions, params); prepareResourceCondition(projectId, mode, conditions); prepareTypesCondition(projectId, types, mode, conditions, params); prepareTimeRangeCondition(projectId, lastModifiedAfter, lastModifiedBefore, conditions, params); prepareReleasedTimeRangeCondition(projectId, releasedAfter, releasedBefore, conditions, params); prepareExpiredTimeRangeCondition(projectId, expiredAfter, expiredBefore, conditions, params); preparePathCondition(projectId, parentPath, mode, conditions, params); prepareStateCondition(projectId, state, mode, conditions, params); // now read matching resources within the subtree List<Object[]> res = null; try { StringBuffer queryBuf = new StringBuffer(256); queryBuf.append(m_sqlManager.readQuery(projectId, C_RESOURCES_READ_TREE)); queryBuf.append(conditions); queryBuf.append(" "); queryBuf.append(m_sqlManager.readQuery(projectId, C_RESOURCES_ORDER_BY_PATH)); Query q = m_sqlManager.createQueryFromJPQL(dbc, queryBuf.toString()); for (int i = 0; i < params.size(); i++) { if (params.get(i) instanceof Integer) { q.setParameter(i + 1, ((Integer)params.get(i)).intValue()); } else if (params.get(i) instanceof Long) { q.setParameter(i + 1, ((Long)params.get(i)).longValue()); } else { q.setParameter(i + 1, params.get(i)); } } res = q.getResultList(); for (Object[] obj : res) { CmsResource resource = createResource(obj, projectId); result.add(resource); } } catch (PersistenceException e) { throw new CmsDbSqlException(Messages.get().container(Messages.ERR_GENERIC_SQL_1, C_RESOURCES_READ_TREE), e); } return result; } /** * Repairs broken links.<p> * * When a resource is created any relation pointing to it is updated to use the right id.<p> * * @param dbc the current database context * @param projectId the project id * @param structureId the structure id of the resource that may help to repair broken links * @param rootPath the path of the resource that may help to repair broken links * * @throws CmsDataAccessException if something goes wrong */ protected void repairBrokenRelations(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId, String rootPath) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RELATIONS_REPAIR_BROKEN); q.setParameter(1, rootPath); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); I_CmsDAOResourceRelations newR; for (I_CmsDAOResourceRelations rr : res) { newR = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); newR.setRelationSourceId(rr.getRelationSourceId()); newR.setRelationSourcePath(rr.getRelationSourcePath()); newR.setRelationTargetId(structureId.toString()); newR.setRelationTargetPath(rr.getRelationTargetPath()); newR.setRelationType(rr.getRelationType()); m_sqlManager.remove(dbc, rr); m_sqlManager.persist(dbc, newR); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Updates broken links.<p> * * When a resource is deleted, then the relations pointing to * the deleted resource are set to the null uuid.<p> * * @param dbc the current database context * @param projectId the project id * @param rootPath the root path of the resource that has been deleted * * @throws CmsDataAccessException if something goes wrong */ protected void updateBrokenRelations(CmsDbContext dbc, CmsUUID projectId, String rootPath) throws CmsDataAccessException { try { Query q = m_sqlManager.createQuery(dbc, projectId, C_RELATIONS_UPDATE_BROKEN); q.setParameter(1, rootPath); @SuppressWarnings("unchecked") List<I_CmsDAOResourceRelations> res = q.getResultList(); I_CmsDAOResourceRelations newR; for (I_CmsDAOResourceRelations rr : res) { newR = CmsProject.isOnlineProject(projectId) ? new CmsDAOOnlineResourceRelations() : new CmsDAOOfflineResourceRelations(); newR.setRelationSourceId(rr.getRelationSourceId()); newR.setRelationSourcePath(rr.getRelationSourcePath()); newR.setRelationTargetId(CmsUUID.getNullUUID().toString()); newR.setRelationTargetPath(rr.getRelationTargetPath()); newR.setRelationType(rr.getRelationType()); m_sqlManager.remove(dbc, rr); m_sqlManager.persist(dbc, newR); } } catch (PersistenceException e) { throw new CmsDataAccessException(Messages.get().container(Messages.ERR_JPA_PERSITENCE, e), e); } } /** * Creates a query by combining a base query with the generated JPQL conditions for a given * URL name mapping filter.<p> * * @param dbc the db context * @param baseQuery the base query to which the conditions should be appended * @param filter the filter from which to generate the conditions * @param online what project to use - ONLINE or OFFLINE project * * @return the created prepared statement * * @throws PersistenceException if something goes wrong */ private Query getQueryForFilter(CmsDbContext dbc, String baseQuery, CmsUrlNameMappingFilter filter, boolean online) throws PersistenceException { CmsPair<String, List<I_CmsQueryParameter>> conditionData = prepareUrlNameMappingConditions(filter); String whereClause = ""; if (!conditionData.getFirst().equals("")) { whereClause = " WHERE " + conditionData.getFirst(); } String query = baseQuery + whereClause; query = replaceProject(query, online); Query q = m_sqlManager.createQueryFromJPQL(dbc, query); int counter = 1; for (I_CmsQueryParameter param : conditionData.getSecond()) { param.insertIntoQuery(q, counter); counter += 1; } return q; } /** * Replaces the %(PROJECT) macro inside a query with either Online or Offline, depending on the value * of a flag.<p> * * We use this instead of the ${PROJECT} replacement mechanism when we need explicit control over the * project, and don't want to implicitly use the project of the DB context.<p> * * @param query the query in which the macro should be replaced * @param online if true, the macro will be replaced with "ONLINE", else "OFFLINE" * * @return the query with the replaced macro */ private String replaceProject(String query, boolean online) { return query.replace("%(PROJECT)", online ? CmsSqlManager.ONLINE_PROJECT : CmsSqlManager.OFFLINE_PROJECT); } }
lgpl-2.1
Sciss/JCollider
src/main/java/de/sciss/jcollider/PowerOfTwoAllocator.java
2829
/* * PowerOfTwoAllocator.java * (JCollider) * * Copyright (c) 2004-2015 Hanns Holger Rutz. All rights reserved. * * This software is published under the GNU Lesser General Public License v2.1+ * * * For further information, please contact Hanns Holger Rutz at * contact@sciss.de */ package de.sciss.jcollider; import java.util.ArrayList; import java.util.List; /** * Quite a 1:1 translation from SClang, this * is used as the default bus allocator by the server. * * @todo unlike the node allocator, this cannot * handle different client IDs. have to find * out how different clients can peacefully * coexist on the same server. * * @author Hanns Holger Rutz * @version 0.32, 25-Feb-08 */ public class PowerOfTwoAllocator implements BlockAllocator { private final int size; private int pos; private final Block[] allocatedBlocks; private final Block[] freeBlocks; public PowerOfTwoAllocator( int size ) { this( size, 0 ); } public PowerOfTwoAllocator( int size, int pos ) { this.size = size; this.pos = pos; allocatedBlocks = new Block[ size ]; freeBlocks = new Block[ 32 ]; } public int alloc( final int n ) { final int result; int np2, sizeClass; Block node; for( np2 = 1, sizeClass = 0; np2 < n; np2 <<= 1, sizeClass++ ) ; // next power of two node = freeBlocks[ sizeClass ]; if( node != null ) { freeBlocks[ sizeClass ] = node.next; result = node.address; } else if( pos + np2 <= size ) { allocatedBlocks[ pos ] = new Block( pos, np2, sizeClass ); result = pos; pos += np2; } else { result = -1; } return result; } public void free( int address ) { final Block node = allocatedBlocks[ address ]; if( node != null ) { node.next = freeBlocks[ node.sizeClass ]; freeBlocks[ node.sizeClass ] = node; } } public List getAllocatedBlocks() { final List result = new ArrayList(); for( int i = 0; i < allocatedBlocks.length; i++ ) { if( allocatedBlocks[ i ] != null ) result.add( allocatedBlocks[ i ]); } return result; } public static class Factory implements BlockAllocator.Factory { public BlockAllocator create( int size ) { return new PowerOfTwoAllocator( size ); } public BlockAllocator create( int size, int pos ) { return new PowerOfTwoAllocator( size, pos ); } } private static class Block implements BlockAllocator.Block { protected final int address; private final int size; protected final int sizeClass; protected Block next = null; protected Block( int address, int size, int sizeClass ) { this.address = address; this.size = size; this.sizeClass = sizeClass; } public int getAddress() { return address; } public int getSize() { return size; } } }
lgpl-2.1
RafaMv0/Pixelbots
src/main/java/com/weebly/pixelbots/database/Medal.java
300
package com.weebly.pixelbots.database; import net.minecraft.util.ResourceLocation; public abstract class Medal { public abstract int getID(); public abstract String getType(); public abstract String getLetter(); public abstract int getSubItems(); public abstract boolean isMaleMedal(); }
lgpl-2.1
Johnr1227/Randomcraft
src/main/java/com/oyoclass/KidoyoMod/itemCheeese_axe.java
325
package com.oyoclass.KidoyoMod; import net.minecraft.item.ItemAxe; public class itemCheeese_axe extends ItemAxe{ protected itemCheeese_axe(ToolMaterial cheese2) { super(cheese2); setTextureName("cm:Imported piskel (3)"); this.setCreativeTab(CoolMod.Random_stuff); // TODO Auto-generated constructor stub } }
lgpl-2.1
bitrepository/reference
bitrepository-core/src/main/java/org/bitrepository/common/filestore/DefaultFileInfo.java
1851
/* * #%L * Bitrepository Core * %% * Copyright (C) 2010 - 2013 The State and University Library, The Royal Library and The State Archives, Denmark * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ package org.bitrepository.common.filestore; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; /** * File info for the files of a default file system. */ public class DefaultFileInfo implements FileInfo { /** The file with the info.*/ private final File file; /** * Constructor. * @param file The file for the file info. */ public DefaultFileInfo(File file) { this.file = file; } @Override public String getFileID() { return file.getName(); } @Override public InputStream getInputstream() throws IOException { return new FileInputStream(file); } @Override public Long getLastModifiedDate() { return file.lastModified(); } @Override public long getSize() { return file.length(); } /** * @return The file. */ public File getFile() { return file; } }
lgpl-2.1
bkarak/java-layout
src/com/jhlabs/awt/LayoutTest.java
3289
import java.awt.*; import com.jhlabs.awt.*; import javax.swing.*; public class LayoutTest { public static void main(String[] args) { paragraphLayout(); packerLayout(); gridLayoutPlus(); basicGridLayout(); clockLayout(); } public static void paragraphLayout() { JFrame jf = new JFrame("ParagraphLayout"); Container f = jf.getContentPane(); f.setLayout(new ParagraphLayout()); JButton b1 = new JButton("One"); JButton b2 = new JButton("Two"); JButton b3 = new JButton("Three"); JButton b4 = new JButton("Four"); JButton b5 = new JButton("Five"); JButton b6 = new JButton("Six"); JButton b7 = new JButton("Seven"); JButton b8 = new JButton("Eight"); JTextField t1 = new JTextField(4); JTextField t2 = new JTextField(20); JTextArea t3 = new JTextArea(5, 30); b2.setFont(new Font("serif", Font.PLAIN, 24)); f.add(new JLabel("Some buttons:"), ParagraphLayout.NEW_PARAGRAPH); f.add(b1); f.add(new JLabel("A long label:"), ParagraphLayout.NEW_PARAGRAPH); f.add(b2); f.add(b3); f.add(new JLabel("Short label:"), ParagraphLayout.NEW_PARAGRAPH); f.add(b4); f.add(b5, ParagraphLayout.NEW_LINE); f.add(b6); f.add(b7); f.add(b8, ParagraphLayout.NEW_LINE); f.add(new JLabel("Text:"), ParagraphLayout.NEW_PARAGRAPH); f.add(t1); f.add(new JLabel("More text:"), ParagraphLayout.NEW_PARAGRAPH); f.add(t2); f.add(new JLabel("miles")); f.add(new JLabel("A text area:"), ParagraphLayout.NEW_PARAGRAPH_TOP); f.add(t3); jf.pack(); jf.show(); } public static void packerLayout() { JFrame jf = new JFrame("PackerLayout"); Container f = jf.getContentPane(); f.setLayout(new PackerLayout()); JButton b1 = new JButton("One"); JButton b2 = new JButton("Two"); JButton b3 = new JButton("Three"); JButton b4 = new JButton("Four"); JButton b5 = new JButton("Five"); JButton b6 = new JButton("Six"); b2.setFont(new Font("serif", Font.PLAIN, 24)); f.add(b1); f.add(b2, PackerLayout.LEFT_CENTER); f.add(b3, PackerLayout.BOTTOM_CENTER_FILL); f.add(b4, PackerLayout.TOP_CENTER_FILL); f.add(b5, PackerLayout.TOP_LEFT); f.add(b6, PackerLayout.RIGHT_CENTER); jf.pack(); jf.show(); } public static void gridLayoutPlus() { JFrame jf = new JFrame("GridLayoutPlus"); Container f = jf.getContentPane(); GridLayoutPlus glp = new GridLayoutPlus(0, 3, 10, 10); glp.setColWeight(1, 2); glp.setColWeight(2, 1); glp.setRowWeight(2, 1); f.setLayout(glp); for (int r = 0; r < 6; r++) { for (int c = 0; c < 3; c++) { f.add(new JButton(r+","+c)); } } jf.pack(); jf.show(); } public static void basicGridLayout() { JFrame jf = new JFrame("BasicGridLayout"); Container f = jf.getContentPane(); BasicGridLayout l = new BasicGridLayout(0, 3, 10, 10); l.setColWeight(1); l.setRowWeight(1); l.setIncludeInvisible(false); f.setLayout(l); for (int r = 0; r < 6; r++) { for (int c = 0; c < 3; c++) { JButton b; f.add(b = new JButton(r+","+c)); b.setVisible((r+c)%4 != 0); } } jf.pack(); jf.show(); } public static void clockLayout() { JFrame jf = new JFrame("ClockLayout"); Container f = jf.getContentPane(); f.setLayout(new ClockLayout()); for (int r = 0; r < 12; r++) { f.add(new JButton(r+"")); } jf.pack(); jf.show(); } }
lgpl-2.1
pezi/treedb-cmdb
src/main/java/at/treedb/at/treedb/util/FileStorage.java
2811
/* * (C) Copyright 2014-2016 Peter Sauer (http://treedb.at/). * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-2.1.html * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ package at.treedb.util; import java.io.File; import java.io.IOException; public class FileStorage { private static FileStorage instance; boolean hasFileStorage; boolean isCleanUp; private String storageDir; private String tmpDir; private String binaryDir; private long counter = System.currentTimeMillis(); private FileStorage(String storageDir, boolean tmpCleanUp) throws Exception { if (storageDir != null) { this.hasFileStorage = true; isCleanUp = tmpCleanUp; File file = new File(storageDir); if (!file.exists()) { if (!file.mkdirs()) { throw new Exception("Unable to create file storage directory: " + storageDir); } } storageDir = file.getCanonicalPath(); this.storageDir = storageDir; tmpDir = storageDir + "/tmp/"; file = new File(tmpDir); if (!file.exists()) { if (!file.mkdirs()) { throw new Exception("Unable to create temp directory: " + tmpDir); } } } } public static synchronized FileStorage getInstance() throws Exception { if (instance == null) { throw new Exception("FileStorage not initalized"); } return instance; } public static synchronized FileStorage init(String storageDir, boolean tmpCleanUp) throws Exception { instance = new FileStorage(storageDir, tmpCleanUp); return instance; } public File createTempFile(String prefix, String suffix) throws IOException { if (hasFileStorage) { if (prefix == null) { prefix = ""; } if (suffix == null) { suffix = ".tmp"; } else { if (!suffix.startsWith(".")) { suffix = "." + suffix; } } File f = new File(tmpDir + prefix + "_" + counter++ + suffix); System.out.println(f.getCanonicalPath()); return f; } else { return File.createTempFile(prefix, suffix); } } }
lgpl-2.1
abixen/abixen-platform
abixen-platform-business-intelligence-service/src/main/java/com/abixen/platform/service/businessintelligence/multivisualisation/application/dto/DataFileColumnValueDto.java
913
/** * Copyright (c) 2010-present Abixen Systems. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.abixen.platform.service.businessintelligence.multivisualisation.application.dto; import lombok.Getter; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @Getter @Setter @Accessors(chain = true) @ToString public class DataFileColumnValueDto { private String value; }
lgpl-2.1
handong106324/sqLogWeb
src/com/sq/entity/GroupUser.java
400
package com.sq.entity; import java.util.Map; import com.jfinal.plugin.activerecord.Model; import com.sq.base.SqageBaseEntity; @SqageBaseEntity(tableName="t_group_user") public class GroupUser extends Model<GroupUser> { public static final GroupUser dao = new GroupUser(); @Override public Map<String, Object> getAttrs() { // TODO Auto-generated method stub return super.getAttrs(); } }
lgpl-2.1
benb/beast-mcmc
src/dr/app/beauti/generator/SubstitutionModelGenerator.java
44043
package dr.app.beauti.generator; import dr.app.beauti.components.ComponentFactory; import dr.app.beauti.enumTypes.FrequencyPolicyType; import dr.app.beauti.enumTypes.LocationSubstModelType; import dr.app.beauti.options.BeautiOptions; import dr.app.beauti.options.PartitionData; import dr.app.beauti.options.PartitionSubstitutionModel; import dr.app.beauti.options.TraitData; import dr.app.beauti.util.XMLWriter; import dr.evolution.alignment.Patterns; import dr.evolution.datatype.DataType; import dr.evolution.datatype.Nucleotides; import dr.evomodel.sitemodel.GammaSiteModel; import dr.evomodel.sitemodel.SiteModel; import dr.evomodel.substmodel.AbstractSubstitutionModel; import dr.evomodel.substmodel.NucModelType; import dr.evomodelxml.sitemodel.GammaSiteModelParser; import dr.evomodelxml.substmodel.*; import dr.evoxml.AlignmentParser; import dr.evoxml.GeneralDataTypeParser; import dr.evoxml.MergePatternsParser; import dr.evoxml.SitePatternsParser; import dr.inference.model.ParameterParser; import dr.inferencexml.loggers.ColumnsParser; import dr.inferencexml.model.CompoundParameterParser; import dr.inferencexml.model.ProductStatisticParser; import dr.inferencexml.model.SumStatisticParser; import dr.util.Attribute; import dr.xml.XMLParser; import java.util.List; /** * @author Alexei Drummond * @author Walter Xie */ public class SubstitutionModelGenerator extends Generator { public SubstitutionModelGenerator(BeautiOptions options, ComponentFactory[] components) { super(options, components); } /** * Writes the substitution model to XML. * * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeSubstitutionSiteModel(PartitionSubstitutionModel model, XMLWriter writer) { DataType dataType = model.getDataType(); String dataTypeDescription = dataType.getDescription(); switch (dataType.getType()) { case DataType.NUCLEOTIDES: // Jukes-Cantor model if (model.getNucSubstitutionModel() == NucModelType.JC) { String prefix = model.getPrefix(); writer.writeComment("The JC substitution model (Jukes & Cantor, 1969)"); writer.writeOpenTag(NucModelType.HKY.getXMLName(), new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "jc")} ); writer.writeOpenTag(HKYParser.FREQUENCIES); writer.writeOpenTag( FrequencyModelParser.FREQUENCY_MODEL, new Attribute[]{ new Attribute.Default<String>("dataType", dataTypeDescription) } ); writer.writeOpenTag(FrequencyModelParser.FREQUENCIES); writer.writeTag( ParameterParser.PARAMETER, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, prefix + "frequencies"), new Attribute.Default<String>(ParameterParser.VALUE, "0.25 0.25 0.25 0.25") }, true ); writer.writeCloseTag(FrequencyModelParser.FREQUENCIES); writer.writeCloseTag(FrequencyModelParser.FREQUENCY_MODEL); writer.writeCloseTag(HKYParser.FREQUENCIES); writer.writeOpenTag(HKYParser.KAPPA); writeParameter("jc.kappa", 1, 1.0, Double.NaN, Double.NaN, writer); writer.writeCloseTag(HKYParser.KAPPA); writer.writeCloseTag(NucModelType.HKY.getXMLName()); throw new IllegalArgumentException("AR: Need to check that kappa = 1 for JC (I have feeling it should be 0.5)"); } else { // Hasegawa Kishino and Yano 85 model if (model.getNucSubstitutionModel() == NucModelType.HKY) { if (model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= model.getCodonPartitionCount(); i++) { writeHKYModel(i, writer, model); } } else { writeHKYModel(-1, writer, model); } } else if (model.getNucSubstitutionModel() == NucModelType.TN93) { if (model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= model.getCodonPartitionCount(); i++) { writeTN93Model(i, writer, model); } } else { writeTN93Model(-1, writer, model); } } else { // General time reversible model if (model.getNucSubstitutionModel() == NucModelType.GTR) { if (model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= model.getCodonPartitionCount(); i++) { writeGTRModel(i, writer, model); } } else { writeGTRModel(-1, writer, model); } } } } //****************** Site Model ***************** if (model.getCodonPartitionCount() > 1) { //model.getCodonHeteroPattern() != null) { for (int i = 1; i <= model.getCodonPartitionCount(); i++) { writeNucSiteModel(i, writer, model); } writer.println(); } else { writeNucSiteModel(-1, writer, model); } break; case DataType.AMINO_ACIDS: // Amino Acid model String aaModel = model.getAaSubstitutionModel().getXMLName(); writer.writeComment("The " + aaModel + " substitution model"); writer.writeTag( EmpiricalAminoAcidModelParser.EMPIRICAL_AMINO_ACID_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + "aa"), new Attribute.Default<String>("type", aaModel)}, true ); //****************** Site Model ***************** writeAASiteModel(writer, model); break; case DataType.TWO_STATES: case DataType.COVARION: switch (model.getBinarySubstitutionModel()) { case BIN_SIMPLE: writeBinarySimpleModel(writer, model); break; case BIN_COVARION: writeBinaryCovarionModel(writer, model); break; } //****************** Site Model ***************** writeTwoStateSiteModel(writer, model); break; case DataType.GENERAL: writeDiscreteTraitsSubstModel(model, writer); //****************** Site Model ***************** writeDiscreteTraitsSiteModel(model, writer); break; default: throw new IllegalArgumentException("Unknown data type"); } } /** * Write the HKY model XML block. * * @param num the model number * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeHKYModel(int num, XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(num); // Hasegawa Kishino and Yano 85 model writer.writeComment("The HKY substitution model (Hasegawa, Kishino & Yano, 1985)"); writer.writeOpenTag(NucModelType.HKY.getXMLName(), new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "hky")} ); writer.writeOpenTag(HKYParser.FREQUENCIES); writeFrequencyModelDNA(writer, model, num); writer.writeCloseTag(HKYParser.FREQUENCIES); writeParameter(num, HKYParser.KAPPA, "kappa", model, writer); writer.writeCloseTag(NucModelType.HKY.getXMLName()); } /** * Write the TN93 model XML block. * * @param num the model number * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeTN93Model(int num, XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(num); // TN93 writer.writeComment("The TN93 substitution model"); writer.writeOpenTag(NucModelType.TN93.getXMLName(), new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "tn93")} ); writer.writeOpenTag(HKYParser.FREQUENCIES); writeFrequencyModelDNA(writer, model, num); writer.writeCloseTag(HKYParser.FREQUENCIES); writeParameter(num, TN93Parser.KAPPA1, "kappa1", model, writer); writeParameter(num, TN93Parser.KAPPA2, "kappa2", model, writer); writer.writeCloseTag(NucModelType.TN93.getXMLName()); } /** * Write the GTR model XML block. * * @param num the model number * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeGTRModel(int num, XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(num); writer.writeComment("The general time reversible (GTR) substitution model"); writer.writeOpenTag(GTRParser.GTR_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "gtr")} ); writer.writeOpenTag(GTRParser.FREQUENCIES); writeFrequencyModelDNA(writer, model, num); writer.writeCloseTag(GTRParser.FREQUENCIES); writeParameter(num, GTRParser.A_TO_C, PartitionSubstitutionModel.GTR_RATE_NAMES[0], model, writer); writeParameter(num, GTRParser.A_TO_G, PartitionSubstitutionModel.GTR_RATE_NAMES[1], model, writer); writeParameter(num, GTRParser.A_TO_T, PartitionSubstitutionModel.GTR_RATE_NAMES[2], model, writer); writeParameter(num, GTRParser.C_TO_G, PartitionSubstitutionModel.GTR_RATE_NAMES[3], model, writer); writeParameter(num, GTRParser.G_TO_T, PartitionSubstitutionModel.GTR_RATE_NAMES[4], model, writer); writer.writeCloseTag(GTRParser.GTR_MODEL); } // write frequencies for DNA data private void writeFrequencyModelDNA(XMLWriter writer, PartitionSubstitutionModel model, int num) { String dataTypeDescription = model.getDataType().getDescription(); String prefix = model.getPrefix(num); writer.writeOpenTag( FrequencyModelParser.FREQUENCY_MODEL, new Attribute[]{ new Attribute.Default<String>("dataType", dataTypeDescription) } ); writeAlignmentRefInFrequencies(writer, model, prefix); writer.writeOpenTag(FrequencyModelParser.FREQUENCIES); switch (model.getFrequencyPolicy()) { case ALLEQUAL: case ESTIMATED: if (num == -1 || model.isUnlinkedFrequencyModel()) { // single partition, or multiple partitions unlinked frequency writer.writeTag(ParameterParser.PARAMETER, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, prefix + "frequencies"), new Attribute.Default<String>(ParameterParser.VALUE, "0.25 0.25 0.25 0.25")}, true); } else { // multiple partitions but linked frequency if (num == 1) { writer.writeTag(ParameterParser.PARAMETER, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + "frequencies"), new Attribute.Default<String>(ParameterParser.VALUE, "0.25 0.25 0.25 0.25")}, true); } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "frequencies"); } } break; case EMPIRICAL: if (num == -1 || model.isUnlinkedFrequencyModel()) { // single partition, or multiple partitions unlinked frequency writeParameter(prefix + "frequencies", 4, Double.NaN, Double.NaN, Double.NaN, writer); } else { // multiple partitions but linked frequency if (num == 1) { writeParameter(model.getPrefix() + "frequencies", 4, Double.NaN, Double.NaN, Double.NaN, writer); } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "frequencies"); } } break; } writer.writeCloseTag(FrequencyModelParser.FREQUENCIES); writer.writeCloseTag(FrequencyModelParser.FREQUENCY_MODEL); } // adding mergePatterns or alignment ref for EMPIRICAL private void writeAlignmentRefInFrequencies(XMLWriter writer, PartitionSubstitutionModel model, String prefix) { if (model.getFrequencyPolicy() == FrequencyPolicyType.EMPIRICAL) { if (model.getDataType() == Nucleotides.INSTANCE && model.getCodonPartitionCount() > 1 && model.isUnlinkedSubstitutionModel()) { for (PartitionData partition : options.getAllPartitionData(model)) { //? writer.writeIDref(MergePatternsParser.MERGE_PATTERNS, prefix + partition.getPrefix() + SitePatternsParser.PATTERNS); } } else { for (PartitionData partition : options.getAllPartitionData(model)) { //? writer.writeIDref(AlignmentParser.ALIGNMENT, partition.getAlignment().getId()); } } } } /** * Write the Binary simple model XML block. * * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeBinarySimpleModel(XMLWriter writer, PartitionSubstitutionModel model) { String dataTypeDescription = model.getDataType().getDescription(); String prefix = model.getPrefix(); writer.writeComment("The Binary simple model (based on the general substitution model)"); writer.writeOpenTag( BinarySubstitutionModelParser.BINARY_SUBSTITUTION_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "bsimple")} ); writer.writeOpenTag(GeneralSubstitutionModelParser.FREQUENCIES); writer.writeOpenTag( FrequencyModelParser.FREQUENCY_MODEL, new Attribute[]{ new Attribute.Default<String>("dataType", dataTypeDescription) } ); writeAlignmentRefInFrequencies(writer, model, prefix); writeFrequencyModelBinary(writer, model, prefix); writer.writeCloseTag(FrequencyModelParser.FREQUENCY_MODEL); writer.writeCloseTag(GeneralSubstitutionModelParser.FREQUENCIES); writer.writeCloseTag(BinarySubstitutionModelParser.BINARY_SUBSTITUTION_MODEL); } /** * Write the Binary covarion model XML block * * @param writer the writer * @param model the partition model to write */ public void writeBinaryCovarionModel(XMLWriter writer, PartitionSubstitutionModel model) { // String dataTypeDescription = TwoStateCovarion.INSTANCE.getDescription(); // dataType="twoStateCovarion" for COVARION_MODEL String prefix = model.getPrefix(); writer.writeComment("The Binary covarion model"); writer.writeOpenTag( BinaryCovarionModelParser.COVARION_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + "bcov")} ); // merge patterns then get frequencies. if (model.getFrequencyPolicy() == FrequencyPolicyType.EMPIRICAL) { List<PartitionData> partitions = options.getAllPartitionData(model); Patterns patterns = new Patterns(partitions.get(0).getAlignment()); for (int i = 1; i < partitions.size(); i++) { patterns.addPatterns(partitions.get(i).getAlignment()); } double[] frequencies = patterns.getStateFrequencies(); writer.writeOpenTag(FrequencyModelParser.FREQUENCIES); writer.writeTag(ParameterParser.PARAMETER, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, prefix + "frequencies"), new Attribute.Default<String>(ParameterParser.VALUE, frequencies[0] + " " + frequencies[1])}, true); writer.writeCloseTag(FrequencyModelParser.FREQUENCIES); } else { writeFrequencyModelBinary(writer, model, prefix); } writeParameter(BinaryCovarionModelParser.HIDDEN_FREQUENCIES, prefix + "hfrequencies", 2, 0.5, 0.0, 1.0, writer); // hfrequencies also 0.5 0.5 writeParameter(BinaryCovarionModelParser.ALPHA, "bcov.alpha", model, writer); writeParameter(BinaryCovarionModelParser.SWITCHING_RATE, "bcov.s", model, writer); writer.writeCloseTag(BinaryCovarionModelParser.COVARION_MODEL); } // write frequencies for binary data private void writeFrequencyModelBinary(XMLWriter writer, PartitionSubstitutionModel model, String prefix) { writer.writeOpenTag(FrequencyModelParser.FREQUENCIES); switch (model.getFrequencyPolicy()) { case ALLEQUAL: case ESTIMATED: writer.writeTag(ParameterParser.PARAMETER, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, prefix + "frequencies"), new Attribute.Default<String>(ParameterParser.VALUE, "0.5 0.5")}, true); break; case EMPIRICAL: writeParameter(prefix + "frequencies", 2, Double.NaN, Double.NaN, Double.NaN, writer); break; } // writeParameter(prefix + "frequencies", 2, Double.NaN, Double.NaN, Double.NaN, writer); writer.writeCloseTag(FrequencyModelParser.FREQUENCIES); } /** * Discrete Traits Subst Model * * @param model PartitionSubstitutionModel * @param writer XMLWriter */ private void writeDiscreteTraitsSubstModel(PartitionSubstitutionModel model, XMLWriter writer) { int numOfStates = TraitData.getStatesListOfTrait(options.taxonList, options.getAllPartitionData(model).get(0).getName()).size(); if (numOfStates < 1) throw new IllegalArgumentException("The number of states must be greater than 1"); for (PartitionData partition : options.getAllPartitionData(model)) { if (numOfStates != TraitData.getStatesListOfTrait(options.taxonList, partition.getName()).size()) { throw new IllegalArgumentException("Discrete Traits having different number of states " + "\n" + "cannot share the same substitution model"); } } if (model.getLocationSubstType() == LocationSubstModelType.SYM_SUBST) { writer.writeComment("symmetric CTMC model for discrete state reconstructions"); writer.writeOpenTag(GeneralSubstitutionModelParser.GENERAL_SUBSTITUTION_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + AbstractSubstitutionModel.MODEL)}); for (PartitionData partition : options.getAllPartitionData(model)) { //? writer.writeIDref(GeneralDataTypeParser.GENERAL_DATA_TYPE, partition.getPrefix() + GeneralTraitGenerator.DATA); } writer.writeOpenTag(GeneralSubstitutionModelParser.FREQUENCIES); writeFrequencyModel(model, numOfStates, true, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.FREQUENCIES); //---------------- rates and indicators ----------------- // AR - we are trying to unify this setup. The only difference between BSSVS and not is the presence of indicators... // if (!model.isActivateBSSVS()) { // writer.writeComment("Rates parameter in " + GeneralSubstitutionModelParser.GENERAL_SUBSTITUTION_MODEL // + " element should have (" + (numOfStates * (numOfStates - 1) / 2) + " - 1) dimensions"); // writeRatesAndIndicators(model, (numOfStates * (numOfStates - 1) / 2) - 1, null, writer); // } else { // writeRatesAndIndicators(model, numOfStates * (numOfStates - 1) / 2, null, writer); // } writeRatesAndIndicators(model, numOfStates * (numOfStates - 1) / 2, null, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.GENERAL_SUBSTITUTION_MODEL); } else if (model.getLocationSubstType() == LocationSubstModelType.ASYM_SUBST) { writer.writeComment("asymmetric CTMC model for discrete state reconstructions"); writer.writeOpenTag(GeneralSubstitutionModelParser.GENERAL_SUBSTITUTION_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + AbstractSubstitutionModel.MODEL), new Attribute.Default<Boolean>(ComplexSubstitutionModelParser.RANDOMIZE, false)}); for (PartitionData partition : options.getAllPartitionData(model)) { //? writer.writeIDref(GeneralDataTypeParser.GENERAL_DATA_TYPE, partition.getPrefix() + GeneralTraitGenerator.DATA); } writer.writeOpenTag(GeneralSubstitutionModelParser.FREQUENCIES); writeFrequencyModel(model, numOfStates, true, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.FREQUENCIES); //---------------- rates and indicators ----------------- writeRatesAndIndicators(model, numOfStates * (numOfStates - 1), null, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.GENERAL_SUBSTITUTION_MODEL); } else { } if (model.isActivateBSSVS()) // If "BSSVS" is not activated, rateIndicator should not be there. writeStatisticModel(model, writer); } private void writeFrequencyModel(PartitionSubstitutionModel model, int numOfSates, Boolean normalize, XMLWriter writer) { if (normalize == null) { writer.writeOpenTag(FrequencyModelParser.FREQUENCY_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + FrequencyModelParser.FREQUENCY_MODEL)}); } else { writer.writeOpenTag(FrequencyModelParser.FREQUENCY_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + FrequencyModelParser.FREQUENCY_MODEL), new Attribute.Default<Boolean>(FrequencyModelParser.NORMALIZE, normalize)}); } for (PartitionData partition : options.getAllPartitionData(model)) { //? writer.writeIDref(GeneralDataTypeParser.GENERAL_DATA_TYPE, partition.getPrefix() + GeneralTraitGenerator.DATA); } writer.writeOpenTag(FrequencyModelParser.FREQUENCIES); writeParameter(model.getPrefix() + "trait.frequencies", numOfSates, Double.NaN, Double.NaN, Double.NaN, writer); writer.writeCloseTag(FrequencyModelParser.FREQUENCIES); writer.writeCloseTag(FrequencyModelParser.FREQUENCY_MODEL); } private void writeRatesAndIndicators(PartitionSubstitutionModel model, int dimension, Integer relativeTo, XMLWriter writer) { writer.writeComment("rates and indicators"); if (relativeTo == null) { writer.writeOpenTag(GeneralSubstitutionModelParser.RATES); } else { writer.writeOpenTag(GeneralSubstitutionModelParser.RATES, new Attribute[]{ new Attribute.Default<Integer>(GeneralSubstitutionModelParser.RELATIVE_TO, relativeTo)}); } model.getParameter("trait.rates").isFixed = true; writeParameter(model.getParameter("trait.rates"), dimension, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.RATES); if (model.isActivateBSSVS()) { //If "BSSVS" is not activated, rateIndicator should not be there. writer.writeOpenTag(GeneralSubstitutionModelParser.INDICATOR); model.getParameter("trait.indicators").isFixed = true; writeParameter(model.getParameter("trait.indicators"), dimension, writer); writer.writeCloseTag(GeneralSubstitutionModelParser.INDICATOR); } } private void writeStatisticModel(PartitionSubstitutionModel model, XMLWriter writer) { writer.writeOpenTag(SumStatisticParser.SUM_STATISTIC, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + "trait.nonZeroRates"), new Attribute.Default<Boolean>(SumStatisticParser.ELEMENTWISE, true)}); writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "trait.indicators"); writer.writeCloseTag(SumStatisticParser.SUM_STATISTIC); writer.writeOpenTag(ProductStatisticParser.PRODUCT_STATISTIC, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + "actualRates"), new Attribute.Default<Boolean>(SumStatisticParser.ELEMENTWISE, false)}); writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "trait.indicators"); writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "trait.rates"); writer.writeCloseTag(ProductStatisticParser.PRODUCT_STATISTIC); } /** * Write the site model XML block. * * @param model the partition model to write in BEAST XML * @param writer the writer */ // public void writeSiteModel(PartitionSubstitutionModel model, XMLWriter writer) { // // switch (model.getDataType().getType()) { // case DataType.NUCLEOTIDES: // if (model.getCodonPartitionCount() > 1) { //model.getCodonHeteroPattern() != null) { // for (int i = 1; i <= model.getCodonPartitionCount(); i++) { // writeNucSiteModel(i, writer, model); // } // writer.println(); // } else { // writeNucSiteModel(-1, writer, model); // } // break; // // case DataType.AMINO_ACIDS: // writeAASiteModel(writer, model); // break; // // case DataType.TWO_STATES: // case DataType.COVARION: // writeTwoStateSiteModel(writer, model); // break; // // default: // throw new IllegalArgumentException("Unknown data type"); // } // } /** * Write the allMus for each partition model. * * @param model PartitionSubstitutionModel * @param writer XMLWriter */ public void writeAllMus(PartitionSubstitutionModel model, XMLWriter writer) { if (model.hasCodon()) { // write allMus for codon model // allMus is global for each gene writer.writeOpenTag(CompoundParameterParser.COMPOUND_PARAMETER, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + "allMus")}); writeMuParameterRefs(model, writer); writer.writeCloseTag(CompoundParameterParser.COMPOUND_PARAMETER); } } /** * Write the all the mu parameters for this partition model. * * @param writer the writer * @param model the partition model to write in BEAST XML */ public void writeMuParameterRefs(PartitionSubstitutionModel model, XMLWriter writer) { if (model.getDataType().getType() == DataType.NUCLEOTIDES && model.getCodonHeteroPattern() != null) { for (int i = 1; i <= model.getCodonPartitionCount(); i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "mu"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "mu"); } } public void writeLog(XMLWriter writer, PartitionSubstitutionModel model) { int codonPartitionCount = model.getCodonPartitionCount(); switch (model.getDataType().getType()) { case DataType.NUCLEOTIDES: // THIS IS DONE BY ALLMUS logging in BeastGenerator // single partition use clock.rate, no "mu"; multi-partition use "allmus" // if (codonPartitionCount > 1) { // // for (int i = 1; i <= codonPartitionCount; i++) { // writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "mu"); // } // } switch (model.getNucSubstitutionModel()) { case HKY: if (codonPartitionCount > 1 && model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= codonPartitionCount; i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "kappa"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "kappa"); } break; case TN93: if (codonPartitionCount > 1 && model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= codonPartitionCount; i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "kappa1"); writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "kappa2"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "kappa1"); writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "kappa2"); } break; case GTR: if (codonPartitionCount > 1 && model.isUnlinkedSubstitutionModel()) { for (int i = 1; i <= codonPartitionCount; i++) { for (String rateName : PartitionSubstitutionModel.GTR_RATE_NAMES) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + rateName); } } } else { for (String rateName : PartitionSubstitutionModel.GTR_RATE_NAMES) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + rateName); } } break; } if (model.getFrequencyPolicy() == FrequencyPolicyType.ESTIMATED) { if (codonPartitionCount > 1 && model.isUnlinkedSubstitutionModel() && model.isUnlinkedFrequencyModel()) { for (int i = 1; i <= codonPartitionCount; i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "frequencies"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "frequencies"); } } break;//NUCLEOTIDES case DataType.AMINO_ACIDS: break;//AMINO_ACIDS case DataType.TWO_STATES: case DataType.COVARION: String prefix = model.getPrefix(); switch (model.getBinarySubstitutionModel()) { case BIN_SIMPLE: break; case BIN_COVARION: writer.writeIDref(ParameterParser.PARAMETER, prefix + "bcov.alpha"); writer.writeIDref(ParameterParser.PARAMETER, prefix + "bcov.s"); writer.writeIDref(ParameterParser.PARAMETER, prefix + "frequencies"); writer.writeIDref(ParameterParser.PARAMETER, prefix + "hfrequencies"); break; } break;//BINARY case DataType.GENERAL: //TODO break; default: throw new IllegalArgumentException("Unknown data type"); } if (model.isGammaHetero()) { if (codonPartitionCount > 1 && model.isUnlinkedHeterogeneityModel()) { for (int i = 1; i <= codonPartitionCount; i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "alpha"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "alpha"); } } if (model.isInvarHetero()) { if (codonPartitionCount > 1 && model.isUnlinkedHeterogeneityModel()) { for (int i = 1; i <= codonPartitionCount; i++) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix(i) + "pInv"); } } else { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "pInv"); } } } public void writeRateLog(PartitionSubstitutionModel model, XMLWriter writer) { writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "trait.rates"); if (model.isActivateBSSVS()) { //If "BSSVS" is not activated, rateIndicator should not be there. writer.writeIDref(ParameterParser.PARAMETER, model.getPrefix() + "trait.indicators"); writer.writeIDref(SumStatisticParser.SUM_STATISTIC, model.getPrefix() + "trait.nonZeroRates"); } } public void writeStatisticLog(PartitionSubstitutionModel model, XMLWriter writer) { if (model.isActivateBSSVS()) { //If "BSSVS" is not activated, rateIndicator should not be there. writer.writeOpenTag(ColumnsParser.COLUMN, new Attribute[]{ new Attribute.Default<String>(ColumnsParser.LABEL, model.getPrefix() + "nonZeroRates"), new Attribute.Default<String>(ColumnsParser.SIGNIFICANT_FIGURES, "6"), new Attribute.Default<String>(ColumnsParser.WIDTH, "12") } ); writer.writeIDref(SumStatisticParser.SUM_STATISTIC, model.getPrefix() + "trait.nonZeroRates"); writer.writeCloseTag(ColumnsParser.COLUMN); } } /** * Write the nucleotide site model XML block. * * @param num the model number * @param writer the writer * @param model the partition model to write in BEAST XML */ private void writeNucSiteModel(int num, XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(num); String prefix2 = model.getPrefix(); writer.writeComment("site model"); writer.writeOpenTag(GammaSiteModel.SITE_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + SiteModel.SITE_MODEL)}); writer.writeOpenTag(GammaSiteModelParser.SUBSTITUTION_MODEL); if (model.isUnlinkedSubstitutionModel()) { switch (model.getNucSubstitutionModel()) { // JC cannot be unlinked because it has no parameters case JC: writer.writeIDref(NucModelType.HKY.getXMLName(), prefix + "jc"); break; case HKY: writer.writeIDref(NucModelType.HKY.getXMLName(), prefix + "hky"); break; case GTR: writer.writeIDref(GTRParser.GTR_MODEL, prefix + "gtr"); break; case TN93: writer.writeIDref(NucModelType.TN93.getXMLName(), prefix + "tn93"); break; default: throw new IllegalArgumentException("Unknown substitution model."); } } else { switch (model.getNucSubstitutionModel()) { case JC: writer.writeIDref(NucModelType.HKY.getXMLName(), prefix2 + "jc"); break; case HKY: writer.writeIDref(NucModelType.HKY.getXMLName(), prefix2 + "hky"); break; case GTR: writer.writeIDref(GTRParser.GTR_MODEL, prefix2 + "gtr"); break; case TN93: writer.writeIDref(NucModelType.TN93.getXMLName(), prefix2 + "tn93"); break; default: throw new IllegalArgumentException("Unknown substitution model."); } } writer.writeCloseTag(GammaSiteModelParser.SUBSTITUTION_MODEL); if (model.hasCodon()) { writeParameter(num, GammaSiteModelParser.RELATIVE_RATE, "mu", model, writer); } if (model.isGammaHetero()) { writer.writeOpenTag(GammaSiteModelParser.GAMMA_SHAPE, new Attribute.Default<String>( GammaSiteModelParser.GAMMA_CATEGORIES, "" + model.getGammaCategories())); if (num == -1 || model.isUnlinkedHeterogeneityModel()) { // writeParameter(prefix + "alpha", model, writer); writeParameter(num, "alpha", model, writer); } else { // multiple partitions but linked heterogeneity if (num == 1) { // writeParameter(prefix2 + "alpha", model, writer); writeParameter("alpha", model, writer); } else { writer.writeIDref(ParameterParser.PARAMETER, prefix2 + "alpha"); } } writer.writeCloseTag(GammaSiteModelParser.GAMMA_SHAPE); } if (model.isInvarHetero()) { writer.writeOpenTag(GammaSiteModelParser.PROPORTION_INVARIANT); if (num == -1 || model.isUnlinkedHeterogeneityModel()) { // writeParameter(prefix + "pInv", model, writer); writeParameter(num, "pInv", model, writer); } else { // multiple partitions but linked heterogeneity if (num == 1) { // writeParameter(prefix2 + "pInv", model, writer); writeParameter("pInv", model, writer); } else { writer.writeIDref(ParameterParser.PARAMETER, prefix2 + "pInv"); } } writer.writeCloseTag(GammaSiteModelParser.PROPORTION_INVARIANT); } writer.writeCloseTag(GammaSiteModel.SITE_MODEL); } /** * Write the two states site model XML block. * * @param writer the writer * @param model the partition model to write in BEAST XML */ private void writeTwoStateSiteModel(XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(); writer.writeComment("site model"); writer.writeOpenTag(GammaSiteModel.SITE_MODEL, new Attribute[]{new Attribute.Default<String>(XMLParser.ID, prefix + SiteModel.SITE_MODEL)}); writer.writeOpenTag(GammaSiteModelParser.SUBSTITUTION_MODEL); switch (model.getBinarySubstitutionModel()) { case BIN_SIMPLE: //writer.writeIDref(dr.evomodel.substmodel.GeneralSubstitutionModel.GENERAL_SUBSTITUTION_MODEL, "bsimple"); writer.writeIDref(BinarySubstitutionModelParser.BINARY_SUBSTITUTION_MODEL, prefix + "bsimple"); break; case BIN_COVARION: writer.writeIDref(BinaryCovarionModelParser.COVARION_MODEL, prefix + "bcov"); break; default: throw new IllegalArgumentException("Unknown substitution model."); } writer.writeCloseTag(GammaSiteModelParser.SUBSTITUTION_MODEL); if (model.hasCodon()) { writeParameter(GammaSiteModelParser.RELATIVE_RATE, "mu", model, writer); } if (model.isGammaHetero()) { writer.writeOpenTag(GammaSiteModelParser.GAMMA_SHAPE, new Attribute.Default<String>(GammaSiteModelParser.GAMMA_CATEGORIES, "" + model.getGammaCategories())); writeParameter(prefix + "alpha", model, writer); writer.writeCloseTag(GammaSiteModelParser.GAMMA_SHAPE); } if (model.isInvarHetero()) { writeParameter(GammaSiteModelParser.PROPORTION_INVARIANT, "pInv", model, writer); } writer.writeCloseTag(GammaSiteModel.SITE_MODEL); } /** * Write the AA site model XML block. * * @param writer the writer * @param model the partition model to write in BEAST XML */ private void writeAASiteModel(XMLWriter writer, PartitionSubstitutionModel model) { String prefix = model.getPrefix(); writer.writeComment("site model"); writer.writeOpenTag(GammaSiteModel.SITE_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, prefix + SiteModel.SITE_MODEL)}); writer.writeOpenTag(GammaSiteModelParser.SUBSTITUTION_MODEL); writer.writeIDref(EmpiricalAminoAcidModelParser.EMPIRICAL_AMINO_ACID_MODEL, prefix + "aa"); writer.writeCloseTag(GammaSiteModelParser.SUBSTITUTION_MODEL); if (model.hasCodon()) { writeParameter(GammaSiteModelParser.RELATIVE_RATE, "mu", model, writer); } if (model.isGammaHetero()) { writer.writeOpenTag(GammaSiteModelParser.GAMMA_SHAPE, new Attribute.Default<String>( GammaSiteModelParser.GAMMA_CATEGORIES, "" + model.getGammaCategories())); writeParameter("alpha", model, writer); writer.writeCloseTag(GammaSiteModelParser.GAMMA_SHAPE); } if (model.isInvarHetero()) { writeParameter(GammaSiteModelParser.PROPORTION_INVARIANT, "pInv", model, writer); } writer.writeCloseTag(GammaSiteModel.SITE_MODEL); } private void writeDiscreteTraitsSiteModel(PartitionSubstitutionModel model, XMLWriter writer) { writer.writeOpenTag(SiteModel.SITE_MODEL, new Attribute[]{ new Attribute.Default<String>(XMLParser.ID, model.getPrefix() + SiteModel.SITE_MODEL)}); writer.writeOpenTag(GammaSiteModelParser.SUBSTITUTION_MODEL); writer.writeIDref(GeneralTraitGenerator.getLocationSubstModelTag(model), model.getPrefix() + AbstractSubstitutionModel.MODEL); writer.writeCloseTag(GammaSiteModelParser.SUBSTITUTION_MODEL); // writer.writeOpenTag(GammaSiteModelParser.MUTATION_RATE); // writeParameter(model.getParameter("trait.mu"), -1, writer); // writer.writeCloseTag(GammaSiteModelParser.MUTATION_RATE); writer.writeCloseTag(SiteModel.SITE_MODEL); } }
lgpl-2.1
solmix/datax
wmix/src/main/java/org/solmix/datax/wmix/UploadEndpoint.java
557
package org.solmix.datax.wmix; import org.solmix.datax.wmix.interceptor.UploadInterceptor; import org.solmix.wmix.mapper.MapperService; public class UploadEndpoint extends DataxEndpoint { private static final long serialVersionUID = -1633004647563444571L; @Override protected void prepareInInterceptors(){ UploadInterceptor in = new UploadInterceptor(); MapperService mapperService=container.getExtension(MapperService.class); in.setMapperService(mapperService); getInInterceptors().add(in); } }
lgpl-2.1
esig/dss
dss-asic-cades/src/test/java/eu/europa/esig/dss/asic/cades/signature/AbstractASiCCAdESCounterSignatureTest.java
4696
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.asic.cades.signature; import eu.europa.esig.dss.asic.cades.ASiCWithCAdESSignatureParameters; import eu.europa.esig.dss.asic.cades.ASiCWithCAdESTimestampParameters; import eu.europa.esig.dss.cades.signature.CAdESCounterSignatureParameters; import eu.europa.esig.dss.diagnostic.DiagnosticData; import eu.europa.esig.dss.diagnostic.SignatureWrapper; import eu.europa.esig.dss.enumerations.ASiCContainerType; import eu.europa.esig.dss.enumerations.SignatureLevel; import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.model.MimeType; import eu.europa.esig.dss.test.signature.AbstractCounterSignatureTest; import eu.europa.esig.dss.utils.Utils; import eu.europa.esig.dss.validation.reports.Reports; import eu.europa.esig.validationreport.jaxb.SignatureIdentifierType; import eu.europa.esig.validationreport.jaxb.SignatureValidationReportType; import eu.europa.esig.validationreport.jaxb.ValidationReportType; import java.util.Collections; import java.util.List; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class AbstractASiCCAdESCounterSignatureTest extends AbstractCounterSignatureTest<ASiCWithCAdESSignatureParameters, ASiCWithCAdESTimestampParameters, CAdESCounterSignatureParameters> { @Override protected MimeType getExpectedMime() { if (ASiCContainerType.ASiC_S.equals(getSignatureParameters().aSiC().getContainerType())) { return MimeType.ASICS; } return MimeType.ASICE; } @Override protected List<DSSDocument> getOriginalDocuments() { return Collections.singletonList(getDocumentToSign()); } @Override protected boolean isBaselineT() { SignatureLevel signatureLevel = getSignatureParameters().getSignatureLevel(); return SignatureLevel.CAdES_BASELINE_LTA.equals(signatureLevel) || SignatureLevel.CAdES_BASELINE_LT.equals(signatureLevel) || SignatureLevel.CAdES_BASELINE_T.equals(signatureLevel); } @Override protected boolean isBaselineLTA() { return SignatureLevel.CAdES_BASELINE_LTA.equals(getSignatureParameters().getSignatureLevel()); } @Override protected void checkContainerInfo(DiagnosticData diagnosticData) { assertNotNull(diagnosticData.getContainerInfo()); assertEquals(getSignatureParameters().aSiC().getContainerType(), diagnosticData.getContainerType()); assertNotNull(diagnosticData.getMimetypeFileContent()); assertTrue(Utils.isCollectionNotEmpty(diagnosticData.getContainerInfo().getContentFiles())); } @Override protected void checkSignatureIdentifier(DiagnosticData diagnosticData) { for (SignatureWrapper signatureWrapper : diagnosticData.getSignatures()) { assertNotNull(signatureWrapper.getSignatureValue()); } } @Override protected void checkReportsSignatureIdentifier(Reports reports) { DiagnosticData diagnosticData = reports.getDiagnosticData(); ValidationReportType etsiValidationReport = reports.getEtsiValidationReportJaxb(); if (Utils.isCollectionNotEmpty(diagnosticData.getSignatures())) { for (SignatureValidationReportType signatureValidationReport : etsiValidationReport.getSignatureValidationReport()) { SignatureWrapper signature = diagnosticData.getSignatureById(signatureValidationReport.getSignatureIdentifier().getId()); SignatureIdentifierType signatureIdentifier = signatureValidationReport.getSignatureIdentifier(); assertNotNull(signatureIdentifier); assertNotNull(signatureIdentifier.getSignatureValue()); assertArrayEquals(signature.getSignatureValue(), signatureIdentifier.getSignatureValue().getValue()); } } } }
lgpl-2.1
strontian/rainsorter
src/main/java/strawn/evariant/rainsorter/tools/DataOrganizationMethods.java
3903
/** * Copyright (C) 2016 David Strawn * * This file is part of rainsorter. * * rainsorter is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * rainsorter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with rainsorter. If not, see http://www.gnu.org/licenses. */ package strawn.evariant.rainsorter.tools; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.opengis.feature.simple.SimpleFeature; import strawn.evariant.rainsorter.data.msapop.MSAPopulationRecord; import strawn.evariant.rainsorter.data.qclcdstations.QCWeatherStationRecord; import strawn.evariant.rainsorter.calculation.MetropolitanStatisticalArea; import strawn.evariant.rainsorter.calculation.WeatherStation; /** * A collection of static methods for converting onto data structure into another. * TODO: These could be generalized using generics and reflection at a later time. */ public class DataOrganizationMethods { /** * converts a list of WeatherStationRecords into a map of WeatherStations keyed by WBAN * * @param stationRecords List of records to convert to map * @return Map of WeatherStations keyed by WBAN */ public static HashMap<String, WeatherStation> createWBANToStationMap(List<QCWeatherStationRecord> stationRecords) { HashMap<String, WeatherStation> stationsByWBAN = new HashMap(); for(QCWeatherStationRecord station : stationRecords) { stationsByWBAN.put(station.wban, new WeatherStation(station)); } return stationsByWBAN; } /** * converts a list of MSAPopulation Records into a list of MetropolitanStatisticalArea * @param populationRecords * @return list of MetropolitanStatisticalArea */ public static ArrayList<MetropolitanStatisticalArea> createMSAList(List<MSAPopulationRecord> populationRecords) { ArrayList<MetropolitanStatisticalArea> toReturn = new ArrayList(); for(MSAPopulationRecord record : populationRecords) { toReturn.add(new MetropolitanStatisticalArea(record.msaName, record.CBSACode, record.population)); } return toReturn; } /** * Converts a list of Regions into a map of regions keyed by their CBSA code * * @param featureList list of features to convert * @return map of regions keyed by their CBSA code */ public static Map<String, SimpleFeature> createCBSAToFeaturesMap(ArrayList<SimpleFeature> featureList) throws IOException { HashMap<String, SimpleFeature> toReturn = new HashMap(); for (SimpleFeature feature : featureList) { String cbsaId = feature.getProperty("CBSAFP").getValue().toString(); toReturn.put(cbsaId, feature); } return toReturn; } /** * Converts a list of MetropolitanStatisticalAreas into a Map with values of the same type, keyed by CBSA code * @param msas list of MSAs to convert * @return a map of MSAs keyed by CBSA code */ public static HashMap<String, MetropolitanStatisticalArea> createCBSACodeToMSAMap(List<MetropolitanStatisticalArea> msas) { HashMap<String, MetropolitanStatisticalArea> msasByCBSPCode = new HashMap(); for(MetropolitanStatisticalArea msa : msas) { msasByCBSPCode.put(msa.CBSACode, msa); } return msasByCBSPCode; } }
lgpl-2.1
jessealama/exist
src/org/exist/xquery/parser/XQueryTokenTypes.java
6700
// $ANTLR 2.7.7 (2006-11-01): "XQuery.g" -> "XQueryParser.java"$ package org.exist.xquery.parser; import antlr.debug.misc.*; import java.io.StringReader; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.Iterator; import java.util.Stack; import org.exist.storage.BrokerPool; import org.exist.storage.DBBroker; import org.exist.EXistException; import org.exist.dom.persistent.DocumentSet; import org.exist.dom.persistent.DocumentImpl; import org.exist.dom.QName; import org.exist.security.PermissionDeniedException; import org.exist.xquery.*; import org.exist.xquery.value.*; import org.exist.xquery.functions.fn.*; public interface XQueryTokenTypes { int EOF = 1; int NULL_TREE_LOOKAHEAD = 3; int QNAME = 4; int EQNAME = 5; int PREDICATE = 6; int FLWOR = 7; int PARENTHESIZED = 8; int ABSOLUTE_SLASH = 9; int ABSOLUTE_DSLASH = 10; int WILDCARD = 11; int PREFIX_WILDCARD = 12; int FUNCTION = 13; int DYNAMIC_FCALL = 14; int UNARY_MINUS = 15; int UNARY_PLUS = 16; int XPOINTER = 17; int XPOINTER_ID = 18; int VARIABLE_REF = 19; int VARIABLE_BINDING = 20; int ELEMENT = 21; int ATTRIBUTE = 22; int ATTRIBUTE_CONTENT = 23; int TEXT = 24; int VERSION_DECL = 25; int NAMESPACE_DECL = 26; int DEF_NAMESPACE_DECL = 27; int DEF_COLLATION_DECL = 28; int DEF_FUNCTION_NS_DECL = 29; int ANNOT_DECL = 30; int GLOBAL_VAR = 31; int FUNCTION_DECL = 32; int INLINE_FUNCTION_DECL = 33; int FUNCTION_INLINE = 34; int FUNCTION_TEST = 35; int MAP_TEST = 36; int LOOKUP = 37; int ARRAY = 38; int ARRAY_TEST = 39; int PROLOG = 40; int OPTION = 41; int ATOMIC_TYPE = 42; int MODULE = 43; int ORDER_BY = 44; int GROUP_BY = 45; int POSITIONAL_VAR = 46; int CATCH_ERROR_CODE = 47; int CATCH_ERROR_DESC = 48; int CATCH_ERROR_VAL = 49; int MODULE_DECL = 50; int MODULE_IMPORT = 51; int SCHEMA_IMPORT = 52; int ATTRIBUTE_TEST = 53; int COMP_ELEM_CONSTRUCTOR = 54; int COMP_ATTR_CONSTRUCTOR = 55; int COMP_TEXT_CONSTRUCTOR = 56; int COMP_COMMENT_CONSTRUCTOR = 57; int COMP_PI_CONSTRUCTOR = 58; int COMP_NS_CONSTRUCTOR = 59; int COMP_DOC_CONSTRUCTOR = 60; int PRAGMA = 61; int GTEQ = 62; int SEQUENCE = 63; int LITERAL_xpointer = 64; int LPAREN = 65; int RPAREN = 66; int NCNAME = 67; int LITERAL_xquery = 68; int LITERAL_version = 69; int SEMICOLON = 70; int LITERAL_module = 71; int LITERAL_namespace = 72; int EQ = 73; int STRING_LITERAL = 74; int LITERAL_declare = 75; int LITERAL_default = 76; // "boundary-space" = 77 int LITERAL_ordering = 78; int LITERAL_construction = 79; // "base-uri" = 80 // "copy-namespaces" = 81 int LITERAL_option = 82; int LITERAL_function = 83; int LITERAL_variable = 84; int MOD = 85; int LITERAL_import = 86; int LITERAL_encoding = 87; int LITERAL_collation = 88; int LITERAL_element = 89; int LITERAL_order = 90; int LITERAL_empty = 91; int LITERAL_greatest = 92; int LITERAL_least = 93; int LITERAL_preserve = 94; int LITERAL_strip = 95; int LITERAL_ordered = 96; int LITERAL_unordered = 97; int COMMA = 98; // "no-preserve" = 99 int LITERAL_inherit = 100; // "no-inherit" = 101 int DOLLAR = 102; int LCURLY = 103; int RCURLY = 104; int COLON = 105; int LITERAL_external = 106; int LITERAL_schema = 107; int BRACED_URI_LITERAL = 108; int LITERAL_as = 109; int LITERAL_at = 110; // "empty-sequence" = 111 int QUESTION = 112; int STAR = 113; int PLUS = 114; int LITERAL_item = 115; int LITERAL_map = 116; int LITERAL_array = 117; int LITERAL_for = 118; int LITERAL_let = 119; int LITERAL_try = 120; int LITERAL_some = 121; int LITERAL_every = 122; int LITERAL_if = 123; int LITERAL_switch = 124; int LITERAL_typeswitch = 125; int LITERAL_update = 126; int LITERAL_replace = 127; int LITERAL_value = 128; int LITERAL_insert = 129; int LITERAL_delete = 130; int LITERAL_rename = 131; int LITERAL_with = 132; int LITERAL_into = 133; int LITERAL_preceding = 134; int LITERAL_following = 135; int LITERAL_catch = 136; int UNION = 137; int LITERAL_where = 138; int LITERAL_return = 139; int LITERAL_in = 140; int LITERAL_by = 141; int LITERAL_stable = 142; int LITERAL_ascending = 143; int LITERAL_descending = 144; int LITERAL_group = 145; int LITERAL_satisfies = 146; int LITERAL_case = 147; int LITERAL_then = 148; int LITERAL_else = 149; int LITERAL_or = 150; int LITERAL_and = 151; int LITERAL_instance = 152; int LITERAL_of = 153; int LITERAL_treat = 154; int LITERAL_castable = 155; int LITERAL_cast = 156; int BEFORE = 157; int AFTER = 158; int LITERAL_eq = 159; int LITERAL_ne = 160; int LITERAL_lt = 161; int LITERAL_le = 162; int LITERAL_gt = 163; int LITERAL_ge = 164; int GT = 165; int NEQ = 166; int LT = 167; int LTEQ = 168; int LITERAL_is = 169; int LITERAL_isnot = 170; int CONCAT = 171; int LITERAL_to = 172; int MINUS = 173; int LITERAL_div = 174; int LITERAL_idiv = 175; int LITERAL_mod = 176; int BANG = 177; int PRAGMA_START = 178; int PRAGMA_END = 179; int LITERAL_union = 180; int LITERAL_intersect = 181; int LITERAL_except = 182; int SLASH = 183; int DSLASH = 184; int LITERAL_text = 185; int LITERAL_node = 186; int LITERAL_attribute = 187; int LITERAL_comment = 188; // "processing-instruction" = 189 // "document-node" = 190 int LITERAL_document = 191; int HASH = 192; int SELF = 193; int XML_COMMENT = 194; int XML_PI = 195; int LPPAREN = 196; int RPPAREN = 197; int AT = 198; int PARENT = 199; int LITERAL_child = 200; int LITERAL_self = 201; int LITERAL_descendant = 202; // "descendant-or-self" = 203 // "following-sibling" = 204 int LITERAL_parent = 205; int LITERAL_ancestor = 206; // "ancestor-or-self" = 207 // "preceding-sibling" = 208 int INTEGER_LITERAL = 209; int DOUBLE_LITERAL = 210; int DECIMAL_LITERAL = 211; // "schema-element" = 212 int END_TAG_START = 213; int QUOT = 214; int APOS = 215; int QUOT_ATTRIBUTE_CONTENT = 216; int ESCAPE_QUOT = 217; int APOS_ATTRIBUTE_CONTENT = 218; int ESCAPE_APOS = 219; int ELEMENT_CONTENT = 220; int XML_COMMENT_END = 221; int XML_PI_END = 222; int XML_CDATA = 223; int LITERAL_collection = 224; int LITERAL_validate = 225; int XML_PI_START = 226; int XML_CDATA_START = 227; int XML_CDATA_END = 228; int LETTER = 229; int DIGITS = 230; int HEX_DIGITS = 231; int NMSTART = 232; int NMCHAR = 233; int WS = 234; int XQDOC_COMMENT = 235; int EXPR_COMMENT = 236; int PREDEFINED_ENTITY_REF = 237; int CHAR_REF = 238; int S = 239; int NEXT_TOKEN = 240; int CHAR = 241; int BASECHAR = 242; int IDEOGRAPHIC = 243; int COMBINING_CHAR = 244; int DIGIT = 245; int EXTENDER = 246; }
lgpl-2.1
tweninger/nina
src/edu/nd/nina/io/Dot.java
2908
package edu.nd.nina.io; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import edu.nd.nina.DirectedGraph; import edu.nd.nina.Graph; import edu.nd.nina.graph.DefaultEdge; import edu.nd.nina.graph.SimpleGraph; public class Dot { public static void save(Graph<String, String> graph, String fileName, String desc) { PrintWriter pw = null; try { pw = new PrintWriter(fileName); } catch (FileNotFoundException e1) { e1.printStackTrace(); return; } if (graph instanceof DirectedGraph) { pw.printf("# Directed graph: %s \n", fileName); } else { pw.printf( "# Undirected graph (each unordered pair of nodes is saved once): %s\n", fileName); } if (!desc.isEmpty()) { pw.printf("# %s\n", desc); } pw.printf("# Nodes: %d Edges: %d\n", graph.vertexSet().size(), graph .edgeSet().size()); if (graph instanceof DirectedGraph) { pw.printf("# FromNodeId\tToNodeId\n"); } else { pw.printf("# NodeId\tNodeId\n"); } if (graph instanceof DirectedGraph) { pw.printf("digraph %s {\n", desc); for (String e : graph.edgeSet()) { pw.printf("%s->%s\n", graph.getEdgeSource(e), graph.getEdgeTarget(e)); } pw.printf("}\n"); }else{ pw.printf("graph %s {\n", desc); for (String e : graph.edgeSet()) { pw.printf("%s--%s\n", graph.getEdgeSource(e), graph.getEdgeTarget(e)); } pw.printf("}\n"); } pw.close(); } public static Graph<String, DefaultEdge> load( String fileName, String desc) { BufferedReader br = null; try { br = new BufferedReader(new FileReader(fileName)); } catch (FileNotFoundException e) { e.printStackTrace(); } String line = ""; boolean directed = false; SimpleGraph<String,DefaultEdge> graph = new SimpleGraph<String,DefaultEdge>(DefaultEdge.class); try { while((line = br.readLine()) != null){ if(line.startsWith("#")){ continue; } if(line.startsWith("graph")){ directed = false; continue; } if(line.startsWith("digraph")){ directed = true; continue; } String[] lineDiv; if(directed){ lineDiv = line.split("->"); }else{ lineDiv = line.split("--"); } if(lineDiv.length != 2){ continue; } if(lineDiv[1].contains("[")){ lineDiv[1] = lineDiv[1].substring(0, lineDiv[1].indexOf("[")); } String src = lineDiv[0]; String dest = lineDiv[1]; graph.addVertex(src); graph.addVertex(dest); graph.addEdge(src, dest); } } catch (IOException e) { e.printStackTrace(); } try { br.close(); } catch (IOException e) { e.printStackTrace(); } return graph; } }
lgpl-3.0
austinv11/Discord4J
core/src/main/java/discord4j/core/object/data/stored/UserBean.java
2865
/* * This file is part of Discord4J. * * Discord4J is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Discord4J is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Discord4J. If not, see <http://www.gnu.org/licenses/>. */ package discord4j.core.object.data.stored; import com.fasterxml.jackson.annotation.JsonTypeInfo; import discord4j.common.json.UserResponse; import reactor.util.annotation.Nullable; import java.io.Serializable; @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) public final class UserBean implements Serializable { private static final long serialVersionUID = 1555537329840118514L; private long id; private String username; private String discriminator; @Nullable private String avatar; private boolean isBot; public UserBean(final UserResponse response) { id = response.getId(); username = response.getUsername(); discriminator = response.getDiscriminator(); avatar = response.getAvatar(); isBot = response.isBot() != null && response.isBot(); } public UserBean(final UserBean toCopy) { id = toCopy.id; username = toCopy.username; discriminator = toCopy.discriminator; avatar = toCopy.avatar; isBot = toCopy.isBot; } public UserBean() {} public long getId() { return id; } public void setId(final long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(final String username) { this.username = username; } public String getDiscriminator() { return discriminator; } public void setDiscriminator(final String discriminator) { this.discriminator = discriminator; } @Nullable public String getAvatar() { return avatar; } public void setAvatar(@Nullable final String avatar) { this.avatar = avatar; } public boolean isBot() { return isBot; } public void setBot(boolean bot) { isBot = bot; } @Override public String toString() { return "UserBean{" + "id=" + id + ", username='" + username + '\'' + ", discriminator='" + discriminator + '\'' + ", avatar='" + avatar + '\'' + ", isBot=" + isBot + '}'; } }
lgpl-3.0
xorware/android_packages_apps_Settings
src/com/android/settings/AppListSwitchPreference.java
1932
package com.android.settings; import android.content.Context; import android.support.v7.preference.PreferenceViewHolder; import android.util.AttributeSet; import android.util.Log; import android.widget.Checkable; /** * A hybrid of AppListPreference and SwitchPreference, representing a preference which can be on or * off but must have a selected value when turned on. * * It is invalid to show this preference when zero valid apps are present. */ public class AppListSwitchPreference extends AppListPreference { private static final String TAG = "AppListSwitchPref"; private Checkable mSwitch; public AppListSwitchPreference(Context context, AttributeSet attrs) { super(context, attrs, 0, R.style.AppListSwitchPreference); } @Override public void onBindViewHolder(PreferenceViewHolder view) { super.onBindViewHolder(view); mSwitch = (Checkable) view.findViewById(com.android.internal.R.id.switch_widget); mSwitch.setChecked(getValue() != null); } @Override protected void onClick() { if (getValue() != null) { // Turning off the current value. if (callChangeListener(null)) { setValue(null); } } else if (getEntryValues() == null || getEntryValues().length == 0) { Log.e(TAG, "Attempting to show dialog with zero entries: " + getKey()); } else if (getEntryValues().length == 1) { // Suppress the dialog and just toggle the preference with the only choice. String value = getEntryValues()[0].toString(); if (callChangeListener(value)) { setValue(value); } } else { super.onClick(); } } @Override public void setValue(String value) { super.setValue(value); if (mSwitch != null) { mSwitch.setChecked(value != null); } } }
lgpl-3.0
Antokolos/iambookmaster
test/com/iambookmaster/qsp/MOBIExportTest.java
1069
package com.iambookmaster.qsp; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import com.iambookmaster.client.model.Model; import com.iambookmaster.client.paragraph.BookDecorator; import com.iambookmaster.server.logic.MOBIBookDecrator; public class MOBIExportTest extends QSPExportTest { public void test1() throws Exception { // perform("attack2attack"); // perform("attack2defence"); // perform("attack2attackWeak"); // perform("attack2attackDeath"); // perform("attack2defenceFatal"); // perform("attack2defenceFatalMax"); // perform("1round"); // perform("3npc"); // perform("Sprites"); perform("Dragon"); // perform("IvanDurak"); } @Override protected BookDecorator getBookDecorator(Model model) { return new MOBIBookDecrator(model,appConstants,appMessages); } @Override protected FileOutputStream getOutputStream() throws IOException { File file = new File("ebooks/output.zip"); if (file.exists()==false) { file.createNewFile(); } return new FileOutputStream(file); } }
lgpl-3.0
c00kiemon5ter/LuceneEval
src/cacm/lists/CacmQueryList.java
775
package cacm.lists; import cacm.CacmQuery; import java.util.LinkedList; import java.util.List; public class CacmQueryList { private List<CacmQuery> queries; public CacmQueryList() { this.queries = new LinkedList<CacmQuery>(); } public CacmQueryList(List<CacmQuery> queries) { this.queries = new LinkedList<CacmQuery>(queries); } /** * @return the queries */ public List<CacmQuery> getQueries() { return queries; } /** * @param queries the queries to set */ public void setQueries(List<CacmQuery> queries) { this.queries = queries; } @Override public String toString() { StringBuilder strbuf = new StringBuilder(); for (CacmQuery query : queries) { strbuf.append(query.toString()).append("\n"); } return strbuf.toString(); } }
lgpl-3.0
olikasg/erlang-scala-metrics
otp_src_R12B-5/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangBitstr.java
7653
/* ``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 2007, Ericsson Utvecklings * AB. All Rights Reserved.'' * * $Id$ */ package com.ericsson.otp.erlang; import java.io.Serializable; import java.io.IOException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; /** * Provides a Java representation of Erlang bitstrs. * An Erlang bitstr is an Erlang binary with a length not * an integral number of bytes (8-bit). Anything * can be represented as a sequence of bytes can be made into an * Erlang bitstr. **/ public class OtpErlangBitstr extends OtpErlangObject implements Serializable, Cloneable { // don't change this! static final long serialVersionUID = -3781009633593609217L; protected byte[] bin; protected int pad_bits; /** * Create a bitstr from a byte array * * @param bin the array of bytes from which to create the bitstr. **/ public OtpErlangBitstr(byte[] bin) { this.bin = new byte[bin.length]; System.arraycopy(bin, 0, this.bin, 0, bin.length); this.pad_bits = 0; } /** * Create a bitstr with pad bits from a byte array. * * @param bin the array of bytes from which to create the bitstr. * @param pad_bits the number of unused bits in the low end of * the last byte. **/ public OtpErlangBitstr(byte[] bin, int pad_bits) { this.bin = new byte[bin.length]; System.arraycopy(bin, 0, this.bin, 0, bin.length); this.pad_bits = pad_bits; check_bitstr(this.bin, this.pad_bits); } private void check_bitstr(byte[] bin, int pad_bits) { if (pad_bits < 0 || 7 < pad_bits) { throw new java.lang.IllegalArgumentException ("Padding must be in range 0..7"); } if (pad_bits != 0 && bin.length == 0) { throw new java.lang.IllegalArgumentException ("Padding on zero length bitstr"); } if (bin.length != 0) { // Make sure padding is zero bin[bin.length-1] &= ~((1 << pad_bits) - 1); } } /** * Create a bitstr from a stream containing a bitstr encoded in * Erlang external format. * * @param buf the stream containing the encoded bitstr. * * @exception OtpErlangDecodeException if the buffer does not * contain a valid external representation of an Erlang bitstr. **/ public OtpErlangBitstr(OtpInputStream buf) throws OtpErlangDecodeException { int pbs[] = {0}; // This is ugly just to get a value-result parameter this.bin = buf.read_bitstr(pbs); this.pad_bits = pbs[0]; check_bitstr(this.bin, this.pad_bits); } /** * Create a bitstr from an arbitrary Java Object. The object must * implement java.io.Serializable or java.io.Externalizable. * * @param o the object to serialize and create this bitstr from. **/ public OtpErlangBitstr(Object o) { try { this.bin = toByteArray(o); this.pad_bits = 0; } catch (IOException e) { throw new java.lang.IllegalArgumentException ("Object must implement Serializable"); } } private static byte[] toByteArray(Object o) throws java.io.IOException { if (o == null) return null; /* need to synchronize use of the shared baos */ java.io.ByteArrayOutputStream baos = new ByteArrayOutputStream(); java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(baos); oos.writeObject(o); oos.flush(); return baos.toByteArray(); } private static Object fromByteArray(byte[] buf) { if (buf == null) return null; try { java.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream(buf); java.io.ObjectInputStream ois = new java.io.ObjectInputStream(bais); return ois.readObject(); } catch (java.lang.ClassNotFoundException e) {} catch (java.io.IOException e) {} return null; } /** * Get the byte array from a bitstr, padded with zero bits * in the little end of the last byte. * * @return the byte array containing the bytes for this bitstr. **/ public byte[] binaryValue() { return this.bin; } /** * Get the size in whole bytes of the bitstr, * rest bits in the last byte not counted. * * @return the number of bytes contained in the bintstr. **/ public int size() { if (this.pad_bits == 0) return this.bin.length; if (this.bin.length == 0) { throw new java.lang.IllegalStateException("Impossible length"); } return this.bin.length - 1; } /** * Get the number of pad bits in the last byte of the * bitstr. The pad bits are zero and in the little end. * * @return the number of pad bits in the bitstr. **/ public int pad_bits() { return this.pad_bits; } /** * Get the java Object from the bitstr. If the bitstr contains a * serialized Java object, then this method will recreate the * object. * * * @return the java Object represented by this bitstr, or null if * the bitstr does not represent a Java Object. **/ public Object getObject() { if (this.pad_bits != 0) return null; return fromByteArray(this.bin); } /** * Get the string representation of this bitstr object. A bitstr is * printed as #Bin&lt;N&gt;, where N is the number of bytes * contained in the object or #bin&lt;N-M&gt; if there are M pad bits. * * @return the Erlang string representation of this bitstr. **/ public String toString() { if (this.pad_bits == 0) return "#Bin<" + this.bin.length + ">"; if (this.bin.length == 0) { throw new java.lang.IllegalStateException("Impossible length"); } return "#Bin<" + this.bin.length + "-" + this.pad_bits + ">"; } /** * Convert this bitstr to the equivalent Erlang external representation. * * @param buf an output stream to which the encoded bitstr should be * written. **/ public void encode(OtpOutputStream buf) { buf.write_bitstr(this.bin, this.pad_bits); } /** * Determine if two bitstrs are equal. Bitstrs are equal if they have * the same byte length and tail length, * and the array of bytes is identical. * * @param o the bitstr to compare to. * * @return true if the bitstrs contain the same bits, false * otherwise. **/ public boolean equals(Object o) { if (! (o instanceof OtpErlangBitstr)) return false; OtpErlangBitstr that = (OtpErlangBitstr)o; if (this.pad_bits != that.pad_bits) return false; int len = this.bin.length; if (len != that.bin.length) return false; for (int i = 0; i < len; i++) { if (this.bin[i] != that.bin[i]) return false; // early exit } return true; } public Object clone() { OtpErlangBitstr that = (OtpErlangBitstr)(super.clone()); that.bin = (byte [])this.bin.clone(); that.pad_bits = this.pad_bits; return that; } }
lgpl-3.0
biotextmining/processes
src/main/java/com/silicolife/textmining/processes/ie/schemas/export/NERSchemaToCSV.java
10680
package com.silicolife.textmining.processes.ie.schemas.export; import java.io.IOException; import java.io.PrintWriter; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import com.silicolife.textmining.core.datastructures.documents.AnnotatedDocumentImpl; import com.silicolife.textmining.core.datastructures.documents.PublicationImpl; import com.silicolife.textmining.core.datastructures.init.InitConfiguration; import com.silicolife.textmining.core.datastructures.report.processes.io.export.NERSchemaExportReportImpl; import com.silicolife.textmining.core.datastructures.utils.conf.GlobalOptions; import com.silicolife.textmining.core.interfaces.core.annotation.IEntityAnnotation; import com.silicolife.textmining.core.interfaces.core.dataaccess.exception.ANoteException; import com.silicolife.textmining.core.interfaces.core.document.IAnnotatedDocument; import com.silicolife.textmining.core.interfaces.core.document.IDocumentSet; import com.silicolife.textmining.core.interfaces.core.document.IPublication; import com.silicolife.textmining.core.interfaces.core.document.structure.ISentence; import com.silicolife.textmining.core.interfaces.core.general.IExternalID; import com.silicolife.textmining.core.interfaces.core.report.processes.INERSchemaExportReport; import com.silicolife.textmining.core.interfaces.process.IE.INERSchema; import com.silicolife.textmining.core.interfaces.process.IE.ner.export.INERCSVExporterConfiguration; import com.silicolife.textmining.core.interfaces.resource.IResource; import com.silicolife.textmining.core.interfaces.resource.IResourceElement; public class NERSchemaToCSV { public NERSchemaToCSV() { } public INERSchemaExportReport exportToCSV(INERCSVExporterConfiguration configuration) throws ANoteException, IOException { long startTime = GregorianCalendar.getInstance().getTimeInMillis(); INERSchemaExportReport report = new NERSchemaExportReportImpl(); PrintWriter pw = new PrintWriter(configuration.getFile()); writeHeaderLine(configuration,pw); Map<Long,String> externalIdsSTr = new HashMap<>(); Map<Long, IResource<IResourceElement>> resourceIdsSTr = new HashMap<>(); INERSchema nerSchema = configuration.getNERSchema(); IDocumentSet docs = nerSchema.getCorpus().getArticlesCorpus(); Iterator<IPublication> itDocs = docs.iterator(); int progressionStep = 0; int progressionTotalSteps = docs.getAllDocuments().size(); while(itDocs.hasNext()) { IPublication doc = itDocs.next(); IAnnotatedDocument docAnnot = new AnnotatedDocumentImpl(doc, nerSchema, nerSchema.getCorpus()); for(IEntityAnnotation ent : docAnnot.getEntitiesAnnotations()) { writeline(configuration,pw,docAnnot,ent,externalIdsSTr,resourceIdsSTr); report.incremetExportedEntity(1); } memoryAndProgressAndTime(progressionStep, progressionTotalSteps, startTime); progressionStep++; } pw.close(); long endTime = GregorianCalendar.getInstance().getTimeInMillis(); report.setTime(endTime-startTime); return report; } private void writeHeaderLine(INERCSVExporterConfiguration configuration,PrintWriter pw) { String[] toWrite = new String[10]; toWrite[configuration.getColumnConfiguration().getAnnotationIDColumn()] = "AnnotationID"; toWrite[configuration.getColumnConfiguration().getPublicationIDColumn()] = "PublicationID/PMID"; toWrite[configuration.getColumnConfiguration().getElementColumn()] = "Term"; toWrite[configuration.getColumnConfiguration().getClassColumn()] = "Class"; toWrite[configuration.getColumnConfiguration().getStartOffset()] = "StartOffset"; toWrite[configuration.getColumnConfiguration().getEndOffset()] = "EndOffset"; toWrite[configuration.getColumnConfiguration().getResourceIDColumn()] = "ResourceID"; toWrite[configuration.getColumnConfiguration().getResourceInformation()] = "Resource Name"; toWrite[configuration.getColumnConfiguration().getResourceExternalIDs()] = "External IDs"; toWrite[configuration.getColumnConfiguration().getSentenceColumn()] = "Sentence"; String header = getLineToWrite(configuration,toWrite); pw.write(header); pw.println(); } private void writeline(INERCSVExporterConfiguration configuration, PrintWriter pw,IAnnotatedDocument docID, IEntityAnnotation entAnnot, Map<Long, String> externalIdsSTr, Map<Long, IResource<IResourceElement>> resourceIdsResource) throws ANoteException, IOException { String[] toWrite = new String[10]; toWrite[configuration.getColumnConfiguration().getAnnotationIDColumn()] = configuration.getTextDelimiter().getValue() + entAnnot.getId() + configuration.getTextDelimiter().getValue(); String extenalLinks = PublicationImpl.getPublicationExternalIDsStream(docID); if(configuration.exportPublicationOtherID() && extenalLinks!=null && !extenalLinks.isEmpty()) { toWrite[configuration.getColumnConfiguration().getPublicationIDColumn()] = configuration.getTextDelimiter().getValue() + extenalLinks + configuration.getTextDelimiter().getValue(); } else { toWrite[configuration.getColumnConfiguration().getPublicationIDColumn()] = configuration.getTextDelimiter().getValue() + "ID:"+docID.getId() + configuration.getTextDelimiter().getValue(); } toWrite[configuration.getColumnConfiguration().getElementColumn()] = configuration.getTextDelimiter().getValue() + entAnnot.getAnnotationValue() + configuration.getTextDelimiter().getValue(); toWrite[configuration.getColumnConfiguration().getClassColumn()] = configuration.getTextDelimiter().getValue() + entAnnot.getClassAnnotation().getName() + configuration.getTextDelimiter().getValue(); toWrite[configuration.getColumnConfiguration().getStartOffset()] = configuration.getTextDelimiter().getValue() + entAnnot.getStartOffset() + configuration.getTextDelimiter().getValue(); toWrite[configuration.getColumnConfiguration().getEndOffset()] = configuration.getTextDelimiter().getValue() + entAnnot.getEndOffset() + configuration.getTextDelimiter().getValue(); if(entAnnot.getResourceElement() != null) { toWrite[configuration.getColumnConfiguration().getResourceIDColumn()] = configuration.getTextDelimiter().getValue() + entAnnot.getResourceElement() + configuration.getTextDelimiter().getValue(); if(configuration.exportResourceInformation()) { if(!resourceIdsResource.containsKey(entAnnot.getResourceElement().getId())) { IResource<IResourceElement> resourceID = InitConfiguration.getDataAccess().getResourceFromResourceElementByID(entAnnot.getResourceElement().getId()); resourceIdsResource.put(entAnnot.getResourceElement().getId(), resourceID); } toWrite[configuration.getColumnConfiguration().getResourceInformation()] = resourceIdsResource.get(entAnnot.getResourceElement().getId()).toString(); toWrite[configuration.getColumnConfiguration().getResourceIDColumn()] = String.valueOf(resourceIdsResource.get(entAnnot.getResourceElement().getId()).getId()); if(configuration.exportResourceExternalID()) { if(!externalIdsSTr.containsKey(entAnnot.getResourceElement().getId())) { String strExternalIds = null; IResourceElement resourceElement = InitConfiguration.getDataAccess().getResourceElementByID(entAnnot.getResourceElement().getId()); List<IExternalID> extIDs = resourceElement.getExtenalIDs(); if(extIDs.size() > 0) { strExternalIds = new String(); for(IExternalID extID: extIDs) { strExternalIds = strExternalIds + configuration.getExternalIDDelimiter().getValue() + extID.getExternalID() + configuration.getIntraExtenalIDdelimiter().getValue() + extID.getSource(); } strExternalIds = strExternalIds.substring(1); strExternalIds = configuration.getTextDelimiter().getValue() + strExternalIds + configuration.getTextDelimiter().getValue(); } externalIdsSTr.put(entAnnot.getResourceElement().getId(), strExternalIds); } } toWrite[configuration.getColumnConfiguration().getResourceExternalIDs()] = externalIdsSTr.get(entAnnot.getResourceElement().getId()); } else { toWrite[configuration.getColumnConfiguration().getResourceInformation()] = null; toWrite[configuration.getColumnConfiguration().getResourceIDColumn()] = null; toWrite[configuration.getColumnConfiguration().getResourceExternalIDs()] = null; } } else { toWrite[configuration.getColumnConfiguration().getResourceIDColumn()] = null; toWrite[configuration.getColumnConfiguration().getResourceInformation()] = null; toWrite[configuration.getColumnConfiguration().getResourceExternalIDs()] = null; } toWrite[configuration.getColumnConfiguration().getSentenceColumn()] = getSentenceAnnotation(configuration, docID, entAnnot); String lineToFile = getLineToWrite(configuration,toWrite); pw.write(lineToFile); pw.println(); } private String getSentenceAnnotation(INERCSVExporterConfiguration configuration, IAnnotatedDocument docAnnot,IEntityAnnotation entityAnnot) throws ANoteException, IOException { return configuration.getTextDelimiter().getValue() + getSentence(docAnnot,entityAnnot.getStartOffset(),entityAnnot.getEndOffset()) + configuration.getTextDelimiter().getValue() ; } private String getSentence(IAnnotatedDocument annotDOc, long startOffset,long endOffset) throws ANoteException, IOException { List<ISentence> sentences = annotDOc.getSentencesText(); ISentence sentenceInit = findSentence(sentences,(int)startOffset); ISentence sentenceEnd = findSentence(sentences,(int)endOffset); int start = (int)sentenceInit.getStartOffset(); int end = (int)sentenceEnd.getEndOffset(); return annotDOc.getDocumentAnnotationText().substring(start,end); } private ISentence findSentence(List<ISentence> sentences, int offset) { for(ISentence set:sentences) { if(set.getStartOffset() <= offset && offset <= set.getEndOffset()) { return set; } } return null; } private String getLineToWrite(INERCSVExporterConfiguration configuration,String[] toWrite) { String line = new String(); for(String value:toWrite) { if(value == null) line = line + configuration.getDefaultDelimiter().getValue(); else line = line + value; line = line + configuration.getMainDelimiter().getValue(); } return line.substring(0, line.length()-configuration.getMainDelimiter().getValue().length()); } protected void memoryAndProgressAndTime(int position, int size, long starttime) { System.out.println((GlobalOptions.decimalformat.format((double)position/ (double) size * 100)) + " %..."); System.gc(); System.out.println((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/(1024*1024) + " MB "); } }
lgpl-3.0
quadracoatl/quadracoatl
common/src/org/quadracoatl/framework/entities/changes/EntityChange.java
1745
/* * Copyright 2016, Robert 'Bobby' Zenz * * This file is part of Quadracoatl. * * Quadracoatl is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Quadracoatl is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Quadracoatl. If not, see <http://www.gnu.org/licenses/>. */ package org.quadracoatl.framework.entities.changes; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class EntityChange { private List<? extends ComponentChange> componentChanges = Collections.emptyList(); private int id = 0; private ChangeType type = null; public EntityChange(ChangeType type, int id) { super(); this.type = type; this.id = id; } public EntityChange(ChangeType type, int id, Collection<? extends ComponentChange> componentChanges) { this(); this.type = type; this.id = id; if (componentChanges != null && !componentChanges.isEmpty()) { this.componentChanges = Collections.unmodifiableList(new ArrayList<>(componentChanges)); } } private EntityChange() { super(); } public List<? extends ComponentChange> getComponentChanges() { return componentChanges; } public int getId() { return id; } public ChangeType getType() { return type; } }
lgpl-3.0
ymanvieu/trading
trading-webapp/src/main/java/fr/ymanvieu/trading/webapp/symbol/controller/SymbolController.java
2132
/** * Copyright (C) 2019 Yoann Manvieu * * This software is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package fr.ymanvieu.trading.webapp.symbol.controller; import java.security.Principal; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import fr.ymanvieu.trading.common.symbol.SymbolService; @RestController @RequestMapping("/api/symbol") @PreAuthorize("isAuthenticated()") public class SymbolController { @Autowired private SymbolService symbolService; @PostMapping("/favorite") public void addFavoriteSymbol(@RequestBody Map<String, String> symbolCode, Principal p) { symbolService.addFavoriteSymbol(symbolCode.get("fromSymbolCode"), symbolCode.get("toSymbolCode"), Integer.valueOf(p.getName())); } @DeleteMapping("/favorite/{fromSymbolCode}/{toSymbolCode}") public void deleteFavoriteSymbol(@PathVariable String fromSymbolCode, @PathVariable String toSymbolCode, Principal p) { symbolService.deleteFavoriteSymbol(fromSymbolCode, toSymbolCode, Integer.valueOf(p.getName())); } }
lgpl-3.0
bnika/MerkOrCore
src/is/merkor/core/redis/dictionaries/RedisClusterMemberDictionary.java
4071
/******************************************************************************* * MerkOrCore * Copyright (c) 2012 Anna B. Nikulásdóttir * * License: GNU Lesser General Public License. * See: <http://www.gnu.org/licenses> and <README.markdown> * *******************************************************************************/ package is.merkor.core.redis.dictionaries; import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import redis.clients.jedis.Jedis; import is.merkor.core.Cluster; import is.merkor.core.ClusterMember; import is.merkor.core.ClusterMemberDictionary; import is.merkor.core.Item; import is.merkor.core.util.MerkorLogger; /** * An implementation of the {@link ClusterMemberDictionary} interface to access * {@link ClusterMember}s stored in Redis format. * * @author Anna B. Nikulasdottir * @version 0.8 */ public class RedisClusterMemberDictionary implements ClusterMemberDictionary { private RedisClusterMemberParser parser = null; private static Logger logger; /** * Constructs a new dictionary using default settings for * Jedis */ public RedisClusterMemberDictionary () throws Exception { MerkorLogger.configureLogger(); logger = Logger.getLogger(RedisRelationParser.class); parser = new RedisClusterMemberParser(); } /** * Constructs a new dictionary using {@code host} and {@code port} * to instantiate the contained Jedis object. */ public RedisClusterMemberDictionary (final String host, final int port) throws Exception { parser = new RedisClusterMemberParser(host, port); MerkorLogger.configureLogger(); logger = Logger.getLogger(RedisRelationParser.class); } /** * Constructs a new dictionary using {@code jedis}. * @param jedis */ public RedisClusterMemberDictionary (final Jedis jedis) throws Exception { parser = new RedisClusterMemberParser(jedis); MerkorLogger.configureLogger(); logger = Logger.getLogger(RedisRelationParser.class); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getClustersFor(java.lang.String) */ @Override public List<ClusterMember> getClustersFor (final String lemma) { validateLemma(lemma); return parser.getClustersFor(lemma); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getClustersFor(java.lang.Long) */ @Override public List<Cluster> getClustersFor (final Long itemId) { validateObject(itemId, "id"); return parser.getClustersFor(itemId); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getClusterItemsForCluster(java.lang.Long) */ @Override public List<? extends ClusterMember> getClusterItemsForCluster (final Long clusterId) { validateObject(clusterId, "clusterId"); return parser.getClusterItemsForCluster(clusterId); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getClusterItemsForItem(is.merkor.core.Item) */ @Override public List<? extends ClusterMember> getClusterItemsForItem (final Item item) { validateObject(item, "item"); return parser.getClusterItemsForItem(item); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getDomainsFor(java.lang.String) */ @Override public Map<String, Item> getDomainsFor (final String lemma) { validateLemma(lemma); return parser.getDomainsFor(lemma); } /* * (non-Javadoc) * @see is.merkor.core.ClusterMemberDictionary#getItemsForDomain(java.lang.String) */ @Override public List<Item> getItemsForDomain (final String domain) { validateObject(domain, "domain"); return parser.getItemsForDomain(domain); } private void validateLemma (final String lemma) { if (null == lemma || lemma.isEmpty()) { IllegalArgumentException e = new IllegalArgumentException(); logger.error("param 'lemma' must not be empty!", e); throw e; } } private void validateObject (final Object obj, final String paramName) { if (null == obj) { IllegalArgumentException e = new IllegalArgumentException(); logger.error("param " + paramName + " must not be null!", e); throw e; } } }
lgpl-3.0
geniejang/ProblemSolving
Leetcode/src/leetcode/no041_FirstMissingPositive/Solution.java
511
package leetcode.no041_FirstMissingPositive; public class Solution { public int firstMissingPositive(int[] nums) { for (int i = 0; i < nums.length;) { int num = nums[i]; if (num == i + 1 || num <= 0 || num > nums.length || nums[num - 1] == num) { i++; } else { int temp = nums[num - 1]; nums[num - 1] = nums[i]; nums[i] = temp; } } int missed = 0; while (missed < nums.length && nums[missed] == missed + 1) { missed++; } return missed + 1; } }
lgpl-3.0
zakski/project-soisceal
scala-core/src/test/java/com/szadowsz/gospel/core/lib/JavaLibraryTestCase.java
14738
package com.szadowsz.gospel.core.lib; import com.szadowsz.gospel.core.Prolog; import com.szadowsz.gospel.core.data.Struct; import com.szadowsz.gospel.core.data.numeric.Number; import com.szadowsz.gospel.core.db.lib.Library; import com.szadowsz.gospel.core.db.primitive.PrimitiveInfo; import com.szadowsz.gospel.core.engine.Solution; import com.szadowsz.gospel.util.exception.engine.PrologException; import com.szadowsz.gospel.util.exception.theory.InvalidTheoryException; import com.szadowsz.gospel.core.db.theory.Theory; import com.szadowsz.gospel.util.TestCounter; import com.szadowsz.gospel.util.exception.data.UnknownVarException; import com.szadowsz.gospel.util.exception.lib.InvalidObjectIdException; import com.szadowsz.gospel.util.exception.solution.InvalidSolutionException; import junit.framework.TestCase; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; public class JavaLibraryTestCase extends TestCase { String theory = null; Prolog engine = new Prolog(); Solution info = null; String result = null; String paths = null; public void testGetPrimitives() { Library library = new OOLibrary(); Map<Integer, List<PrimitiveInfo>> primitives = library.getPrimitives(); assertEquals(3, primitives.size()); assertEquals(0, primitives.get(PrimitiveInfo.DIRECTIVE()).size()); assertTrue(primitives.get(PrimitiveInfo.PREDICATE()).size() > 0); assertEquals(0, primitives.get(PrimitiveInfo.FUNCTOR()).size()); } public void testAnonymousObjectRegistration() throws InvalidTheoryException, InvalidObjectIdException { OOLibrary lib = (OOLibrary) engine.getLibrary("com.szadowsz.gospel.core.lib.OOLibrary"); String theory = "demo(X) :- X <- update. \n"; engine.setTheory(new Theory(theory)); TestCounter counter = new TestCounter(); // check registering behaviour Struct t = lib.register(counter); engine.solve(new Struct("demo", t)); assertEquals(1, counter.getValue()); // check unregistering behaviour lib.unregister(t); Solution goal = engine.solve(new Struct("demo", t)); assertFalse(goal.isSuccess()); } public void testDynamicObjectsRetrival() throws PrologException, InvalidObjectIdException, InvalidTheoryException, InvalidSolutionException { Prolog engine = new Prolog(); OOLibrary lib = (OOLibrary) engine.getLibrary("com.szadowsz.gospel.core.lib.OOLibrary"); String theory = "demo(C) :- \n" + "java_object('com.szadowsz.gospel.util.TestCounter', [], C), \n" + "C <- update, \n" + "C <- update. \n"; engine.setTheory(new Theory(theory)); Solution info = engine.solve("demo(Obj)."); Struct id = (Struct) info.getVarValue("Obj"); TestCounter counter = (TestCounter) lib.getRegisteredDynamicObject(id); assertEquals(2, counter.getValue()); } public void test_java_object() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { // Testing URLClassLoader with a paths' array setPath(true); theory = "demo(C) :- \n" + "set_classpath([" + paths + "]), \n" + "java_object('Counter', [], Obj), \n" + "Obj <- inc, \n" + "Obj <- inc, \n" + "Obj <- getValue returns C."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); Number result2 = (Number) info.getVarValue("Value"); assertEquals(2, result2.intValue()); // Testing URLClassLoader with java.lang.String class theory = "demo_string(S) :- \n" + "java_object('java.lang.String', ['MyString'], Obj_str), \n" + "Obj_str <- toString returns S."; engine.setTheory(new Theory(theory)); info = engine.solve("demo_string(StringValue)."); assertEquals(true, info.isSuccess()); result = info.getVarValue("StringValue").toString().replace("'", ""); assertEquals("MyString", result); } public void test_java_object_2() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { setPath(true); theory = "demo_hierarchy(Gear) :- \n" + "set_classpath([" + paths + "]), \n" + "java_object('Bicycle', [3, 4, 5], MyBicycle), \n" + "java_object('MountainBike', [5, 6, 7, 8], MyMountainBike), \n" + "MyMountainBike <- getGear returns Gear."; engine.setTheory(new Theory(theory)); info = engine.solve("demo_hierarchy(Res)."); assertEquals(false, info.isHalted()); Number result2 = (Number) info.getVarValue("Res"); assertEquals(8, result2.intValue()); } public void test_invalid_path_java_object() throws PrologException, IOException, InvalidTheoryException, InvalidSolutionException { //Testing incorrect path setPath(false); theory = "demo(Res) :- \n" + "set_classpath([" + paths + "]), \n" + "java_object('Counter', [], Obj_inc), \n" + "Obj_inc <- inc, \n" + "Obj_inc <- inc, \n" + "Obj_inc <- getValue returns Res."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isHalted()); } public void test_java_call_3() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { //Testing java_call_3 using URLClassLoader setPath(true); theory = "demo(Value) :- set_classpath([" + paths + "]), class('TestStaticClass') <- echo('Message') returns Value."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(StringValue)."); assertEquals(true, info.isSuccess()); result = info.getVarValue("StringValue").toString().replace("'", ""); assertEquals("Message", result); //Testing get/set static Field setPath(true); theory = "demo_2(Value) :- set_classpath([" + paths + "]), class('TestStaticClass').'id' <- get(Value)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo_2(Res)."); assertEquals(true, info.isSuccess()); assertEquals(0, Integer.parseInt(info.getVarValue("Res").toString())); theory = "demo_2(Value, NewValue) :- set_classpath([" + paths + "]), class('TestStaticClass').'id' <- set(Value), \n" + "class('TestStaticClass').'id' <- get(NewValue)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo_2(5, Val)."); assertEquals(true, info.isSuccess()); assertEquals(5, Integer.parseInt(info.getVarValue("Val").toString())); } public void test_invalid_path_java_call_4() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { //Testing java_call_4 with invalid path setPath(false); theory = "demo(Value) :- set_classpath([" + paths + "]), class('TestStaticClass') <- echo('Message') returns Value."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(StringValue)."); assertEquals(true, info.isHalted()); } public void test_java_array() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { //Testing java_array_length using URLClassLoader setPath(true); theory = "demo(Size) :- set_classpath([" + paths + "]), java_object('Counter', [], MyCounter), \n" + "java_object('Counter[]', [10], ArrayCounters), \n" + "java_array_length(ArrayCounters, Size)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); Number resultInt = (Number) info.getVarValue("Value"); assertEquals(10, resultInt.intValue()); //Testing java_array_set and java_array_get setPath(true); theory = "demo(Res) :- set_classpath([" + paths + "]), java_object('Counter', [], MyCounter), \n" + "java_object('Counter[]', [10], ArrayCounters), \n" + "MyCounter <- inc, \n" + "java_array_set(ArrayCounters, 0, MyCounter), \n" + "java_array_get(ArrayCounters, 0, C), \n" + "C <- getValue returns Res."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); Number resultInt2 = (Number) info.getVarValue("Value"); assertEquals(1, resultInt2.intValue()); } public void test_set_classpath() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { //Testing java_array_length using URLClassLoader setPath(true); theory = "demo(Size) :- set_classpath([" + paths + "]), \n " + "java_object('Counter', [], MyCounter), \n" + "java_object('Counter[]', [10], ArrayCounters), \n" + "java_array_length(ArrayCounters, Size)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); Number resultInt = (Number) info.getVarValue("Value"); assertEquals(10, resultInt.intValue()); } public void test_get_classpath() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException, UnknownVarException { //Testing get_classpath using DynamicURLClassLoader with not URLs added theory = "demo(P) :- get_classpath(P)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); assertEquals(true, info.getTerm("Value").isList()); assertEquals("[]", info.getTerm("Value").toString()); //Testing get_classpath using DynamicURLClassLoader with not URLs added setPath(true); theory = "demo(P) :- set_classpath([" + paths + "]), get_classpath(P)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Value)."); assertEquals(true, info.isSuccess()); assertEquals(true, info.getTerm("Value").isList()); assertEquals("[" + paths + "]", info.getTerm("Value").toString()); // // Test if get_classpath(PathList) unifies with the DynamicURLClassLoader urls // theory = "demo(P) :- set_classpath([" + paths + "]), get_classpath([" + paths + "])."; // // engine.setTheory(new Theory(theory)); // info = engine.solve("demo(S)."); // assertEquals(true, info.isSuccess()); } public void test_register_1() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException, UnknownVarException { setPath(true); theory = "demo(Obj) :- \n" + "set_classpath([" + paths + "]), \n" + "java_object('Counter', [], Obj), \n" + "Obj <- inc, \n" + "Obj <- inc, \n" + "register(Obj)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(R)."); assertEquals(true, info.isSuccess()); theory = "demo2(Obj, Val) :- \n" + "Obj <- inc, \n" + "Obj <- getValue returns Val."; engine.addTheory(new Theory(theory)); String obj = info.getTerm("R").toString(); Solution info2 = engine.solve("demo2(" + obj + ", V)."); assertEquals(true, info2.isSuccess()); assertEquals(3, Integer.parseInt(info2.getVarValue("V").toString())); // Test invalid object_id registration theory = "demo(Obj1) :- register(Obj1)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Res)."); assertEquals(true, info.isHalted()); } public void test_unregister_1() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException, UnknownVarException, InvalidObjectIdException { // Test invalid object_id unregistration theory = "demo(Obj1) :- unregister(Obj1)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Res)."); assertEquals(true, info.isHalted()); setPath(true); theory = "demo(Obj) :- \n" + "set_classpath([" + paths + "]), \n" + "java_object('Counter', [], Obj), \n" + "Obj <- inc, \n" + "Obj <- inc, \n" + "register(Obj), unregister(Obj)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(Res)."); assertEquals(true, info.isSuccess()); OOLibrary lib = (OOLibrary) engine.getLibrary("com.szadowsz.gospel.core.lib.OOLibrary"); Struct id = (Struct) info.getTerm("Res"); Object obj = lib.getRegisteredObject(id); assertNull(obj); } public void test_java_catch() throws PrologException, IOException, InvalidSolutionException, InvalidTheoryException { setPath(true); theory = "goal :- set_classpath([" + paths + "]), java_object('TestStaticClass', [], Obj), Obj <- testMyException. \n" +"demo(StackTrace) :- java_catch(goal, [('java.lang.IllegalArgumentException'( \n" + "Cause, Msg, StackTrace),write(Msg))], \n" + "true)."; engine.setTheory(new Theory(theory)); info = engine.solve("demo(S)."); assertEquals(true, info.isSuccess()); } public void test_interface() throws PrologException, IOException, InvalidTheoryException, InvalidSolutionException { setPath(true); theory = "goal1 :- set_classpath([" + paths + "])," + "java_object('Pippo', [], Obj), class('Pluto') <- method(Obj)."; engine.setTheory(new Theory(theory)); info = engine.solve("goal1."); assertEquals(true, info.isSuccess()); theory = "goal2 :- set_classpath([" + paths + "])," + "java_object('Pippo', [], Obj), class('Pluto') <- method2(Obj)."; engine.setTheory(new Theory(theory)); info = engine.solve("goal2."); assertEquals(true, info.isSuccess()); theory = "goal3 :- java_object('Pippo', [], Obj), set_classpath([" + paths + "]), class('Pluto') <- method(Obj)."; engine.setTheory(new Theory(theory)); info = engine.solve("goal3."); assertEquals(true, info.isSuccess()); theory = "goal4 :- set_classpath([" + paths + "]), " + "java_object('IPippo[]', [5], Array), " + "java_object('Pippo', [], Obj), " + "java_array_set(Array, 0, Obj)," + "java_array_get(Array, 0, Obj2)," + "Obj2 <- met."; engine.setTheory(new Theory(theory)); info = engine.solve("goal4."); assertEquals(true, info.isSuccess()); theory = "goal5 :- set_classpath([" + paths + "])," + "java_object('Pippo', [], Obj)," + "class('Pluto') <- method(Obj as 'IPippo')."; engine.setTheory(new Theory(theory)); info = engine.solve("goal5."); assertEquals(true, info.isSuccess()); } /** * @param valid: used to change a valid/invalid array of paths */ private void setPath(boolean valid) throws IOException { File file = new File("."); // Array paths contains a valid path if(valid) { paths = "'" + file.getCanonicalPath() + "'," + "'" + file.getCanonicalPath() + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "TestURLClassLoader.jar'"; paths += "," + "'" + file.getCanonicalPath() + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "TestInterfaces.jar'"; } // Array paths does not contain a valid path else { paths = "'" + file.getCanonicalPath() + "'"; } } }
lgpl-3.0
Technius/Starbound-Mod-Toolkit
src/main/java/co/technius/starboundmodtoolkit/ModPane.java
1469
package co.technius.starboundmodtoolkit; import javafx.geometry.Insets; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.GridPane; import co.technius.starboundmodtoolkit.mod.AssetViewer; import co.technius.starboundmodtoolkit.mod.Mod; public class ModPane extends TabPane { Mod mod; ModsPane mods; Label assetC = new Label("Number of assets: Unknown"); AssetListPane assets; AssetViewer assetPane = new AssetViewer(); public ModPane(Mod mod, ModsPane mods) { this.mod = mod; this.mods = mods; setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE); GridPane grid = new GridPane(); Insets padding = new Insets(10); grid.setPadding(padding); GridPane.setConstraints(assetC, 0, 0, 2, 1); grid.getChildren().addAll(assetC); Tab main = new Tab("Mod Summary"); main.setContent(grid); BorderPane assetp = new BorderPane(); assetp.setPadding(padding); assets = new AssetListPane(this); assetp.setCenter(assetPane); assetp.setLeft(assets); Tab info = new Tab("Mod Info Editor"); AssetViewer av = new AssetViewer(); info.setContent(av); av.update(mod.getInfo()); Tab assetTab = new Tab("Assets"); assetTab.setContent(assetp); getTabs().addAll(main, info, assetTab); } public void updateAssets() { if(mod.updateAssets()) { assetC.setText("Total number of assets: " + mod.getAssetCount()); } } }
lgpl-3.0
HOMlab/QN-ACTR-Release
QN-ACTR Java/src/jmt/gui/common/panels/parametric/PopulationMixPanel.java
11109
/** * Copyright (C) 2006, Laboratorio di Valutazione delle Prestazioni - Politecnico di Milano * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package jmt.gui.common.panels.parametric; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.Vector; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSpinner; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.ScrollPaneConstants; import javax.swing.SpinnerNumberModel; import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import jmt.gui.common.definitions.ClassDefinition; import jmt.gui.common.definitions.SimulationDefinition; import jmt.gui.common.definitions.StationDefinition; import jmt.gui.common.definitions.parametric.ParametricAnalysis; import jmt.gui.common.definitions.parametric.PopulationMixParametricAnalysis; /** * <p>Title: PopulationMixPanel</p> * <p>Description: this is the panel for the parametric analysis where * the proportion between two closed classes is modified while global * number of jobs is kept constant.</p> * * @author Francesco D'Aquino * Date: 9-mar-2006 * Time: 16.18.40 */ public class PopulationMixPanel extends ParameterOptionPanel { /** * */ private static final long serialVersionUID = 1L; private JLabel fromLabel; private JSpinner from; private JLabel toLabel; private JSpinner to; private JLabel stepsLabel; private JSpinner steps; private JLabel classChooserLabel; private JComboBox classChooser; private JScrollPane scroll; private JTextArea description; private JScrollPane descrPane; private TitledBorder descriptionTitle; private PopulationMixParametricAnalysis PMPA; public PopulationMixPanel(PopulationMixParametricAnalysis pmpa, ClassDefinition classDef, StationDefinition stationDef, SimulationDefinition simDef) { super(); PMPA = pmpa; super.setOrientation(JSplitPane.HORIZONTAL_SPLIT); super.setDividerSize(3); DESCRIPTION = "This type of analysis is available for closed models with two classes only " + "(and possibly other open classes) and it applies only to the closed classes.\n\n" + "Repeat the simulation changing the proportion of jobs " + "between the two closed classes, keeping constant the total number of jobs.\n\n" + "The 'From' and 'To' values represent the initial and final values of " + "population mix (ßi = Ni / N) for the chosen class.\n\n" + "Since only integer values are allowed " + "the number of steps that can be practically executed may be very small."; sd = stationDef; cd = classDef; simd = simDef; initialize(); } public void initialize() { JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5)); fromLabel = new JLabel("Initial ß: "); from = new JSpinner(new SpinnerNumberModel(PMPA.getInitialValue(), 0.000, 1.000, 0.001)); from.setToolTipText("Sets the initial proportion of jobs"); toLabel = new JLabel("Final ß: "); to = new JSpinner(new SpinnerNumberModel(PMPA.getFinalValue(), 0.000, 1.000, 0.001)); to.setToolTipText("Sets the final proportion of jobs"); stepsLabel = new JLabel("Steps (n. of exec.): "); int maxSteps = PMPA.searchForAvaibleSteps(); if (maxSteps > ParametricAnalysis.MAX_STEP_NUMBER) { maxSteps = ParametricAnalysis.MAX_STEP_NUMBER; } steps = new JSpinner(new SpinnerNumberModel(PMPA.getNumberOfSteps(), 2, maxSteps, 1)); steps.setToolTipText("Sets the number of steps to be performed"); Vector classes = cd.getClosedClassKeys(); String[] classNames = new String[classes.size()]; for (int i = 0; i < classes.size(); i++) { classNames[i] = cd.getClassName(classes.get(i)); } classChooserLabel = new JLabel("Class: "); classChooser = new JComboBox(classNames); classChooser.setToolTipText("Sets the class the inserted values will refer to"); classChooser.setSelectedItem(cd.getClassName(PMPA.getReferenceClass())); edit.add(fromLabel); edit.add(from); edit.add(toLabel); edit.add(to); edit.add(stepsLabel); edit.add(steps); edit.add(classChooserLabel); edit.add(classChooser); edit.setPreferredSize(new Dimension(130, 88)); JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5)); editLables.add(fromLabel); editLables.add(toLabel); editLables.add(stepsLabel); editLables.add(classChooserLabel); editLables.setPreferredSize(new Dimension(100, 88)); JPanel editPanel = new JPanel(); editPanel.add(editLables); editPanel.add(edit); editPanel.setBorder(new EmptyBorder(15, 20, 0, 20)); JPanel cont = new JPanel(new BorderLayout()); cont.add(editPanel, BorderLayout.CENTER); scroll = new JScrollPane(cont); title = new TitledBorder("Type of population mix"); scroll.setBorder(title); description = new JTextArea(DESCRIPTION); description.setOpaque(false); description.setEditable(false); description.setLineWrap(true); description.setWrapStyleWord(true); descrPane = new JScrollPane(description); descriptionTitle = new TitledBorder(new EtchedBorder(), "Description"); descrPane.setBorder(descriptionTitle); descrPane.setMinimumSize(new Dimension(80, 0)); scroll.setMinimumSize(new Dimension(360, 0)); setLeftComponent(scroll); setRightComponent(descrPane); setListeners(); this.setBorder(new EmptyBorder(5, 0, 5, 0)); } @Override public void setEnabled(boolean enabled) { fromLabel.setEnabled(enabled); from.setEnabled(enabled); toLabel.setEnabled(enabled); to.setEnabled(enabled); stepsLabel.setEnabled(enabled); steps.setEnabled(enabled); classChooserLabel.setEnabled(enabled); classChooser.setEnabled(enabled); description.setEnabled(enabled); if (!enabled) { scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); } else { scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); descrPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); } if (!enabled) { title.setTitleColor(Color.LIGHT_GRAY); descriptionTitle.setTitleColor(Color.LIGHT_GRAY); } else { title.setTitleColor(DEFAULT_TITLE_COLOR); descriptionTitle.setTitleColor(DEFAULT_TITLE_COLOR); } } private void setListeners() { from.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (from.getValue() instanceof Double) { Double fValue = (Double) from.getValue(); Double tValue = (Double) to.getValue(); SpinnerNumberModel snm = (SpinnerNumberModel) steps.getModel(); double oldValue = PMPA.getInitialValue(); PMPA.setInitialValue(fValue.doubleValue()); int newMaxSteps = PMPA.searchForAvaibleSteps(); if (newMaxSteps > ParametricAnalysis.MAX_STEP_NUMBER) { newMaxSteps = ParametricAnalysis.MAX_STEP_NUMBER; } if ((fValue.doubleValue() != tValue.doubleValue()) && (newMaxSteps >= ((Integer) snm.getMinimum()).intValue())) { int oldSteps = ((Integer) snm.getValue()).intValue(); snm.setMaximum(new Integer(newMaxSteps)); if (newMaxSteps < oldSteps) { PMPA.setNumberOfSteps(newMaxSteps); steps.setValue(new Integer(newMaxSteps)); } } else { PMPA.setInitialValue(oldValue); } } from.setValue(new Double(PMPA.getInitialValue())); } }); to.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (to.getValue() instanceof Double) { Double fValue = (Double) from.getValue(); Double tValue = (Double) to.getValue(); SpinnerNumberModel snm = (SpinnerNumberModel) steps.getModel(); double oldValue = PMPA.getFinalValue(); PMPA.setFinalValue(tValue.doubleValue()); int newMaxSteps = PMPA.searchForAvaibleSteps(); if (newMaxSteps > ParametricAnalysis.MAX_STEP_NUMBER) { newMaxSteps = ParametricAnalysis.MAX_STEP_NUMBER; } if ((fValue.doubleValue() != tValue.doubleValue()) && (newMaxSteps >= ((Integer) snm.getMinimum()).intValue())) { int oldSteps = ((Integer) snm.getValue()).intValue(); snm.setMaximum(new Integer(newMaxSteps)); if (newMaxSteps < oldSteps) { PMPA.setNumberOfSteps(newMaxSteps); steps.setValue(new Integer(newMaxSteps)); } } else { PMPA.setFinalValue(oldValue); } } to.setValue(new Double(PMPA.getFinalValue())); } }); steps.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (steps.getValue() instanceof Integer) { int sValue = ((Integer) steps.getValue()).intValue(); int sMax = ((Integer) ((SpinnerNumberModel) steps.getModel()).getMaximum()).intValue(); int sMin = ((Integer) ((SpinnerNumberModel) steps.getModel()).getMinimum()).intValue(); if ((sValue >= sMin) && (sValue <= sMax)) { PMPA.setNumberOfSteps(sValue); } } steps.setValue(new Integer(PMPA.getNumberOfSteps())); } }); classChooser.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { String className = (String) classChooser.getSelectedItem(); Object classKey = null; Vector classes = cd.getClassKeys(); //for cycle used to get the key of the selected class for (int i = 0; i < classes.size(); i++) { if (cd.getClassName(classes.get(i)).equals(className)) { classKey = classes.get(i); break; } } PMPA.setReferenceClass(classKey); PMPA.setDefaultInitialValue(); from.setValue(new Double(PMPA.getInitialValue())); //SpinnerNumberModel snm = (SpinnerNumberModel) steps.getModel(); //int oldMax = ((Integer)snm.getMaximum()).intValue(); //int currentSteps = ((Integer)snm.getValue()).intValue(); //int newMaximumSteps = PMPA.searchForAvaibleSteps(); //if (newMaximumSteps > ParametricAnalysis.MAX_STEP_NUMBER) newMaximumSteps = ParametricAnalysis.MAX_STEP_NUMBER; //if (newMaximumSteps < oldMax) steps.setModel(new SpinnerNumberModel(newMaximumSteps,2,newMaximumSteps,0.001)); //else steps.setModel(new SpinnerNumberModel(currentSteps,2,newMaximumSteps,0.001)); } }); } }
lgpl-3.0
jmecosta/sonar
sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java
2078
/* * Sonar, open source software quality management tool. * Copyright (C) 2008-2012 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * Sonar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with Sonar; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.wsclient.services; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; import org.junit.Test; public class SourceQueryTest extends QueryTestCase { @Test public void create() { assertThat(SourceQuery.create("myproject:org.foo.Bar").getUrl(), is("/api/sources?resource=myproject%3Aorg.foo.Bar&")); assertThat(SourceQuery.create("myproject:org.foo.Bar").getModelClass().getName(), is(Source.class.getName())); } @Test public void createWithHighlightedSyntax() { assertThat(SourceQuery.createWithHighlightedSyntax("myproject:org.foo.Bar").getUrl(), is("/api/sources?resource=myproject%3Aorg.foo.Bar&color=true&")); assertThat(SourceQuery.createWithHighlightedSyntax("myproject:org.foo.Bar").getModelClass().getName(), is(Source.class.getName())); } @Test public void getOnlyAFewLines() { assertThat(SourceQuery.create("myproject:org.foo.Bar").setFromLineToLine(10, 30).getUrl(), is("/api/sources?resource=myproject%3Aorg.foo.Bar&from=10&to=30&")); assertThat(SourceQuery.create("myproject:org.foo.Bar").setLinesFromLine(10, 20).getUrl(), is("/api/sources?resource=myproject%3Aorg.foo.Bar&from=10&to=30&")); } }
lgpl-3.0
DANCEcollaborative/bazaar
Genesis-Plugins/tests/plugins/fileParsing/CSVParserTest.java
1896
package plugins.fileParsing; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.IOException; import java.nio.charset.Charset; import java.util.HashSet; import org.junit.Before; import org.junit.Test; import plugins.input.CSVParser; import edu.cmu.side.model.data.DocumentList; public class CSVParserTest{ CSVParser parser; HashSet<String> files; @Before public void setUp(){ parser = new CSVParser(); files = new HashSet<String>(); } @Test public void testCanHandleTrue(){ String correctFileType = "correct.csv"; assertTrue(parser.canHandle(correctFileType)); } @Test public void testCanHandleFalseIncorrectSuffix(){ String incorrectFileType = "incorrect.rb"; assertFalse(parser.canHandle(incorrectFileType)); } @Test public void testCanHandleFalseNoSuffix(){ String incorrectNoSuffix = "incorrect"; assertFalse(parser.canHandle(incorrectNoSuffix)); } @Test public void testParseDocumentEmptyList(){ DocumentList parsed; try { parsed = parser.parseDocumentList(files, Charset.forName("UTF-8")); assertEquals(parsed.getSize(), 0); } catch (IOException e) { fail(); e.printStackTrace(); } } @Test public void testParseDocumentSingleFile(){ files.add("../lightside/testData/Gallup.csv"); try{ DocumentList parsed = parser.parseDocumentList(files, Charset.forName("UTF-8")); assertEquals(parsed.getSize(), 942); } catch(IOException e){ fail(); e.printStackTrace(); } } @Test public void testParseDocumentNullList(){ try{ DocumentList parsed = parser.parseDocumentList(null, Charset.forName("UTF-8")); assertEquals(parsed.getSize(),0); } catch(IOException e){ fail(); e.printStackTrace(); } } }
lgpl-3.0
sarndt/AbusingSwing
src/main/java/net/abusingjava/swing/magix/XListController.java
72
package net.abusingjava.swing.magix; public class XListController { }
lgpl-3.0
anndy201/mars-framework
manager/src/main/java/com/sqsoft/mars/inc/hateoas/PatientinfoResource.java
559
/** * */ package com.sqsoft.mars.inc.hateoas; import org.springframework.hateoas.ResourceSupport; import com.sqsoft.mars.his.domain.PatientinfoView; /** * @author lenovo * */ public class PatientinfoResource extends ResourceSupport { /** * */ private final PatientinfoView patientinfo; /** * * @param patientinfo */ public PatientinfoResource(PatientinfoView patientinfo) { super(); this.patientinfo = patientinfo; } /** * @return the patientinfo */ public PatientinfoView getPatientinfo() { return patientinfo; } }
lgpl-3.0
pmarches/jStellarAPI
src/main/java/jstellarapi/ds/account/tx/AccountTx.java
1365
package jstellarapi.ds.account.tx; import javax.annotation.Generated; import javax.validation.Valid; import com.google.gson.annotations.Expose; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @Generated("org.jsonschema2pojo") public class AccountTx { @Expose @Valid private Result result; /** * * @return * The result */ public Result getResult() { return result; } /** * * @param result * The result */ public void setResult(Result result) { this.result = result; } public AccountTx withResult(Result result) { this.result = result; return this; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } @Override public int hashCode() { return new HashCodeBuilder().append(result).toHashCode(); } @Override public boolean equals(Object other) { if (other == this) { return true; } if ((other instanceof AccountTx) == false) { return false; } AccountTx rhs = ((AccountTx) other); return new EqualsBuilder().append(result, rhs.result).isEquals(); } }
lgpl-3.0
kbss-cvut/jopa
jopa-api/src/main/java/cz/cvut/kbss/jopa/model/annotations/OWLObjectProperty.java
1787
/** * Copyright (C) 2022 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package cz.cvut.kbss.jopa.model.annotations; import java.lang.annotation.*; /** * Marks an attribute mapped to an OWL object property. * * The Java type of such attributes is either another entity or a valid identifier type. * * Note that for use with RDF(S), attributes annotated with this annotation are expected to reference other RDF resources. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface OWLObjectProperty { /** * IRI of the object property * * @return IRI of the object property */ String iri(); /** * (Optional) The operations that must be cascaded to the target of the association. * <p> * By default no operations are cascaded. * * @return Cascading setting for the annotated attribute */ CascadeType[] cascade() default {}; /** * (Optional) Whether the association should be lazily loaded or must be eagerly fetched. * * @return Whether this property is read only */ FetchType fetch() default FetchType.LAZY; }
lgpl-3.0
hongliangpan/manydesigns.cn
trunk/portofino-database/src/main/java/com/manydesigns/portofino/actions/forms/ConnectionProviderTableForm.java
1986
/* * Copyright (C) 2005-2013 ManyDesigns srl. All rights reserved. * http://www.manydesigns.com/ * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.manydesigns.portofino.actions.forms; import com.manydesigns.elements.annotations.Status; import com.manydesigns.portofino.model.database.ConnectionProvider; /** * @author Paolo Predonzani - paolo.predonzani@manydesigns.com * @author Angelo Lupo - angelo.lupo@manydesigns.com * @author Giampiero Granatella - giampiero.granatella@manydesigns.com * @author Alessio Stalla - alessio.stalla@manydesigns.com */ public class ConnectionProviderTableForm { public static final String copyright = "Copyright (c) 2005-2013, ManyDesigns srl"; public String databaseName; @Status(red={ConnectionProvider.STATUS_ERROR}, amber={ConnectionProvider.STATUS_DISCONNECTED}, green={ConnectionProvider.STATUS_CONNECTED}) public String status; public String description; public ConnectionProviderTableForm() {} public ConnectionProviderTableForm(String databaseName, String description, String status) { this.databaseName = databaseName; this.status = status; this.description = description; } }
lgpl-3.0
biotextmining/processes
src/main/java/com/silicolife/textmining/processes/ie/ner/linnaeus/adapt/uk/ac/man/entitytagger/generate/GenerateAutomatons.java
12026
package com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.uk.ac.man.entitytagger.generate; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.sql.PreparedStatement; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.logging.Logger; import java.util.regex.Pattern; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.dk.brics.automaton.Automaton; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.dk.brics.automaton.BasicOperations; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.dk.brics.automaton.CustomRunAutomaton; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.dk.brics.automaton.RegExp; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.martin.common.Tuple; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.martin.common.compthreads.ArrayBasedMaster; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.martin.common.compthreads.IteratorBasedMaster; import com.silicolife.textmining.processes.ie.ner.linnaeus.adapt.martin.common.compthreads.Problem; /** * Class providing functions used to generate automatons for efficient regular expression matching * @author Martin * */ class GenerateAutomatons { /** * Class used to join several automatons together and minimize the result (put into a class to enable concurrent computations) * @author Martin * */ private class ProcessProblem implements Problem<Automaton>{ private ArrayList<Automaton> automatons; private boolean minimize; public ProcessProblem(ArrayList<Automaton> automatons, boolean minimize){ this.automatons = automatons; this.minimize = minimize; } public Automaton compute() { Automaton res; if (automatons.size() > 1){ res = BasicOperations.union(automatons); res.setDeterministic(false); } else { res = automatons.get(0); } res.determinize(); if (minimize) res.minimize(); return res; } } private class ToAutomatonProblem implements Problem<Automaton>{ private DictionaryEntry entry; private boolean lowercase; public ToAutomatonProblem(DictionaryEntry entry, boolean lowercase){ this.entry = entry; this.lowercase = lowercase; } public Automaton compute() { //System.out.println("(" + entry.getRegexp() + ")" + AutomatonMatcher.delimiter + species); String sr = "(" + entry.getRegexp() + ")"; if (lowercase) sr = sr.toLowerCase(); if (sr.contains(""+CustomRunAutomaton.delimiter)) throw new IllegalStateException("The regular expression " + sr + " contains the CustomRunAutomaton.delimiter character. You need to change character."); RegExp r = null; try{ r = new RegExp(sr + CustomRunAutomaton.delimiter + entry.getId()); } catch (Exception e){ System.err.println("Detected exception when creating regular expression: '" + sr + CustomRunAutomaton.delimiter + entry.getId() + "'"); System.err.println(e); e.printStackTrace(); System.exit(-1); } Automaton a = r.toAutomaton(); String shortest = a.getShortestExample(true); if (shortest == null || shortest.equals(CustomRunAutomaton.delimiter + entry.getId())){ System.err.println("Warning: detected erroneous regexp for id " + entry.getId() + ", returning null automaton (regexp: '" + sr + "'"); return null; } a.setDeterministic(false); a.determinize(); return a; } } private class ToAutomatonProblemIterator implements Iterator<Problem<Automaton>>{ private ArrayList<DictionaryEntry> dictionaryEntries; int currentItem = 0; private boolean lowercase; public ToAutomatonProblemIterator(ArrayList<DictionaryEntry> dictionaryEntries, boolean lowercase){ this.dictionaryEntries = dictionaryEntries; this.lowercase = lowercase; } public boolean hasNext() { return currentItem < dictionaryEntries.size(); } public ToAutomatonProblem next() { return new ToAutomatonProblem(dictionaryEntries.get(currentItem++),lowercase); } /** * not implemented */ public void remove() { throw new IllegalStateException("not implemented"); } } /** * Function which will take a list of automatons and join them together in groups of size multiJoin (e.g. input 12 automatons and multiJoin=3 would give output of 4 automatons) * @param automatons the list of automatons to be joined together * @param multiJoin the number of automatons that should be joined at a time * @param minimize whether to perform automaton minimization afterwards (will produce smaller automatons requiring less memory, but requires more time to perform) * @param showNumStates whether to print some statistics at the end * @param numThreads the number of concurrent joins to perform (note that multiple threads will increase memory requirements) * @param logger * @return a list of joined automatons of size (automatons.size() / multiJoin). */ ArrayList<Automaton> process(ArrayList<Automaton> automatons, int multiJoin, boolean minimize, boolean showNumStates, int numThreads, Logger logger){ ArrayList<Automaton> res = new ArrayList<Automaton>(); int numRuns = automatons.size() / multiJoin; int numStartStates=0,numEndStates=0; if (numRuns * multiJoin < automatons.size()) numRuns++; Problem<Automaton> problems[] = new ProcessProblem[numRuns]; for (int i = 0; i < numRuns; i++){ ArrayList<Automaton> temp = new ArrayList<Automaton>(); for (int j = 0; j < multiJoin; j++){ int index = i * multiJoin + j; if (index < automatons.size()){ temp.add(automatons.get(index)); if (showNumStates) numStartStates += automatons.get(index).getNumberOfStates(); } } problems[i] = new ProcessProblem(temp,minimize); } ArrayBasedMaster<Automaton> master = new ArrayBasedMaster<Automaton>(problems, numThreads); logger.info("%t: Processing automatons... "); new Thread(master).start(); Object[] solutions = master.getSolutions(); for (int i = 0; i < solutions.length; i++){ Automaton a = (Automaton) solutions[i]; numEndStates += a.getNumberOfStates(); res.add(a); } logger.info("done. " + automatons.size() + " automatons (" + numStartStates + " states) -> " + res.size() + " (" + numEndStates + " states)\n"); return res; } static CustomRunAutomaton[] loadRArray(File file, Logger logger){ CustomRunAutomaton[] r = null; try { ObjectInputStream inStream = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file))); int size = inStream.readInt(); logger.info("%t: Loading runautomatons..."); r = new CustomRunAutomaton[size]; for (int i = 0; i < r.length; i++) r[i] = (CustomRunAutomaton) inStream.readObject(); logger.info(" done, loaded " + size + " automatons from file " + file.getAbsolutePath() + ".\n"); inStream.close(); } catch (Exception e){ System.err.println(e); e.printStackTrace(); System.exit(-1); } return r; } static void storeRArray(ArrayList<Automaton> list, boolean ignoreCase, boolean tableize, File file, Logger logger){ CustomRunAutomaton[] r = new CustomRunAutomaton[list.size()]; logger.info("%t: Converting automatons to runautomatons (tableize = " + tableize + ")..."); for (int i = 0; i < list.size(); i++) r[i] = new CustomRunAutomaton(list.get(i),tableize); logger.info(" done.\n"); try { logger.info("%t: Storing runautomatons..."); ObjectOutputStream outStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file))); outStream.writeInt(list.size()); outStream.writeBoolean(ignoreCase); for (int i = 0; i < r.length; i++) outStream.writeObject(r[i]); outStream.close(); logger.info(" done. Stored " + r.length + " runautomatons to file " + file.getAbsolutePath() + "\n"); } catch (Exception e){ System.err.println(e); e.printStackTrace(); System.exit(-1); } } /** * converts a list of dictionary entries to their corresponding automatons * @param dictionaryEntries the list of dictionary entries * @param numThreads the number of concurrent threads to use for conversion * @param report null if the function should not output progress, will otherwise print progress after every report:th conversion) * @param b * @param logger * @return the list of automatons representing the list of dictionary entries */ ArrayList<Automaton> toAutomatons(ArrayList<DictionaryEntry> dictionaryEntries, int numThreads, Integer report, boolean ignoreCase, Logger logger){ logger.info("%t: Generating automatons, ignoreCase = " + ignoreCase + "...\n"); Iterator<Problem<Automaton>> problems = new ToAutomatonProblemIterator(dictionaryEntries,ignoreCase); IteratorBasedMaster<Automaton> master = new IteratorBasedMaster<Automaton>(problems, numThreads); new Thread(master).start(); int i = 0; ArrayList<Automaton> res = new ArrayList<Automaton>(); while (master.hasNext()){ Automaton a = master.next(); if (a != null) res.add(a); if (report != null && ++i % report == 0) logger.info(i + " / " + dictionaryEntries.size() + "\n"); } logger.info("%t: Automatons complete.\n"); return res; } static Tuple<ArrayList<Automaton>, Boolean> loadArray(File file) { ArrayList<Automaton> l = new ArrayList<Automaton>(); boolean ignoreCase = false; try { ObjectInputStream inStream = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file))); int size = inStream.readInt(); ignoreCase = inStream.readBoolean(); for (int i = 0; i < size; i++) l.add((Automaton)inStream.readObject()); inStream.close(); } catch (Exception e){ System.err.println(e); e.printStackTrace(); System.exit(-1); } return new Tuple<ArrayList<Automaton>, Boolean>(l, ignoreCase); } static void storeArray(File file, ArrayList<Automaton> l, boolean ignoreCase) { try { ObjectOutputStream outStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file))); outStream.writeInt(l.size()); outStream.writeBoolean(ignoreCase); for (int i = 0; i < l.size(); i++){ outStream.writeObject(l.get(i)); } outStream.close(); } catch (Exception e){ System.err.println(e); e.printStackTrace(); System.exit(-1); } } public static void storeVariants(File file, PreparedStatement pstmt, List<Automaton> automatons, Logger logger, int report) { try{ BufferedWriter outStream = file != null ? new BufferedWriter(new FileWriter(file)) : null; Pattern splitter = Pattern.compile(""+CustomRunAutomaton.delimiter); int c = 0; logger.info("%t: Starting automaton conversion.\n"); for (Automaton a : automatons){ Set<String> variants = a.getFiniteStrings(); if (variants == null) throw new IllegalStateException("Non-finite automaton detected - this cannot be converted"); if (variants.size() == 0) System.err.println("0"); for (String v : variants){ String[] parts = splitter.split(v); if (parts.length != 2) throw new IllegalStateException("parts.length == " + parts.length); if (outStream != null) outStream.write(parts[1] + "\t" + parts[0] + "\n"); if (pstmt != null){ pstmt.setString(1, parts[1]); pstmt.setString(2, parts[0]); pstmt.setNull(3, java.sql.Types.NULL); pstmt.addBatch(); } } if (pstmt != null) pstmt.executeBatch(); if (report != -1 && ++c % report == 0) logger.info("%t: Converted " + c + " automatons to variants.\n"); } if (outStream != null) outStream.close(); logger.info("%t: Completed.\n"); } catch (Exception e){ System.err.println(e); e.printStackTrace(); System.exit(-1); } } }
lgpl-3.0
Mindtoeye/Hoop
src/edu/cmu/cs/in/search/HoopPositionEntry.java
2361
/** * Author: Martin van Velsen <vvelsen@cs.cmu.edu> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package edu.cmu.cs.in.search; import java.util.ArrayList; import java.util.Random; //import edu.cmu.cs.in.base.HoopBase; public class HoopPositionEntry /*extends HoopBase*/ implements Comparable { private long docID=-1; private long tf=1; private long docLen=1; private float evaluation=(float) 0.0; private ArrayList<Long> posList=null; /** * */ public HoopPositionEntry () { //setClassName ("HoopPositionEntry"); //debug ("HoopPositionEntry ()"); posList=new ArrayList<Long> (); Random testScoreGenerator = new Random(); setEvaluation((float) (testScoreGenerator.nextFloat()-0.010441)); } /** * */ public void setDocID(long docID) { this.docID = docID; } /** * */ public long getDocID() { return docID; } /** * */ public void setTf(long tf) { this.tf = tf; } /** * */ public long getTf() { return tf; } /** * */ public void setDocLen(long docLen) { this.docLen = docLen; } /** * */ public long getDocLen() { return docLen; } /** * */ public void setPosList(ArrayList<Long> posList) { this.posList = posList; } /** * */ public ArrayList<Long> getPosList() { return posList; } /** * */ public float getEvaluation() { return evaluation; } /** * */ public void setEvaluation(float evaluation) { this.evaluation = evaluation; } /** * */ @Override public int compareTo(Object obj) { //System.out.println ("compareTo ()"); HoopPositionEntry target=(HoopPositionEntry) obj; if (target.evaluation>this.evaluation) return (1); return 0; } }
lgpl-3.0
ideaconsult/i5
iuclid_5_5-io/src/main/java/eu/europa/echa/schemas/iuclid5/_20130101/studyrecord/EN_HENRY_LAW_SECTION/EndpointStudyRecord.java
675693
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.01.13 at 07:13:27 PM EET // package eu.europa.echa.schemas.iuclid5._20130101.studyrecord.EN_HENRY_LAW_SECTION; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="modificationHistory"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="modification" maxOccurs="unbounded"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="comment" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="modificationBy" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="date" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ownershipProtection"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="fractionalDocument" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="sealed" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="copyProtection" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="name" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType"/> * &lt;element name="ownerRef" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="description" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="notes" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="lastModificationDate" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;attribute name="type" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentTypeType" /> * &lt;attribute name="uniqueKey" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentReferencePKType" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="origin" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="description" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="notes" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="endpointKind" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="lastModificationDate" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;attribute name="type" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentTypeType" /> * &lt;attribute name="uniqueKey" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentReferencePKType" /> * &lt;attribute name="targetType" type="{http://www.w3.org/2001/XMLSchema}long" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="dataProtection" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="confidentiality" minOccurs="0"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N64" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;element name="justification" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;element name="regulatoryPurposes" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence maxOccurs="unbounded" minOccurs="0"> * &lt;element name="regulatoryPurpose"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N78" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="purposeFlag" minOccurs="0"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Y14-3" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;element name="dataWaiving" minOccurs="0"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z02" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;element name="dataWaivingJustification" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;element name="studyResultType" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z05" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="studyPeriod" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="reliability" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A36" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="rationalReliability" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;element name="scientificPart"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="EN_HENRY_LAW"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;all> * &lt;element name="GEN_DATA_SOURCE_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REFERENCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_REFERENCE_TYPE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_AUTHOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TITLE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_SOURCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TESTLAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_DATE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_ACCESS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_PROT_CLAIM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_SAMESTUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_MAT_ME_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="5" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_DEVIATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_NOGUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GLP_COMPLIANCE_STATEMENT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_SEL_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="TESTMAT_INDICATOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_IDENTIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_CONFIDENTIAL_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_ME_TC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_RESULTS_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="HENRYSLAW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRECISION_LOQUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="VALUEUNIT_PRESSURE_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_RS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_OVERALL_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REM_ANYOTHER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD_STUDYREPORT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PG_ILLUSTRATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_APPL_SUM_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="APPL_CL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="APPL_EXEC_SUM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_OTHER_STUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/all> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;attribute name="version" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;attribute name="documentReferencePK" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentReferencePKType" /> * &lt;attribute name="robustStudy" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="usedForClassification" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="usedForMSDS" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "modificationHistory", "ownershipProtection", "name", "ownerRef", "origin", "dataProtection", "purposeFlag", "dataWaiving", "dataWaivingJustification", "studyResultType", "studyPeriod", "reliability", "rationalReliability", "scientificPart" }) @XmlRootElement(name = "EndpointStudyRecord") public class EndpointStudyRecord { @XmlElement(required = true) protected EndpointStudyRecord.ModificationHistory modificationHistory; @XmlElement(required = true) protected EndpointStudyRecord.OwnershipProtection ownershipProtection; @XmlElement(required = true) protected String name; protected EndpointStudyRecord.OwnerRef ownerRef; protected EndpointStudyRecord.Origin origin; protected EndpointStudyRecord.DataProtection dataProtection; protected EndpointStudyRecord.PurposeFlag purposeFlag; protected EndpointStudyRecord.DataWaiving dataWaiving; protected String dataWaivingJustification; protected EndpointStudyRecord.StudyResultType studyResultType; protected String studyPeriod; protected EndpointStudyRecord.Reliability reliability; protected String rationalReliability; @XmlElement(required = true) protected EndpointStudyRecord.ScientificPart scientificPart; @XmlAttribute(required = true) protected String version; @XmlAttribute(required = true) protected String documentReferencePK; @XmlAttribute protected Boolean robustStudy; @XmlAttribute protected Boolean usedForClassification; @XmlAttribute protected Boolean usedForMSDS; /** * Gets the value of the modificationHistory property. * * @return * possible object is * {@link EndpointStudyRecord.ModificationHistory } * */ public EndpointStudyRecord.ModificationHistory getModificationHistory() { return modificationHistory; } /** * Sets the value of the modificationHistory property. * * @param value * allowed object is * {@link EndpointStudyRecord.ModificationHistory } * */ public void setModificationHistory(EndpointStudyRecord.ModificationHistory value) { this.modificationHistory = value; } /** * Gets the value of the ownershipProtection property. * * @return * possible object is * {@link EndpointStudyRecord.OwnershipProtection } * */ public EndpointStudyRecord.OwnershipProtection getOwnershipProtection() { return ownershipProtection; } /** * Sets the value of the ownershipProtection property. * * @param value * allowed object is * {@link EndpointStudyRecord.OwnershipProtection } * */ public void setOwnershipProtection(EndpointStudyRecord.OwnershipProtection value) { this.ownershipProtection = value; } /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the ownerRef property. * * @return * possible object is * {@link EndpointStudyRecord.OwnerRef } * */ public EndpointStudyRecord.OwnerRef getOwnerRef() { return ownerRef; } /** * Sets the value of the ownerRef property. * * @param value * allowed object is * {@link EndpointStudyRecord.OwnerRef } * */ public void setOwnerRef(EndpointStudyRecord.OwnerRef value) { this.ownerRef = value; } /** * Gets the value of the origin property. * * @return * possible object is * {@link EndpointStudyRecord.Origin } * */ public EndpointStudyRecord.Origin getOrigin() { return origin; } /** * Sets the value of the origin property. * * @param value * allowed object is * {@link EndpointStudyRecord.Origin } * */ public void setOrigin(EndpointStudyRecord.Origin value) { this.origin = value; } /** * Gets the value of the dataProtection property. * * @return * possible object is * {@link EndpointStudyRecord.DataProtection } * */ public EndpointStudyRecord.DataProtection getDataProtection() { return dataProtection; } /** * Sets the value of the dataProtection property. * * @param value * allowed object is * {@link EndpointStudyRecord.DataProtection } * */ public void setDataProtection(EndpointStudyRecord.DataProtection value) { this.dataProtection = value; } /** * Gets the value of the purposeFlag property. * * @return * possible object is * {@link EndpointStudyRecord.PurposeFlag } * */ public EndpointStudyRecord.PurposeFlag getPurposeFlag() { return purposeFlag; } /** * Sets the value of the purposeFlag property. * * @param value * allowed object is * {@link EndpointStudyRecord.PurposeFlag } * */ public void setPurposeFlag(EndpointStudyRecord.PurposeFlag value) { this.purposeFlag = value; } /** * Gets the value of the dataWaiving property. * * @return * possible object is * {@link EndpointStudyRecord.DataWaiving } * */ public EndpointStudyRecord.DataWaiving getDataWaiving() { return dataWaiving; } /** * Sets the value of the dataWaiving property. * * @param value * allowed object is * {@link EndpointStudyRecord.DataWaiving } * */ public void setDataWaiving(EndpointStudyRecord.DataWaiving value) { this.dataWaiving = value; } /** * Gets the value of the dataWaivingJustification property. * * @return * possible object is * {@link String } * */ public String getDataWaivingJustification() { return dataWaivingJustification; } /** * Sets the value of the dataWaivingJustification property. * * @param value * allowed object is * {@link String } * */ public void setDataWaivingJustification(String value) { this.dataWaivingJustification = value; } /** * Gets the value of the studyResultType property. * * @return * possible object is * {@link EndpointStudyRecord.StudyResultType } * */ public EndpointStudyRecord.StudyResultType getStudyResultType() { return studyResultType; } /** * Sets the value of the studyResultType property. * * @param value * allowed object is * {@link EndpointStudyRecord.StudyResultType } * */ public void setStudyResultType(EndpointStudyRecord.StudyResultType value) { this.studyResultType = value; } /** * Gets the value of the studyPeriod property. * * @return * possible object is * {@link String } * */ public String getStudyPeriod() { return studyPeriod; } /** * Sets the value of the studyPeriod property. * * @param value * allowed object is * {@link String } * */ public void setStudyPeriod(String value) { this.studyPeriod = value; } /** * Gets the value of the reliability property. * * @return * possible object is * {@link EndpointStudyRecord.Reliability } * */ public EndpointStudyRecord.Reliability getReliability() { return reliability; } /** * Sets the value of the reliability property. * * @param value * allowed object is * {@link EndpointStudyRecord.Reliability } * */ public void setReliability(EndpointStudyRecord.Reliability value) { this.reliability = value; } /** * Gets the value of the rationalReliability property. * * @return * possible object is * {@link String } * */ public String getRationalReliability() { return rationalReliability; } /** * Sets the value of the rationalReliability property. * * @param value * allowed object is * {@link String } * */ public void setRationalReliability(String value) { this.rationalReliability = value; } /** * Gets the value of the scientificPart property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart } * */ public EndpointStudyRecord.ScientificPart getScientificPart() { return scientificPart; } /** * Sets the value of the scientificPart property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart } * */ public void setScientificPart(EndpointStudyRecord.ScientificPart value) { this.scientificPart = value; } /** * Gets the value of the version property. * * @return * possible object is * {@link String } * */ public String getVersion() { return version; } /** * Sets the value of the version property. * * @param value * allowed object is * {@link String } * */ public void setVersion(String value) { this.version = value; } /** * Gets the value of the documentReferencePK property. * * @return * possible object is * {@link String } * */ public String getDocumentReferencePK() { return documentReferencePK; } /** * Sets the value of the documentReferencePK property. * * @param value * allowed object is * {@link String } * */ public void setDocumentReferencePK(String value) { this.documentReferencePK = value; } /** * Gets the value of the robustStudy property. * * @return * possible object is * {@link Boolean } * */ public Boolean isRobustStudy() { return robustStudy; } /** * Sets the value of the robustStudy property. * * @param value * allowed object is * {@link Boolean } * */ public void setRobustStudy(Boolean value) { this.robustStudy = value; } /** * Gets the value of the usedForClassification property. * * @return * possible object is * {@link Boolean } * */ public Boolean isUsedForClassification() { return usedForClassification; } /** * Sets the value of the usedForClassification property. * * @param value * allowed object is * {@link Boolean } * */ public void setUsedForClassification(Boolean value) { this.usedForClassification = value; } /** * Gets the value of the usedForMSDS property. * * @return * possible object is * {@link Boolean } * */ public Boolean isUsedForMSDS() { return usedForMSDS; } /** * Sets the value of the usedForMSDS property. * * @param value * allowed object is * {@link Boolean } * */ public void setUsedForMSDS(Boolean value) { this.usedForMSDS = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="confidentiality" minOccurs="0"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N64" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;element name="justification" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;element name="regulatoryPurposes" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence maxOccurs="unbounded" minOccurs="0"> * &lt;element name="regulatoryPurpose"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N78" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "confidentiality", "justification", "regulatoryPurposes" }) public static class DataProtection { protected EndpointStudyRecord.DataProtection.Confidentiality confidentiality; protected String justification; protected EndpointStudyRecord.DataProtection.RegulatoryPurposes regulatoryPurposes; /** * Gets the value of the confidentiality property. * * @return * possible object is * {@link EndpointStudyRecord.DataProtection.Confidentiality } * */ public EndpointStudyRecord.DataProtection.Confidentiality getConfidentiality() { return confidentiality; } /** * Sets the value of the confidentiality property. * * @param value * allowed object is * {@link EndpointStudyRecord.DataProtection.Confidentiality } * */ public void setConfidentiality(EndpointStudyRecord.DataProtection.Confidentiality value) { this.confidentiality = value; } /** * Gets the value of the justification property. * * @return * possible object is * {@link String } * */ public String getJustification() { return justification; } /** * Sets the value of the justification property. * * @param value * allowed object is * {@link String } * */ public void setJustification(String value) { this.justification = value; } /** * Gets the value of the regulatoryPurposes property. * * @return * possible object is * {@link EndpointStudyRecord.DataProtection.RegulatoryPurposes } * */ public EndpointStudyRecord.DataProtection.RegulatoryPurposes getRegulatoryPurposes() { return regulatoryPurposes; } /** * Sets the value of the regulatoryPurposes property. * * @param value * allowed object is * {@link EndpointStudyRecord.DataProtection.RegulatoryPurposes } * */ public void setRegulatoryPurposes(EndpointStudyRecord.DataProtection.RegulatoryPurposes value) { this.regulatoryPurposes = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N64" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) public static class Confidentiality { @XmlValue protected String value; @XmlAttribute protected String valueID; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence maxOccurs="unbounded" minOccurs="0"> * &lt;element name="regulatoryPurpose"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N78" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "regulatoryPurpose" }) public static class RegulatoryPurposes { protected List<EndpointStudyRecord.DataProtection.RegulatoryPurposes.RegulatoryPurpose> regulatoryPurpose; /** * Gets the value of the regulatoryPurpose property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the regulatoryPurpose property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRegulatoryPurpose().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.DataProtection.RegulatoryPurposes.RegulatoryPurpose } * * */ public List<EndpointStudyRecord.DataProtection.RegulatoryPurposes.RegulatoryPurpose> getRegulatoryPurpose() { if (regulatoryPurpose == null) { regulatoryPurpose = new ArrayList<EndpointStudyRecord.DataProtection.RegulatoryPurposes.RegulatoryPurpose>(); } return this.regulatoryPurpose; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_N78" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "otherValue" }) public static class RegulatoryPurpose { @XmlElementRef(name = "otherValue", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> otherValue; @XmlAttribute protected String valueID; /** * Gets the value of the otherValue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getOtherValue() { return otherValue; } /** * Sets the value of the otherValue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setOtherValue(JAXBElement<String> value) { this.otherValue = ((JAXBElement<String> ) value); } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z02" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) public static class DataWaiving { @XmlValue protected String value; @XmlAttribute protected String valueID; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="modification" maxOccurs="unbounded"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="comment" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="modificationBy" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="date" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "modification" }) public static class ModificationHistory { @XmlElement(required = true) protected List<EndpointStudyRecord.ModificationHistory.Modification> modification; /** * Gets the value of the modification property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the modification property. * * <p> * For example, to add a new item, do as follows: * <pre> * getModification().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ModificationHistory.Modification } * * */ public List<EndpointStudyRecord.ModificationHistory.Modification> getModification() { if (modification == null) { modification = new ArrayList<EndpointStudyRecord.ModificationHistory.Modification>(); } return this.modification; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="comment" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="modificationBy" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="date" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "comment", "modificationBy" }) public static class Modification { @XmlElementRef(name = "comment", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> comment; @XmlElementRef(name = "modificationBy", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> modificationBy; @XmlAttribute(required = true) protected String date; /** * Gets the value of the comment property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getComment() { return comment; } /** * Sets the value of the comment property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setComment(JAXBElement<String> value) { this.comment = ((JAXBElement<String> ) value); } /** * Gets the value of the modificationBy property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getModificationBy() { return modificationBy; } /** * Sets the value of the modificationBy property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setModificationBy(JAXBElement<String> value) { this.modificationBy = ((JAXBElement<String> ) value); } /** * Gets the value of the date property. * * @return * possible object is * {@link String } * */ public String getDate() { return date; } /** * Sets the value of the date property. * * @param value * allowed object is * {@link String } * */ public void setDate(String value) { this.date = value; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="description" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="notes" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="endpointKind" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="lastModificationDate" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;attribute name="type" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentTypeType" /> * &lt;attribute name="uniqueKey" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentReferencePKType" /> * &lt;attribute name="targetType" type="{http://www.w3.org/2001/XMLSchema}long" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "description", "notes", "endpointKind" }) public static class Origin { protected String description; protected String notes; protected String endpointKind; @XmlAttribute protected String lastModificationDate; @XmlAttribute(required = true) protected DocumentTypeType type; @XmlAttribute(required = true) protected String uniqueKey; @XmlAttribute protected Long targetType; /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the notes property. * * @return * possible object is * {@link String } * */ public String getNotes() { return notes; } /** * Sets the value of the notes property. * * @param value * allowed object is * {@link String } * */ public void setNotes(String value) { this.notes = value; } /** * Gets the value of the endpointKind property. * * @return * possible object is * {@link String } * */ public String getEndpointKind() { return endpointKind; } /** * Sets the value of the endpointKind property. * * @param value * allowed object is * {@link String } * */ public void setEndpointKind(String value) { this.endpointKind = value; } /** * Gets the value of the lastModificationDate property. * * @return * possible object is * {@link String } * */ public String getLastModificationDate() { return lastModificationDate; } /** * Sets the value of the lastModificationDate property. * * @param value * allowed object is * {@link String } * */ public void setLastModificationDate(String value) { this.lastModificationDate = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link DocumentTypeType } * */ public DocumentTypeType getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link DocumentTypeType } * */ public void setType(DocumentTypeType value) { this.type = value; } /** * Gets the value of the uniqueKey property. * * @return * possible object is * {@link String } * */ public String getUniqueKey() { return uniqueKey; } /** * Sets the value of the uniqueKey property. * * @param value * allowed object is * {@link String } * */ public void setUniqueKey(String value) { this.uniqueKey = value; } /** * Gets the value of the targetType property. * * @return * possible object is * {@link Long } * */ public Long getTargetType() { return targetType; } /** * Sets the value of the targetType property. * * @param value * allowed object is * {@link Long } * */ public void setTargetType(Long value) { this.targetType = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="description" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;element name="notes" type="{http://echa.europa.eu/schemas/iuclid5/20130101}escapedStringUserType" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="lastModificationDate" type="{http://echa.europa.eu/schemas/iuclid5/20130101}datetimeType" /> * &lt;attribute name="type" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentTypeType" /> * &lt;attribute name="uniqueKey" use="required" type="{http://echa.europa.eu/schemas/iuclid5/20130101}documentReferencePKType" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "description", "notes" }) public static class OwnerRef { protected String description; protected String notes; @XmlAttribute protected String lastModificationDate; @XmlAttribute(required = true) protected DocumentTypeType type; @XmlAttribute(required = true) protected String uniqueKey; /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the notes property. * * @return * possible object is * {@link String } * */ public String getNotes() { return notes; } /** * Sets the value of the notes property. * * @param value * allowed object is * {@link String } * */ public void setNotes(String value) { this.notes = value; } /** * Gets the value of the lastModificationDate property. * * @return * possible object is * {@link String } * */ public String getLastModificationDate() { return lastModificationDate; } /** * Sets the value of the lastModificationDate property. * * @param value * allowed object is * {@link String } * */ public void setLastModificationDate(String value) { this.lastModificationDate = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link DocumentTypeType } * */ public DocumentTypeType getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link DocumentTypeType } * */ public void setType(DocumentTypeType value) { this.type = value; } /** * Gets the value of the uniqueKey property. * * @return * possible object is * {@link String } * */ public String getUniqueKey() { return uniqueKey; } /** * Sets the value of the uniqueKey property. * * @param value * allowed object is * {@link String } * */ public void setUniqueKey(String value) { this.uniqueKey = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="fractionalDocument" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="sealed" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="copyProtection" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class OwnershipProtection { @XmlAttribute protected Boolean fractionalDocument; @XmlAttribute protected Boolean sealed; @XmlAttribute protected Boolean copyProtection; /** * Gets the value of the fractionalDocument property. * * @return * possible object is * {@link Boolean } * */ public Boolean isFractionalDocument() { return fractionalDocument; } /** * Sets the value of the fractionalDocument property. * * @param value * allowed object is * {@link Boolean } * */ public void setFractionalDocument(Boolean value) { this.fractionalDocument = value; } /** * Gets the value of the sealed property. * * @return * possible object is * {@link Boolean } * */ public Boolean isSealed() { return sealed; } /** * Sets the value of the sealed property. * * @param value * allowed object is * {@link Boolean } * */ public void setSealed(Boolean value) { this.sealed = value; } /** * Gets the value of the copyProtection property. * * @return * possible object is * {@link Boolean } * */ public Boolean isCopyProtection() { return copyProtection; } /** * Sets the value of the copyProtection property. * * @param value * allowed object is * {@link Boolean } * */ public void setCopyProtection(Boolean value) { this.copyProtection = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Y14-3" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) public static class PurposeFlag { @XmlValue protected String value; @XmlAttribute protected String valueID; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A36" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "otherValue" }) public static class Reliability { @XmlElementRef(name = "otherValue", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> otherValue; @XmlAttribute protected String valueID; /** * Gets the value of the otherValue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getOtherValue() { return otherValue; } /** * Sets the value of the otherValue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setOtherValue(JAXBElement<String> value) { this.otherValue = ((JAXBElement<String> ) value); } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="EN_HENRY_LAW"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;all> * &lt;element name="GEN_DATA_SOURCE_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REFERENCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_REFERENCE_TYPE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_AUTHOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TITLE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_SOURCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TESTLAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_DATE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_ACCESS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_PROT_CLAIM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_SAMESTUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_MAT_ME_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="5" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_DEVIATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_NOGUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GLP_COMPLIANCE_STATEMENT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_SEL_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="TESTMAT_INDICATOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_IDENTIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_CONFIDENTIAL_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_ME_TC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_RESULTS_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="HENRYSLAW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRECISION_LOQUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="VALUEUNIT_PRESSURE_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_RS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_OVERALL_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REM_ANYOTHER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD_STUDYREPORT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PG_ILLUSTRATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_APPL_SUM_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="APPL_CL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="APPL_EXEC_SUM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_OTHER_STUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/all> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "enhenrylaw" }) public static class ScientificPart { @XmlElement(name = "EN_HENRY_LAW", required = true) protected EndpointStudyRecord.ScientificPart.ENHENRYLAW enhenrylaw; /** * Gets the value of the enhenrylaw property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW getENHENRYLAW() { return enhenrylaw; } /** * Sets the value of the enhenrylaw property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW } * */ public void setENHENRYLAW(EndpointStudyRecord.ScientificPart.ENHENRYLAW value) { this.enhenrylaw = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;all> * &lt;element name="GEN_DATA_SOURCE_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REFERENCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_REFERENCE_TYPE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_AUTHOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TITLE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_SOURCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TESTLAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_DATE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_ACCESS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="DATA_PROT_CLAIM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_SAMESTUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_MAT_ME_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="5" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_DEVIATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_NOGUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GLP_COMPLIANCE_STATEMENT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_SEL_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="TESTMAT_INDICATOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_IDENTIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TESTMAT_CONFIDENTIAL_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="METHOD_DETAILS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_ME_TC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_RESULTS_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="HENRYSLAW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRECISION_LOQUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="VALUEUNIT_PRESSURE_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM_RS" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_OVERALL_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="REM_ANYOTHER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="AD_STUDYREPORT" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PG_ILLUSTRATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="GEN_APPL_SUM_HD" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/> * &lt;element name="APPL_CL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="APPL_EXEC_SUM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="CROSSREF_OTHER_STUDY" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/all> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { }) public static class ENHENRYLAW { @XmlElementRef(name = "GEN_DATA_SOURCE_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> gendatasourcehd; @XmlElement(name = "REFERENCE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE reference; @XmlElement(name = "DATA_ACCESS") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS dataaccess; @XmlElement(name = "DATA_PROT_CLAIM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM dataprotclaim; @XmlElement(name = "CROSSREF_SAMESTUDY") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY crossrefsamestudy; @XmlElementRef(name = "GEN_MAT_ME_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> genmatmehd; @XmlElement(name = "GUIDELINE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE guideline; @XmlElement(name = "METHOD_NOGUIDELINE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE methodnoguideline; @XmlElement(name = "GLP_COMPLIANCE_STATEMENT") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT glpcompliancestatement; @XmlElementRef(name = "TESTMAT_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> testmathd; @XmlElement(name = "TESTMAT_INDICATOR") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR testmatindicator; @XmlElement(name = "TESTMAT") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT testmat; @XmlElement(name = "TESTMAT_FORM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM testmatform; @XmlElement(name = "TESTMAT_DETAILS") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS testmatdetails; @XmlElement(name = "TESTMAT_CONFIDENTIAL_DETAILS") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS testmatconfidentialdetails; @XmlElement(name = "METHOD_DETAILS") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS methoddetails; @XmlElement(name = "REM_ME_TC") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC remmetc; @XmlElementRef(name = "GEN_RESULTS_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> genresultshd; @XmlElement(name = "HENRYSLAW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW henryslaw; @XmlElement(name = "REM_RS") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS remrs; @XmlElementRef(name = "GEN_OVERALL_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> genoverallhd; @XmlElement(name = "REM_ANYOTHER") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER remanyother; @XmlElement(name = "AD") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD ad; @XmlElement(name = "AD_STUDYREPORT") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT adstudyreport; @XmlElement(name = "PG_ILLUSTRATION") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION pgillustration; @XmlElementRef(name = "GEN_APPL_SUM_HD", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<Object> genapplsumhd; @XmlElement(name = "APPL_CL") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL applcl; @XmlElement(name = "APPL_EXEC_SUM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM applexecsum; @XmlElement(name = "CROSSREF_OTHER_STUDY") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY crossrefotherstudy; /** * Gets the value of the gendatasourcehd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getGENDATASOURCEHD() { return gendatasourcehd; } /** * Sets the value of the gendatasourcehd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setGENDATASOURCEHD(JAXBElement<Object> value) { this.gendatasourcehd = ((JAXBElement<Object> ) value); } /** * Gets the value of the reference property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE getREFERENCE() { return reference; } /** * Sets the value of the reference property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE } * */ public void setREFERENCE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE value) { this.reference = value; } /** * Gets the value of the dataaccess property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS getDATAACCESS() { return dataaccess; } /** * Sets the value of the dataaccess property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS } * */ public void setDATAACCESS(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS value) { this.dataaccess = value; } /** * Gets the value of the dataprotclaim property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM getDATAPROTCLAIM() { return dataprotclaim; } /** * Sets the value of the dataprotclaim property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM } * */ public void setDATAPROTCLAIM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM value) { this.dataprotclaim = value; } /** * Gets the value of the crossrefsamestudy property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY getCROSSREFSAMESTUDY() { return crossrefsamestudy; } /** * Sets the value of the crossrefsamestudy property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY } * */ public void setCROSSREFSAMESTUDY(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY value) { this.crossrefsamestudy = value; } /** * Gets the value of the genmatmehd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getGENMATMEHD() { return genmatmehd; } /** * Sets the value of the genmatmehd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setGENMATMEHD(JAXBElement<Object> value) { this.genmatmehd = ((JAXBElement<Object> ) value); } /** * Gets the value of the guideline property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE getGUIDELINE() { return guideline; } /** * Sets the value of the guideline property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE } * */ public void setGUIDELINE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE value) { this.guideline = value; } /** * Gets the value of the methodnoguideline property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE getMETHODNOGUIDELINE() { return methodnoguideline; } /** * Sets the value of the methodnoguideline property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE } * */ public void setMETHODNOGUIDELINE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE value) { this.methodnoguideline = value; } /** * Gets the value of the glpcompliancestatement property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT getGLPCOMPLIANCESTATEMENT() { return glpcompliancestatement; } /** * Sets the value of the glpcompliancestatement property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT } * */ public void setGLPCOMPLIANCESTATEMENT(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT value) { this.glpcompliancestatement = value; } /** * Gets the value of the testmathd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getTESTMATHD() { return testmathd; } /** * Sets the value of the testmathd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setTESTMATHD(JAXBElement<Object> value) { this.testmathd = ((JAXBElement<Object> ) value); } /** * Gets the value of the testmatindicator property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR getTESTMATINDICATOR() { return testmatindicator; } /** * Sets the value of the testmatindicator property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR } * */ public void setTESTMATINDICATOR(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR value) { this.testmatindicator = value; } /** * Gets the value of the testmat property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT getTESTMAT() { return testmat; } /** * Sets the value of the testmat property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT } * */ public void setTESTMAT(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT value) { this.testmat = value; } /** * Gets the value of the testmatform property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM getTESTMATFORM() { return testmatform; } /** * Sets the value of the testmatform property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM } * */ public void setTESTMATFORM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM value) { this.testmatform = value; } /** * Gets the value of the testmatdetails property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS getTESTMATDETAILS() { return testmatdetails; } /** * Sets the value of the testmatdetails property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS } * */ public void setTESTMATDETAILS(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS value) { this.testmatdetails = value; } /** * Gets the value of the testmatconfidentialdetails property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS getTESTMATCONFIDENTIALDETAILS() { return testmatconfidentialdetails; } /** * Sets the value of the testmatconfidentialdetails property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS } * */ public void setTESTMATCONFIDENTIALDETAILS(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS value) { this.testmatconfidentialdetails = value; } /** * Gets the value of the methoddetails property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS getMETHODDETAILS() { return methoddetails; } /** * Sets the value of the methoddetails property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS } * */ public void setMETHODDETAILS(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS value) { this.methoddetails = value; } /** * Gets the value of the remmetc property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC getREMMETC() { return remmetc; } /** * Sets the value of the remmetc property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC } * */ public void setREMMETC(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC value) { this.remmetc = value; } /** * Gets the value of the genresultshd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getGENRESULTSHD() { return genresultshd; } /** * Sets the value of the genresultshd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setGENRESULTSHD(JAXBElement<Object> value) { this.genresultshd = ((JAXBElement<Object> ) value); } /** * Gets the value of the henryslaw property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW getHENRYSLAW() { return henryslaw; } /** * Sets the value of the henryslaw property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW } * */ public void setHENRYSLAW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW value) { this.henryslaw = value; } /** * Gets the value of the remrs property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS getREMRS() { return remrs; } /** * Sets the value of the remrs property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS } * */ public void setREMRS(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS value) { this.remrs = value; } /** * Gets the value of the genoverallhd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getGENOVERALLHD() { return genoverallhd; } /** * Sets the value of the genoverallhd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setGENOVERALLHD(JAXBElement<Object> value) { this.genoverallhd = ((JAXBElement<Object> ) value); } /** * Gets the value of the remanyother property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER getREMANYOTHER() { return remanyother; } /** * Sets the value of the remanyother property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER } * */ public void setREMANYOTHER(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER value) { this.remanyother = value; } /** * Gets the value of the ad property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD getAD() { return ad; } /** * Sets the value of the ad property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD } * */ public void setAD(EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD value) { this.ad = value; } /** * Gets the value of the adstudyreport property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT getADSTUDYREPORT() { return adstudyreport; } /** * Sets the value of the adstudyreport property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT } * */ public void setADSTUDYREPORT(EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT value) { this.adstudyreport = value; } /** * Gets the value of the pgillustration property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION getPGILLUSTRATION() { return pgillustration; } /** * Sets the value of the pgillustration property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION } * */ public void setPGILLUSTRATION(EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION value) { this.pgillustration = value; } /** * Gets the value of the genapplsumhd property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public JAXBElement<Object> getGENAPPLSUMHD() { return genapplsumhd; } /** * Sets the value of the genapplsumhd property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link Object }{@code >} * */ public void setGENAPPLSUMHD(JAXBElement<Object> value) { this.genapplsumhd = ((JAXBElement<Object> ) value); } /** * Gets the value of the applcl property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL getAPPLCL() { return applcl; } /** * Sets the value of the applcl property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL } * */ public void setAPPLCL(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL value) { this.applcl = value; } /** * Gets the value of the applexecsum property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM getAPPLEXECSUM() { return applexecsum; } /** * Sets the value of the applexecsum property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM } * */ public void setAPPLEXECSUM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM value) { this.applexecsum = value; } /** * Gets the value of the crossrefotherstudy property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY getCROSSREFOTHERSTUDY() { return crossrefotherstudy; } /** * Sets the value of the crossrefotherstudy property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY } * */ public void setCROSSREFOTHERSTUDY(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY value) { this.crossrefotherstudy = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class AD { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "doc", "rem" }) public static class Set { @XmlElement(name = "DOC") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.DOC doc; @XmlElement(name = "REM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.REM rem; /** * Gets the value of the doc property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.DOC } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.DOC getDOC() { return doc; } /** * Sets the value of the doc property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.DOC } * */ public void setDOC(EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.DOC value) { this.doc = value; } /** * Gets the value of the rem property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.REM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.REM getREM() { return rem; } /** * Sets the value of the rem property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.REM } * */ public void setREM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.AD.Set.REM value) { this.rem = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DOC" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="DOC.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "doc", "docDescription", "docMimetype" }) public static class DOC { @XmlElement(name = "DOC") protected String doc; @XmlElement(name = "DOC.description") protected String docDescription; @XmlElement(name = "DOC.mimetype") protected String docMimetype; /** * Gets the value of the doc property. * * @return * possible object is * {@link String } * */ public String getDOC() { return doc; } /** * Sets the value of the doc property. * * @param value * allowed object is * {@link String } * */ public void setDOC(String value) { this.doc = value; } /** * Gets the value of the docDescription property. * * @return * possible object is * {@link String } * */ public String getDOCDescription() { return docDescription; } /** * Sets the value of the docDescription property. * * @param value * allowed object is * {@link String } * */ public void setDOCDescription(String value) { this.docDescription = value; } /** * Gets the value of the docMimetype property. * * @return * possible object is * {@link String } * */ public String getDOCMimetype() { return docMimetype; } /** * Sets the value of the docMimetype property. * * @param value * allowed object is * {@link String } * */ public void setDOCMimetype(String value) { this.docMimetype = value; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "rem" }) public static class REM { @XmlElementRef(name = "REM", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> rem; /** * Gets the value of the rem property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREM() { return rem; } /** * Sets the value of the rem property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREM(JAXBElement<String> value) { this.rem = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class ADSTUDYREPORT { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "attachmentbelow" }) public static class Set { @XmlElement(name = "ATTACHMENT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set.ATTACHMENTBELOW attachmentbelow; /** * Gets the value of the attachmentbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set.ATTACHMENTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set.ATTACHMENTBELOW getATTACHMENTBELOW() { return attachmentbelow; } /** * Sets the value of the attachmentbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set.ATTACHMENTBELOW } * */ public void setATTACHMENTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.ADSTUDYREPORT.Set.ATTACHMENTBELOW value) { this.attachmentbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ATTACHMENT_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ATTACHMENT_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "attachmentbelow", "attachmentbelowDescription", "attachmentbelowMimetype" }) public static class ATTACHMENTBELOW { @XmlElement(name = "ATTACHMENT_BELOW") protected String attachmentbelow; @XmlElement(name = "ATTACHMENT_BELOW.description") protected String attachmentbelowDescription; @XmlElement(name = "ATTACHMENT_BELOW.mimetype") protected String attachmentbelowMimetype; /** * Gets the value of the attachmentbelow property. * * @return * possible object is * {@link String } * */ public String getATTACHMENTBELOW() { return attachmentbelow; } /** * Sets the value of the attachmentbelow property. * * @param value * allowed object is * {@link String } * */ public void setATTACHMENTBELOW(String value) { this.attachmentbelow = value; } /** * Gets the value of the attachmentbelowDescription property. * * @return * possible object is * {@link String } * */ public String getATTACHMENTBELOWDescription() { return attachmentbelowDescription; } /** * Sets the value of the attachmentbelowDescription property. * * @param value * allowed object is * {@link String } * */ public void setATTACHMENTBELOWDescription(String value) { this.attachmentbelowDescription = value; } /** * Gets the value of the attachmentbelowMimetype property. * * @return * possible object is * {@link String } * */ public String getATTACHMENTBELOWMimetype() { return attachmentbelowMimetype; } /** * Sets the value of the attachmentbelowMimetype property. * * @param value * allowed object is * {@link String } * */ public void setATTACHMENTBELOWMimetype(String value) { this.attachmentbelowMimetype = value; } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class APPLCL { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class Set { @XmlElement(name = "TEXTAREA_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set.TEXTAREABELOW textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set.TEXTAREABELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set.TEXTAREABELOW getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set.TEXTAREABELOW } * */ public void setTEXTAREABELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLCL.Set.TEXTAREABELOW value) { this.textareabelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class TEXTAREABELOW { @XmlElementRef(name = "TEXTAREA_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEXTAREABELOW(JAXBElement<String> value) { this.textareabelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class APPLEXECSUM { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class Set { @XmlElement(name = "RICHTEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set.RICHTEXTBELOW richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set.RICHTEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set.RICHTEXTBELOW getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set.RICHTEXTBELOW } * */ public void setRICHTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.APPLEXECSUM.Set.RICHTEXTBELOW value) { this.richtextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class RICHTEXTBELOW { @XmlElementRef(name = "RICHTEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setRICHTEXTBELOW(JAXBElement<String> value) { this.richtextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class CROSSREFOTHERSTUDY { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textbelow" }) public static class Set { @XmlElement(name = "TEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set.TEXTBELOW textbelow; /** * Gets the value of the textbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set.TEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set.TEXTBELOW getTEXTBELOW() { return textbelow; } /** * Sets the value of the textbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set.TEXTBELOW } * */ public void setTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFOTHERSTUDY.Set.TEXTBELOW value) { this.textbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textbelow" }) public static class TEXTBELOW { @XmlElementRef(name = "TEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> textbelow; /** * Gets the value of the textbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEXTBELOW() { return textbelow; } /** * Sets the value of the textbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEXTBELOW(JAXBElement<String> value) { this.textbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class CROSSREFSAMESTUDY { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textbelow" }) public static class Set { @XmlElement(name = "TEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set.TEXTBELOW textbelow; /** * Gets the value of the textbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set.TEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set.TEXTBELOW getTEXTBELOW() { return textbelow; } /** * Sets the value of the textbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set.TEXTBELOW } * */ public void setTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.CROSSREFSAMESTUDY.Set.TEXTBELOW value) { this.textbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textbelow" }) public static class TEXTBELOW { @XmlElementRef(name = "TEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> textbelow; /** * Gets the value of the textbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEXTBELOW() { return textbelow; } /** * Sets the value of the textbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEXTBELOW(JAXBElement<String> value) { this.textbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class DATAACCESS { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseotherlistpop" }) public static class Set { @XmlElement(name = "PHRASEOTHER_LIST_POP") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set.PHRASEOTHERLISTPOP phraseotherlistpop; /** * Gets the value of the phraseotherlistpop property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set.PHRASEOTHERLISTPOP } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set.PHRASEOTHERLISTPOP getPHRASEOTHERLISTPOP() { return phraseotherlistpop; } /** * Sets the value of the phraseotherlistpop property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set.PHRASEOTHERLISTPOP } * */ public void setPHRASEOTHERLISTPOP(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAACCESS.Set.PHRASEOTHERLISTPOP value) { this.phraseotherlistpop = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z03" minOccurs="0"/> * &lt;element name="LIST_POP.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listpop", "listpopValue", "listpoptxt" }) public static class PHRASEOTHERLISTPOP { @XmlElement(name = "LIST_POP") protected String listpop; @XmlElement(name = "LIST_POP.value") protected String listpopValue; @XmlElementRef(name = "LIST_POP_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> listpoptxt; /** * Gets the value of the listpop property. * * @return * possible object is * {@link String } * */ public String getLISTPOP() { return listpop; } /** * Sets the value of the listpop property. * * @param value * allowed object is * {@link String } * */ public void setLISTPOP(String value) { this.listpop = value; } /** * Gets the value of the listpopValue property. * * @return * possible object is * {@link String } * */ public String getLISTPOPValue() { return listpopValue; } /** * Sets the value of the listpopValue property. * * @param value * allowed object is * {@link String } * */ public void setLISTPOPValue(String value) { this.listpopValue = value; } /** * Gets the value of the listpoptxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getLISTPOPTXT() { return listpoptxt; } /** * Sets the value of the listpoptxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setLISTPOPTXT(JAXBElement<String> value) { this.listpoptxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class DATAPROTCLAIM { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_POP_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseotherlistpopfix" }) public static class Set { @XmlElement(name = "PHRASEOTHER_LIST_POP_FIX") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set.PHRASEOTHERLISTPOPFIX phraseotherlistpopfix; /** * Gets the value of the phraseotherlistpopfix property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set.PHRASEOTHERLISTPOPFIX } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set.PHRASEOTHERLISTPOPFIX getPHRASEOTHERLISTPOPFIX() { return phraseotherlistpopfix; } /** * Sets the value of the phraseotherlistpopfix property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set.PHRASEOTHERLISTPOPFIX } * */ public void setPHRASEOTHERLISTPOPFIX(EndpointStudyRecord.ScientificPart.ENHENRYLAW.DATAPROTCLAIM.Set.PHRASEOTHERLISTPOPFIX value) { this.phraseotherlistpopfix = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_POP_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z30" minOccurs="0"/> * &lt;element name="LIST_POP_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_POP_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listpopfix", "listpopfixValue", "listpopfixtxt" }) public static class PHRASEOTHERLISTPOPFIX { @XmlElement(name = "LIST_POP_FIX") protected String listpopfix; @XmlElement(name = "LIST_POP_FIX.value") protected String listpopfixValue; @XmlElementRef(name = "LIST_POP_FIX_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> listpopfixtxt; /** * Gets the value of the listpopfix property. * * @return * possible object is * {@link String } * */ public String getLISTPOPFIX() { return listpopfix; } /** * Sets the value of the listpopfix property. * * @param value * allowed object is * {@link String } * */ public void setLISTPOPFIX(String value) { this.listpopfix = value; } /** * Gets the value of the listpopfixValue property. * * @return * possible object is * {@link String } * */ public String getLISTPOPFIXValue() { return listpopfixValue; } /** * Sets the value of the listpopfixValue property. * * @param value * allowed object is * {@link String } * */ public void setLISTPOPFIXValue(String value) { this.listpopfixValue = value; } /** * Gets the value of the listpopfixtxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getLISTPOPFIXTXT() { return listpopfixtxt; } /** * Sets the value of the listpopfixtxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setLISTPOPFIXTXT(JAXBElement<String> value) { this.listpopfixtxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_SEL_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class GLPCOMPLIANCESTATEMENT { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_LIST_SEL_FIX" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseotherlistselfix" }) public static class Set { @XmlElement(name = "PHRASEOTHER_LIST_SEL_FIX") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set.PHRASEOTHERLISTSELFIX phraseotherlistselfix; /** * Gets the value of the phraseotherlistselfix property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set.PHRASEOTHERLISTSELFIX } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set.PHRASEOTHERLISTSELFIX getPHRASEOTHERLISTSELFIX() { return phraseotherlistselfix; } /** * Sets the value of the phraseotherlistselfix property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set.PHRASEOTHERLISTSELFIX } * */ public void setPHRASEOTHERLISTSELFIX(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GLPCOMPLIANCESTATEMENT.Set.PHRASEOTHERLISTSELFIX value) { this.phraseotherlistselfix = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_SEL_FIX" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z40" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LIST_SEL_FIX_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listselfix", "listselfixValue", "listselfixtxt" }) public static class PHRASEOTHERLISTSELFIX { @XmlElement(name = "LIST_SEL_FIX") protected String listselfix; @XmlElement(name = "LIST_SEL_FIX.value") protected String listselfixValue; @XmlElementRef(name = "LIST_SEL_FIX_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> listselfixtxt; /** * Gets the value of the listselfix property. * * @return * possible object is * {@link String } * */ public String getLISTSELFIX() { return listselfix; } /** * Sets the value of the listselfix property. * * @param value * allowed object is * {@link String } * */ public void setLISTSELFIX(String value) { this.listselfix = value; } /** * Gets the value of the listselfixValue property. * * @return * possible object is * {@link String } * */ public String getLISTSELFIXValue() { return listselfixValue; } /** * Sets the value of the listselfixValue property. * * @param value * allowed object is * {@link String } * */ public void setLISTSELFIXValue(String value) { this.listselfixValue = value; } /** * Gets the value of the listselfixtxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getLISTSELFIXTXT() { return listselfixtxt; } /** * Sets the value of the listselfixtxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setLISTSELFIXTXT(JAXBElement<String> value) { this.listselfixtxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="5" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_DEVIATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class GUIDELINE { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_GUIDELINE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="PHRASEOTHER_DEVIATION" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "qualifier", "phraseotherguideline", "phraseotherdeviation" }) public static class Set { @XmlElement(name = "QUALIFIER") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.QUALIFIER qualifier; @XmlElement(name = "PHRASEOTHER_GUIDELINE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERGUIDELINE phraseotherguideline; @XmlElement(name = "PHRASEOTHER_DEVIATION") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERDEVIATION phraseotherdeviation; /** * Gets the value of the qualifier property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.QUALIFIER } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.QUALIFIER getQUALIFIER() { return qualifier; } /** * Sets the value of the qualifier property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.QUALIFIER } * */ public void setQUALIFIER(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.QUALIFIER value) { this.qualifier = value; } /** * Gets the value of the phraseotherguideline property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERGUIDELINE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERGUIDELINE getPHRASEOTHERGUIDELINE() { return phraseotherguideline; } /** * Sets the value of the phraseotherguideline property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERGUIDELINE } * */ public void setPHRASEOTHERGUIDELINE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERGUIDELINE value) { this.phraseotherguideline = value; } /** * Gets the value of the phraseotherdeviation property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERDEVIATION } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERDEVIATION getPHRASEOTHERDEVIATION() { return phraseotherdeviation; } /** * Sets the value of the phraseotherdeviation property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERDEVIATION } * */ public void setPHRASEOTHERDEVIATION(EndpointStudyRecord.ScientificPart.ENHENRYLAW.GUIDELINE.Set.PHRASEOTHERDEVIATION value) { this.phraseotherdeviation = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="DEVIATION" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z08" minOccurs="0"/> * &lt;element name="DEVIATION.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="DEVIATION_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "deviation", "deviationValue", "deviationtxt" }) public static class PHRASEOTHERDEVIATION { @XmlElement(name = "DEVIATION") protected String deviation; @XmlElement(name = "DEVIATION.value") protected String deviationValue; @XmlElementRef(name = "DEVIATION_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> deviationtxt; /** * Gets the value of the deviation property. * * @return * possible object is * {@link String } * */ public String getDEVIATION() { return deviation; } /** * Sets the value of the deviation property. * * @param value * allowed object is * {@link String } * */ public void setDEVIATION(String value) { this.deviation = value; } /** * Gets the value of the deviationValue property. * * @return * possible object is * {@link String } * */ public String getDEVIATIONValue() { return deviationValue; } /** * Sets the value of the deviationValue property. * * @param value * allowed object is * {@link String } * */ public void setDEVIATIONValue(String value) { this.deviationValue = value; } /** * Gets the value of the deviationtxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getDEVIATIONTXT() { return deviationtxt; } /** * Sets the value of the deviationtxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setDEVIATIONTXT(JAXBElement<String> value) { this.deviationtxt = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="GUIDELINE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P100" minOccurs="0"/> * &lt;element name="GUIDELINE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="GUIDELINE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "guideline", "guidelineValue", "guidelinetxt" }) public static class PHRASEOTHERGUIDELINE { @XmlElement(name = "GUIDELINE") protected String guideline; @XmlElement(name = "GUIDELINE.value") protected String guidelineValue; @XmlElementRef(name = "GUIDELINE_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> guidelinetxt; /** * Gets the value of the guideline property. * * @return * possible object is * {@link String } * */ public String getGUIDELINE() { return guideline; } /** * Sets the value of the guideline property. * * @param value * allowed object is * {@link String } * */ public void setGUIDELINE(String value) { this.guideline = value; } /** * Gets the value of the guidelineValue property. * * @return * possible object is * {@link String } * */ public String getGUIDELINEValue() { return guidelineValue; } /** * Sets the value of the guidelineValue property. * * @param value * allowed object is * {@link String } * */ public void setGUIDELINEValue(String value) { this.guidelineValue = value; } /** * Gets the value of the guidelinetxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getGUIDELINETXT() { return guidelinetxt; } /** * Sets the value of the guidelinetxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setGUIDELINETXT(JAXBElement<String> value) { this.guidelinetxt = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="QUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z06" minOccurs="0"/> * &lt;element name="QUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "qualifier", "qualifierValue" }) public static class QUALIFIER { @XmlElement(name = "QUALIFIER") protected String qualifier; @XmlElement(name = "QUALIFIER.value") protected String qualifierValue; /** * Gets the value of the qualifier property. * * @return * possible object is * {@link String } * */ public String getQUALIFIER() { return qualifier; } /** * Sets the value of the qualifier property. * * @param value * allowed object is * {@link String } * */ public void setQUALIFIER(String value) { this.qualifier = value; } /** * Gets the value of the qualifierValue property. * * @return * possible object is * {@link String } * */ public String getQUALIFIERValue() { return qualifierValue; } /** * Sets the value of the qualifierValue property. * * @param value * allowed object is * {@link String } * */ public void setQUALIFIERValue(String value) { this.qualifierValue = value; } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRECISION_LOQUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="VALUEUNIT_PRESSURE_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class HENRYSLAW { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRECISION_LOQUALIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="VALUEUNIT_PRESSURE_VALUE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "precisionloqualifier", "tempvalue", "valueunitpressurevalue", "rem" }) public static class Set { @XmlElement(name = "PRECISION_LOQUALIFIER") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.PRECISIONLOQUALIFIER precisionloqualifier; @XmlElement(name = "TEMP_VALUE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.TEMPVALUE tempvalue; @XmlElement(name = "VALUEUNIT_PRESSURE_VALUE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.VALUEUNITPRESSUREVALUE valueunitpressurevalue; @XmlElement(name = "REM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.REM rem; /** * Gets the value of the precisionloqualifier property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.PRECISIONLOQUALIFIER } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.PRECISIONLOQUALIFIER getPRECISIONLOQUALIFIER() { return precisionloqualifier; } /** * Sets the value of the precisionloqualifier property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.PRECISIONLOQUALIFIER } * */ public void setPRECISIONLOQUALIFIER(EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.PRECISIONLOQUALIFIER value) { this.precisionloqualifier = value; } /** * Gets the value of the tempvalue property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.TEMPVALUE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.TEMPVALUE getTEMPVALUE() { return tempvalue; } /** * Sets the value of the tempvalue property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.TEMPVALUE } * */ public void setTEMPVALUE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.TEMPVALUE value) { this.tempvalue = value; } /** * Gets the value of the valueunitpressurevalue property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.VALUEUNITPRESSUREVALUE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.VALUEUNITPRESSUREVALUE getVALUEUNITPRESSUREVALUE() { return valueunitpressurevalue; } /** * Sets the value of the valueunitpressurevalue property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.VALUEUNITPRESSUREVALUE } * */ public void setVALUEUNITPRESSUREVALUE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.VALUEUNITPRESSUREVALUE value) { this.valueunitpressurevalue = value; } /** * Gets the value of the rem property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.REM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.REM getREM() { return rem; } /** * Sets the value of the rem property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.REM } * */ public void setREM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.HENRYSLAW.Set.REM value) { this.rem = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LOQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-1" minOccurs="0"/> * &lt;element name="LOQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="LOVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UPQUALIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A02-2" minOccurs="0"/> * &lt;element name="UPQUALIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UPVALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P101" minOccurs="0"/> * &lt;element name="UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "loqualifier", "loqualifierValue", "lovalue", "upqualifier", "upqualifierValue", "upvalue", "unit", "unitValue", "unittxt" }) public static class PRECISIONLOQUALIFIER { @XmlElement(name = "LOQUALIFIER") protected String loqualifier; @XmlElement(name = "LOQUALIFIER.value") protected String loqualifierValue; @XmlElementRef(name = "LOVALUE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> lovalue; @XmlElement(name = "UPQUALIFIER") protected String upqualifier; @XmlElement(name = "UPQUALIFIER.value") protected String upqualifierValue; @XmlElementRef(name = "UPVALUE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> upvalue; @XmlElement(name = "UNIT") protected String unit; @XmlElement(name = "UNIT.value") protected String unitValue; @XmlElementRef(name = "UNIT_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> unittxt; /** * Gets the value of the loqualifier property. * * @return * possible object is * {@link String } * */ public String getLOQUALIFIER() { return loqualifier; } /** * Sets the value of the loqualifier property. * * @param value * allowed object is * {@link String } * */ public void setLOQUALIFIER(String value) { this.loqualifier = value; } /** * Gets the value of the loqualifierValue property. * * @return * possible object is * {@link String } * */ public String getLOQUALIFIERValue() { return loqualifierValue; } /** * Sets the value of the loqualifierValue property. * * @param value * allowed object is * {@link String } * */ public void setLOQUALIFIERValue(String value) { this.loqualifierValue = value; } /** * Gets the value of the lovalue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getLOVALUE() { return lovalue; } /** * Sets the value of the lovalue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setLOVALUE(JAXBElement<String> value) { this.lovalue = ((JAXBElement<String> ) value); } /** * Gets the value of the upqualifier property. * * @return * possible object is * {@link String } * */ public String getUPQUALIFIER() { return upqualifier; } /** * Sets the value of the upqualifier property. * * @param value * allowed object is * {@link String } * */ public void setUPQUALIFIER(String value) { this.upqualifier = value; } /** * Gets the value of the upqualifierValue property. * * @return * possible object is * {@link String } * */ public String getUPQUALIFIERValue() { return upqualifierValue; } /** * Sets the value of the upqualifierValue property. * * @param value * allowed object is * {@link String } * */ public void setUPQUALIFIERValue(String value) { this.upqualifierValue = value; } /** * Gets the value of the upvalue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getUPVALUE() { return upvalue; } /** * Sets the value of the upvalue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setUPVALUE(JAXBElement<String> value) { this.upvalue = ((JAXBElement<String> ) value); } /** * Gets the value of the unit property. * * @return * possible object is * {@link String } * */ public String getUNIT() { return unit; } /** * Sets the value of the unit property. * * @param value * allowed object is * {@link String } * */ public void setUNIT(String value) { this.unit = value; } /** * Gets the value of the unitValue property. * * @return * possible object is * {@link String } * */ public String getUNITValue() { return unitValue; } /** * Sets the value of the unitValue property. * * @param value * allowed object is * {@link String } * */ public void setUNITValue(String value) { this.unitValue = value; } /** * Gets the value of the unittxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getUNITTXT() { return unittxt; } /** * Sets the value of the unittxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setUNITTXT(JAXBElement<String> value) { this.unittxt = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "rem" }) public static class REM { @XmlElementRef(name = "REM", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> rem; /** * Gets the value of the rem property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREM() { return rem; } /** * Sets the value of the rem property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREM(JAXBElement<String> value) { this.rem = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEMP_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_19_9"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "tempvalue" }) public static class TEMPVALUE { @XmlElementRef(name = "TEMP_VALUE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> tempvalue; /** * Gets the value of the tempvalue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEMPVALUE() { return tempvalue; } /** * Sets the value of the tempvalue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEMPVALUE(JAXBElement<String> value) { this.tempvalue = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PRESSURE_VALUE" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_21_13"> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;element name="PRESSURE_UNIT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_P02" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="PRESSURE_UNIT_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "pressurevalue", "pressureunit", "pressureunitValue", "pressureunittxt" }) public static class VALUEUNITPRESSUREVALUE { @XmlElementRef(name = "PRESSURE_VALUE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> pressurevalue; @XmlElement(name = "PRESSURE_UNIT") protected String pressureunit; @XmlElement(name = "PRESSURE_UNIT.value") protected String pressureunitValue; @XmlElementRef(name = "PRESSURE_UNIT_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> pressureunittxt; /** * Gets the value of the pressurevalue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getPRESSUREVALUE() { return pressurevalue; } /** * Sets the value of the pressurevalue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setPRESSUREVALUE(JAXBElement<String> value) { this.pressurevalue = ((JAXBElement<String> ) value); } /** * Gets the value of the pressureunit property. * * @return * possible object is * {@link String } * */ public String getPRESSUREUNIT() { return pressureunit; } /** * Sets the value of the pressureunit property. * * @param value * allowed object is * {@link String } * */ public void setPRESSUREUNIT(String value) { this.pressureunit = value; } /** * Gets the value of the pressureunitValue property. * * @return * possible object is * {@link String } * */ public String getPRESSUREUNITValue() { return pressureunitValue; } /** * Sets the value of the pressureunitValue property. * * @param value * allowed object is * {@link String } * */ public void setPRESSUREUNITValue(String value) { this.pressureunitValue = value; } /** * Gets the value of the pressureunittxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getPRESSUREUNITTXT() { return pressureunittxt; } /** * Sets the value of the pressureunittxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setPRESSUREUNITTXT(JAXBElement<String> value) { this.pressureunittxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class METHODDETAILS { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class Set { @XmlElement(name = "TEXTAREA_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set.TEXTAREABELOW textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set.TEXTAREABELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set.TEXTAREABELOW getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set.TEXTAREABELOW } * */ public void setTEXTAREABELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODDETAILS.Set.TEXTAREABELOW value) { this.textareabelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class TEXTAREABELOW { @XmlElementRef(name = "TEXTAREA_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEXTAREABELOW(JAXBElement<String> value) { this.textareabelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class METHODNOGUIDELINE { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class Set { @XmlElement(name = "TEXTAREA_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set.TEXTAREABELOW textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set.TEXTAREABELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set.TEXTAREABELOW getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set.TEXTAREABELOW } * */ public void setTEXTAREABELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.METHODNOGUIDELINE.Set.TEXTAREABELOW value) { this.textareabelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TEXTAREA_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "textareabelow" }) public static class TEXTAREABELOW { @XmlElementRef(name = "TEXTAREA_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> textareabelow; /** * Gets the value of the textareabelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTEXTAREABELOW() { return textareabelow; } /** * Sets the value of the textareabelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTEXTAREABELOW(JAXBElement<String> value) { this.textareabelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class PGILLUSTRATION { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "picbelow" }) public static class Set { @XmlElement(name = "PIC_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set.PICBELOW picbelow; /** * Gets the value of the picbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set.PICBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set.PICBELOW getPICBELOW() { return picbelow; } /** * Sets the value of the picbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set.PICBELOW } * */ public void setPICBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.PGILLUSTRATION.Set.PICBELOW value) { this.picbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PIC_BELOW" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIC_BELOW.mimetype" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "picbelow", "picbelowDescription", "picbelowMimetype" }) public static class PICBELOW { @XmlElement(name = "PIC_BELOW") protected String picbelow; @XmlElement(name = "PIC_BELOW.description") protected String picbelowDescription; @XmlElement(name = "PIC_BELOW.mimetype") protected String picbelowMimetype; /** * Gets the value of the picbelow property. * * @return * possible object is * {@link String } * */ public String getPICBELOW() { return picbelow; } /** * Sets the value of the picbelow property. * * @param value * allowed object is * {@link String } * */ public void setPICBELOW(String value) { this.picbelow = value; } /** * Gets the value of the picbelowDescription property. * * @return * possible object is * {@link String } * */ public String getPICBELOWDescription() { return picbelowDescription; } /** * Sets the value of the picbelowDescription property. * * @param value * allowed object is * {@link String } * */ public void setPICBELOWDescription(String value) { this.picbelowDescription = value; } /** * Gets the value of the picbelowMimetype property. * * @return * possible object is * {@link String } * */ public String getPICBELOWMimetype() { return picbelowMimetype; } /** * Sets the value of the picbelowMimetype property. * * @param value * allowed object is * {@link String } * */ public void setPICBELOWMimetype(String value) { this.picbelowMimetype = value; } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_REFERENCE_TYPE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_AUTHOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TITLE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_SOURCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TESTLAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_DATE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class REFERENCE { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_REFERENCE_TYPE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_AUTHOR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TITLE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_SOURCE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_TESTLAB" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="REFERENCE_REPORT_DATE" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseotherreferencetype", "referenceauthor", "referenceyear", "referencetitle", "referencesource", "referencetestlab", "referencereportno", "referencecompanyid", "referencecompanystudyno", "referencereportdate" }) public static class Set { @XmlElement(name = "PHRASEOTHER_REFERENCE_TYPE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.PHRASEOTHERREFERENCETYPE phraseotherreferencetype; @XmlElement(name = "REFERENCE_AUTHOR") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEAUTHOR referenceauthor; @XmlElement(name = "REFERENCE_YEAR") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEYEAR referenceyear; @XmlElement(name = "REFERENCE_TITLE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETITLE referencetitle; @XmlElement(name = "REFERENCE_SOURCE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCESOURCE referencesource; @XmlElement(name = "REFERENCE_TESTLAB") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETESTLAB referencetestlab; @XmlElement(name = "REFERENCE_REPORT_NO") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTNO referencereportno; @XmlElement(name = "REFERENCE_COMPANY_ID") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYID referencecompanyid; @XmlElement(name = "REFERENCE_COMPANY_STUDY_NO") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYSTUDYNO referencecompanystudyno; @XmlElement(name = "REFERENCE_REPORT_DATE") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTDATE referencereportdate; /** * Gets the value of the phraseotherreferencetype property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.PHRASEOTHERREFERENCETYPE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.PHRASEOTHERREFERENCETYPE getPHRASEOTHERREFERENCETYPE() { return phraseotherreferencetype; } /** * Sets the value of the phraseotherreferencetype property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.PHRASEOTHERREFERENCETYPE } * */ public void setPHRASEOTHERREFERENCETYPE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.PHRASEOTHERREFERENCETYPE value) { this.phraseotherreferencetype = value; } /** * Gets the value of the referenceauthor property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEAUTHOR } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEAUTHOR getREFERENCEAUTHOR() { return referenceauthor; } /** * Sets the value of the referenceauthor property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEAUTHOR } * */ public void setREFERENCEAUTHOR(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEAUTHOR value) { this.referenceauthor = value; } /** * Gets the value of the referenceyear property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEYEAR } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEYEAR getREFERENCEYEAR() { return referenceyear; } /** * Sets the value of the referenceyear property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEYEAR } * */ public void setREFERENCEYEAR(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEYEAR value) { this.referenceyear = value; } /** * Gets the value of the referencetitle property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETITLE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETITLE getREFERENCETITLE() { return referencetitle; } /** * Sets the value of the referencetitle property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETITLE } * */ public void setREFERENCETITLE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETITLE value) { this.referencetitle = value; } /** * Gets the value of the referencesource property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCESOURCE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCESOURCE getREFERENCESOURCE() { return referencesource; } /** * Sets the value of the referencesource property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCESOURCE } * */ public void setREFERENCESOURCE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCESOURCE value) { this.referencesource = value; } /** * Gets the value of the referencetestlab property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETESTLAB } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETESTLAB getREFERENCETESTLAB() { return referencetestlab; } /** * Sets the value of the referencetestlab property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETESTLAB } * */ public void setREFERENCETESTLAB(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCETESTLAB value) { this.referencetestlab = value; } /** * Gets the value of the referencereportno property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTNO } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTNO getREFERENCEREPORTNO() { return referencereportno; } /** * Sets the value of the referencereportno property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTNO } * */ public void setREFERENCEREPORTNO(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTNO value) { this.referencereportno = value; } /** * Gets the value of the referencecompanyid property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYID } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYID getREFERENCECOMPANYID() { return referencecompanyid; } /** * Sets the value of the referencecompanyid property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYID } * */ public void setREFERENCECOMPANYID(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYID value) { this.referencecompanyid = value; } /** * Gets the value of the referencecompanystudyno property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYSTUDYNO } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYSTUDYNO getREFERENCECOMPANYSTUDYNO() { return referencecompanystudyno; } /** * Sets the value of the referencecompanystudyno property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYSTUDYNO } * */ public void setREFERENCECOMPANYSTUDYNO(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCECOMPANYSTUDYNO value) { this.referencecompanystudyno = value; } /** * Gets the value of the referencereportdate property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTDATE } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTDATE getREFERENCEREPORTDATE() { return referencereportdate; } /** * Sets the value of the referencereportdate property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTDATE } * */ public void setREFERENCEREPORTDATE(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REFERENCE.Set.REFERENCEREPORTDATE value) { this.referencereportdate = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TYPE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z31" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="REFERENCE_TYPE_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencetype", "referencetypeValue", "referencetypetxt" }) public static class PHRASEOTHERREFERENCETYPE { @XmlElement(name = "REFERENCE_TYPE") protected String referencetype; @XmlElement(name = "REFERENCE_TYPE.value") protected String referencetypeValue; @XmlElementRef(name = "REFERENCE_TYPE_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencetypetxt; /** * Gets the value of the referencetype property. * * @return * possible object is * {@link String } * */ public String getREFERENCETYPE() { return referencetype; } /** * Sets the value of the referencetype property. * * @param value * allowed object is * {@link String } * */ public void setREFERENCETYPE(String value) { this.referencetype = value; } /** * Gets the value of the referencetypeValue property. * * @return * possible object is * {@link String } * */ public String getREFERENCETYPEValue() { return referencetypeValue; } /** * Sets the value of the referencetypeValue property. * * @param value * allowed object is * {@link String } * */ public void setREFERENCETYPEValue(String value) { this.referencetypeValue = value; } /** * Gets the value of the referencetypetxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCETYPETXT() { return referencetypetxt; } /** * Sets the value of the referencetypetxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCETYPETXT(JAXBElement<String> value) { this.referencetypetxt = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_AUTHOR" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referenceauthor" }) public static class REFERENCEAUTHOR { @XmlElementRef(name = "REFERENCE_AUTHOR", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referenceauthor; /** * Gets the value of the referenceauthor property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCEAUTHOR() { return referenceauthor; } /** * Sets the value of the referenceauthor property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCEAUTHOR(JAXBElement<String> value) { this.referenceauthor = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencecompanyid" }) public static class REFERENCECOMPANYID { @XmlElementRef(name = "REFERENCE_COMPANY_ID", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencecompanyid; /** * Gets the value of the referencecompanyid property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCECOMPANYID() { return referencecompanyid; } /** * Sets the value of the referencecompanyid property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCECOMPANYID(JAXBElement<String> value) { this.referencecompanyid = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_COMPANY_STUDY_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencecompanystudyno" }) public static class REFERENCECOMPANYSTUDYNO { @XmlElementRef(name = "REFERENCE_COMPANY_STUDY_NO", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencecompanystudyno; /** * Gets the value of the referencecompanystudyno property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCECOMPANYSTUDYNO() { return referencecompanystudyno; } /** * Sets the value of the referencecompanystudyno property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCECOMPANYSTUDYNO(JAXBElement<String> value) { this.referencecompanystudyno = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_DATE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}timestamp" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencereportdate" }) public static class REFERENCEREPORTDATE { @XmlElementRef(name = "REFERENCE_REPORT_DATE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencereportdate; /** * Gets the value of the referencereportdate property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCEREPORTDATE() { return referencereportdate; } /** * Sets the value of the referencereportdate property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCEREPORTDATE(JAXBElement<String> value) { this.referencereportdate = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_REPORT_NO" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencereportno" }) public static class REFERENCEREPORTNO { @XmlElementRef(name = "REFERENCE_REPORT_NO", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencereportno; /** * Gets the value of the referencereportno property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCEREPORTNO() { return referencereportno; } /** * Sets the value of the referencereportno property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCEREPORTNO(JAXBElement<String> value) { this.referencereportno = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_SOURCE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencesource" }) public static class REFERENCESOURCE { @XmlElementRef(name = "REFERENCE_SOURCE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencesource; /** * Gets the value of the referencesource property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCESOURCE() { return referencesource; } /** * Sets the value of the referencesource property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCESOURCE(JAXBElement<String> value) { this.referencesource = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TESTLAB" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencetestlab" }) public static class REFERENCETESTLAB { @XmlElementRef(name = "REFERENCE_TESTLAB", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencetestlab; /** * Gets the value of the referencetestlab property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCETESTLAB() { return referencetestlab; } /** * Sets the value of the referencetestlab property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCETESTLAB(JAXBElement<String> value) { this.referencetestlab = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_TITLE" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referencetitle" }) public static class REFERENCETITLE { @XmlElementRef(name = "REFERENCE_TITLE", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referencetitle; /** * Gets the value of the referencetitle property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCETITLE() { return referencetitle; } /** * Sets the value of the referencetitle property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCETITLE(JAXBElement<String> value) { this.referencetitle = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="REFERENCE_YEAR" minOccurs="0"> * &lt;simpleType> * &lt;union> * &lt;simpleType> * &lt;restriction base="{http://echa.europa.eu/schemas/iuclid5/20130101}number_4_0"> * &lt;minInclusive value="1000"/> * &lt;maxInclusive value="9999"/> * &lt;/restriction> * &lt;/simpleType> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="0"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/union> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "referenceyear" }) public static class REFERENCEYEAR { @XmlElementRef(name = "REFERENCE_YEAR", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> referenceyear; /** * Gets the value of the referenceyear property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getREFERENCEYEAR() { return referenceyear; } /** * Sets the value of the referenceyear property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setREFERENCEYEAR(JAXBElement<String> value) { this.referenceyear = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class REMANYOTHER { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class Set { @XmlElement(name = "RICHTEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set.RICHTEXTBELOW richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set.RICHTEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set.RICHTEXTBELOW getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set.RICHTEXTBELOW } * */ public void setRICHTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMANYOTHER.Set.RICHTEXTBELOW value) { this.richtextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class RICHTEXTBELOW { @XmlElementRef(name = "RICHTEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setRICHTEXTBELOW(JAXBElement<String> value) { this.richtextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class REMMETC { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class Set { @XmlElement(name = "RICHTEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set.RICHTEXTBELOW richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set.RICHTEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set.RICHTEXTBELOW getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set.RICHTEXTBELOW } * */ public void setRICHTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMMETC.Set.RICHTEXTBELOW value) { this.richtextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class RICHTEXTBELOW { @XmlElementRef(name = "RICHTEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setRICHTEXTBELOW(JAXBElement<String> value) { this.richtextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class REMRS { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class Set { @XmlElement(name = "RICHTEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set.RICHTEXTBELOW richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set.RICHTEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set.RICHTEXTBELOW getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set.RICHTEXTBELOW } * */ public void setRICHTEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.REMRS.Set.RICHTEXTBELOW value) { this.richtextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RICHTEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string256000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "richtextbelow" }) public static class RICHTEXTBELOW { @XmlElementRef(name = "RICHTEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> richtextbelow; /** * Gets the value of the richtextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getRICHTEXTBELOW() { return richtextbelow; } /** * Sets the value of the richtextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setRICHTEXTBELOW(JAXBElement<String> value) { this.richtextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" maxOccurs="10" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_IDENTIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class TESTMAT { protected List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set> set; /** * Gets the value of the set property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the set property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set } * * */ public List<EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set> getSet() { if (set == null) { set = new ArrayList<EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set>(); } return this.set; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_IDENTIFIER" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element name="ID" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseotheridentifier", "id" }) public static class Set { @XmlElement(name = "PHRASEOTHER_IDENTIFIER") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.PHRASEOTHERIDENTIFIER phraseotheridentifier; @XmlElement(name = "ID") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.ID id; /** * Gets the value of the phraseotheridentifier property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.PHRASEOTHERIDENTIFIER } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.PHRASEOTHERIDENTIFIER getPHRASEOTHERIDENTIFIER() { return phraseotheridentifier; } /** * Sets the value of the phraseotheridentifier property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.PHRASEOTHERIDENTIFIER } * */ public void setPHRASEOTHERIDENTIFIER(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.PHRASEOTHERIDENTIFIER value) { this.phraseotheridentifier = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.ID } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.ID getID() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.ID } * */ public void setID(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMAT.Set.ID value) { this.id = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string2000" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "id" }) public static class ID { @XmlElementRef(name = "ID", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> id; /** * Gets the value of the id property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getID() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setID(JAXBElement<String> value) { this.id = ((JAXBElement<String> ) value); } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="IDENTIFIER" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z39" minOccurs="0"/> * &lt;element name="IDENTIFIER.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="IDENTIFIER_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "identifier", "identifierValue", "identifiertxt" }) public static class PHRASEOTHERIDENTIFIER { @XmlElement(name = "IDENTIFIER") protected String identifier; @XmlElement(name = "IDENTIFIER.value") protected String identifierValue; @XmlElementRef(name = "IDENTIFIER_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> identifiertxt; /** * Gets the value of the identifier property. * * @return * possible object is * {@link String } * */ public String getIDENTIFIER() { return identifier; } /** * Sets the value of the identifier property. * * @param value * allowed object is * {@link String } * */ public void setIDENTIFIER(String value) { this.identifier = value; } /** * Gets the value of the identifierValue property. * * @return * possible object is * {@link String } * */ public String getIDENTIFIERValue() { return identifierValue; } /** * Sets the value of the identifierValue property. * * @param value * allowed object is * {@link String } * */ public void setIDENTIFIERValue(String value) { this.identifierValue = value; } /** * Gets the value of the identifiertxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getIDENTIFIERTXT() { return identifiertxt; } /** * Sets the value of the identifiertxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setIDENTIFIERTXT(JAXBElement<String> value) { this.identifiertxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class TESTMATCONFIDENTIALDETAILS { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "freetextbelow" }) public static class Set { @XmlElement(name = "FREETEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set.FREETEXTBELOW freetextbelow; /** * Gets the value of the freetextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set.FREETEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set.FREETEXTBELOW getFREETEXTBELOW() { return freetextbelow; } /** * Sets the value of the freetextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set.FREETEXTBELOW } * */ public void setFREETEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATCONFIDENTIALDETAILS.Set.FREETEXTBELOW value) { this.freetextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "freetextbelow" }) public static class FREETEXTBELOW { @XmlElementRef(name = "FREETEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> freetextbelow; /** * Gets the value of the freetextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getFREETEXTBELOW() { return freetextbelow; } /** * Sets the value of the freetextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setFREETEXTBELOW(JAXBElement<String> value) { this.freetextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class TESTMATDETAILS { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "freetextbelow" }) public static class Set { @XmlElement(name = "FREETEXT_BELOW") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set.FREETEXTBELOW freetextbelow; /** * Gets the value of the freetextbelow property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set.FREETEXTBELOW } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set.FREETEXTBELOW getFREETEXTBELOW() { return freetextbelow; } /** * Sets the value of the freetextbelow property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set.FREETEXTBELOW } * */ public void setFREETEXTBELOW(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATDETAILS.Set.FREETEXTBELOW value) { this.freetextbelow = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="FREETEXT_BELOW" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string32768" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "freetextbelow" }) public static class FREETEXTBELOW { @XmlElementRef(name = "FREETEXT_BELOW", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> freetextbelow; /** * Gets the value of the freetextbelow property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getFREETEXTBELOW() { return freetextbelow; } /** * Sets the value of the freetextbelow property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setFREETEXTBELOW(JAXBElement<String> value) { this.freetextbelow = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class TESTMATFORM { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="PHRASEOTHER_TESTMAT_FORM" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "phraseothertestmatform" }) public static class Set { @XmlElement(name = "PHRASEOTHER_TESTMAT_FORM") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set.PHRASEOTHERTESTMATFORM phraseothertestmatform; /** * Gets the value of the phraseothertestmatform property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set.PHRASEOTHERTESTMATFORM } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set.PHRASEOTHERTESTMATFORM getPHRASEOTHERTESTMATFORM() { return phraseothertestmatform; } /** * Sets the value of the phraseothertestmatform property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set.PHRASEOTHERTESTMATFORM } * */ public void setPHRASEOTHERTESTMATFORM(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATFORM.Set.PHRASEOTHERTESTMATFORM value) { this.phraseothertestmatform = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="TESTMAT_FORM" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_A101" minOccurs="0"/> * &lt;element name="TESTMAT_FORM.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;element name="TESTMAT_FORM_TXT" type="{http://echa.europa.eu/schemas/iuclid5/20130101}string255" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "testmatform", "testmatformValue", "testmatformtxt" }) public static class PHRASEOTHERTESTMATFORM { @XmlElement(name = "TESTMAT_FORM") protected String testmatform; @XmlElement(name = "TESTMAT_FORM.value") protected String testmatformValue; @XmlElementRef(name = "TESTMAT_FORM_TXT", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> testmatformtxt; /** * Gets the value of the testmatform property. * * @return * possible object is * {@link String } * */ public String getTESTMATFORM() { return testmatform; } /** * Sets the value of the testmatform property. * * @param value * allowed object is * {@link String } * */ public void setTESTMATFORM(String value) { this.testmatform = value; } /** * Gets the value of the testmatformValue property. * * @return * possible object is * {@link String } * */ public String getTESTMATFORMValue() { return testmatformValue; } /** * Sets the value of the testmatformValue property. * * @param value * allowed object is * {@link String } * */ public void setTESTMATFORMValue(String value) { this.testmatformValue = value; } /** * Gets the value of the testmatformtxt property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getTESTMATFORMTXT() { return testmatformtxt; } /** * Sets the value of the testmatformtxt property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setTESTMATFORMTXT(JAXBElement<String> value) { this.testmatformtxt = ((JAXBElement<String> ) value); } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="set" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "set" }) public static class TESTMATINDICATOR { protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set set; /** * Gets the value of the set property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set getSet() { return set; } /** * Sets the value of the set property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set } * */ public void setSet(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set value) { this.set = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listbelowsel" }) public static class Set { @XmlElement(name = "LIST_BELOW_SEL") protected EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set.LISTBELOWSEL listbelowsel; /** * Gets the value of the listbelowsel property. * * @return * possible object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set.LISTBELOWSEL } * */ public EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set.LISTBELOWSEL getLISTBELOWSEL() { return listbelowsel; } /** * Sets the value of the listbelowsel property. * * @param value * allowed object is * {@link EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set.LISTBELOWSEL } * */ public void setLISTBELOWSEL(EndpointStudyRecord.ScientificPart.ENHENRYLAW.TESTMATINDICATOR.Set.LISTBELOWSEL value) { this.listbelowsel = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="LIST_BELOW_SEL" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z38" minOccurs="0"/> * &lt;element name="LIST_BELOW_SEL.value" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listbelowsel", "listbelowselValue" }) public static class LISTBELOWSEL { @XmlElement(name = "LIST_BELOW_SEL") protected String listbelowsel; @XmlElement(name = "LIST_BELOW_SEL.value") protected String listbelowselValue; /** * Gets the value of the listbelowsel property. * * @return * possible object is * {@link String } * */ public String getLISTBELOWSEL() { return listbelowsel; } /** * Sets the value of the listbelowsel property. * * @param value * allowed object is * {@link String } * */ public void setLISTBELOWSEL(String value) { this.listbelowsel = value; } /** * Gets the value of the listbelowselValue property. * * @return * possible object is * {@link String } * */ public String getLISTBELOWSELValue() { return listbelowselValue; } /** * Sets the value of the listbelowselValue property. * * @param value * allowed object is * {@link String } * */ public void setLISTBELOWSELValue(String value) { this.listbelowselValue = value; } } } } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="otherValue" type="{http://echa.europa.eu/schemas/iuclid5/20130101}picklistClearText" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="valueID" type="{http://echa.europa.eu/schemas/iuclid5/20130101}phrasegroup_Z05" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "otherValue" }) public static class StudyResultType { @XmlElementRef(name = "otherValue", namespace = "http://echa.europa.eu/schemas/iuclid5/20130101", type = JAXBElement.class) protected JAXBElement<String> otherValue; @XmlAttribute protected String valueID; /** * Gets the value of the otherValue property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getOtherValue() { return otherValue; } /** * Sets the value of the otherValue property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setOtherValue(JAXBElement<String> value) { this.otherValue = ((JAXBElement<String> ) value); } /** * Gets the value of the valueID property. * * @return * possible object is * {@link String } * */ public String getValueID() { return valueID; } /** * Sets the value of the valueID property. * * @param value * allowed object is * {@link String } * */ public void setValueID(String value) { this.valueID = value; } } }
lgpl-3.0
oleg-cherednik/cop.swing.segment-viewer
src/main/java/cop/swing/controls/segment/tmp/factories/NineSegmentSymbolFactory.java
641
package cop.swing.controls.segment.tmp.factories; public class NineSegmentSymbolFactory extends SevenSegmentSymbolFactory { public static final int SEG_TOP_SLASH = 0x80; public static final int SEG_BOTTOM_SLASH = 0x100; static { symbols.put('1', symbols.get('1') | SEG_TOP_SLASH); symbols.put('3', SEG_TOP | SEG_TOP_SLASH | SEG_CENTER | SEG_BOTTOM_SIDE_RIGHT | SEG_BOTTOM); symbols.put('7', SEG_TOP | SEG_TOP_SLASH | SEG_BOTTOM_SLASH); } /* * BasicSegmentSymbolFactory */ @Override protected int getAll() { return super.getAll() | SEG_TOP_SLASH | SEG_BOTTOM_SLASH; } }
lgpl-3.0
ODTBuilder/Builder-v1.0
OpenGDS_2017/src/main/java/com/git/opengds/generalization/service/GeneralizationProgressService.java
592
package com.git.opengds.generalization.service; import org.json.simple.JSONArray; import com.git.opengds.user.domain.UserVO; public interface GeneralizationProgressService { Integer setStateToRequest(UserVO userVO, int validateStart, String collectionName, String type, JSONArray layersArray); Integer setStateToRequest(UserVO userVO, int validateStart, String collectionName, String type, String layerName); void setStateToProgressing(UserVO userVO, int state, String type, Integer pIdx); void setStateToResponse(UserVO userVO, String type, String genTbName, Integer pIdx); }
lgpl-3.0
fuinorg/utils4j
src/test/java/org/fuin/utils4j/filter/RegExprPropertyFilterTest.java
6447
/** * Copyright (C) 2015 Michael Schnell. All rights reserved. * http://www.fuin.org/ * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see http://www.gnu.org/licenses/. */ package org.fuin.utils4j.filter; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; //CHECKSTYLE:OFF public class RegExprPropertyFilterTest extends PropertyFilterTest { @Override protected final PropertyFilter createTestee(final String propertyName) { return new RegExprPropertyFilter(propertyName, "a*b"); } @Test public final void testSetGetType() { final RegExprPropertyFilter filter = new RegExprPropertyFilter(STRING_PROPERTY_NAME, "a*b"); filter.setType(RegExprFilter.MATCHES); assertThat(filter.getType()).isEqualTo(RegExprFilter.MATCHES); assertThat(filter.getTypeName()).isEqualTo("matches"); filter.setType(RegExprFilter.LOOKING_AT); assertThat(filter.getType()).isEqualTo(RegExprFilter.LOOKING_AT); assertThat(filter.getTypeName()).isNull(); filter.setType(RegExprFilter.FIND); assertThat(filter.getType()).isEqualTo(RegExprFilter.FIND); assertThat(filter.getTypeName()).isEqualTo("find"); } @Test public final void testSetGetTypeName() { final RegExprPropertyFilter filter = new RegExprPropertyFilter(STRING_PROPERTY_NAME, "a*b"); filter.setTypeName("matches"); assertThat(filter.getTypeName()).isEqualTo("matches"); assertThat(filter.getType()).isEqualTo(RegExprFilter.MATCHES); filter.setTypeName("lookingAt"); assertThat(filter.getTypeName()).isNull(); assertThat(filter.getType()).isEqualTo(RegExprFilter.LOOKING_AT); filter.setTypeName("find"); assertThat(filter.getTypeName()).isEqualTo("find"); assertThat(filter.getType()).isEqualTo(RegExprFilter.FIND); } @Test public final void testCompliesMatches() { final RegExprPropertyFilter filter1 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, "a*b"); filter1.setType(RegExprFilter.MATCHES); assertThat(filter1.complies(new TestObject("ab"))).isTrue(); assertThat(filter1.complies(new TestObject("aab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaabb"))).isFalse(); assertThat(filter1.complies(new TestObject("abc"))).isFalse(); assertThat(filter1.complies(new TestObject("bab"))).isFalse(); assertThat(filter1.complies(new TestObject("xbab"))).isFalse(); final RegExprPropertyFilter filter2 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, ".*schlemmerinfo\\.de.*"); filter2.setType(RegExprFilter.MATCHES); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/hamburg/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/deu"))).isTrue(); assertThat(filter2.complies(new TestObject("www.schlemmerinfo.de"))).isTrue(); } @Test public final void testCompliesLookingAt() { final RegExprPropertyFilter filter1 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, "a*b"); filter1.setType(RegExprFilter.LOOKING_AT); assertThat(filter1.complies(new TestObject("ab"))).isTrue(); assertThat(filter1.complies(new TestObject("aab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaabb"))).isTrue(); assertThat(filter1.complies(new TestObject("abc"))).isTrue(); assertThat(filter1.complies(new TestObject("bab"))).isTrue(); assertThat(filter1.complies(new TestObject("xbab"))).isFalse(); final RegExprPropertyFilter filter2 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, ".*schlemmerinfo\\.de.*"); filter2.setType(RegExprFilter.LOOKING_AT); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/hamburg/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/deu"))).isTrue(); assertThat(filter2.complies(new TestObject("www.schlemmerinfo.de"))).isTrue(); } @Test public final void testCompliesFind() { final RegExprPropertyFilter filter1 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, "a*b"); filter1.setType(RegExprFilter.FIND); assertThat(filter1.complies(new TestObject("ab"))).isTrue(); assertThat(filter1.complies(new TestObject("aab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaab"))).isTrue(); assertThat(filter1.complies(new TestObject("aaabb"))).isTrue(); assertThat(filter1.complies(new TestObject("abc"))).isTrue(); assertThat(filter1.complies(new TestObject("bab"))).isTrue(); assertThat(filter1.complies(new TestObject("xbab"))).isTrue(); final RegExprPropertyFilter filter2 = new RegExprPropertyFilter(STRING_PROPERTY_NAME, ".*schlemmerinfo\\.de.*"); filter2.setType(RegExprFilter.FIND); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/eng/hamburg/"))).isTrue(); assertThat(filter2.complies(new TestObject("http://www.schlemmerinfo.de/deu"))).isTrue(); assertThat(filter2.complies(new TestObject("www.schlemmerinfo.de"))).isTrue(); } } // CHECKSTYLE:ON
lgpl-3.0
syntelos/jauk
src/automaton/NamedAutomata.java
22298
/* * automaton * * Copyright (c) 2001-2011 Anders Moeller * Copyright (c) 2011 John Pritchard * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package automaton; /** * Named automata. * * <h3>Complex Automata</h3> * * <pre> * final Builtin builtin = Builtin.Init(); * final State begin = new State(true); * { * final State text = new State(true); * final State nest = new State(true); * final State end = new State(true); * * begin.addTransition(new Transition('{',text)); * text.addTransition(new Transition(' ','z',text)); * text.addTransition(new Transition('|',text)); * text.addTransition(new Transition('{',nest)); * text.addTransition(new Transition('}',end)); * nest.addTransition(new Transition(' ','z',nest)); * nest.addTransition(new Transition('|',nest)); * nest.addTransition(new Transition('}',text)); * } * final Automaton BlockBody = new Automaton(begin); * * * final Basic cx = new Basic(builtin,true,new Object[][]{ * {"Block.Head",BasicAutomata.MakeString("{")}, * {"Block.Body",BlockBody}, * {"Block.Tail",BasicAutomata.MakeString("}")}, * }); * jauk.Re BlockRe = new jauk.Re(cx,"&lt;_&gt;*(for|while|if)~(&lt;Block.Head&gt;)*&lt;Block.Body&gt;"); * </pre> * * * @see RegExp * @author John Pritchard */ public interface NamedAutomata { /** * @return Known name, able to return. */ public boolean isAutomaton(String name); /** * @return Must be a non null, cloneable automaton. Otherwise * throw an illegal argument exception. */ public Automaton getAutomaton(String name); /** * An implementation of Named Automata permitting additional * scopes as inferior or superior. */ public static class Basic extends lxl.Map<String,Automaton> implements Context { protected final NamedAutomata map; protected final boolean mapSuperior; protected final boolean spacetime; public Basic(){ this(true,null,true); } public Basic(boolean spacetime){ this(spacetime,null,true); } public Basic(NamedAutomata map, boolean superior){ this(true,null,true); } public Basic(boolean spacetime, NamedAutomata map, boolean superior){ super(); this.spacetime = spacetime; if (null != map){ this.map = map; this.mapSuperior = superior; } else { this.map = null; this.mapSuperior = false; } } public Basic(NamedAutomata map, boolean superior, String[][] fill){ this(true,map,superior,fill); } public Basic(boolean spacetime, NamedAutomata map, boolean superior, String[][] fill){ this(spacetime,map,superior); if (null != fill){ for (String[] nvpair: fill){ if (null != nvpair && 2 == nvpair.length){ String name = nvpair[0]; String regx = nvpair[1]; this.put(name,new RegExp(regx).toAutomaton()); } } } } public Basic(NamedAutomata map, boolean superior, Object[][] fill){ this(true,map,superior,fill); } public Basic(boolean spacetime, NamedAutomata map, boolean superior, Object[][] fill){ this(spacetime,map,superior); if (null != fill){ for (Object[] nvpair: fill){ if (null != nvpair && 2 == nvpair.length){ String name = (String)nvpair[0]; Automaton aut = (Automaton)nvpair[1]; this.put(name,aut); } } } } public boolean compileForTime(){ return this.spacetime; } public boolean isAutomaton(String name){ if (null != this.map) return (this.containsKey(name) || this.map.isAutomaton(name)); else return this.containsKey(name); } public Automaton getAutomaton(String name){ if (null != this.map){ if (this.mapSuperior){ if (this.map.isAutomaton(name)) return this.map.getAutomaton(name); else { final Automaton automaton = this.get(name); if (null != automaton) return automaton; else throw new IllegalArgumentException(String.format("Automaton named '%s' not found.",name)); } } else { final Automaton automaton = this.get(name); if (null != automaton) return automaton; else return this.map.getAutomaton(name); } } else { final Automaton automaton = this.get(name); if (null != automaton) return automaton; else throw new IllegalArgumentException(String.format("Automaton named '%s' not found.",name)); } } } /** * An implementation of Named Automata with a few of the automata * defined in the original automaton package. */ public static class Builtin extends Basic { /* * */ public final static boolean Spacetime; static { boolean spacetime = true; try { String config = System.getProperty("automaton.NamedAutomata.Builtin.Spacetime"); if (null != config) spacetime = "true".equals(config); } catch (Throwable ignore){ } Spacetime = spacetime; } /* * Assign */ public final static NamedAutomata Instance = new Builtin(); /* * Self referencing operatations */ static { ((Builtin)Instance).init(); } /** * Provoke class initialization */ public final static NamedAutomata Init(){ return Instance; } public Builtin(){ super(Spacetime); } protected void init(){ this.put("Extender",(new RegExp("[\u3031-\u3035\u309D-\u309E\u30FC-\u30FE\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005]")).toAutomaton()); this.put("CombiningChar",(new RegExp("[\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05C1-\u05C2\u064B-\u0652" + "\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093E-\u094C\u0951-\u0954" + "\u0962-\u0963\u0981-\u0983\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09E2-\u09E3\u0A40-\u0A42\u0A47-\u0A48" + "\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3E-\u0B43" + "\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0C01-\u0C03" + "\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD" + "\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0E34-\u0E3A\u0E47-\u0E4E\u0EB4-\u0EB9" + "\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F99-\u0FAD\u0FB1-\u0FB7" + "\u20D0-\u20DC\u302A-\u302F\u05BF\u05C4\u0670\u093C\u094D\u09BC\u09BE\u09BF\u09D7\u0A02\u0A3C\u0A3E\u0A3F" + "\u0ABC\u0B3C\u0BD7\u0D57\u0E31\u0EB1\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F97\u0FB9\u20E1\u3099\u309A]")).toAutomaton()); this.put("Digit",(new RegExp("[\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F" + "\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]")).toAutomaton()); this.put("Ideographic",(new RegExp("[\u4E00-\u9FA5\u3021-\u3029\u3007]")).toAutomaton()); this.put("BaseChar",(new RegExp("[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148" + "\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0388-\u038A" + "\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481" + "\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0561-\u0586" + "\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3" + "\u06E5-\u06E6\u0905-\u0939\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B6-\u09B9" + "\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33" + "\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A72-\u0A74\u0A85-\u0A8B\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0" + "\u0AB2-\u0AB3\u0AB5-\u0AB9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39" + "\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9E-\u0B9F\u0BA3-\u0BA4" + "\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39" + "\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CE0-\u0CE1\u0D05-\u0D0C" + "\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82" + "\u0E87-\u0E88\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB2-\u0EB3\u0EC0-\u0EC4" + "\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1102-\u1103\u1105-\u1107\u110B-\u110C\u110E-\u1112" + "\u1154-\u1155\u115F-\u1161\u116D-\u116E\u1172-\u1173\u11AE-\u11AF\u11B7-\u11B8\u11BC-\u11C2\u1E00-\u1E9B" + "\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F5F-\u1F7D\u1F80-\u1FB4" + "\u1FB6-\u1FBC\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC" + "\u212A-\u212B\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3" + "\u0386\u038C\u03DA\u03DC\u03DE\u03E0\u0559\u06D5\u093D\u09B2\u0A5E\u0A8D\u0ABD\u0AE0\u0B3D\u0B9C\u0CDE\u0E30\u0E84\u0E8A" + "\u0E8D\u0EA5\u0EA7\u0EB0\u0EBD\u1100\u1109\u113C\u113E\u1140\u114C\u114E\u1150\u1159\u1163\u1165\u1167\u1169\u1175\u119E" + "\u11A8\u11AB\u11BA\u11EB\u11F0\u11F9\u1F59\u1F5B\u1F5D\u1FBE\u2126\u212E]")).toAutomaton()); /* * Essential unicode character classes */ this.put("Letter",(new RegExp("<BaseChar>|<Ideographic>")).toAutomaton()); this.put("Char",(new RegExp("[\t\n\r\u0020-\uD7FF\ue000-\ufffd]|[\uD800-\uDBFF][\uDC00-\uDFFF]")).toAutomaton()); /* * Whitespace (+ related) */ this.put("_",(new RegExp("[ \t\n\r]")).toAutomaton()); this.put("Sp",(new RegExp("[ \t]")).toAutomaton()); this.put("S",(new RegExp("[ \t\n\r]")).toAutomaton()); this.put("Newline",(new RegExp("[\n\r]")).toAutomaton()); this.put("Line",(new RegExp("~(<Newline>)*<Newline>#")).toAutomaton()); /* * Convenience */ { Basic cc = new Basic(this,true,new Object[][]{ {"CC.Head",BasicAutomata.MakeString("/*")}, {"CC.Tail",BasicAutomata.MakeString("*/")}, }); this.put("CComment",(new RegExp(cc,"<CC.Head>~(<CC.Tail>)*<CC.Tail>#")).toAutomaton()); } /* * ASCII (unicode basic & common) */ this.put("LowAlpha",(new RegExp("[a-z]")).toAutomaton()); this.put("UpAlpha",(new RegExp("[A-Z]")).toAutomaton()); this.put("Digit",(new RegExp("[0-9]")).toAutomaton()); this.put("Dot",(new RegExp("\".\"")).toAutomaton()); this.put("Hyphen",(new RegExp("\"-\"")).toAutomaton()); this.put("Alpha",(new RegExp("<LowAlpha>|<UpAlpha>")).toAutomaton()); this.put("AlphaNum",(new RegExp("<Alpha>|<Digit>")).toAutomaton()); this.put("AlphaNumDot",(new RegExp("<AlphaNum>|<Dot>")).toAutomaton()); this.put("AlphaNumDotHyphen",(new RegExp("<AlphaNum>|<Dot>|<Hyphen>")).toAutomaton()); /* * A weak email address validator is fast. This email * address string is adequate to database use. This string * has one at (@) and no colons (:). */ this.put("EmailAddress",(new RegExp("<AlphaNumDotHyphen>+\"@\"<AlphaNumDotHyphen>+")).toAutomaton()); /* * A simplistic URL validator adequate to most database * use. */ this.put("LinkUrl",(new RegExp("<LowAlpha>+\"://\"([@:]|<AlphaNumDotHyphen>)+\"/\"([/?&%]|<AlphaNumDotHyphen>)+")).toAutomaton()); /* * A telephone number validator that requires '+' country * code and dot or hyphen formatting. * * Accepts the following examples. * +1-800-555-1212 * +1.800.555.1212 * +41-22-730-5989 * +6-22-73-05-98-99 * * Rejects mixed hyphens and dots, and inadequate number * of hyphen or dot separated groups. */ this.put("TelephoneNumber",(new RegExp("(\"+\"(<Digit>+<Dot>){3,5}<Digit>+|\"+\"(<Digit>+<Hyphen>){3,5}<Digit>+)")).toAutomaton()); /* * Date & Time */ this.put("Z",(new RegExp("[-+](<00-13>:<00-59>|14:00)|Z")).toAutomaton()); this.put("Y",(new RegExp("(<Digit>{4,})&~(0000)")).toAutomaton()); this.put("M",(new RegExp("<01-12>")).toAutomaton()); this.put("D",(new RegExp("<01-31>")).toAutomaton()); this.put("T",(new RegExp("<00-23>:<00-59>:<00-59>|24:00:00")).toAutomaton()); this.put("Duration",(new RegExp("<_>*(-?P(((<Digit>+Y)?(<Digit>+M)?(<Digit>+D)?(T(((<Digit>+H)?(<Digit>+M)?(<Digit>+(\\.<Digit>+)?S)?)&~()))?)&~()))<_>*")).toAutomaton()); this.put("DateTime",(new RegExp("<_>*(-?<Y>-<M>-<Digit>T<T>(\\.<Digit>+)?<Z>?)<_>*")).toAutomaton()); this.put("Time",(new RegExp("<_>*(<T>(\\.<Digit>+)?<Z>?)<_>*")).toAutomaton()); this.put("Date",(new RegExp("<_>*(-?<Y>-<M>-<D><Z>?)<_>*")).toAutomaton()); this.put("YearMonth",(new RegExp("<_>*(-?<Y>-<M><Z>?)<_>*")).toAutomaton()); this.put("Year",(new RegExp("<_>*(-?<Y><Z>?)<_>*")).toAutomaton()); this.put("MonthDay",(new RegExp("<_>*(--<M>-<D><Z>?)<_>*")).toAutomaton()); this.put("Day",(new RegExp("<_>*(--<D><Z>?)<_>*")).toAutomaton()); this.put("Month",(new RegExp("<_>*(--<M><Z>?)<_>*")).toAutomaton()); /* * Data Strings */ this.put("DoubleQuote",(new RegExp("[\"]")).toAutomaton()); this.put("BackSlash",(new RegExp("[\\\\]")).toAutomaton()); this.put("DoubleQuoted",(new RegExp("<DoubleQuote>~(<DoubleQuote>)*<DoubleQuote>")).toAutomaton()); //this.put("DoubleQuoted",(new RegExp("<DoubleQuote>((~<DoubleQuote>)|(<BackSlash><DoubleQuote>))*<DoubleQuote>")).toAutomaton()); this.put("SingleQuote",(new RegExp("'")).toAutomaton()); this.put("SingleQuoted",(new RegExp("<SingleQuote>~(<SingleQuote>)*<SingleQuote>")).toAutomaton()); //this.put("SingleQuoted",(new RegExp("<SingleQuote>((~<SingleQuote>)|(<BackSlash><SingleQuote>))*<SingleQuote>")).toAutomaton()); this.put("Hex",(new RegExp("<Digit>|[a-f]|[A-F]")).toAutomaton()); this.put("B64",(new RegExp("[A-Za-z0-9+/]")).toAutomaton()); this.put("B16",(new RegExp("[AEIMQUYcgkosw048]")).toAutomaton()); this.put("B04",(new RegExp("[AQgw]")).toAutomaton()); this.put("B04S",(new RegExp("<B04> ?")).toAutomaton()); this.put("B16S",(new RegExp("<B16> ?")).toAutomaton()); this.put("B64S",(new RegExp("<B64> ?")).toAutomaton()); this.put("HexBinary",(new RegExp("<_>*([0-9a-fA-F]{2}*)<_>*")).toAutomaton()); this.put("B64Binary",(new RegExp("<_>*(((<B64S><B64S><B64S><B64S>)*((<B64S><B64S><B64S><B64>)|(<B64S><B64S><B16S>=)|(<B64S><B04S>= ?=)))?)<_>*")).toAutomaton()); /* * Logical & Numeric Values */ this.put("Boolean",(new RegExp("<_>*(true|false|1|0)<_>*")).toAutomaton()); this.put("Decimal",(new RegExp("<_>*([-+]?<Digit>+(\\.<Digit>+)?)<_>*")).toAutomaton()); this.put("Float",(new RegExp("<_>*([-+]?<Digit>+(\\.<Digit>+)?([Ee][-+]?<Digit>+)?|INF|-INF|NaN)<_>*")).toAutomaton()); this.put("Integer",(new RegExp("<_>*[-+]?[0-9]+<_>*")).toAutomaton()); this.put("NonPositiveInteger",(new RegExp("<_>*(0+|-<Digit>+)<_>*")).toAutomaton()); this.put("NegativeInteger",(new RegExp("<_>*(-[1-9]<Digit>*)<_>*")).toAutomaton()); this.put("NonNegativeInteger",(new RegExp("<_>*(<Digit>+)<_>*")).toAutomaton()); this.put("PositiveInteger",(new RegExp("<_>*([1-9]<Digit>*)<_>*")).toAutomaton()); final Basic Numeric = new Basic(this,true,new Object[][]{ {"UNSIGNEDLONG", BasicAutomata.MakeMaxInteger("18446744073709551615")}, {"UNSIGNEDINT", BasicAutomata.MakeMaxInteger("4294967295")}, {"UNSIGNEDSHORT", BasicAutomata.MakeMaxInteger("65535")}, {"UNSIGNEDBYTE", BasicAutomata.MakeMaxInteger("255")}, {"LONG", BasicAutomata.MakeMaxInteger("9223372036854775807")}, {"LONG_NEG", BasicAutomata.MakeMaxInteger("9223372036854775808")}, {"INT", BasicAutomata.MakeMaxInteger("2147483647")}, {"INT_NEG", BasicAutomata.MakeMaxInteger("2147483648")}, {"SHORT", BasicAutomata.MakeMaxInteger("32767")}, {"SHORT_NEG", BasicAutomata.MakeMaxInteger("32768")}, {"BYTE", BasicAutomata.MakeMaxInteger("127")}, {"BYTE_NEG", BasicAutomata.MakeMaxInteger("128")} }); this.put("ULong",(new RegExp(Numeric,"<_>*<UNSIGNEDLONG><_>*")).toAutomaton()); this.put("UInt",(new RegExp(Numeric,"<_>*<UNSIGNEDINT><_>*")).toAutomaton()); this.put("UShort",(new RegExp(Numeric,"<_>*<UNSIGNEDSHORT><_>*")).toAutomaton()); this.put("UByte",(new RegExp(Numeric,"<_>*<UNSIGNEDBYTE><_>*")).toAutomaton()); this.put("Long",(new RegExp(Numeric,"<_>*(<LONG>|-<LONG_NEG>)<_>*")).toAutomaton()); this.put("Int",(new RegExp(Numeric,"<_>*(<INT>|-<INT_NEG>)<_>*")).toAutomaton()); this.put("Short",(new RegExp(Numeric,"<_>*(<SHORT>|-<SHORT_NEG>)<_>*")).toAutomaton()); this.put("Byte",(new RegExp(Numeric,"<_>*(<BYTE>|-<BYTE_NEG>)<_>*")).toAutomaton()); } } }
lgpl-3.0
ligzy/Chronicle-Queue
chronicle-queue/src/main/java/net/openhft/chronicle/queue/ChronicleQueue.java
4272
/* * Copyright (C) 2015 higherfrequencytrading.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.openhft.chronicle.queue; import org.jetbrains.annotations.NotNull; import java.io.Closeable; import java.io.IOException; /** * <em>Chronicle</em> (in a generic sense) is a Java project focused on building a persisted low latency messaging * framework for high performance and critical applications. * * <p> Using non-heap storage options <em>Chronicle</em> provides a processing environment where applications does not * suffer from <em>GarbageCollection</em>. <em>GarbageCollection</em> (GC) may slow down your critical operations * non-deterministically at any time.. In order to avoid non-determinism and escape from GC delays off-heap memory * solutions are addressed. The main idea is to manage your memory manually so does not suffer from GC. Chronicle * behaves like a management interface over off-heap memory so you can build your own solutions over it. * * <p><em>Chronicle</em> uses RandomAccessFiles while managing memory and this choice brings lots of possibility. Random * access files permit non-sequential, or random, access to a file's contents. To access a file randomly, you open the * file, seek a particular location, and read from or write to that file. RandomAccessFiles can be seen as "large" * C-type byte arrays that you can access any random index "directly" using pointers. File portions can be used as * ByteBuffers if the portion is mapped into memory. * * <p>{@link ChronicleQueue} (now in the specific sense) is the main interface for management and can * be seen as the "Collection class" of the <em>Chronicle</em> environment. You will reserve a portion of memory and * then put/fetch/update records using the {@link ChronicleQueue} interface.</p> * * <p>{@link Excerpt} is the main data container in a {@link ChronicleQueue}, * each Chronicle is composed of Excerpts. Putting data to a chronicle means starting a new Excerpt, writing data into * it and finishing the Excerpt at the end.</p> * * <p>While {@link Excerpt} is a generic purpose container allowing for remote access, it also has * more specialized counterparts for sequential operations. See {@link ExcerptTailer} and {@link * net.openhft.chronicle.queue.ExcerptAppender}</p> * * @author peter.lawrey */ public interface ChronicleQueue extends Closeable { /** * @return A descriptive name for this chronicle which can be used for logging. */ String name(); /** * An Excerpt can be used access entries randomly and optionally change them. * * @return Excerpt * @throws IOException if an IO problem occurs */ @NotNull Excerpt createExcerpt() throws IOException; /** * A Tailer can be used to read sequentially from the start of a given position. * * @return ExcerptTailer * @throws IOException if an IO problem occurs */ @NotNull ExcerptTailer createTailer() throws IOException; /** * An Appender can be used to write new excerpts sequentially to the end. * * @return ExcerptAppender * @throws IOException if an IO problem occurs */ @NotNull ExcerptAppender createAppender() throws IOException; /** * @return The current estimated number of entries. */ long size(); /** * Remove all the entries in the chronicle. */ void clear(); /** * @return the lowest valid index available. */ long firstAvailableIndex(); /** * @return the highest valid index immediately available. */ long lastWrittenIndex(); }
lgpl-3.0
awltech/easycukes
easycukes-commons/src/main/java/com/worldline/easycukes/commons/Constants.java
369
package com.worldline.easycukes.commons; import lombok.experimental.UtilityClass; /** * Just a bunch of constants * * @author aneveux * @version 1.0 */ @UtilityClass public class Constants { public static final String BASEURL = "baseurl"; public static final String SCMURL = "scmurl"; public static final String CUCUMBER_PREFIX = "cucumberprefix"; }
lgpl-3.0
lazarcon/J_CPU_Simulation
CPU-Simulation/src/test/java/ch/zhaw/lazari/cpu/impl/ProgramLoader2ByteInstructionSetTest.java
2117
/* * File: ProgramLoader2ByteInstructionSetTest.java * Date: Oct 29, 2013 * * Copyright 2013 Constantin Lazari. All rights reserved. * * Unless required by applicable law or agreed to in writing, this software * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. */ package ch.zhaw.lazari.cpu.impl; import static ch.zhaw.lazari.cpu.impl.utils.BooleanArrayUtils.fromInt; import static ch.zhaw.lazari.cpu.impl.utils.BooleanArrayUtils.toInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import java.util.LinkedList; import java.util.List; import org.junit.Test; import ch.zhaw.lazari.cpu.api.Memory; import ch.zhaw.lazari.cpu.api.ProgramLoader; /** * Responsibility: */ public class ProgramLoader2ByteInstructionSetTest { /** * Test method for {@link ch.zhaw.lazari.cpu.impl.ProgramLoader2ByteInstructionSet#load(java.util.List)}. */ @Test public void testLoad() { final Memory memory = mock(Memory.class); final ProgramLoader loader = new ProgramLoader2ByteInstructionSet(); final List<String> lines = new LinkedList<String>(); lines.add("100 CLR R0"); lines.add("102 CLR R1"); lines.add("104 CLR R2 some comment"); lines.add("106 CLR R3"); lines.add(""); lines.add("108 ADD R0"); lines.add("110 ADDD -24; comment"); lines.add("112 INC"); lines.add("114 DEC"); lines.add("116 SWDD R1 #200"); lines.add("118 LWDD R2 #300"); lines.add("120 SRA"); lines.add("122 SLA"); lines.add("124 SRL"); lines.add("126 SLL"); lines.add("128 AND R3"); lines.add("130 OR R2"); lines.add("134 NOT"); lines.add("136 BZ R1"); lines.add("138 BNZ R2"); lines.add("140 BC R3"); lines.add("142 B R0"); lines.add("144 BZD #200"); lines.add("146 BNZD #202"); lines.add("148 BCD #204"); lines.add("150 BD #206"); lines.add("152 END"); loader.load(lines, memory); verify(memory).store(100, toByte("00000010")); verify(memory).store(101, toByte("10000000")); } private boolean[] toByte(final String bits) { return fromInt(toInt(bits), Byte.SIZE); } }
lgpl-3.0
kwakeroni/workshops
java9/solution/src/test/java/be/kwakeroni/workshop/java9/solution/language/Strings.java
7266
package be.kwakeroni.workshop.java9.solution.language; import be.kwakeroni.workshop.java9.solution.Student; import com.fasterxml.jackson.databind.ObjectMapper; import org.assertj.core.api.Assertions; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import java.text.CompactNumberFormat; import java.text.NumberFormat; import java.util.Arrays; import java.util.Locale; import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; public class Strings { private final ObjectMapper objectMapper = new ObjectMapper(); private final Student student = new Student("Bart", "Simpson", 8); /** * @since 13-14 (Preview) */ @Test public void testStudentSerialization() throws Exception { JSONAssert.assertEquals( objectMapper.writeValueAsString(student), //language=json """ { firstName: "Bart", lastName: "Simpson", age: 8 }""", false ); } /** * @since 13-14 (Preview) */ @Test public void testSerializationPretty() throws Exception { assertThat(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(student)) .isEqualTo(/* language=json */ """ { "firstName" : "Bart", "lastName" : "Simpson", "age" : 8 }"""); } /** * @since 12 (String.indent) * @since 13-14 (Preview) */ @Test public void testIndent() throws Exception { assertThat(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(student).indent(2)) .isEqualTo(/* language=json */ """ { "firstName" : "Bart", "lastName" : "Simpson", "age" : 8 } """); } /** * @since 14 (preview) */ @Test public void testSkipNewline() throws Exception { assertThat(""" TODO Search for a piece of poetry with some very long lines that may need to be wrapped around \ for readibility and that we would want to wrap over multiple lines but not really And with a second line to finish """).isEqualTo("TODO Search for a piece of poetry with some very long lines that may need to be wrapped around for readibility and that we would want to wrap over multiple lines but not really\nAnd with a second line to finish\n"); } /** * @since 14 (preview) */ @Test public void testTrailingSpace() throws Exception { assertThat(""" Some text That is \s Layed Out Squarely\s """).isEqualTo("Some text\nThat is \nLayed Out\nSquarely \n"); } /** * @since 13-14 (Preview) */ @Test public void testStripIndent() throws Exception { assertThat((/* language=json */ """ { "firstName" : "Bart", "lastName" : "Simpson", "age" : 8 } \ """.stripIndent())) .isEqualTo(/* language=json */ """ { "firstName" : "Bart", "lastName" : "Simpson", "age" : 8 } """); } /** * @since 13-14 (preview) */ @Test public void testConcatenation() throws Exception { String name = "Tobania"; assertThat(""" This example is used by %s to show that concatenating text blocks is not an easy matter""".formatted(name)) .isEqualTo("This example\nis used by Tobania\nto show that\nconcatenating\ntext blocks\nis not\nan easy matter"); } /** * @since 11 */ @Test public void testWhiteSpace() throws Exception { String one = " "; String two = "   "; assertThat(one).isBlank(); assertThat(one).isJavaBlank(); assertThat(one.isBlank()).isTrue(); assertThat(two).isBlank(); assertThat(two).isJavaBlank(); assertThat(two.isBlank()).isTrue(); String oneX = one + "X"; String twoX = two + "X"; assertThat(oneX.trim()).isEqualTo("X"); assertThat(oneX.strip()).isEqualTo("X"); // assertThat(twoX.trim()).isEqualTo("X"); assertThat(twoX.strip()).isEqualTo("X"); } /** * @since 11 */ @Test public void testLines() { //language=properties String properties = """ jpa.datasource.url=jdbc:localhost:postgres/mydb jpa.datasource.username=postgres jpa.datasource.password=postgres """; assertThat(properties.lines()).containsExactly( "jpa.datasource.url=jdbc:localhost:postgres/mydb", "jpa.datasource.username=postgres", "jpa.datasource.password=postgres" ); } /** * @since 11 */ @Test public void testStringRepeat() { assertThat("XY".repeat(3)).isEqualTo("XYXYXY"); } /** * @since 12 */ @Test public void testStringTransform() { assertThat("get" + "student first name ".trim().transform(this::toCamelCase)) .isEqualTo("getStudentFirstName"); } /** * @since 13-14 (preview) */ @Test public void testTranslateEscapes() { assertThat("\\\"XY\\\"\\r\\n".translateEscapes()) .isEqualTo("\"XY\"\r\n"); } @Test public void testCompactNumberFormat() { assertThat(NumberFormat.getCompactNumberInstance().format(1000)).isEqualTo("1K"); assertThat(NumberFormat.getCompactNumberInstance().format(15_000)).isEqualTo("15K"); assertThat(NumberFormat.getCompactNumberInstance().format(1024)).isEqualTo("1K"); assertThat(NumberFormat.getCompactNumberInstance().format(1_000_000_000_000L)).isEqualTo("1T"); assertThat(NumberFormat.getCompactNumberInstance().format(1500)).isEqualTo("2K"); CompactNumberFormat format = (CompactNumberFormat) NumberFormat.getCompactNumberInstance(); format.setMaximumFractionDigits(1); assertThat(format.format(1500)).isEqualTo("1.5K"); } private String toCamelCase(String string){ if (string == null){ return null; } return Arrays.stream(string.split("\\s")) .map(this::capitalize) .collect(Collectors.joining()); } private String capitalize(String string){ return (string == null)? null : (string.isEmpty())? "" : Character.toUpperCase(string.charAt(0)) + string.substring(1); } }
lgpl-3.0
butterbrother/ews-redirector
src/main/java/com/github/butterbrother/ews/redirector/graphics/TrayControl.java
5094
package com.github.butterbrother.ews.redirector.graphics; import com.github.butterbrother.ews.redirector.service.Notificator; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.net.URL; import java.util.logging.Logger; /** * Осуществляет загрузку иконки в системный трей. * Создаёт меню для трея. */ public class TrayControl { private SystemTray systemTray; private TrayIcon icon; private MenuItem exitItem = new MenuItem("Exit"); private MenuItem configItem = new MenuItem("Settings..."); private SettingsWindow win = null; private Logger logger = Logger.getLogger(this.getClass().getSimpleName()); public TrayControl() throws AWTException { if (!SystemTray.isSupported()) { logger.severe("System tray is not supported"); System.exit(1); } systemTray = SystemTray.getSystemTray(); icon = new TrayIcon(getTrayImage(), "EWS redirector"); createTrayPopupMenu(); systemTray.add(icon); } /** * Добавляет слушателя для иконки. * В нашем случае нужно для открытия окна настроек * при двойном щелчке по иконке в трее. * * @param listener Слушатель иконки */ public void setIconDoubleClickListener(MouseListener listener) { icon.addMouseListener(listener); } /** * Передает экземпляр окна конфигуратора. * <p> * Передаёт экземпляр окна конфигуратора {@link SettingsWindow} для возможности его открытия, * сохранения конфигурации перед выходом и т.п. * * @param win экземпляр окна конфигуратора */ public void setSettingsWindow(SettingsWindow win) { this.win = win; } /** * Находит подходящую картинку для трея исходя из его размера. * Если картинка не будет найдена - вернёт самую большую. * Картинки должны существовать в jar-файле, в images. * Разрешения: 16, 22, 24, 32, 48 и 64. * Формат: png * * @return Картинка из jar. */ private Image getTrayImage() { Toolkit toolkit = Toolkit.getDefaultToolkit(); ClassLoader loader = this.getClass().getClassLoader(); Dimension iconSize = systemTray.getTrayIconSize(); URL iconPath = loader.getResource("icons/" + (int) iconSize.getHeight() + ".png"); if (iconPath == null) iconPath = loader.getResource("icons/64.png"); return toolkit.getImage(iconPath); } /** * Создаёт контекстное меню трея */ private void createTrayPopupMenu() { final PopupMenu menu = new PopupMenu(); MenuItem header = new MenuItem("EWS redirector (v0.2.4)"); header.setEnabled(false); menu.add(header); menu.addSeparator(); configItem.setActionCommand("config"); menu.add(configItem); exitItem.setActionCommand("exit"); menu.add(exitItem); icon.setPopupMenu(menu); ActionListener menuListener = e -> { switch (e.getActionCommand()) { case "config": win.showSettingsWin(); break; case "exit": win.saveWindowPos(); System.exit(0); break; } }; configItem.addActionListener(menuListener); exitItem.addActionListener(menuListener); } /** * Показывает сообщение из трея. Проброс из специального класса, * что бы не управлять треем напрямую. * * @param caption заголовок * @param text текст сообщения * @param type тип сообщения */ private void showPopup(String caption, String text, TrayIcon.MessageType type) { icon.displayMessage(caption, text, type); logger.info("Show popup: [" + caption + "] " + text); } public TrayPopup getTrayPopup() { return new TrayPopup(); } /** * Класс для отображения нотификаций в трее */ public class TrayPopup implements Notificator { /** * Показывает ошибку из трея * * @param caption заголовок сообщения * @param text текст сообщения */ @Override public void error(String caption, String text) { showPopup(caption, text, TrayIcon.MessageType.ERROR); } } }
lgpl-3.0
alessandroleite/dohko
services/src/test/java/LauchExcaliburAppTest.java
3050
/** * Copyright (C) 2013-2014 the original author or authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.util.concurrent.TimeUnit; import org.excalibur.core.LoginCredentials; import org.excalibur.core.exec.OnlineChannel; import org.excalibur.core.ssh.SshClient; import org.excalibur.core.ssh.SshClientFactory; import org.excalibur.core.util.Strings2; import org.excalibur.core.util.SystemUtils2; import com.google.common.net.HostAndPort; public class LauchExcaliburAppTest { static final String GCE = "chmod +x /home/alessandro/excalibur/*.sh && cd /home/alessandro/excalibur && nohup /home/alessandro/excalibur/excalibur.sh &"; public static void main(String[] args) throws IOException { System.err.println(TimeUnit.MINUTES.toMillis(1)); File credential = new File(SystemUtils2.getUserDirectory(), "/ec2/ssh/key3.key"); LoginCredentials loginCredentials = LoginCredentials.builder().authenticateAsSudo(false).privateKey(credential).user("alessandro").build(); SshClient client = SshClientFactory.defaultSshClientFactory().create(HostAndPort.fromParts("146.148.51.170", 22), loginCredentials); client.connect(); OnlineChannel shell = client.shell(); final BufferedReader reader = new BufferedReader(new InputStreamReader(shell.getOutput())); final StringBuilder sb = new StringBuilder(); Thread t = new Thread(new Runnable() { @Override public void run() { while (true) { try { String line = reader.readLine(); if (line == null) { break; } sb.append(line).append(Strings2.NEW_LINE); } catch (IOException exception) { } } } }); t.start(); shell.write("cd ~/excalibur\n"); shell.write("pwd\n"); shell.write("nohup ./excalibur.sh &\n"); shell.write("tail -f nohup.out\n"); shell.close(); client.disconnect(); reader.close(); } }
lgpl-3.0
MesquiteProject/MesquiteArchive
releases/Mesquite2.5/Mesquite Project/Source/mesquite/lib/table/CMTable.java
1648
/* Mesquite source code. Copyright 1997-2008 W. Maddison and D. Maddison. Version 2.5, June 2008. Disclaimer: The Mesquite source code is lengthy and we are few. There are no doubt inefficiencies and goofs in this code. The commenting leaves much to be desired. Please approach this source code with the spirit of helping out. Perhaps with your help we can be more than a few, and make Mesquite better. Mesquite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Mesquite's web site is http://mesquiteproject.org This source code and its compiled class files are free and modifiable under the terms of GNU Lesser General Public License. (http://www.gnu.org/copyleft/lesser.html) */ package mesquite.lib.table; /*~~ */ import mesquite.lib.*; import mesquite.lib.duties.*; /** An interface used to expose extra methods of character matrix editor table to assistants. */ public abstract class CMTable extends MesquiteTable { public CMTable (int numRowsTotal, int numColumnsTotal, int totalWidth, int totalHeight, int rowNamesWidth, int colorScheme, boolean showRowNumbers, boolean showColumnNumbers) { super(numRowsTotal, numColumnsTotal, totalWidth, totalHeight, rowNamesWidth, colorScheme, showRowNumbers, showColumnNumbers); } public abstract DataColumnNamesAssistant getDataColumnNamesAssistant(int subRow); public abstract void setLastColumnVisibleLinked(int column); public abstract void setFirstColumnVisibleLinked(int column); public abstract void setLastRowVisibleLinked(int row); public abstract void setFirstRowVisibleLinked(int row); public abstract CellColorer getCellColorer(); }
lgpl-3.0
sing-group/aibench-project
aibench-pluginmanager/src/main/java/org/jdesktop/swingx/plaf/basic/BasicLoginPaneUI.java
6846
/* * #%L * The AIBench Plugin Manager Plugin * %% * Copyright (C) 2006 - 2017 Daniel Glez-Peña and Florentino Fdez-Riverola * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ /* * $Id: BasicLoginPaneUI.java,v 1.1 2009-04-13 22:17:49 mrjato Exp $ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx.plaf.basic; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.geom.GeneralPath; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.JComponent; import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import org.jdesktop.swingx.JXLoginPane; import org.jdesktop.swingx.plaf.LoginPaneUI; import org.jdesktop.swingx.plaf.UIManagerExt; /** * Base implementation of the <code>JXLoginPane</code> UI. * * @author rbair */ public class BasicLoginPaneUI extends LoginPaneUI { private class LocaleHandler implements PropertyChangeListener { /** * {@inheritDoc} */ public void propertyChange(PropertyChangeEvent evt) { Object src = evt.getSource(); if (src instanceof JComponent) { ((JComponent) src).updateUI(); } } } private JXLoginPane dlg; /** Creates a new instance of BasicLoginDialogUI */ public BasicLoginPaneUI(JXLoginPane dlg) { this.dlg = dlg; // dlg.addPropertyChangeListener("locale", new LocaleHandler()); } public static ComponentUI createUI(JComponent c) { return new BasicLoginPaneUI((JXLoginPane)c); } public void installUI(JComponent c) { installDefaults(); } protected void installDefaults() { String s = dlg.getBannerText(); if (s == null || s.equals("")) { dlg.setBannerText(UIManagerExt.getString("JXLoginPane.bannerString", dlg.getLocale())); } s = dlg.getErrorMessage(); if (s == null || s.equals("")) { dlg.setErrorMessage(UIManagerExt.getString("JXLoginPane.errorMessage", dlg.getLocale())); } } /** * Creates default 400x60 banner for the login panel. * @see org.jdesktop.swingx.plaf.LoginPaneUI#getBanner() */ public Image getBanner() { int w = 400; int h = 60; float loginStringX = w * .05f; float loginStringY = h * .75f; BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = img.createGraphics(); try { Font font = UIManager.getFont("JXLoginPane.bannerFont"); g2.setFont(font); Graphics2D originalGraphics = g2; try { if (!dlg.getComponentOrientation().isLeftToRight()) { originalGraphics = (Graphics2D) g2.create(); g2.scale(-1, 1); g2.translate(-w, 0); loginStringX = w - (((float) font.getStringBounds( dlg.getBannerText(), originalGraphics.getFontRenderContext()) .getWidth()) + w * .05f); } g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); // draw a big square g2.setColor(UIManager .getColor("JXLoginPane.bannerDarkBackground")); g2.fillRect(0, 0, w, h); // create the curve shape GeneralPath curveShape = new GeneralPath( GeneralPath.WIND_NON_ZERO); curveShape.moveTo(0, h * .6f); curveShape.curveTo(w * .167f, h * 1.2f, w * .667f, h * -.5f, w, h * .75f); curveShape.lineTo(w, h); curveShape.lineTo(0, h); curveShape.lineTo(0, h * .8f); curveShape.closePath(); // draw into the buffer a gradient (bottom to top), and the text // "Login" GradientPaint gp = new GradientPaint(0, h, UIManager .getColor("JXLoginPane.bannerDarkBackground"), 0, 0, UIManager.getColor("JXLoginPane.bannerLightBackground")); g2.setPaint(gp); g2.fill(curveShape); originalGraphics.setColor(UIManager .getColor("JXLoginPane.bannerForeground")); originalGraphics.drawString(dlg.getBannerText(), loginStringX, loginStringY); } finally { originalGraphics.dispose(); } } finally { g2.dispose(); } return img; } }
lgpl-3.0
mapsforge/vtm
vtm-playground/src/org/oscim/test/ThemeTest.java
1447
package org.oscim.test; import org.oscim.awt.AwtGraphics; import org.oscim.backend.AssetAdapter; import org.oscim.core.GeometryBuffer.GeometryType; import org.oscim.core.Tag; import org.oscim.core.TagSet; import org.oscim.theme.IRenderTheme; import org.oscim.theme.ThemeLoader; import org.oscim.theme.VtmThemes; import org.oscim.theme.styles.RenderStyle; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class ThemeTest { public static void main(String[] args) { AwtGraphics.init(); AssetAdapter.init(new AssetAdapter() { @Override public InputStream openFileAsStream(String name) { try { return new FileInputStream("/home/jeff/src/vtm/OpenScienceMap/vtm/assets/" + name); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } } }); IRenderTheme t = ThemeLoader.load(VtmThemes.DEFAULT); TagSet tags = new TagSet(); tags.add(new Tag("highway", "trunk_link")); tags.add(new Tag("brigde", "yes")); tags.add(new Tag("oneway", "yes")); RenderStyle[] ri = t.matchElement(GeometryType.LINE, tags, 16); for (RenderStyle r : ri) { System.out.println("class: " + r.getClass().getName()); } } }
lgpl-3.0
SlimeVoid/WirelessRedstone
src/main/java/net/slimevoid/wirelessredstone/block/BlockRedstoneWirelessR.java
12452
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. This program is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. You should have received a copy of the GNU * Lesser General Public License along with this program. If not, see * <http://www.gnu.org/licenses/> */ package net.slimevoid.wirelessredstone.block; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.slimevoid.wirelessredstone.core.WirelessRedstone; import net.slimevoid.wirelessredstone.core.lib.GuiLib; import net.slimevoid.wirelessredstone.core.lib.IconLib; import net.slimevoid.wirelessredstone.ether.RedstoneEther; import net.slimevoid.wirelessredstone.network.handlers.RedstoneEtherPacketHandler; import net.slimevoid.wirelessredstone.tileentity.TileEntityRedstoneWireless; import net.slimevoid.wirelessredstone.tileentity.TileEntityRedstoneWirelessR; /** * Wireless Receiver Block. * * @author ali4z */ public class BlockRedstoneWirelessR extends BlockRedstoneWireless { private boolean initialSchedule; @Override public void registerIcons(IIconRegister iconRegister) { this.iconBuffer = new IIcon[2][6]; this.iconBuffer[0][0] = iconRegister.registerIcon(IconLib.WIRELESS_BOTTOM_OFF); this.iconBuffer[0][1] = iconRegister.registerIcon(IconLib.WIRELESS_TOP_OFF); this.iconBuffer[0][2] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_OFF); this.iconBuffer[0][3] = iconRegister.registerIcon(IconLib.WIRELESS_RX_FRONT_OFF); this.iconBuffer[0][4] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_OFF); this.iconBuffer[0][5] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_OFF); this.iconBuffer[1][0] = iconRegister.registerIcon(IconLib.WIRELESS_BOTTOM_ON); this.iconBuffer[1][1] = iconRegister.registerIcon(IconLib.WIRELESS_TOP_ON); this.iconBuffer[1][2] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_ON); this.iconBuffer[1][3] = iconRegister.registerIcon(IconLib.WIRELESS_RX_FRONT_ON); this.iconBuffer[1][4] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_ON); this.iconBuffer[1][5] = iconRegister.registerIcon(IconLib.WIRELESS_RX_SIDE_ON); } /** * Constructor.<br> * Sets the Block ID.<br> * Tells the Block to tick on load. * * @param i * Block ID */ public BlockRedstoneWirelessR(int x, float hardness, float resistance) { super(x, hardness, resistance); setStepSound(Block.soundTypeMetal); setTickRandomly(true); initialSchedule = true; } /** * Checks if the Block has already ticked once. */ public boolean hasTicked() { return !this.initialSchedule; } /** * Changes the frequency.<br> * - Remove receiver from old frequency.<br> * - Add receiver to new frequency.<br> * - Update the tick. */ @Override public void changeFreq(World world, int x, int y, int z, Object oldFreq, Object freq) { RedstoneEther.getInstance().remReceiver(world, x, y, z, oldFreq); RedstoneEther.getInstance().addReceiver(world, x, y, z, freq); updateTick(world, x, y, z, null); } /** * Is triggered after the Block and TileEntity is added to the world.<br> * - Add receiver to ether.<br> * - Notify all neighboring Blocks.<br> * - Update the tick. */ @Override protected void onBlockRedstoneWirelessAdded(World world, int x, int y, int z) { RedstoneEther.getInstance().addReceiver(world, x, y, z, getFreq(world, x, y, z)); world.notifyBlocksOfNeighborChange(x, y, z, this); updateTick(world, x, y, z, null); } /** * Is triggered after the Block is removed from the world and before the * TileEntity is removed.<br> * - Remove receiver from ether.<br> * - Notify all neighboring Blocks. */ @Override protected void onBlockRedstoneWirelessRemoved(World world, int x, int y, int z) { RedstoneEther.getInstance().remReceiver(world, x, y, z, getFreq(world, x, y, z)); world.notifyBlocksOfNeighborChange(x, y, z, this); } /** * Is triggered on Block activation unless overrides exits prematurely.<br> * - Associates the TileEntity with the GUI. - Opens the GUI. */ @Override protected boolean onBlockRedstoneWirelessActivated(World world, int x, int y, int z, EntityPlayer entityplayer) { TileEntity tileentity = world.getTileEntity(x, y, z); if (tileentity != null && tileentity instanceof TileEntityRedstoneWirelessR) { entityplayer.openGui(WirelessRedstone.instance, GuiLib.GUIID_INVENTORY, world, x, y, z); } return true; } /** * Is triggered on Block's neighbouring Block change.<br> * - Update the tick if the neighbouring Block is not of the same type. */ @Override protected void onBlockRedstoneWirelessNeighborChange(World world, int x, int y, int z, Block block) { if (block.equals(this)) return; updateTick(world, x, y, z, null); } @Override protected IIcon getBlockRedstoneWirelessTexture(IBlockAccess iblockaccess, int x, int y, int z, int l) { if (getState(iblockaccess, x, y, z)) { return this.getIconFromStateAndSide(1, l); } else { return this.getBlockRedstoneWirelessTextureFromSide(l); } } @Override protected IIcon getBlockRedstoneWirelessTextureFromSide(int side) { return this.getIconFromStateAndSide(0, side); } @Override protected TileEntityRedstoneWireless getBlockRedstoneWirelessEntity() { return new TileEntityRedstoneWirelessR(); } /** * Triggered on a Block update tick.<br> * If the state in the ether has changed from metadata state:<br> * - Update the metadata state.<br> * - Mark the Block for update.<br> * - Notify neighbors of changes. */ @Override protected void updateRedstoneWirelessTick(World world, int x, int y, int z, Random random) { if (initialSchedule) initialSchedule = false; if (world == null) return; String freq = getFreq(world, x, y, z); boolean oldState = getState(world, x, y, z); boolean newState = RedstoneEther.getInstance().getFreqState(world, freq); if (newState != oldState) { setState(world, x, y, z, newState); world.markBlockForUpdate(x, y, z); notifyNeighbors(world, x, y, z, this); if (!world.isRemote) { TileEntity entity = world.getTileEntity(x, y, z); if (entity instanceof TileEntityRedstoneWireless) RedstoneEtherPacketHandler.sendEtherTileToAll((TileEntityRedstoneWireless) entity, world); } } } /** * Checks whether or not the Block is directly emitting power to a * direction.<br> * - Query metadata state. - Query the TileEntity for directional state. */ @Override protected int isRedstoneWirelessPoweringTo(World world, int x, int y, int z, int l) { TileEntity entity = world.getTileEntity(x, y, z); if (entity instanceof TileEntityRedstoneWireless) { return (((TileEntityRedstoneWireless) entity).isPoweringDirection(l) && getState(world, x, y, z)) ? 16 : 0; } return 0; } /** * Checks whether or not the Block is indirectly emitting power to a * direction.<br> * - Query directional state. - Query the TileEntity for indirect * directional state. */ @Override protected int isRedstoneWirelessIndirectlyPoweringTo(World world, int x, int y, int z, int l) { TileEntity entity = world.getTileEntity(x, y, z); if (entity instanceof TileEntityRedstoneWireless) { if (!((TileEntityRedstoneWireless) entity).isPoweringIndirectly(l)) return 0; else return isProvidingStrongPower(world, x, y, z, l); } return 0; } @Override protected boolean isBlockRedstoneWirelessSolidOnSide(IBlockAccess world, int x, int y, int z, ForgeDirection side) { return this.isOpaqueCube(); } @Override protected boolean isBlockRedstoneWirelessOpaqueCube() { return false; } }
lgpl-3.0
Mark-de-Haan/molgenis
molgenis-data-security/src/main/java/org/molgenis/data/security/meta/PackageRepositorySecurityDecorator.java
5865
package org.molgenis.data.security.meta; import org.molgenis.data.AbstractRepositoryDecorator; import org.molgenis.data.DataService; import org.molgenis.data.Repository; import org.molgenis.data.meta.model.Package; import org.molgenis.data.meta.model.PackageMetadata; import org.molgenis.data.security.PackageIdentity; import org.molgenis.data.security.exception.NullParentPackageNotSuException; import org.molgenis.data.security.exception.PackagePermissionDeniedException; import org.molgenis.data.security.owned.AbstractRowLevelSecurityRepositoryDecorator.Action; import org.molgenis.security.core.UserPermissionEvaluator; import org.springframework.security.acls.model.Acl; import org.springframework.security.acls.model.MutableAcl; import org.springframework.security.acls.model.MutableAclService; import org.springframework.security.acls.model.ObjectIdentity; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; import static java.util.Objects.requireNonNull; import static org.molgenis.data.security.PackagePermission.ADD_PACKAGE; import static org.molgenis.security.core.utils.SecurityUtils.currentUserIsSuOrSystem; public class PackageRepositorySecurityDecorator extends AbstractRepositoryDecorator<Package> { private final MutableAclService mutableAclService; private final UserPermissionEvaluator userPermissionEvaluator; private final DataService dataService; public PackageRepositorySecurityDecorator(Repository<Package> delegateRepository, MutableAclService mutableAclService, UserPermissionEvaluator userPermissionEvaluator, DataService dataService) { super(delegateRepository); this.mutableAclService = requireNonNull(mutableAclService); this.userPermissionEvaluator = requireNonNull(userPermissionEvaluator); this.dataService = requireNonNull(dataService); } @Override public void update(Package pack) { checkParentPermission(pack, Action.UPDATE); updateAcl(pack); delegate().update(pack); } @Override public void update(Stream<Package> packages) { super.update(packages.filter(pack -> { checkParentPermission(pack, Action.UPDATE); updateAcl(pack); return true; })); } @Override public void delete(Package pack) { deleteAcl(pack); delegate().delete(pack); } @Override public void delete(Stream<Package> packages) { delegate().delete(packages.filter(pack -> { deleteAcl(pack); return true; })); } @Override public void deleteById(Object id) { deleteAcl(id.toString()); delegate().deleteById(id); } @Override public void deleteAll(Stream<Object> ids) { super.deleteAll(ids.filter(id -> { deleteAcl(id.toString()); return true; })); } @Override public void deleteAll() { iterator().forEachRemaining(this::deleteAcl); super.deleteAll(); } @Override public void add(Package pack) { checkParentPermission(pack, Action.CREATE); createAcl(pack); delegate().add(pack); } @Override public Integer add(Stream<Package> packages) { LinkedList<Package> resolved = new LinkedList<>(); resolveDependencies(packages.collect(Collectors.toList()), resolved); return super.add(resolved.stream().filter(pack -> { checkParentPermission(pack, Action.CREATE); createAcl(pack); return true; })); } private void resolveDependencies(List<Package> packages, LinkedList<Package> resolved) { if (packages.size() != resolved.size()) { for (Package pack : packages) { if (!resolved.contains(pack) && (!packages.contains(pack.getParent()) || resolved.contains( pack.getParent()))) { resolved.add(pack); } } resolveDependencies(packages, resolved); } } private void createAcl(Package pack) { PackageIdentity packageIdentity = new PackageIdentity(pack); MutableAcl acl = mutableAclService.createAcl(packageIdentity); if (pack.getParent() != null) { ObjectIdentity parentIdentity = new PackageIdentity(pack.getParent()); Acl parentAcl = mutableAclService.readAclById(parentIdentity); acl.setParent(parentAcl); mutableAclService.updateAcl(acl); } } private void deleteAcl(String id) { PackageIdentity packageIdentity = new PackageIdentity(id); mutableAclService.deleteAcl(packageIdentity, true); } private void deleteAcl(Package pack) { deleteAcl(pack.getId()); } private void updateAcl(Package pack) { PackageIdentity packageIdentity = new PackageIdentity(pack); MutableAcl acl = (MutableAcl) mutableAclService.readAclById(packageIdentity); if (pack.getParent() != null) { ObjectIdentity parentIdentity = new PackageIdentity(pack.getParent()); Acl parentAcl = mutableAclService.readAclById(parentIdentity); if (!parentAcl.equals(acl.getParentAcl())) { acl.setParent(parentAcl); mutableAclService.updateAcl(acl); } } } private void checkParentPermission(Package newPackage, Action action) { Package parent = newPackage.getParent(); if (parent != null) { boolean checkPackage = isParentUpdated(action, newPackage); if (checkPackage && !userPermissionEvaluator.hasPermission(new PackageIdentity(parent.getId()), ADD_PACKAGE)) { throw new PackagePermissionDeniedException(ADD_PACKAGE, parent); } } else { if (!currentUserIsSuOrSystem() && isParentUpdated(action, newPackage)) { throw new NullParentPackageNotSuException(); } } } private boolean isParentUpdated(Action action, Package pack) { boolean updated; if (action == Action.CREATE) { updated = true; } else { Package currentpackage = dataService.findOneById(PackageMetadata.PACKAGE, pack.getId(), Package.class); if (currentpackage.getParent() == null) { updated = pack.getParent() != null; } else { updated = !currentpackage.getParent().equals(pack.getParent()); } } return updated; } }
lgpl-3.0
schemaspy/schemaspy
src/main/java/org/schemaspy/model/DatabaseObject.java
2931
/* * Copyright (C) 2016 Rafal Kasa * Copyright (C) 2016 Ismail Simsek * Copyright (C) 2017 Wojciech Kasa * * This file is part of SchemaSpy. * * SchemaSpy is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SchemaSpy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with SchemaSpy. If not, see <http://www.gnu.org/licenses/>. */ package org.schemaspy.model; import java.util.Set; /** * Created by rkasa on 2016-04-15. * @author Rafal Kasa * @author Ismail Simsek * @author Wojciech Kasa */ public class DatabaseObject implements Comparable<DatabaseObject>{ private String name; private final String fullName; private final String typeName; private final Integer type; private final int length; private final Set<TableColumn> parents; private final Set<TableColumn> children; public DatabaseObject(TableColumn object) { this.name = object.getName(); this.fullName = object.getTable().getFullName() + "." + object.getName(); this.typeName = object.getTypeName(); this.type = object.getType(); this.length = object.getLength(); this.parents = object.getParents(); this.children = object.getChildren(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTypeName() { return typeName; } public Integer getType() { return type; } public int getLength() { return length; } public Set<TableColumn> getParents() { return parents; } public Set<TableColumn> getChildren() { return children; } public String getFullName() { return fullName; } @Override public String toString() { return name; } @Override public int compareTo(DatabaseObject column2) { int rc = this.getFullName().compareToIgnoreCase(column2.getFullName()); if (rc == 0) { if (this.getType() != null && column2.getType() != null) // type is exact while typeName can be adorned with additional stuff (e.g. MSSQL appends " identity" for auto-inc keys) rc = this.getType().compareTo(column2.getType()); else rc = this.getTypeName().compareToIgnoreCase(column2.getTypeName()); } if (rc == 0) rc = this.getLength() - column2.getLength(); return rc; } }
lgpl-3.0
pvginkel/WsRest
wsrest-test/src/test/java/org/webathome/wsrest/test/SerializationFixture.java
5844
package org.webathome.wsrest.test; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.webathome.wsrest.client.WsRestException; import org.webathome.wsrest.client.RequestType; import java.util.ArrayList; import java.util.List; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @RunWith(JUnit4.class) public class SerializationFixture extends FixtureBase { @Test public void echoChar() throws WsRestException { test("char", 'a'); } @Test public void echoNullableChar() throws WsRestException { test("nullable-char", 'a'); } @Test public void echoShort() throws WsRestException { test("short", (short)42); } @Test public void echoNullableShort() throws WsRestException { test("nullable-short", (short)42); } @Test public void echoInt() throws WsRestException { test("int", 42); } @Test public void echoNullableInt() throws WsRestException { test("nullable-int", 42); } @Test public void echoLong() throws WsRestException { test("long", (long)42); } @Test public void echoNullableLong() throws WsRestException { test("nullable-long", (long)42); } @Test public void echoString() throws WsRestException { test("string", "Hello world!"); } @Test public void echoFloat() throws WsRestException { test("float", (float)42.7); } @Test public void echoNullableFloat() throws WsRestException { test("nullable-float", (float)42.7); } @Test public void echoDouble() throws WsRestException { test("double", 42.7); } @Test public void echoNullableDouble() throws WsRestException { test("nullable-double", 42.7); } @Test public void echoBoolean() throws WsRestException { test("boolean", true); } @Test public void echoNullableBoolean() throws WsRestException { test("nullable-boolean", true); } @Test public void echoEnum() throws WsRestException { test("enum", MyEnum.B); } @Test public void echoIntArray() throws WsRestException { assertEquals( 1 + 2 + 3, (int)openConnection() .newRequest("/serialization/echo-int-array", RequestType.GET) .addQueryParam("value", new int[]{1, 2, 3}) .getResponse(Integer.class) ); } @Test public void echoNull() throws WsRestException { assertEquals( null, openConnection() .newRequest("/serialization/echo-nullable-int", RequestType.GET) .addQueryParam("value", null) .getResponse(Integer.class) ); } @Test public void echoDefaultInt() throws WsRestException { assertEquals( 0, (int)openConnection() .newRequest("/serialization/echo-int", RequestType.GET) .getResponse(Integer.class) ); } @Test public void echoMultiple() throws WsRestException { assertEquals( (long)(42 + 84 + 168), (long)openConnection() .newRequest("/serialization/echo-multiple", RequestType.GET) .addQueryParam("a", 42) .addQueryParam("b", 84) .addQueryParam("c", 168) .getResponse(Long.class) ); } @Test public void echoObject() throws WsRestException { TestObject testObject = new TestObject(); testObject.setA("Hello world!"); testObject.setB(42); assertEquals( testObject, openConnection() .newRequest("/serialization/echo-object", RequestType.GET) .setJsonBody(testObject) .getJson(TestObject.class) ); } @Test public void echoArray() throws WsRestException { TestObject testObject1 = new TestObject(); testObject1.setA("Hello world 1!"); testObject1.setB(42); TestObject testObject2 = new TestObject(); testObject2.setA("Hello world 2!"); testObject2.setB(42); TestObject[] array = new TestObject[]{testObject1, testObject2}; assertArrayEquals( array, (TestObject[])openConnection() .newRequest("/serialization/echo-array", RequestType.GET) .setJsonBody(array) .getJson(TestObject[].class) ); } @Test public void echoList() throws WsRestException { List<TestObject> list = new ArrayList<>(); TestObject testObject1 = new TestObject(); testObject1.setA("Hello world 1!"); testObject1.setB(42); list.add(testObject1); TestObject testObject2 = new TestObject(); testObject2.setA("Hello world 2!"); testObject2.setB(42); list.add(testObject2); assertEquals( list, openConnection() .newRequest("/serialization/echo-list", RequestType.GET) .setJsonBody(list) .getJson(TestObject.LIST_TYPE) ); } private void test(String method, Object value) throws WsRestException { assertEquals( value, openConnection() .newRequest("/serialization/echo-" + method, RequestType.GET) .addQueryParam("value", value) .getResponse(value.getClass()) ); } }
lgpl-3.0
OurGrid/OurGrid
src/test/java/org/ourgrid/acceptance/util/peer/Req_106_Util.java
2634
/* * Copyright (C) 2008 Universidade Federal de Campina Grande * * This file is part of OurGrid. * * OurGrid is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package org.ourgrid.acceptance.util.peer; import java.util.List; import org.easymock.EasyMock; import org.ourgrid.acceptance.util.PeerAcceptanceUtil; import org.ourgrid.common.interfaces.status.PeerStatusProvider; import org.ourgrid.common.interfaces.status.PeerStatusProviderClient; import org.ourgrid.common.interfaces.to.UserInfo; import br.edu.ufcg.lsd.commune.container.ObjectDeployment; import br.edu.ufcg.lsd.commune.context.ModuleContext; import br.edu.ufcg.lsd.commune.identification.ContainerID; import br.edu.ufcg.lsd.commune.identification.DeploymentID; import br.edu.ufcg.lsd.commune.testinfra.AcceptanceTestUtil; public class Req_106_Util extends PeerAcceptanceUtil{ public Req_106_Util(ModuleContext context) { super(context); } /** * Verifies users' status, comparing it * to the given UserInfo list parameter * @param usersInfo The expected status of the users */ public void getUsersStatus(List<UserInfo> usersInfo) { //Create client mock PeerStatusProviderClient statusProviderClient = EasyMock.createMock(PeerStatusProviderClient.class); DeploymentID pspcID = new DeploymentID(new ContainerID("pspc", "server", "broker"), "broker"); AcceptanceTestUtil.publishTestObject(application, pspcID, statusProviderClient, PeerStatusProviderClient.class); //Get status provider PeerStatusProvider statusProvider = getStatusProvider(); ObjectDeployment statusProviderOD = getStatusProviderObjectDeployment(); //Record mock behavior statusProviderClient.hereIsUsersStatus(statusProviderOD.getDeploymentID().getServiceID(), usersInfo); EasyMock.replay(statusProviderClient); //Requesting users info statusProvider.getUsersStatus(statusProviderClient); //Verifying behavior EasyMock.verify(statusProviderClient); } }
lgpl-3.0
ecologylab/ecologylabFundamental
src/ecologylab/serialization/serializers/FormatSerializer.java
5243
package ecologylab.serialization.serializers; import java.io.File; import java.io.IOException; import java.io.OutputStream; import ecologylab.serialization.ClassDescriptor; import ecologylab.serialization.FieldDescriptor; import ecologylab.serialization.SIMPLTranslationException; import ecologylab.serialization.SimplTypesScope; import ecologylab.serialization.TranslationContextPool; import ecologylab.serialization.SimplTypesScope.GRAPH_SWITCH; import ecologylab.serialization.TranslationContext; import ecologylab.serialization.formatenums.BinaryFormat; import ecologylab.serialization.formatenums.Format; import ecologylab.serialization.formatenums.StringFormat; import ecologylab.serialization.serializers.binaryformats.TLVSerializer; import ecologylab.serialization.serializers.stringformats.BibtexSerializer; import ecologylab.serialization.serializers.stringformats.JSONSerializer; import ecologylab.serialization.serializers.stringformats.StringSerializer; import ecologylab.serialization.serializers.stringformats.XMLSerializer; /** * FormatSerializer. an abstract base class from where format-specific serializers derive. Its main * use is for exposing the API for serialization methods. It contains helper functions and wrapper * serialization functions, allowing software developers to use different types of objects for * serialization, such as System.out, File, StringBuilder, or return serialized data as * StringBuilder * * @author nabeel * */ public abstract class FormatSerializer { /** * * @param object * @param outputStream * @throws SIMPLTranslationException */ public void serialize(Object object, OutputStream outputStream) throws SIMPLTranslationException { TranslationContext translationContext = TranslationContextPool.get().acquire(); serialize(object, outputStream, translationContext); TranslationContextPool.get().release(translationContext); } public abstract void serialize(Object object, OutputStream outputStream, TranslationContext translationContext) throws SIMPLTranslationException; /** * * @param object * @param outputFile * @throws SIMPLTranslationException * @throws IOException */ public void serialize(Object object, File outputFile) throws SIMPLTranslationException { TranslationContext translationContext = TranslationContextPool.get().acquire(); serialize(object, outputFile, translationContext); TranslationContextPool.get().release(translationContext); } public abstract void serialize(Object object, File outputFile, TranslationContext translationContext) throws SIMPLTranslationException; /** * * @param object * @return */ protected ClassDescriptor<? extends FieldDescriptor> getClassDescriptor(Object object) { return ClassDescriptor.getClassDescriptor(object.getClass()); } /** * * @param object * @param translationContext TODO */ protected void serializationPostHook(Object object, TranslationContext translationContext) { if (object instanceof ISimplSerializationPost) { ((ISimplSerializationPost) object).serializationPostHook(translationContext); } } /** * * @param object * @param translationContext TODO */ protected void serializationPreHook(Object object, TranslationContext translationContext) { if (object instanceof ISimplSerializationPre) { ((ISimplSerializationPre) object).serializationPreHook(translationContext); } } /** * * @param object * @param translationContext * @return */ protected boolean alreadySerialized(Object object, TranslationContext translationContext) { return SimplTypesScope.graphSwitch == GRAPH_SWITCH.ON && translationContext.alreadyMarshalled(object); } /** * returns the specific type of serializer based on the input format * * @param format * @return FormatSerializer * @throws SIMPLTranslationException */ public static FormatSerializer getSerializer(Format format) throws SIMPLTranslationException { switch (format) { case XML: return new XMLSerializer(); case JSON: return new JSONSerializer(); case TLV: return new TLVSerializer(); case BIBTEX: return new BibtexSerializer(); default: throw new SIMPLTranslationException(format + " format not supported"); } } /** * returns the specific type of serializer based on the input format * * @param format * @return FormatSerializer * @throws SIMPLTranslationException */ public static StringSerializer getStringSerializer(StringFormat format) throws SIMPLTranslationException { switch (format) { case XML: return new XMLSerializer(); case JSON: return new JSONSerializer(); case BIBTEX: return new BibtexSerializer(); default: throw new SIMPLTranslationException(format + " format not supported"); } } /** * returns the specific type of serializer based on the input format * * @param format * @return FormatSerializer * @throws SIMPLTranslationException */ public static FormatSerializer getBinarySerializer(BinaryFormat format) throws SIMPLTranslationException { switch (format) { case TLV: return new TLVSerializer(); default: throw new SIMPLTranslationException(format + " format not supported"); } } }
lgpl-3.0
raedle/Squidy
squidy-nodes/src/main/java/org/squidy/nodes/FlipVertical2D.java
3142
/** * Squidy Interaction Library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * Squidy Interaction Library is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Squidy Interaction Library. If not, see * <http://www.gnu.org/licenses/>. * * 2009 Human-Computer Interaction Group, University of Konstanz. * <http://hci.uni-konstanz.de> * * Please contact info@squidy-lib.de or visit our website * <http://www.squidy-lib.de> for further information. */ package org.squidy.nodes; import javax.xml.bind.annotation.XmlType; import org.squidy.manager.controls.TextField; import org.squidy.manager.data.IData; import org.squidy.manager.data.Processor; import org.squidy.manager.data.Property; import org.squidy.manager.data.Processor.Status; import org.squidy.manager.data.impl.DataPosition2D; import org.squidy.manager.model.AbstractNode; /** * <code>FlipVertical2D</code>. * * <pre> * Date: Feb 12, 2008 * Time: 1:40:48 AM * </pre> * * @author Werner Koenig, werner.koenig@uni-konstanz.de, University of Konstanz * @author Roman R&auml;dle, <a * href="mailto:Roman.Raedle@uni-konstanz.de">Roman. * Raedle@uni-konstanz.de</a>, University of Konstanz * @version $Id: FlipVertical2D.java 772 2011-09-16 15:39:44Z raedle $ */ @XmlType(name = "FlipVertical2D") @Processor( name = "Flip Vertical 2D", icon = "/org/squidy/nodes/image/48x48/flipvertical.png", description = "/org/squidy/nodes/html/FlipVertical2D.html", types = { Processor.Type.FILTER }, tags = { "flip", "vertical" } ) public class FlipVertical2D extends AbstractNode { // ################################################################################ // BEGIN OF ADJUSTABLES // ################################################################################ @Property(name = "Minimum X value") @TextField private double minXValue = 0.0; public double getMinXValue() { return minXValue; } public void setMinXValue(double minXValue) { this.minXValue = minXValue; } @Property(name = "Maximum X value") @TextField private double maxXValue = 1.0; public double getMaxXValue() { return maxXValue; } public void setMaxXValue(double maxXValue) { this.maxXValue = maxXValue; } // ################################################################################ // END OF ADJUSTABLES // ################################################################################ /** * @param dataPosition2D * @return */ public IData process(DataPosition2D dataPosition2D) { dataPosition2D.setX(maxXValue - dataPosition2D.getX() + minXValue); // dataPosition2D.setX(1.0f - dataPosition2D.getX()); return dataPosition2D; } }
lgpl-3.0
halvors/Electrometrics
src/main/java/org/halvors/electrometrics/common/item/ItemBlock.java
414
package org.halvors.electrometrics.common.item; import net.minecraft.block.Block; import org.halvors.electrometrics.Electrometrics; /** * This is a basic ItemBlock that is meant to be extended by other ItemBlocks. * * @author halvors */ public class ItemBlock extends net.minecraft.item.ItemBlock { protected ItemBlock(Block block) { super(block); setCreativeTab(Electrometrics.getCreativeTab()); } }
lgpl-3.0
npklein/molgenis
molgenis-ontology/src/main/java/org/molgenis/ontology/sorta/meta/SortaJobExecutionMetaData.java
2081
package org.molgenis.ontology.sorta.meta; import org.molgenis.data.jobs.model.JobExecutionMetaData; import org.molgenis.data.jobs.model.JobPackage; import org.molgenis.data.meta.SystemEntityType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import static java.util.Objects.requireNonNull; import static org.molgenis.data.jobs.model.JobPackage.PACKAGE_JOB; import static org.molgenis.data.meta.AttributeType.*; import static org.molgenis.data.meta.model.Package.PACKAGE_SEPARATOR; @Component public class SortaJobExecutionMetaData extends SystemEntityType { public static final String SIMPLE_NAME = "SortaJobExecution"; public static final String SORTA_JOB_EXECUTION = PACKAGE_JOB + PACKAGE_SEPARATOR + SIMPLE_NAME; public final static String ONTOLOGY_IRI = "ontologyIri"; public final static String NAME = "name"; public final static String DELETE_URL = "deleteUrl"; public final static String SOURCE_ENTITY = "sourceEntity"; public final static String RESULT_ENTITY = "resultEntity"; public final static String THRESHOLD = "Threshold"; public static final String SORTA_MATCH_JOB_TYPE = "SORTA"; private final JobPackage jobPackage; private final JobExecutionMetaData jobExecutionMetaData; @Autowired SortaJobExecutionMetaData(JobPackage jobPackage, JobExecutionMetaData jobExecutionMetaData) { super(SIMPLE_NAME, PACKAGE_JOB); this.jobPackage = requireNonNull(jobPackage); this.jobExecutionMetaData = requireNonNull(jobExecutionMetaData); } @Override public void init() { setLabel("SORTA job execution"); setPackage(jobPackage); setExtends(jobExecutionMetaData); addAttribute(NAME).setDataType(STRING).setNillable(false); addAttribute(RESULT_ENTITY).setDataType(STRING).setNillable(false); addAttribute(SOURCE_ENTITY).setDataType(STRING).setNillable(false); addAttribute(ONTOLOGY_IRI).setDataType(STRING).setNillable(false); addAttribute(DELETE_URL).setDataType(HYPERLINK).setNillable(false); addAttribute(THRESHOLD).setDataType(DECIMAL).setNillable(false); } }
lgpl-3.0
yawlfoundation/yawl
src/org/yawlfoundation/yawl/procletService/persistence/DBConnection.java
8787
/* * Copyright (c) 2004-2020 The YAWL Foundation. All rights reserved. * The YAWL Foundation is a collaboration of individuals and * organisations who are committed to improving workflow technology. * * This file is part of YAWL. YAWL is free software: you can * redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation. * * YAWL is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with YAWL. If not, see <http://www.gnu.org/licenses/>. */ package org.yawlfoundation.yawl.procletService.persistence; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.LoggerConfig; import org.hibernate.HibernateException; import org.yawlfoundation.yawl.util.HibernateEngine; import java.util.HashSet; import java.util.List; import java.util.Properties; import java.util.Set; public class DBConnection { private static HibernateEngine _db; // communicates with underlying database private DBConnection () { } public static HibernateEngine init(Properties props) { // minimise hibernate logging setLogLevel(LogManager.getLogger("org.hibernate"), Level.WARN); setLogLevel(LogManager.getLogger("com.mchange.v2.c3p0"), Level.WARN); // setup database connection Set<Class> persistedClasses = new HashSet<Class>(); persistedClasses.add(UniqueID.class); persistedClasses.add(StoredBlockRel.class); persistedClasses.add(StoredDecisions.class); persistedClasses.add(StoredItem.class); persistedClasses.add(StoredInteractionArc.class); persistedClasses.add(StoredOptions.class); persistedClasses.add(StoredPerformative.class); persistedClasses.add(StoredPortConnection.class); persistedClasses.add(StoredProcletBlock.class); persistedClasses.add(StoredProcletPort.class); _db = new HibernateEngine(true, persistedClasses, props); return _db; } public static Properties configure(String dialect, String driver, String url, String username, String password) throws HibernateException { Properties props = new Properties(); props.setProperty("hibernate.dialect", dialect); props.setProperty("hibernate.connection.driver_class", driver); props.setProperty("hibernate.connection.url", url); props.setProperty("hibernate.connection.username", username); props.setProperty("hibernate.connection.password", password); // add static props props.setProperty("hibernate.query.substitutions", "true 1, false 0, yes 'Y', no 'N'"); props.setProperty("hibernate.show_sql", "false"); props.setProperty("hibernate.current_session_context_class", "thread"); props.setProperty("hibernate.jdbc.batch_size", "0"); props.setProperty("hibernate.jdbc.use_streams_for_binary", "true"); props.setProperty("hibernate.max_fetch_depth", "1"); props.setProperty("hibernate.cache.region_prefix", "hibernate.test"); props.setProperty("hibernate.cache.use_query_cache", "true"); props.setProperty("hibernate.cache.use_second_level_cache", "true"); props.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.EhCacheRegionFactory"); props.setProperty("hibernate.connection.provider_class", "org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"); props.setProperty("hibernate.c3p0.max_size", "20"); props.setProperty("hibernate.c3p0.min_size", "2"); props.setProperty("hibernate.c3p0.timeout", "5000"); props.setProperty("hibernate.c3p0.max_statements", "100"); props.setProperty("hibernate.c3p0.idle_test_period", "3000"); props.setProperty("hibernate.c3p0.acquire_increment", "1"); return props; } public static void close() { _db.closeFactory(); } public static boolean insert(Object obj) { return _db.exec(obj, HibernateEngine.DB_INSERT, true); } public static boolean update(Object obj) { return _db.exec(obj, HibernateEngine.DB_UPDATE, true); } public static boolean delete(Object obj) { return _db.exec(obj, HibernateEngine.DB_DELETE, true); } public static List getObjectsForClass(String className) { return _db.getObjectsForClass(className); } public static List getObjectsForClassWhere(String className, String whereClause) { return _db.getObjectsForClassWhere(className, whereClause); } public static void deleteAll(String className) { _db.execUpdate("delete from " + className); } public static void deleteAll(Item itemType) { _db.execUpdate("delete from StoredItem as s where s.itemType=" + itemType.ordinal()); } public static List execQuery(String query) { return _db.execQuery(query); } public static int execUpdate(String query) { return _db.execUpdate(query); } public static List getStoredItems(Item itemType) { return getObjectsForClassWhere("StoredItem", "itemType=" + itemType.ordinal()); } public static StoredItem getStoredItem(String classID, String procletID, String blockID, Item itemType) { List items = getStoredItems(classID, procletID, blockID, itemType); return (! items.isEmpty()) ? (StoredItem) items.get(0) : null; } public static List getStoredItems(String classID, String procletID, String blockID, Item itemType) { String query = String.format("from StoredItem as s where s.classID='%s' and " + "s.procletID='%s' and s.blockID='%s' and s.itemType=%d", classID, procletID, blockID, itemType.ordinal()); return _db.execQuery(query); } public static StoredItem getSelectedStoredItem(String classID, String procletID, String blockID, Item itemType) { List items = getSelectedStoredItems(classID, procletID, blockID, itemType); return (! items.isEmpty()) ? (StoredItem) items.get(0) : null; } public static List getSelectedStoredItems(String classID, String procletID, String blockID, Item itemType) { String query = String.format("from StoredItem as s where s.classID='%s' and " + "s.procletID='%s' and s.blockID='%s' and s.itemType=%d and " + "s.selected=%b", classID, procletID, blockID, itemType.ordinal(), true); return _db.execQuery(query); } public static void setStoredItemSelected(String classID, String procletID, String blockID, Item itemType) { setStoredItemSelected(getStoredItem(classID, procletID, blockID, itemType)); } public static void setStoredItemsSelected(String classID, String procletID, String blockID, Item itemType) { setStoredItemsSelected(getStoredItems(classID, procletID, blockID, itemType)); } public static void setStoredItemSelected(StoredItem item) { if (item != null) { item.setSelected(true); update(item); } } public static void setStoredItemsSelected(List items) { for (Object o :items) { ((StoredItem) o).setSelected(true); update(o); } } private static void setLogLevel(Logger logger, Level level) { LoggerContext ctx = (LoggerContext) LogManager.getContext(false); Configuration config = ctx.getConfiguration(); LoggerConfig loggerConfig = config.getLoggerConfig(logger.getName()); loggerConfig.setLevel(level); ctx.updateLoggers(); } }
lgpl-3.0
kbss-cvut/reporting-tool
src/test/java/cz/cvut/kbss/reporting/security/OntologyAuthenticationProviderTest.java
6855
/** * Copyright (C) 2017 Czech Technical University in Prague * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package cz.cvut.kbss.reporting.security; import cz.cvut.kbss.reporting.config.RestConfig; import cz.cvut.kbss.reporting.environment.config.MockSesamePersistence; import cz.cvut.kbss.reporting.environment.config.TestSecurityConfig; import cz.cvut.kbss.reporting.environment.generator.Generator; import cz.cvut.kbss.reporting.model.Person; import cz.cvut.kbss.reporting.security.model.UserDetails; import cz.cvut.kbss.reporting.service.BaseServiceTestRunner; import cz.cvut.kbss.reporting.service.security.LoginTracker; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.security.authentication.*; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextImpl; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.test.context.ContextConfiguration; import static org.junit.Assert.*; import static org.mockito.Mockito.verify; @ContextConfiguration(classes = {TestSecurityConfig.class, RestConfig.class, MockSesamePersistence.class}) public class OntologyAuthenticationProviderTest extends BaseServiceTestRunner { @Rule public ExpectedException thrown = ExpectedException.none(); @Autowired @Qualifier("ontologyAuthenticationProvider") private AuthenticationProvider provider; @Autowired private LoginTracker loginTracker; private Person user; @Before public void setUp() throws Exception { this.user = persistPerson(); SecurityContextHolder.setContext(new SecurityContextImpl()); } @After public void tearDown() throws Exception { SecurityContextHolder.setContext(new SecurityContextImpl()); } @Test public void successfulAuthenticationSetsSecurityContext() { final Authentication auth = authentication(Generator.USERNAME, Generator.PASSWORD); final SecurityContext context = SecurityContextHolder.getContext(); assertNull(context.getAuthentication()); final Authentication result = provider.authenticate(auth); assertNotNull(SecurityContextHolder.getContext()); final UserDetails details = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getDetails(); assertEquals(Generator.USERNAME, details.getUsername()); assertTrue(result.isAuthenticated()); } private static Authentication authentication(String username, String password) { return new UsernamePasswordAuthenticationToken(username, password); } @Test public void authenticateThrowsUserNotFoundExceptionForUnknownUsername() { thrown.expect(UsernameNotFoundException.class); final Authentication auth = authentication("unknownUsername", Generator.PASSWORD); try { provider.authenticate(auth); } finally { final SecurityContext context = SecurityContextHolder.getContext(); assertNull(context.getAuthentication()); } } @Test public void authenticateThrowsBadCredentialsForInvalidPassword() { thrown.expect(BadCredentialsException.class); final Authentication auth = authentication(Generator.USERNAME, "unknownPassword"); try { provider.authenticate(auth); } finally { final SecurityContext context = SecurityContextHolder.getContext(); assertNull(context.getAuthentication()); } } @Test public void supportsUsernameAndPasswordAuthentication() { assertTrue(provider.supports(UsernamePasswordAuthenticationToken.class)); } @Test public void authenticateThrowsLockedExceptionForLockedAccount() { thrown.expect(LockedException.class); thrown.expectMessage("Account is locked."); user.lock(); personDao.update(user); final Authentication auth = authentication(user.getUsername(), Generator.PASSWORD); try { provider.authenticate(auth); } finally { final SecurityContext context = SecurityContextHolder.getContext(); assertNull(context.getAuthentication()); } } @Test public void failedLoginNotifiesLoginTracker() { thrown.expect(BadCredentialsException.class); final Authentication auth = authentication(Generator.USERNAME, "unknownPassword"); try { provider.authenticate(auth); } finally { final ArgumentCaptor<Person> captor = ArgumentCaptor.forClass(Person.class); verify(loginTracker).unsuccessfulLoginAttempt(captor.capture()); assertEquals(user.getUri(), captor.getValue().getUri()); } } @Test public void successfulLoginNotifiesLoginTracker() { final Authentication auth = authentication(Generator.USERNAME, Generator.PASSWORD); final Authentication result = provider.authenticate(auth); assertTrue(result.isAuthenticated()); final ArgumentCaptor<Person> captor = ArgumentCaptor.forClass(Person.class); verify(loginTracker).successfulLoginAttempt(captor.capture()); assertEquals(user.getUri(), captor.getValue().getUri()); } @Test public void authenticateThrowsDisabledExceptionForDisabledAccount() { thrown.expect(DisabledException.class); thrown.expectMessage("Account is disabled."); user.disable(); personDao.update(user); final Authentication auth = authentication(user.getUsername(), Generator.PASSWORD); try { provider.authenticate(auth); } finally { final SecurityContext context = SecurityContextHolder.getContext(); assertNull(context.getAuthentication()); } } }
lgpl-3.0
tweninger/nina
src/edu/nd/nina/graph/GraphUnion.java
8789
/* ========================================== * JGraphT : a free Java graph-theory library * ========================================== * * Project Info: http://jgrapht.sourceforge.net/ * Project Creator: Barak Naveh (http://sourceforge.net/users/barak_naveh) * * (C) Copyright 2003-2009, by Barak Naveh and Contributors. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ /* ------------------------- * GraphUnion.java * ------------------------- * (C) Copyright 2009-2009, by Ilya Razenshteyn * * Original Author: Ilya Razenshteyn and Contributors. * * $Id: GraphUnion.java 695 2009-07-06 02:18:35Z perfecthash $ * * Changes * ------- * 02-Feb-2009 : Initial revision (IR); * */ package edu.nd.nina.graph; import java.io.*; import java.util.*; import edu.nd.nina.*; import edu.nd.nina.util.*; /** * <p>Read-only union of two graphs: G<sub>1</sub> and G<sub>2</sub>. If * G<sub>1</sub> = (V<sub>1</sub>, E<sub>1</sub>) and G<sub>2</sub> = * (V<sub>2</sub>, E<sub>2</sub>) then their union G = (V, E), where V is the * union of V<sub>1</sub> and V<sub>2</sub>, and E is the union of E<sub>1</sub> * and E<sub>1</sub>.</p> * * <p><tt>GraphUnion</tt> implements <tt>Graph</tt> interface. <tt> * GraphUnion</tt> uses <tt>WeightCombiner</tt> to choose policy for calculating * edge weight.</p> */ public class GraphUnion<V, E, G extends Graph<V, E>> extends AbstractGraph<V, E> implements Serializable { //~ Static fields/initializers --------------------------------------------- private static final long serialVersionUID = -740199233080172450L; private static final String READ_ONLY = "union of graphs is read-only"; //~ Instance fields -------------------------------------------------------- private G g1; private G g2; private WeightCombiner operator; //~ Constructors ----------------------------------------------------------- public GraphUnion(G g1, G g2, WeightCombiner operator) { if (g1 == null) { throw new NullPointerException("g1 is null"); } if (g2 == null) { throw new NullPointerException("g2 is null"); } if (g1 == g2) { throw new IllegalArgumentException("g1 is equal to g2"); } this.g1 = g1; this.g2 = g2; this.operator = operator; } public GraphUnion(G g1, G g2) { this(g1, g2, WeightCombiner.SUM); } //~ Methods ---------------------------------------------------------------- public Set<E> getAllEdges(V sourceVertex, V targetVertex) { Set<E> res = new HashSet<E>(); if (g1.containsVertex(sourceVertex) && g1.containsVertex(targetVertex)) { res.addAll(g1.getAllEdges(sourceVertex, targetVertex)); } if (g2.containsVertex(sourceVertex) && g2.containsVertex(targetVertex)) { res.addAll(g2.getAllEdges(sourceVertex, targetVertex)); } return Collections.unmodifiableSet(res); } public E getEdge(V sourceVertex, V targetVertex) { E res = null; if (g1.containsVertex(sourceVertex) && g1.containsVertex(targetVertex)) { res = g1.getEdge(sourceVertex, targetVertex); } if ((res == null) && g2.containsVertex(sourceVertex) && g2.containsVertex(targetVertex)) { res = g2.getEdge(sourceVertex, targetVertex); } return res; } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public EdgeFactory<V, E> getEdgeFactory() { throw new UnsupportedOperationException(READ_ONLY); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public E addEdge(V sourceVertex, V targetVertex) { throw new UnsupportedOperationException(READ_ONLY); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public boolean addEdge(V sourceVertex, V targetVertex, E e) { throw new UnsupportedOperationException(READ_ONLY); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public boolean addVertex(V v) { throw new UnsupportedOperationException(READ_ONLY); } /** * @see Graph#getAllMatchingType(Class<?>) */ public Set<V> getAllMatchingType(Class<?> clazz) { Set<V> res = new HashSet<V>(); res.addAll(g1.getAllMatchingType(clazz)); res.addAll(g2.getAllMatchingType(clazz)); return Collections.unmodifiableSet(res); } /** * @see Graph#getTypes() */ public Set<Class<?>> getTypes() { Set<Class<?>> res = new HashSet<Class<?>>(); res.addAll(g1.getTypes()); res.addAll(g2.getTypes()); return Collections.unmodifiableSet(res); } public boolean containsEdge(E e) { return g1.containsEdge(e) || g2.containsEdge(e); } public boolean containsVertex(V v) { return g1.containsVertex(v) || g2.containsVertex(v); } public Set<E> edgeSet() { Set<E> res = new HashSet<E>(); res.addAll(g1.edgeSet()); res.addAll(g2.edgeSet()); return Collections.unmodifiableSet(res); } public Set<E> edgesOf(V vertex) { Set<E> res = new HashSet<E>(); if (g1.containsVertex(vertex)) { res.addAll(g1.edgesOf(vertex)); } if (g2.containsVertex(vertex)) { res.addAll(g2.edgesOf(vertex)); } return Collections.unmodifiableSet(res); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public E removeEdge(V sourceVertex, V targetVertex) { throw new UnsupportedOperationException(READ_ONLY); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public boolean removeEdge(E e) { throw new UnsupportedOperationException(READ_ONLY); } /** * Throws <tt>UnsupportedOperationException</tt>, because <tt> * GraphUnion</tt> is read-only. */ public boolean removeVertex(V v) { throw new UnsupportedOperationException(READ_ONLY); } public Set<V> vertexSet() { Set<V> res = new HashSet<V>(); res.addAll(g1.vertexSet()); res.addAll(g2.vertexSet()); return Collections.unmodifiableSet(res); } public V getEdgeSource(E e) { if (g1.containsEdge(e)) { return g1.getEdgeSource(e); } if (g2.containsEdge(e)) { return g2.getEdgeSource(e); } return null; } public V getEdgeTarget(E e) { if (g1.containsEdge(e)) { return g1.getEdgeTarget(e); } if (g2.containsEdge(e)) { return g2.getEdgeTarget(e); } return null; } public double getEdgeWeight(E e) { if (g1.containsEdge(e) && g2.containsEdge(e)) { return operator.combine(g1.getEdgeWeight(e), g2.getEdgeWeight(e)); } if (g1.containsEdge(e)) { return g1.getEdgeWeight(e); } if (g2.containsEdge(e)) { return g2.getEdgeWeight(e); } throw new IllegalArgumentException("no such edge in the union"); } /** * @return G<sub>1</sub> */ public G getG1() { return g1; } /** * @return G<sub>2</sub> */ public G getG2() { return g2; } } // End GraphUnion.java
lgpl-3.0
mobilesec/sesames
SesameLibrary/src/at/sesame/fhooe/lib/charts/SesameChartHelper.java
12418
/***************************************************************************** * Project: Sesame-S Client * Description: mobile client for interaction with the sesame-s system * Author: Peter Riedl * Copyright: Peter Riedl, 06/2011 * ******************************************************************************/ package at.sesame.fhooe.lib.charts; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import org.achartengine.chart.PointStyle; import org.achartengine.model.CategorySeries; import org.achartengine.model.MultipleCategorySeries; import org.achartengine.model.TimeSeries; import org.achartengine.model.XYMultipleSeriesDataset; import org.achartengine.model.XYSeries; import org.achartengine.renderer.DefaultRenderer; import org.achartengine.renderer.SimpleSeriesRenderer; import org.achartengine.renderer.XYMultipleSeriesRenderer; import org.achartengine.renderer.XYSeriesRenderer; import android.graphics.Color; import android.util.Log; /** * this class is used to specify data series and renderers to be used with aChartEngine * @author Peter Riedl * */ public class SesameChartHelper { private static final String TAG = "SesameChartHelper"; public XYMultipleSeriesDataset buildDataset(String[] titles, List<double[]> xValues,List<double[]> yValues) { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); int length = titles.length; for (int i = 0; i < length; i++) { XYSeries series = new XYSeries(titles[i]); double[] xV = xValues.get(i); double[] yV = yValues.get(i); int seriesLength = xV.length; for (int k = 0; k < seriesLength; k++) { series.add(xV[k], yV[k]); } dataset.addSeries(series); } return dataset; } /** * Builds an XY multiple series renderer. * * @param colors the series rendering colors * @param styles the series point styles * @return the XY multiple series renderers */ public XYMultipleSeriesRenderer buildRenderer(int[] colors, PointStyle[] styles) { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); renderer.setAxisTitleTextSize(16); renderer.setChartTitleTextSize(20); renderer.setLabelsTextSize(15); renderer.setLegendTextSize(15); renderer.setPointSize(5f); renderer.setMargins(new int[] { 20, 30, 15, 0 }); int length = colors.length; for (int i = 0; i < length; i++) { XYSeriesRenderer r = new XYSeriesRenderer(); r.setColor(colors[i]); r.setPointStyle(styles[i]); renderer.addSeriesRenderer(r); } return renderer; } /** * Sets a few of the series renderer settings. * * @param renderer the renderer to set the properties to * @param title the chart title * @param xTitle the title for the X axis * @param yTitle the title for the Y axis * @param xMin the minimum value on the X axis * @param xMax the maximum value on the X axis * @param yMin the minimum value on the Y axis * @param yMax the maximum value on the Y axis * @param axesColor the axes color * @param labelsColor the labels color */ protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String xTitle, String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor, int labelsColor) { renderer.setChartTitle(title); renderer.setXTitle(xTitle); renderer.setYTitle(yTitle); renderer.setXAxisMin(xMin); renderer.setXAxisMax(xMax); renderer.setYAxisMin(yMin); renderer.setYAxisMax(yMax); renderer.setAxesColor(axesColor); renderer.setLabelsColor(labelsColor); } /** * Builds an XY multiple time dataset using the provided values. * * @param titles the series titles * @param xValues the values for the X axis * @param yValues the values for the Y axis * @return the XY multiple time dataset */ protected XYMultipleSeriesDataset buildDateDataset(String[] titles, List<Date[]> xValues, List<double[]> yValues) { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); int length = titles.length; for (int i = 0; i < length; i++) { TimeSeries series = new TimeSeries(titles[i]); Date[] xV = xValues.get(i); double[] yV = yValues.get(i); int seriesLength = xV.length; for (int k = 0; k < seriesLength; k++) { series.add(xV[k], yV[k]); } dataset.addSeries(series); } return dataset; } /** * Builds a category series using the provided values. * * @param titles the series titles * @param values the values * @return the category series */ protected CategorySeries buildCategoryDataset(String title, double[] values) { CategorySeries series = new CategorySeries(title); int k = 0; for (double value : values) { series.add("Project " + ++k, value); } return series; } /** * Builds a multiple category series using the provided values. * * @param titles the series titles * @param values the values * @return the category series */ protected MultipleCategorySeries buildMultipleCategoryDataset(String title, List<String[]> titles, List<double[]> values) { MultipleCategorySeries series = new MultipleCategorySeries(title); int k = 0; for (double[] value : values) { series.add(2007 + k + "", titles.get(k), value); k++; } return series; } /** * Builds a category renderer to use the provided colors. * * @param colors the colors * @return the category renderer */ protected DefaultRenderer buildCategoryRenderer(int[] colors) { DefaultRenderer renderer = new DefaultRenderer(); renderer.setLabelsTextSize(15); renderer.setLegendTextSize(15); renderer.setMargins(new int[] { 20, 30, 15, 0 }); for (int color : colors) { SimpleSeriesRenderer r = new SimpleSeriesRenderer(); r.setColor(color); renderer.addSeriesRenderer(r); } return renderer; } /** * Builds a bar multiple series dataset using the provided values. * * @param titles the series titles * @param values the values * @return the XY multiple bar dataset */ public XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); int length = titles.length; for (int i = 0; i < length; i++) { CategorySeries series = new CategorySeries(titles[i]); double[] v = values.get(i); int seriesLength = v.length; for (int k = 0; k < seriesLength; k++) { series.add(v[k]); } dataset.addSeries(series.toXYSeries()); } return dataset; } /** * Builds a bar multiple series renderer to use the provided colors. * * @param colors the series renderers colors * @return the bar multiple series renderer */ protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); renderer.setAxisTitleTextSize(16); renderer.setChartTitleTextSize(20); renderer.setLabelsTextSize(15); renderer.setLegendTextSize(15); renderer.setShowGrid(true); int length = colors.length; for (int i = 0; i < length; i++) { SimpleSeriesRenderer r = new SimpleSeriesRenderer(); r.setColor(colors[i]); renderer.addSeriesRenderer(r); } return renderer; } /** * creates a renderer for the energy data graph * @param _data the data to be rendered (needed for correct x-labels) * @param _xSpacingInHours the spacing in hours between two x-labels * @return a renderer for energy data graphs */ public XYMultipleSeriesRenderer buildEnergyDataRenderer(GregorianCalendar _startDate, int _length, int _xSpacingInHours) { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); //----------------------------------------------------------------------------------------------------- //general setup //----------------------------------------------------------------------------------------------------- performGeneralEnergyDataRendererSetup(renderer); //----------------------------------------------------------------------------------------------------- //x-labels //----------------------------------------------------------------------------------------------------- if(_length<100)//1 measurement every 15 minutes --> 4 measurements per hour --> 92 measurements per day { layoutEnergyDataRendererXLabelsHour(renderer, _length, _xSpacingInHours); } else { layoutEnergyDataRendererXLabelsDay(renderer, _startDate, _length, _xSpacingInHours); } //----------------------------------------------------------------------------------------------------- //y-labels //----------------------------------------------------------------------------------------------------- // layoutEnergyDataRendererYLabels(renderer, _data); //----------------------------------------------------------------------------------------------------- //finish //----------------------------------------------------------------------------------------------------- XYSeriesRenderer r = new XYSeriesRenderer(); renderer.addSeriesRenderer(r); return renderer; } private XYMultipleSeriesRenderer performGeneralEnergyDataRendererSetup(XYMultipleSeriesRenderer _renderer) { _renderer.setAxisTitleTextSize(16); _renderer.setChartTitleTextSize(20); _renderer.setLabelsTextSize(15); _renderer.setLegendTextSize(15); _renderer.setPointSize(5f); _renderer.setGridColor(Color.WHITE); _renderer.setShowGrid(true); return _renderer; } private XYMultipleSeriesRenderer layoutEnergyDataRendererXLabelsHour(XYMultipleSeriesRenderer _renderer, int _length, int _xSpacingInHours) { _renderer.setXLabels(0); // int len = _data.length; int interval = 4*_xSpacingInHours; //a data value is present every 15 minutes --> four times per hour. for(int i = 0;i<_length;i+=interval) { _renderer.addXTextLabel(i+1, getXLabelForEnergyDataHour(i));//i+1 because x-indexing starts with 1 in achartengine } return _renderer; } private String getXLabelForEnergyDataHour(int _idx) { GregorianCalendar gc = new GregorianCalendar(); gc.set(Calendar.HOUR_OF_DAY, 0); gc.set(Calendar.MINUTE,0); for(int i = 0;i<_idx;i++) { gc.add(Calendar.MINUTE, 15); } SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); // String res = ; return sdf.format(gc.getTime()); } private XYMultipleSeriesRenderer layoutEnergyDataRendererXLabelsDay(XYMultipleSeriesRenderer _renderer, GregorianCalendar _startDate, int _lenght, int _xSpacingInHours) { _renderer.setXLabels(0); // int len = _data.length; // int interval = 4*_xSpacingInHours; //a data value is present every 15 minutes --> four times per hour. for(int i = 0;i<_lenght;i+=92)//1 measurement every 15 minutes --> 4 measurements per hour --> 92 measurements per day { _renderer.addXTextLabel(i+1, getXLabelForEnergyDataDay(_startDate, i));//i+1 because x-indexing starts with 1 in achartengine } return _renderer; } private String getXLabelForEnergyDataDay(GregorianCalendar _startDate, int _idx) { GregorianCalendar gc = new GregorianCalendar(); gc.set(Calendar.YEAR, _startDate.get(Calendar.YEAR)); gc.set(Calendar.MONTH, _startDate.get(Calendar.MONTH)); gc.set(Calendar.DAY_OF_MONTH, _startDate.get(Calendar.DAY_OF_MONTH)); // Log.e(TAG, gc.toString()); for(int i = 0;i<_idx;i++) { // if(i>0) { if(i%92==0) { gc.add(Calendar.DAY_OF_YEAR, 1); } } } SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); return sdf.format(gc.getTime()); } private XYMultipleSeriesRenderer layoutEnergyDataRendererYLabels(XYMultipleSeriesRenderer _renderer, double[] _data) { _renderer.setYLabels(0); ArrayList<Double> dataArrList = new ArrayList<Double>(); for(int i = 0;i<_data.length;i++) { dataArrList.add(new Double(_data[i])); } double maxY = Collections.max(dataArrList); // Log.e(TAG, "max of data="+maxY); for(int i = 100;i<maxY;i+=100) { _renderer.addYTextLabel(i, ""+i); } return _renderer; } }
lgpl-3.0
jblievremont/sonarqube
server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/CopyAction.java
2372
/* * SonarQube, open source software quality management tool. * Copyright (C) 2008-2014 SonarSource * mailto:contact AT sonarsource DOT com * * SonarQube is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * SonarQube is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.server.qualitygate.ws; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.text.JsonWriter; import org.sonar.core.qualitygate.db.QualityGateDto; import org.sonar.server.qualitygate.QualityGates; public class CopyAction implements QGateWsAction { private final QualityGates qualityGates; public CopyAction(QualityGates qualityGates) { this.qualityGates = qualityGates; } @Override public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction("copy") .setDescription("Copy a Quality Gate. Require Administer Quality Profiles and Gates permission") .setPost(true) .setSince("4.3") .setHandler(this); action.createParam(QGatesWs.PARAM_ID) .setDescription("The ID of the source quality gate") .setRequired(true) .setExampleValue("1"); action.createParam(QGatesWs.PARAM_NAME) .setDescription("The name of the quality gate to create") .setRequired(true) .setExampleValue("My Quality Gate"); } @Override public void handle(Request request, Response response) { QualityGateDto newQualityGate = qualityGates.copy(QGatesWs.parseId(request, QGatesWs.PARAM_ID), request.mandatoryParam(QGatesWs.PARAM_NAME)); JsonWriter writer = response.newJsonWriter(); QGatesWs.writeQualityGate(newQualityGate, writer).close(); } }
lgpl-3.0
scottysinclair/barleydb
src/main/java/scott/barleydb/api/core/entity/EntityContextHelper.java
12171
package scott.barleydb.api.core.entity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; /* * #%L * BarleyDB * %% * Copyright (C) 2014 Scott Sinclair <scottysinclair@gmail.com> * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ public class EntityContextHelper { private static final Logger LOG = LoggerFactory.getLogger(EntityContextHelper.class); public interface Predicate { boolean matches(Entity entity); } @SafeVarargs public static Collection<Entity> flatten(Collection<Entity> ...colColEntities) { LinkedHashSet<Entity> result = new LinkedHashSet<>(); for (Collection<Entity> col: colColEntities) { result.addAll(col); } return result; } /** * Navigates the object graph for each entity in the collection of entities. returns the entities which match the predicate. * @param entities the collection of entities to navigate * @param predicate he predicate * @return */ public static LinkedHashSet<Entity> findEntites(Collection<Entity> entities, Predicate predicate) { LinkedHashSet<Entity> matches = new LinkedHashSet<>(); HashSet<Entity> checked = new HashSet<>(); for (Entity entity: entities) { findEntites(matches, checked, entity, predicate); } return matches; } /** * Navigates the object graph for each entity in the collection of entities. returns the entities which match the predicate. * @param entities the collection of entities to navigate * @param predicate he predicate * @return */ public static LinkedHashSet<Entity> findAllEntites(Entity ...entities) { return findEntites(Arrays.asList(entities), new Predicate() { @Override public boolean matches(Entity entity) { return true; } }); } /** * Finds all entities by navigating the object graph from entity which match the given predicate.<br/> * * @param matches * @param checked * @param entity * @param predicate * @return */ public static LinkedHashSet<Entity> findEntites(LinkedHashSet<Entity> matches, HashSet<Entity> checked, Entity entity, Predicate predicate) { if (!checked.add( entity )) { return matches; } if (predicate.matches( entity )) { matches.add(entity); } for (RefNode refNode: entity.getChildren(RefNode.class)) { Entity e = refNode.getReference(false); if (e != null) { findEntites(matches, checked, e, predicate); } } for (ToManyNode toManyNode: entity.getChildren(ToManyNode.class)) { for (Entity e: toManyNode.getList()) { if (e != null) { findEntites(matches, checked, e, predicate); } } } return matches; } public static int countLoaded(Collection<Entity> entities) { int count = 0; for (Entity e: entities) { if (e.isLoaded()) { count++; } } return count; } public static int countNotLoaded(Collection<Entity> entities) { int count = 0; for (Entity e: entities) { if (e.isFetchRequired()) { count++; } } return count; } public static int countNew(Collection<Entity> entities) { int count = 0; for (Entity e: entities) { if (e.isClearlyNotInDatabase()) { count++; } } return count; } public static Collection<Entity> toParents(Collection<RefNode> fkReferences) { Collection<Entity> list = new LinkedList<Entity>(); for (RefNode refNode : fkReferences) { list.add(refNode.getParent()); } return list; } /** * Adds the set of entities assuming that the set will respect the fetched status of * tomany relations, ie if the set contains an entitiy with fetched == true for a ToManyNode * then the many entities are also in the list * @param entities * @param newContext */ public static List<Entity> addEntities(Iterable<Entity> entities, EntityContext newContext, boolean includeNonFetchedEntities, boolean overwriteOptimisticLocks) { List<Entity> copiedEntities = new LinkedList<Entity>(); for (Entity entity : entities) { //check if we are including non-fetched entities if (!includeNonFetchedEntities && entity.getKey().getValue() != null && entity.isFetchRequired()) { continue; } Entity e = newContext.getEntityByUuidOrKey(entity.getUuid(), entity.getEntityType(), entity.getKey().getValue(), false); if (e != null) { if (e.isLoaded() && entity.isNotLoaded()) { //nothing to do... continue; } } else { e = new Entity(newContext, entity); newContext.add(e); } e.setEntityState(entity.getEntityState()); e.copyValueNodesToMe(entity, overwriteOptimisticLocks); copiedEntities.add(e); } return copiedEntities; } /** * Applies the changes to the new context * @param entities * @param newContext */ public static List<Entity> applyChanges(List<Entity> entities, EntityContext newContext, EntityFilter filter) { List<Entity> newEntities = new LinkedList<Entity>(); for (Entity entity : entities) { if (!filter.includesEntity(entity)) { LOG.trace("Entity {} filtered out from changes being applied to the other context", entity); continue; } Entity e = newContext.getEntityByUuidOrKey(entity.getUuid(), entity.getEntityType(), entity.getKey().getValue(), true); LOG.trace("Copying entity values for {}", e); e.copyValueNodesToMe(entity); e.getConstraints().set( entity.getConstraints() ); e.setEntityState(entity.getEntityState()); newEntities.add(e); } return newEntities; } public interface EntityFilter { public boolean includesEntity(Entity entity); } /** * Copies the ref states from entityContext to newContext * @param entityContext * @param newContext */ public static void copyRefStates(EntityContext entityContext, EntityContext newContext, Iterable<Entity> newEntities, EntityFilter entityFilter) { //we need to iterate without concurrent modification errors, when ref ids are set //we need to process all refs first as the tomany refs depend on the refs for (Entity entity : newEntities) { Entity orig = entityContext.getEntityByUuidOrKey(entity.getUuid(), entity.getEntityType(), entity.getKey().getValue(), true); for (RefNode refNode : entity.getChildren(RefNode.class)) { LOG.trace("Copying ref state for {}.{}", entity, refNode.getName()); RefNode origRefNode = orig.getChild(refNode.getName(), RefNode.class); if (!refNode.getEntityType().equals(origRefNode.getEntityType())) { throw new IllegalStateException("CopyRefStatesFailed: entity " + origRefNode.getParent() + " has ref " + origRefNode.getName() + " with the wrong entity type: " + origRefNode.getEntityType()); } refNode.setLoaded( origRefNode.isLoaded()); if (refNode.isLoaded()) { Entity origRefE = origRefNode.getReference(false); if (origRefE != null) { Entity e = newContext.getEntityByUuidOrKey(origRefE.getUuid(), origRefE.getEntityType(), origRefE.getKey().getValue(), true); refNode.setReference(e); } else{ refNode.setReference(null); } } } } for (Entity entity : newEntities) { Entity orig = entityContext.getEntityByUuidOrKey(entity.getUuid(), entity.getEntityType(), entity.getKey().getValue(), true); for (ToManyNode toManyNode : entity.getChildren(ToManyNode.class)) { LOG.trace("Copying tomanynode state for {}.{}", entity, toManyNode.getName()); ToManyNode origToManyNode = orig.getChild(toManyNode.getName(), ToManyNode.class); /* LOG.debug(" ------------------------------------------- "); LOG.debug("copyRefState: fetched orig: " + origToManyNode.toString() + " " + origToManyNode.isFetched()); LOG.debug("copyRefState: entities orig: " + origToManyNode.toString() + " " + origToManyNode.getList()); LOG.debug("copyRefState: removed orig: " + origToManyNode.toString() + " " + origToManyNode.getRemovedEntities()); LOG.debug("copyRefState: fetched dest: " + toManyNode.toString() + " " + toManyNode.isFetched()); LOG.debug("copyRefState: entities dest: " + toManyNode.toString() + " " + toManyNode.getList()); LOG.debug("copyRefState: removed dest: " + toManyNode.toString() + " " + toManyNode.getRemovedEntities()); */ /* * If the original tomany node is fetched then our one will be too. * * If toManyNode is already fetched then should leave it, it * should not be set to false */ if (!toManyNode.isFetched()) { toManyNode.setFetched(origToManyNode.isFetched()); } /* * Add any new entities to the destination ToManyRef */ Set<Entity> processed = new HashSet<>(); if (containsIncludedNewRefs(origToManyNode, entityFilter)) { for (Entity e : origToManyNode.getNewEntities()) { if (!processed.add(e)) { continue; } Entity e2 = newContext.getEntityByUuidOrKey(e.getUuid(), e.getEntityType(), e.getKey().getValue(), true); if (!toManyNode.contains( e2 )) { toManyNode.add(e2); } } } //looks up the entities in it's own context toManyNode.refresh(); } } } private static boolean containsIncludedNewRefs(ToManyNode toManyNode, EntityFilter entityFilter) { int countIncludes = 0, countExcludes = 0; for (Entity e : toManyNode.getNewEntities()) { if (entityFilter.includesEntity(e)) { countIncludes++; } else { countExcludes++; } } if (countExcludes > 0 && countIncludes > 0) { throw new IllegalStateException("A ToMany nodes references must all be included or all excluded '" + toManyNode + "'"); } return countIncludes > 0; } }
lgpl-3.0
R3ap3rG/G-Craft
src/main/java/com/R3ap3rG/gcraft/client/gui/ModGuiConfig.java
762
package com.R3ap3rG.gcraft.client.gui; import com.R3ap3rG.gcraft.handler.ConfigHandler; import com.R3ap3rG.gcraft.reference.Reference; import cpw.mods.fml.client.config.GuiConfig; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.common.config.Configuration; public class ModGuiConfig extends GuiConfig { public ModGuiConfig(GuiScreen guiScreen) { super(guiScreen, new ConfigElement(ConfigHandler.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Reference.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.configuration.toString())); } }
lgpl-3.0
p-smith/open-ig
src/hu/openig/launcher/LReleaseItem.java
639
/* * Copyright 2008-2014, David Karnok * The file is part of the Open Imperium Galactica project. * * The code should be distributed under the LGPL license. * See http://www.gnu.org/licenses/lgpl.html for details. */ package hu.openig.launcher; import java.util.ArrayList; import java.util.List; /** * Represents a release entry item. * @author akarnokd, 2014 nov. 12 */ public class LReleaseItem { /** The item category if not null. */ public String category; /** The associated issues if any. */ public final List<Integer> issues = new ArrayList<>(); /** The textual description of the item. */ public String text; }
lgpl-3.0
Alfresco/alfresco-repository
src/test/java/org/alfresco/repo/audit/AuditMethodInterceptorTest.java
12783
/* * #%L * Alfresco Repository * %% * Copyright (C) 2005 - 2016 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of * the paid license agreement will prevail. Otherwise, the software is * provided under the following open source license terms: * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * #L% */ package org.alfresco.repo.audit; import java.io.Serializable; import java.net.URL; import java.util.Date; import java.util.Map; import junit.framework.TestCase; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.repo.audit.model.AuditModelRegistryImpl; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.transaction.TransactionServiceImpl; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.audit.AuditQueryParameters; import org.alfresco.service.cmr.audit.AuditService; import org.alfresco.service.cmr.audit.AuditService.AuditQueryCallback; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.service.transaction.TransactionService; import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.testing.category.LuceneTests; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.experimental.categories.Category; import org.springframework.context.ApplicationContext; import org.springframework.util.ResourceUtils; /** * Tests AuditMethodInterceptor * * @see AuditMethodInterceptor * @author alex.mukha * @since 4.2.3 */ @Category(LuceneTests.class) public class AuditMethodInterceptorTest extends TestCase { private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(); private AuditModelRegistryImpl auditModelRegistry; private TransactionServiceImpl transactionServiceImpl; private NodeService nodeService; private SearchService searchService; private ServiceRegistry serviceRegistry; private AuditComponent auditComponent; private AuditService auditService; private TransactionService transactionService; private NodeRef nodeRef; private static String APPLICATION_NAME_MNT_11072 = "alfresco-mnt-11072"; private static String APPLICATION_NAME_MNT_16748 = "SearchAudit"; private static final Log logger = LogFactory.getLog(AuditMethodInterceptorTest.class); @SuppressWarnings("deprecation") @Override public void setUp() throws Exception { auditModelRegistry = (AuditModelRegistryImpl) ctx.getBean("auditModel.modelRegistry"); serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); auditComponent = (AuditComponent) ctx.getBean("auditComponent"); auditService = serviceRegistry.getAuditService(); transactionService = serviceRegistry.getTransactionService(); transactionServiceImpl = (TransactionServiceImpl) ctx.getBean("transactionService"); nodeService = serviceRegistry.getNodeService(); searchService = serviceRegistry.getSearchService(); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); nodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); // Register the models URL modelUrlMnt11072 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-11072.xml"); URL modelUrlMnt16748 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-16748.xml"); auditModelRegistry.registerModel(modelUrlMnt11072); auditModelRegistry.registerModel(modelUrlMnt16748); auditModelRegistry.loadAuditModels(); } @Override public void tearDown() { auditService.clearAudit(APPLICATION_NAME_MNT_11072, null, null); auditService.clearAudit(APPLICATION_NAME_MNT_16748, null, null); auditModelRegistry.destroy(); AuthenticationUtil.clearCurrentSecurityContext(); } /** * Test for <a href="https://issues.alfresco.com/jira/browse/MNT-11072">MNT-11072</a> <br> * Use NodeService, as it is wrapped by the AuditMethodInterceptor, to get node props in read-only server mode. */ public void testAuditInReadOnly_MNT11072() throws Exception { // Run as admin AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser(); QName veto = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "TestVeto"); transactionServiceImpl.setAllowWrite(false, veto); try { // Access the node in read-only transaction Map<QName, Serializable> props = transactionService.getRetryingTransactionHelper() .doInTransaction(new RetryingTransactionCallback<Map<QName, Serializable>>() { @Override public Map<QName, Serializable> execute() throws Throwable { return nodeService.getProperties(nodeRef); } }, true, false); assertNotNull("The props should exsist.", props); // Search for audit final StringBuilder sb = new StringBuilder(); final MutableInt rowCount = new MutableInt(); AuditQueryCallback callback = new AuditQueryCallback() { @Override public boolean valuesRequired() { return true; } @Override public boolean handleAuditEntry(Long entryId, String applicationName, String user, long time, Map<String, Serializable> values) { assertNotNull(applicationName); assertNotNull(user); sb.append("Row: ").append(entryId).append(" | ") .append(applicationName).append(" | ") .append(user).append(" | ") .append(new Date(time)).append(" | ") .append(values).append(" | ").append("\n"); rowCount.setValue(rowCount.intValue() + 1); return true; } @Override public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new AlfrescoRuntimeException(errorMsg, error); } }; AuditQueryParameters params = new AuditQueryParameters(); params.setForward(true); params.setUser(AuthenticationUtil.getAdminUserName()); params.setApplicationName(APPLICATION_NAME_MNT_11072); rowCount.setValue(0); auditComponent.auditQuery(callback, params, Integer.MAX_VALUE); assertEquals("There should be one audit entry.", 1, rowCount.intValue()); assertTrue("The requested nodeRef should be in the audit entry.", sb.toString().contains(nodeRef.toString())); if (logger.isDebugEnabled()) { logger.debug(sb.toString()); } } finally { transactionServiceImpl.setAllowWrite(true, veto); } } /** * Test for <a href="https://issues.alfresco.com/jira/browse/MNT-16748">MNT-16748</a> <br> * Use {@link SearchService#query(StoreRef, String, String)} to perform a query. */ public void testAuditSearchServiceQuery() throws Exception { // Run as admin AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser(); // Perform a search @SuppressWarnings("unused") ResultSet rs = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<ResultSet>() { @Override public ResultSet execute() throws Throwable { return searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_XPATH, "/app:company_home"); } }, true, false); // Check the audit entries checkAuditEntries(APPLICATION_NAME_MNT_16748, SearchService.LANGUAGE_XPATH, "/app:company_home", 1); } /** * Test for <a href="https://issues.alfresco.com/jira/browse/MNT-16748">MNT-16748</a> <br> * Use {@link SearchService#query(SearchParameters)} to perform a query. */ public void testAuditSearchServiceSearchParametersQuery() throws Exception { // Run as admin AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser(); // Create SearchParameters to be used in query SearchParameters sp = new SearchParameters(); sp.setLanguage(SearchService.LANGUAGE_XPATH); sp.setQuery("/app:company_home/app:dictionary"); sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); // Perform a search @SuppressWarnings("unused") ResultSet rs = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<ResultSet>() { @Override public ResultSet execute() throws Throwable { return searchService.query(sp); } }, true, false); // Check the audit entries checkAuditEntries(APPLICATION_NAME_MNT_16748, SearchService.LANGUAGE_XPATH, "/app:company_home/app:dictionary", 1); } private void checkAuditEntries(String applicationName, String language, String query, int resultsNumber) { final StringBuilder sb = new StringBuilder(); final MutableInt rowCount = new MutableInt(); AuditQueryCallback callback = new AuditQueryCallback() { @Override public boolean valuesRequired() { return true; } @Override public boolean handleAuditEntry(Long entryId, String applicationName, String user, long time, Map<String, Serializable> values) { assertNotNull(applicationName); assertNotNull(user); sb.append("Row: ").append(entryId).append(" | ") .append(applicationName).append(" | ") .append(user).append(" | ") .append(new Date(time)).append(" | ") .append(values).append(" | ").append("\n"); rowCount.setValue(rowCount.intValue() + 1); return true; } @Override public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new AlfrescoRuntimeException(errorMsg, error); } }; AuditQueryParameters params = new AuditQueryParameters(); params.setForward(true); params.setUser(AuthenticationUtil.getAdminUserName()); params.setApplicationName(applicationName); rowCount.setValue(0); auditComponent.auditQuery(callback, params, Integer.MAX_VALUE); assertEquals("Incorrect number of audit entries", resultsNumber, rowCount.intValue()); assertTrue("The requested language should be in the audit entry.", sb.toString().contains(language)); assertTrue("The used query should be in the audit entry.", sb.toString().contains(query)); if (logger.isDebugEnabled()) { logger.debug(sb.toString()); } } }
lgpl-3.0
subes/invesdwin-norva
invesdwin-norva/src/main/java/de/invesdwin/norva/apt/staticfacade/StaticFacadeDefinition.java
434
package de.invesdwin.norva.apt.staticfacade; public @interface StaticFacadeDefinition { String name(); Class<?>[] targets(); String[] filterMethodSignatureExpressions() default {}; /** * These are the signature like "com.google.common.primitives.Chars#compare(char, char)" which are generated as the * {@see} comment of the static facade. */ String[] filterSeeMethodSignatures() default {}; }
lgpl-3.0
harshpoddar21/route_suggest_algo
jsprit-instances/src/main/java/com/graphhopper/jsprit/instance/reader/Taillard.java
20690
/******************************************************************************* * Copyright (C) 2013 Stefan Schroeder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package com.graphhopper.jsprit.instance.reader; //package instances; // //import java.io.BufferedReader; //import java.io.IOException; //import java.util.ArrayList; //import java.util.Collection; //import java.util.HashMap; //import java.util.Map; //import java.util.concurrent.ExecutorService; //import java.util.concurrent.Executors; //import java.util.concurrent.TimeUnit; // //import org.apache.log4j.Level; //import org.apache.log4j.Logger; //import org.matsim.contrib.freight.vrp.algorithms.rr.costCalculators.JobInsertionCalculator; //import org.matsim.contrib.freight.vrp.algorithms.rr.costCalculators.RouteAgentFactory; //import org.matsim.contrib.freight.vrp.algorithms.rr.listener.RuinAndRecreateReport; //import org.matsim.contrib.freight.vrp.algorithms.rr.ruin.JobDistanceAvgCosts; //import org.matsim.contrib.freight.vrp.algorithms.rr.ruin.RuinRadial; //import org.matsim.contrib.freight.vrp.basics.Driver; //import org.matsim.contrib.freight.vrp.basics.Job; //import org.matsim.contrib.freight.vrp.basics.RouteAlgorithm; //import org.matsim.contrib.freight.vrp.basics.RouteAlgorithm.VehicleSwitchedListener; //import org.matsim.contrib.freight.vrp.basics.Service; //import org.matsim.contrib.freight.vrp.basics.Tour; //import org.matsim.contrib.freight.vrp.basics.TourActivity; //import org.matsim.contrib.freight.vrp.basics.TourStateUpdater; //import org.matsim.contrib.freight.vrp.basics.Vehicle; //import org.matsim.contrib.freight.vrp.basics.VehicleFleetManager; //import org.matsim.contrib.freight.vrp.basics.VehicleFleetManagerImpl; //import org.matsim.contrib.freight.vrp.basics.VehicleImpl; //import org.matsim.contrib.freight.vrp.basics.VehicleImpl.Type; //import org.matsim.contrib.freight.vrp.basics.VehicleImpl.VehicleCostParams; //import org.matsim.contrib.freight.vrp.basics.VehicleRoute; //import org.matsim.contrib.freight.vrp.basics.VehicleRoute.VehicleRouteCostCalculator; //import org.matsim.contrib.freight.vrp.basics.VehicleRouteCostFunction; //import org.matsim.contrib.freight.vrp.basics.VehicleRouteCostFunctionFactory; //import org.matsim.contrib.freight.vrp.basics.VehicleRoutingCosts; //import org.matsim.contrib.freight.vrp.basics.VehicleRoutingProblem; //import org.matsim.contrib.freight.vrp.basics.VehicleRoutingProblemSolution; //import org.matsim.contrib.freight.vrp.basics.VrpBuilder; //import org.matsim.contrib.freight.vrp.utils.Coordinate; //import org.matsim.contrib.freight.vrp.utils.EuclideanDistanceCalculator; //import org.matsim.contrib.freight.vrp.utils.Locations; //import org.matsim.contrib.freight.vrp.utils.RouteUtils; //import org.matsim.core.utils.io.IOUtils; // //import ruinFactories.RadialRuinFactory; //import selectors.SelectBest; //import selectors.SelectRandomly; //import strategies.GendreauPostOpt; //import strategies.RadialAndRandomRemoveBestInsert; //import vrp.SearchStrategy; //import vrp.SearchStrategyManager; //import vrp.SearchStrategyModule; //import vrp.VehicleRoutingMetaAlgorithm; //import acceptors.AcceptNewRemoveWorst; //import basics.VehicleRouteFactoryImpl; //import basics.costcalculators.AuxilliaryCostCalculator; //import basics.costcalculators.CalculatesActivityInsertion; //import basics.costcalculators.CalculatesServiceInsertionConsideringFixCost; //import basics.costcalculators.CalculatesServiceInsertionOnRouteLevel; //import basics.costcalculators.CalculatesVehTypeDepServiceInsertion; //import basics.inisolution.CreateInitialSolution; //import basics.insertion.ConfigureFixCostCalculator; //import basics.insertion.DepotDistance; //import basics.insertion.ParRegretInsertion; //import basics.insertion.RecreationBestInsertion; // ///** // * test instances for the capacitated vrp with time windows. instances are from solomon // * and can be found at: // * http://neo.lcc.uma.es/radi-aeb/WebVRP/ // * @author stefan schroeder // * // */ // // // //public class Taillard { // // // static class MyLocations implements Locations{ // // private Map<String,Coordinate> locations = new HashMap<String, Coordinate>(); // // public void addLocation(String id, Coordinate coord){ // locations.put(id, coord); // } // // @Override // public Coordinate getCoord(String id) { // return locations.get(id); // } // } // // public static final String VRPHE = "vrphe"; // // public static final String VFM = "vfm"; // // private static Logger logger = Logger.getLogger(Christophides.class); // // private String fileNameOfInstance; // // private String depotId; // // private String instanceName; // // private String vehicleFile; // // private String vehicleCostScenario; // // private String vrpType; // // private ResultWriter resultWriter; // // private RuinAndRecreateReport report; // // // public Taillard(String fileNameOfInstance, String instanceName, String vehicleFileName, String vehicleCostScenario, String vrpType) { // super(); // this.fileNameOfInstance = fileNameOfInstance; // this.instanceName = instanceName; // this.vehicleFile = vehicleFileName; // this.vehicleCostScenario = vehicleCostScenario; // this.vrpType = vrpType; // } // // public static void main(String[] args) throws IOException { // System.out.println("start " + System.currentTimeMillis()); // Logger.getRootLogger().setLevel(Level.INFO); // // int nOfProcessors = Runtime.getRuntime().availableProcessors(); // logger.info("nOfProcessors: " + nOfProcessors); // ExecutorService executor = Executors.newFixedThreadPool(nOfProcessors+2); // // ResultWriter resultWriter = new ResultWriter(); //// String vrpType = "VFM"; // String vrpType = VRPHE; // String pblm_abbr = "R101"; // String costScen = "R_19"; // // String problem = "100_" + pblm_abbr + "_LuiShen"; // String problemFile = pblm_abbr + ".txt"; // Taillard luiShen = new Taillard("/Users/stefan/Documents/Schroeder/Dissertation/vrpInstances/cvrptw_solomon/nOfCust100/"+problemFile, // problem, "/Users/stefan/Documents/Schroeder/Dissertation/vrpInstances/vrphe_taillard/"+costScen+".txt", costScen, vrpType); // luiShen.setResultWriter(resultWriter); // luiShen.run(executor); // // System.out.println("finish " + System.currentTimeMillis()); // resultWriter.write("output/taillard_"+ pblm_abbr + "_" + costScen + ".txt"); // resultWriter.writeSolutions("output/taillard_solution_" + pblm_abbr + "_" + costScen + ".txt"); // // executor.shutdown(); // try { // executor.awaitTermination(10, TimeUnit.SECONDS); // } catch (InterruptedException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // } // // private static String getName(int i) { // if(i<10){ // return "0" + i; // } // else{ // return "" + i; // } // } // // private void setResultWriter(ResultWriter resultWriter) { // this.resultWriter = resultWriter; // // } // // public void run(ExecutorService executor){ // // final MyLocations myLocations = new MyLocations(); // Collection<Job> jobs = new ArrayList<Job>(); // final Map<String,Service> jobMap = readLocationsAndJobs(myLocations,jobs); // // VehicleRoutingCosts costs = new VehicleRoutingCosts() { // // @Override // public double getBackwardTransportTime(String fromId, String toId, double arrivalTime, Driver driver, Vehicle vehicle) { // return getTransportTime(fromId, toId, arrivalTime, null, null); // } // // @Override // public double getBackwardTransportCost(String fromId, String toId, double arrivalTime, Driver driver, Vehicle vehicle) { // return getTransportCost(fromId, toId, arrivalTime, null, null); // } // // @Override // public double getTransportCost(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) { // double variableCost; // if(vehicle == null){ // variableCost = 1.0; // } // else{ // variableCost = vehicle.getType().vehicleCostParams.perDistanceUnit; // } // return variableCost*EuclideanDistanceCalculator.calculateDistance(myLocations.getCoord(fromId), myLocations.getCoord(toId)); // } // // @Override // public double getTransportTime(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) { // return getTransportCost(fromId, toId, departureTime, driver, vehicle); // } // }; // // VrpBuilder vrpBuilder = new VrpBuilder(costs); // for(Job j : jobs){ // vrpBuilder.addJob(j); // } // createVehicles(vrpBuilder); // VehicleRoutingProblem vrp = vrpBuilder.build(); // // VehicleRoutingMetaAlgorithm metaAlgorithm = new VehicleRoutingMetaAlgorithm(vrp); // configure(metaAlgorithm,vrp,executor,myLocations); // metaAlgorithm.run(); // // printSolutions(vrp); // // VehicleRoutingProblemSolution bestSolution = new SelectBest().selectSolution(vrp); // // resultWriter.addResult(instanceName+"_"+vehicleCostScenario , instanceName, RouteUtils.getNuOfActiveRoutes(bestSolution.getRoutes()), bestSolution.getCost()); // resultWriter.addSolution(bestSolution); // // // } // // private void printSolutions(VehicleRoutingProblem vrp) { // for(VehicleRoutingProblemSolution s : vrp.getSolutions()){ // System.out.println("total: " + s.getCost()); // System.out.println("activeTours: " + RouteUtils.getNuOfActiveRoutes(s.getRoutes())); // System.out.println(""); // } // // } // // private void configure(VehicleRoutingMetaAlgorithm metaAlgorithm, final VehicleRoutingProblem vrp, ExecutorService executor, MyLocations myLocations) { // VehicleRoute.VehicleRouteCostCalculator = new VehicleRouteCostCalculator() { // // @Override // public double calculate(Tour tour, Vehicle vehicle, Driver driver) { //// return vehicle.getType().vehicleCostParams.fix + tour.getCost(); // return tour.getCost(); // } // // }; // //// final VehicleFleetManager vehicleFleetManager = new InfiniteVehicles(vrp.getVehicles()); // final VehicleFleetManager vehicleFleetManager = new VehicleFleetManagerImpl(vrp.getVehicles()); // // final VehicleRouteCostFunctionFactory costFuncFac = getFac(); // // AuxilliaryCostCalculator auxilliaryCostCalculator = new AuxilliaryCostCalculator(vrp.getCosts(), costFuncFac); // CalculatesActivityInsertion actInsertion = new CalculatesActivityInsertion(auxilliaryCostCalculator,0,5); //// CalculatesServiceInsertion standardServiceInsertion = new CalculatesServiceInsertion(actInsertion); // CalculatesServiceInsertionOnRouteLevel standardServiceInsertion = new CalculatesServiceInsertionOnRouteLevel(actInsertion,vrp.getCosts(),costFuncFac); // CalculatesServiceInsertionOnRouteLevel.MEMORYSIZE_FORPROMISING_INSERTIONPOSITIONS = 2; // CalculatesServiceInsertionConsideringFixCost withFixCost = new CalculatesServiceInsertionConsideringFixCost(standardServiceInsertion); // withFixCost.setWeightOfFixCost(0.0); // // final JobInsertionCalculator vehicleTypeDepInsertionCost = new CalculatesVehTypeDepServiceInsertion(vehicleFleetManager, standardServiceInsertion); // // final TourStateUpdater tourStateCalculator = new TourStateUpdater(vrp.getCosts(),costFuncFac); // tourStateCalculator.setTimeWindowUpdate(false); // // RouteAgentFactory routeAgentFactory = new RouteAgentFactory(){ // // @Override // public RouteAlgorithm createAgent(VehicleRoute route) { // VehicleSwitchedListener switched = new VehicleSwitchedListener() { // // @Override // public void vehicleSwitched(Vehicle oldVehicle, Vehicle newVehicle) { // vehicleFleetManager.unlock(oldVehicle); // vehicleFleetManager.lock(newVehicle); // } // // }; // RouteAlgorithmImpl agent = new RouteAlgorithmImpl(vehicleTypeDepInsertionCost, tourStateCalculator); // agent.getListeners().add(switched); // return agent; // } // // }; // // ParRegretInsertion regretInsertion = new ParRegretInsertion(executor, routeAgentFactory); // regretInsertion.getListener().add(new ConfigureFixCostCalculator(vrp, withFixCost)); // regretInsertion.setJobDistance(new DepotDistance(myLocations, depotId)); // regretInsertion.scoreParam_of_timeWindowLegth = 0.5; // regretInsertion.scoreParam_of_distance = 0.2; // regretInsertion.setVehicleRouteFactory(new VehicleRouteFactoryImpl(depotId)); // // // RecreationBestInsertion bestInsertion = new RecreationBestInsertion(routeAgentFactory); // bestInsertion.getListener().add(new ConfigureFixCostCalculator(vrp, withFixCost)); // bestInsertion.setVehicleRouteFactory(new VehicleRouteFactoryImpl(depotId)); // //// for(int i=0;i<3;i++){ // VehicleRoutingProblemSolution vrpSol = new CreateInitialSolution(bestInsertion).createInitialSolution(vrp); // vrp.getSolutions().add(vrpSol); //// } // // // RadialAndRandomRemoveBestInsert smallNeighborHoodSearchModule = new RadialAndRandomRemoveBestInsert(vrp, vehicleFleetManager, routeAlgorithm); // smallNeighborHoodSearchModule.setCalcConsideringFix(withFixCost); // smallNeighborHoodSearchModule.setStateCalc(tourStateCalculator); // smallNeighborHoodSearchModule.setInsertionStrategy(bestInsertion); // smallNeighborHoodSearchModule.setAuxilliaryCostCalculator(auxilliaryCostCalculator); // // SearchStrategy smallNeighborHoodSearch = new SearchStrategy(new SelectRandomly(), new AcceptNewRemoveWorst()); // // smallNeighborHoodSearch.addModule(smallNeighborHoodSearchModule); // // GendreauPostOpt postOpt = new GendreauPostOpt(vrp, routeAgentFactory, // (RuinRadial) new RadialRuinFactory(0.2, new JobDistanceAvgCosts(vrp.getCosts()), routeAgentFactory).createStrategy(vrp), // bestInsertion); // postOpt.setFleetManager(vehicleFleetManager); // postOpt.setVehicleRouteFactory(new VehicleRouteFactoryImpl(depotId)); // postOpt.setMaxIterations(2000); // postOpt.setShareOfJobsToRuin(0.18); //// smallNeighborHoodSearch.addModule(postOpt); // // //// SearchStrategy strat2 = new SearchStrategy(new SelectBest(), new AcceptNewRemoveWorst()); //// GendreauPostOpt postOpt2 = new GendreauPostOpt(vrp, routeAgentFactory, //// (RuinRadial) new RadialRuinFactory(0.2, new JobDistanceAvgCosts(vrp.getCosts()), routeAgentFactory).createStrategy(vrp), //// bestInsertion); //// postOpt2.setFleetManager(vehicleFleetManager); //// postOpt2.setVehicleRouteFactory(new VehicleRouteFactoryImpl(depotId)); //// postOpt2.setMaxIterations(2000); //// postOpt2.setShareOfJobsToRuin(0.1); //// strat2.addModule(postOpt2); // // SearchStrategyModule solutionVerifier = new SearchStrategyModule() { // // @Override // public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution vrpSolution) { // logger.info("verify solution"); // if(SolutionVerifier.resultOfSolutionEqualsSumOfIndividualRouteCost(vrpSolution, vrp, costFuncFac,false)) return vrpSolution; // throw new IllegalStateException("solution is not valid"); // } // }; // smallNeighborHoodSearch.addModule(solutionVerifier); // // SearchStrategyManager strategyManager = new SearchStrategyManager(); // strategyManager.addStrategy(smallNeighborHoodSearch, 1.0); //// strategyManager.addStrategy(strat2, 0.3); // // metaAlgorithm.setSearchStrategyManager(strategyManager); // metaAlgorithm.setMaxIterations(20); // VehicleRoutingProblem.SOLUTION_MEMORY = 4; // // // } // // private VehicleRouteCostFunctionFactory getFac() { // VehicleRouteCostFunctionFactory fac = new VehicleRouteCostFunctionFactory() { // // @Override // public VehicleRouteCostFunction createCostFunction(Vehicle vehicle, Driver driver) { // return new VehicleRouteCostFunction(){ // // double cost = 0.0; // // @Override // public void handleActivity(TourActivity tourAct, double startTime, double endTime) { // if(startTime > tourAct.getLatestOperationStartTime()){ // cost += Double.MAX_VALUE; // } // } // // @Override // public void handleLeg(TourActivity fromAct, TourActivity toAct, double depTime, double tpCost) { // cost += tpCost; // // } // // @Override // public double getCost() { // return cost; // } // // @Override // public void finish() { // // // } // // @Override // public void reset() { // // } // // }; // } // }; // return fac; // } // // private void createVehicles(VrpBuilder vrpBuilder) { // BufferedReader reader = IOUtils.getBufferedReader(vehicleFile); // String line = null; // int vehicleIdColumn = 0; // int capacityColumn = 1; // int fixColumn = 2; // int varColumn = 3; // int nOfVehiclesColumn = 4; // boolean firstLine = true; // try { // while((line = reader.readLine()) != null){ // if(firstLine){ // firstLine = false; // continue; // } // String[] tokens = line.split(";"); // String vehicleId = tokens[vehicleIdColumn]; // int capacity = Integer.parseInt(tokens[capacityColumn]); // int fixCost = Integer.parseInt(tokens[fixColumn]); // double var; // if(vrpType.equals(VRPHE)){ // var = Double.parseDouble(tokens[varColumn]); // } // else { // var = 1.0; // } // int nOfVehicles = Integer.parseInt(tokens[nOfVehiclesColumn]); // for(int i=0;i<nOfVehicles;i++){ // String vId = vehicleId + "_" + (i+1); // VehicleCostParams costparams = VehicleImpl.getFactory().createVehicleCostParams(fixCost, 0.0, var); // Type type = VehicleImpl.getFactory().createType(vehicleId, capacity, costparams); // VehicleImpl v = VehicleImpl.getFactory().createVehicle(vId, depotId, type); // vrpBuilder.addVehicle(v); // } // } // reader.close(); // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // } // // private Map<String,Service> readLocationsAndJobs(MyLocations locations, Collection<Job> jobs){ // BufferedReader reader = IOUtils.getBufferedReader(fileNameOfInstance); // String line = null; // int counter = 0; // Map<String,Service> jobMap = new HashMap<String, Service>(); // try { // while((line = reader.readLine()) != null){ // line = line.replace("\r", ""); // line = line.trim(); // String[] tokens = line.split(" +"); // counter++; // if(counter == 5){ // int vehicleCap = Integer.parseInt(tokens[1]); // continue; // } // // if(counter > 9){ // Coordinate coord = makeCoord(tokens[1],tokens[2]); // double depotStart = 0.0; // double depotEnd = Double.MAX_VALUE; // String customerId = tokens[0]; // locations.addLocation(customerId, coord); // int demand = Integer.parseInt(tokens[3]); // double start = Double.parseDouble(tokens[4]); // double end = Double.parseDouble(tokens[5]); // double serviceTime = Double.parseDouble(tokens[6]); // if(counter == 10){ // depotStart = start; // depotEnd = end; // depotId = tokens[0]; // // } // else{ // Service service = VrpUtils.createService("" + counter, customerId, demand, 0.0, 0.0, Double.MAX_VALUE); //// Shipment shipment = VrpUtils.createShipment("" + counter, depotId, customerId, demand, //// VrpUtils.createTimeWindow(depotStart, depotEnd), VrpUtils.createTimeWindow(start, end)); //// shipment.setDeliveryServiceTime(serviceTime); // jobs.add(service); // jobMap.put(customerId, service); //// jobs.add(shipment); //// j //// Shipment shipment = VrpUtils.createShipment("" + counter, depotId, customerId, demand, //// VrpUtils.createTimeWindow(depotStart, depotEnd), VrpUtils.createTimeWindow(start, end)); //// shipment.setDeliveryServiceTime(serviceTime); //// jobs.add(shipment); // } // } // } // reader.close(); // } catch (NumberFormatException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // return jobMap; // } // // private Coordinate makeCoord(String xString, String yString) { // double x = Double.parseDouble(xString); // double y = Double.parseDouble(yString); // return new Coordinate(x,y); // } // //}
lgpl-3.0
jkonert/socom
SocomAPI/src/de/tud/kom/socom/database/report/HSQLReportDatabase.java
3946
package de.tud.kom.socom.database.report; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Date; import java.util.LinkedList; import java.util.List; import de.tud.kom.socom.database.HSQLDatabase; import de.tud.kom.socom.util.datatypes.Report; import de.tud.kom.socom.util.exceptions.IllegalParameterException; public class HSQLReportDatabase extends HSQLDatabase implements ReportDatabase { private static ReportDatabase instance = new HSQLReportDatabase(); private HSQLReportDatabase() { super(); } public static ReportDatabase getInstance() { return instance; } @Override public boolean createReport(long informant, String type, long referenceId, String report) throws SQLException, IllegalParameterException { PreparedStatement typeStatement = db.getPreparedStatement("SELECT id FROM reporttypes WHERE type = ?"); typeStatement.setString(1, type); ResultSet rs = typeStatement.executeQuery(); if(!rs.next()) throw new IllegalParameterException("type"); long typeid = rs.getLong(1); PreparedStatement statement = db.getPreparedStatement("INSERT INTO reports " + "(informant, type, reference, report) VALUES (" + "?, ?,?,?);"); statement.setLong(1, informant); statement.setLong(2, typeid); statement.setLong(3, referenceId); statement.setString(4, report); return statement.executeUpdate() == 1; } @Override public List<Report> getReports(int limit, int offset, boolean includereviewed) throws SQLException { List<Report> result = new LinkedList<Report>(); String limitStatement = limit != -1 ? " LIMIT " + limit + (offset != -1 ? " OFFSET " + offset : "") : ""; String whereStatement = includereviewed ? "" : " WHERE reviewed = false "; String query = "SELECT " + "id, informant, reporttypes.type, reference, reference2, date, report, review, reviewed, reviewedby, reviewedon " + "FROM reports INNER JOIN reporttypes ON reports.type = reporttypes.id " + whereStatement + " ORDER BY date DESC " + limitStatement; PreparedStatement statement = db.getPreparedStatement(query); ResultSet rs = statement.executeQuery(); while(rs.next()) { Report r = extractReport(rs); result.add(r); } return result; } @Override public boolean makeReview(long reportid, long uid, String review) throws SQLException { PreparedStatement statement = db.getPreparedStatement("UPDATE reports " + "SET reviewed = true, reviewedby = ?, review = ?, reviewedon = CURRENT_TIMESTAMP " + "WHERE id = ?;"); statement.setLong(1, uid); statement.setString(2, review); statement.setLong(3, reportid); return statement.executeUpdate() == 1; } @Override public Report getReport(long reportid) throws SQLException { String query = "SELECT " + "id, informant, reporttypes.type, reference, reference2, date, report, review, reviewed, reviewedby, reviewedon " + "FROM reports INNER JOIN reporttypes ON reports.type = reporttypes.id " + "WHERE id = ?"; PreparedStatement statement = db.getPreparedStatement(query); statement.setLong(1, reportid); ResultSet rs = statement.executeQuery(); if(rs.next()) return extractReport(rs); return null; } private Report extractReport(ResultSet rs) throws SQLException { String report = rs.getString("report"); String reference2 = rs.getString("reference2"); String type = rs.getString("type"); long reference = rs.getLong("reference"); long id = rs.getLong("id"); Date timestamp = rs.getTimestamp("date"); long informant = rs.getLong("informant"); boolean reviewed = rs.getBoolean("reviewed"); long reviewedby = rs.getLong("reviewedby"); String review = rs.getString("review"); Date reviewedon = rs.getTimestamp("reviewedon"); Report r = new Report(id, informant, report, type, reference2, reference, timestamp); if(reviewed) r.addReview(reviewedby, review, reviewedon); return r; } }
lgpl-3.0
dutoitc/mitard
src/main/java/ch/mno/talend/mitard/writers/AbstractWriter.java
1560
package ch.mno.talend.mitard.writers; import ch.mno.talend.mitard.data.Context; import ch.mno.talend.mitard.data.TalendFile; import ch.mno.talend.mitard.data.TalendFiles; import ch.mno.talend.mitard.out.JSonWriter; import java.io.File; import java.io.IOException; import java.util.List; import java.util.regex.Pattern; import java.util.stream.Collectors; /** * Created by dutoitc on 13.05.2015. */ public abstract class AbstractWriter { private final Context context; public AbstractWriter(Context context) { this.context = context; } public Context getContext() { return context; } public abstract void write(TalendFiles talendFiles); /** Write obj as JSON in productionPath/data/filename */ protected void writeJson(String filename, Object obj) throws IOException { String pathname = context.getProductionPath() + "/data/" + filename; JSonWriter writer = new JSonWriter(); writer.writeJSon(new File(pathname), obj); } /** Check if the given name is in the context blacklist */ protected boolean isBlacklisted(String name) { for (String item: context.getBLACKLIST()) { if (Pattern.compile(item, Pattern.CASE_INSENSITIVE).matcher(name).matches()) { return true; } } return false; } protected List<TalendFile> filterBlacklisted(List<TalendFile> files) { return files.stream().filter(f->!isBlacklisted(f.getName()) && !isBlacklisted(f.getPath())).collect(Collectors.toList()); } }
lgpl-3.0
denarie/Portofino
elements/src/main/java/com/manydesigns/elements/reflection/PropertiesAccessor.java
3353
/* * Copyright (C) 2005-2017 ManyDesigns srl. All rights reserved. * http://www.manydesigns.com/ * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.manydesigns.elements.reflection; import java.lang.annotation.Annotation; import java.util.Arrays; import java.util.Comparator; import java.util.Properties; /* * @author Paolo Predonzani - paolo.predonzani@manydesigns.com * @author Angelo Lupo - angelo.lupo@manydesigns.com * @author Giampiero Granatella - giampiero.granatella@manydesigns.com * @author Alessio Stalla - alessio.stalla@manydesigns.com */ @SuppressWarnings({"UnusedDeclaration"}) public class PropertiesAccessor implements ClassAccessor { public static final String copyright = "Copyright (C) 2005-2017 ManyDesigns srl"; protected final PropertiesEntryAccessor[] accessors; public PropertiesAccessor(Properties properties) { accessors = new PropertiesEntryAccessor[properties.size()]; int i = 0; for (Object current : properties.keySet()) { String name = (String)current; accessors[i] = new PropertiesEntryAccessor(name); i++; } // sort alphabetically Arrays.sort(accessors, new Comparator<PropertiesEntryAccessor>() { public int compare(PropertiesEntryAccessor o1, PropertiesEntryAccessor o2) { return o1.getName().compareTo(o2.getName()); } }); } public String getName() { return null; } @Override public Class<?> getType() { return Properties.class; } public PropertyAccessor getProperty(String propertyName) throws NoSuchFieldException { for (PropertiesEntryAccessor current : accessors) { if (current.getName().equals(propertyName)) { return current; } } throw new NoSuchFieldException(propertyName); } public PropertyAccessor[] getProperties() { return accessors.clone(); } public PropertyAccessor[] getKeyProperties() { return new PropertyAccessor[0]; } public Object newInstance() { return null; } public boolean isAnnotationPresent( Class<? extends Annotation> annotationClass) { return false; } public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { return null; } public Annotation[] getAnnotations() { return new Annotation[0]; } public Annotation[] getDeclaredAnnotations() { return new Annotation[0]; } }
lgpl-3.0
Alfresco/alfresco-repository
src/test/java/org/alfresco/repo/usage/RepoUsageComponentTest.java
11122
/* * #%L * Alfresco Repository * %% * Copyright (C) 2005 - 2016 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of * the paid license agreement will prevail. Otherwise, the software is * provided under the following open source license terms: * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * #L% */ package org.alfresco.repo.usage; import javax.transaction.UserTransaction; import junit.framework.TestCase; import org.alfresco.repo.lock.JobLockService; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.transaction.AlfrescoTransactionSupport; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.service.cmr.admin.RepoUsage; import org.alfresco.service.cmr.admin.RepoUsage.LicenseMode; import org.alfresco.service.cmr.admin.RepoUsage.UsageType; import org.alfresco.service.cmr.admin.RepoUsageStatus; import org.alfresco.service.transaction.TransactionService; import org.alfresco.test_category.OwnJVMTestsCategory; import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.testing.category.LuceneTests; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.FixMethodOrder; import org.junit.experimental.categories.Category; import org.junit.runners.MethodSorters; import org.springframework.context.ApplicationContext; /** * Tests {@link RepoUsageComponent} * * @author Derek Hulley * @since 3.5 */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @Category({OwnJVMTestsCategory.class, LuceneTests.class}) public class RepoUsageComponentTest extends TestCase { private ApplicationContext ctx; private static final Log logger = LogFactory.getLog(RepoUsageComponentTest.class); private TransactionService transactionService; private RepoUsageComponent repoUsageComponent; private JobLockService jobLockService; private UserTransaction txn; private RepoUsage restrictionsBefore; @Override protected void setUp() throws Exception { ctx = ApplicationContextHelper.getApplicationContext(); if (AlfrescoTransactionSupport.isActualTransactionActive()) { fail("Test started with transaction in progress"); } transactionService = (TransactionService) ctx.getBean("transactionComponent"); repoUsageComponent = (RepoUsageComponent) ctx.getBean("repoUsageComponent"); jobLockService = (JobLockService) ctx.getBean("jobLockService"); AuthenticationUtil.setRunAsUserSystem(); txn = transactionService.getUserTransaction(); txn.begin(); restrictionsBefore = repoUsageComponent.getRestrictions(); } @Override protected void tearDown() throws Exception { // Reset restrictions try { repoUsageComponent.setRestrictions(restrictionsBefore); } catch (Throwable e) { e.printStackTrace(); } AuthenticationUtil.clearCurrentSecurityContext(); if (txn != null) { try { txn.commit(); } catch (Throwable e) { try { txn.rollback(); } catch (Throwable ee) {} throw new RuntimeException("Failed to commit test transaction", e); } } } public void test1Setup() { } /** * Helper to wrap in a txn */ private RepoUsage getUsage() { RetryingTransactionCallback<RepoUsage> getCallback = new RetryingTransactionCallback<RepoUsage>() { @Override public RepoUsage execute() throws Throwable { return repoUsageComponent.getUsage(); } }; return transactionService.getRetryingTransactionHelper().doInTransaction(getCallback, true); } /** * Helper to wrap in a txn */ private boolean updateUsage(final UsageType usageType) { RetryingTransactionCallback<Boolean> getCallback = new RetryingTransactionCallback<Boolean>() { @Override public Boolean execute() throws Throwable { return repoUsageComponent.updateUsage(usageType); } }; return transactionService.getRetryingTransactionHelper().doInTransaction(getCallback, false); } public void test2NoTxn() throws Throwable { txn.commit(); txn = null; try { repoUsageComponent.getUsage(); fail("Txn required for calls to RepoAdminComponent."); } catch (RuntimeException e) { // Expected } } public void test3GetUsage() { getUsage(); } public void test4FullUse() throws Exception { // Update usage updateUsage(UsageType.USAGE_ALL); // Set the restrictions RepoUsage restrictions = new RepoUsage( System.currentTimeMillis(), getUsage().getUsers(), getUsage().getDocuments(), LicenseMode.TEAM, System.currentTimeMillis() + 24*3600000, false); repoUsageComponent.setRestrictions(restrictions); // Get the restrictions (should not need a txn for this) RepoUsage restrictionsCheck = repoUsageComponent.getRestrictions(); assertEquals("Restrictions should return without change.", restrictions, restrictionsCheck); // Update use updateUsage(UsageType.USAGE_ALL); // Get the usage RepoUsage usage = getUsage(); // Check assertNotNull("Usage is null", usage); assertNotNull("Invalid user count", usage.getUsers()); assertNotNull("Invalid document count", usage.getDocuments()); assertEquals("License mode not set", restrictions.getLicenseMode(), usage.getLicenseMode()); assertEquals("License expiry not set", restrictions.getLicenseExpiryDate(), usage.getLicenseExpiryDate()); assertEquals("Read-only state not set", restrictions.isReadOnly(), usage.isReadOnly()); RepoUsageStatus status = repoUsageComponent.getUsageStatus(); logger.debug(status); } /** * Tests license code interaction. This interaction would be done using runAs 'System'. */ public void test5LicenseUse() throws Exception { Long licenseUserLimit = 5L; Long licenseDocumentLimit = 100000L; LicenseMode licenseMode = LicenseMode.TEAM; Long licenseExpiry = System.currentTimeMillis() + 24*3600000; // Get actual license details (incl. generating trial license) // Push license restrictions RepoUsage restrictions = new RepoUsage( System.currentTimeMillis(), licenseUserLimit, // From license licenseDocumentLimit, // From license licenseMode, // From license licenseExpiry, // From license transactionService.getAllowWrite() == false);// After license validity has been verified repoUsageComponent.setRestrictions(restrictions); // Trigger a usage update updateUsage(UsageType.USAGE_ALL); // Get the usage @SuppressWarnings("unused") RepoUsage usage = getUsage(); } /** * Check that concurrent updates are prevented * * The test is disabled as the Component is not using JobLocks any more */ /* public void test6ConcurrentUpdates() throws Exception { // Firstly check that we can get an update assertTrue("Failed to update all usages", updateUsage(UsageType.USAGE_ALL)); assertTrue("Failed to update user count", updateUsage(UsageType.USAGE_USERS)); assertTrue("Failed to update document count", updateUsage(UsageType.USAGE_DOCUMENTS)); // Now take a lock of it all and see that they fail String lockToken = jobLockService.getLock(RepoUsageComponent.LOCK_USAGE, RepoUsageComponent.LOCK_TTL); try { // Check assertFalse("Expected usage updates to be kicked out", updateUsage(UsageType.USAGE_ALL)); assertFalse("Expected usage updates to be kicked out", updateUsage(UsageType.USAGE_USERS)); assertFalse("Expected usage updates to be kicked out", updateUsage(UsageType.USAGE_DOCUMENTS)); } finally { jobLockService.releaseLock(lockToken, RepoUsageComponent.LOCK_USAGE); } // Lock documents updates only lockToken = jobLockService.getLock(RepoUsageComponent.LOCK_USAGE_DOCUMENTS, RepoUsageComponent.LOCK_TTL); try { // Check assertFalse("Expected usage updates to be kicked out", updateUsage(UsageType.USAGE_ALL)); assertTrue("Failed to update user count", updateUsage(UsageType.USAGE_USERS)); assertFalse("Expected document usage updates to be kicked out", updateUsage(UsageType.USAGE_DOCUMENTS)); } finally { jobLockService.releaseLock(lockToken, RepoUsageComponent.LOCK_USAGE_DOCUMENTS); } // Lock user updates only lockToken = jobLockService.getLock(RepoUsageComponent.LOCK_USAGE_USERS, RepoUsageComponent.LOCK_TTL); try { // Check assertFalse("Expected usage updates to be kicked out", updateUsage(UsageType.USAGE_ALL)); assertFalse("Expected user usage updates to be kicked out", updateUsage(UsageType.USAGE_USERS)); assertTrue("Failed to update document count", updateUsage(UsageType.USAGE_DOCUMENTS)); } finally { jobLockService.releaseLock(lockToken, RepoUsageComponent.LOCK_USAGE_USERS); } } */ }
lgpl-3.0
SonarSource/sonarqube
sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
7511
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.core.issue; import com.google.common.collect.ImmutableMap; import java.text.SimpleDateFormat; import java.util.List; import org.apache.commons.lang.StringUtils; import org.junit.Test; import org.sonar.api.issue.Issue; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.Duration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class DefaultIssueTest { private DefaultIssue issue = new DefaultIssue(); @Test public void test_setters_and_getters() throws Exception { issue.setKey("ABCD") .setComponentKey("org.sample.Sample") .setProjectKey("Sample") .setRuleKey(RuleKey.of("squid", "S100")) .setLanguage("xoo") .setSeverity("MINOR") .setManualSeverity(true) .setMessage("a message") .setLine(7) .setGap(1.2d) .setEffort(Duration.create(28800L)) .setStatus(Issue.STATUS_CLOSED) .setResolution(Issue.RESOLUTION_FIXED) .setAssigneeUuid("julien") .setAuthorLogin("steph") .setChecksum("c7b5db46591806455cf082bb348631e8") .setNew(true) .setIsOnReferencedBranch(true) .setIsOnChangedLine(true) .setIsNewCodeReferenceIssue(true) .setIsNoLongerNewCodeReferenceIssue(true) .setBeingClosed(true) .setOnDisabledRule(true) .setCopied(true) .setChanged(true) .setSendNotifications(true) .setCreationDate(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-19")) .setUpdateDate(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-20")) .setCloseDate(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-21")) .setSelectedAt(1400000000000L); assertThat(issue.key()).isEqualTo("ABCD"); assertThat(issue.componentKey()).isEqualTo("org.sample.Sample"); assertThat(issue.projectKey()).isEqualTo("Sample"); assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("squid", "S100")); assertThat(issue.language()).isEqualTo("xoo"); assertThat(issue.severity()).isEqualTo("MINOR"); assertThat(issue.manualSeverity()).isTrue(); assertThat(issue.message()).isEqualTo("a message"); assertThat(issue.line()).isEqualTo(7); assertThat(issue.gap()).isEqualTo(1.2d); assertThat(issue.effort()).isEqualTo(Duration.create(28800L)); assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED); assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED); assertThat(issue.assignee()).isEqualTo("julien"); assertThat(issue.authorLogin()).isEqualTo("steph"); assertThat(issue.checksum()).isEqualTo("c7b5db46591806455cf082bb348631e8"); assertThat(issue.isNew()).isTrue(); assertThat(issue.isOnReferencedBranch()).isTrue(); assertThat(issue.isOnChangedLine()).isTrue(); assertThat(issue.isNewCodeReferenceIssue()).isTrue(); assertThat(issue.isNoLongerNewCodeReferenceIssue()).isTrue(); assertThat(issue.isCopied()).isTrue(); assertThat(issue.isBeingClosed()).isTrue(); assertThat(issue.isOnDisabledRule()).isTrue(); assertThat(issue.isChanged()).isTrue(); assertThat(issue.mustSendNotifications()).isTrue(); assertThat(issue.creationDate()).isEqualTo(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-19")); assertThat(issue.updateDate()).isEqualTo(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-20")); assertThat(issue.closeDate()).isEqualTo(new SimpleDateFormat("yyyy-MM-dd").parse("2013-08-21")); assertThat(issue.selectedAt()).isEqualTo(1400000000000L); } @Test public void set_empty_dates() { issue .setCreationDate(null) .setUpdateDate(null) .setCloseDate(null) .setSelectedAt(null); assertThat(issue.creationDate()).isNull(); assertThat(issue.updateDate()).isNull(); assertThat(issue.closeDate()).isNull(); assertThat(issue.selectedAt()).isNull(); } @Test public void fail_on_empty_status() { try { issue.setStatus(""); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Status must be set"); } } @Test public void fail_on_bad_severity() { try { issue.setSeverity("FOO"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Not a valid severity: FOO"); } } @Test public void message_should_be_abbreviated_if_too_long() { issue.setMessage(StringUtils.repeat("a", 5_000)); assertThat(issue.message()).hasSize(1_333); } @Test public void message_should_be_trimmed() { issue.setMessage(" foo "); assertThat(issue.message()).isEqualTo("foo"); } @Test public void message_could_be_null() { issue.setMessage(null); assertThat(issue.message()).isNull(); } @Test public void test_nullable_fields() { issue.setGap(null).setSeverity(null).setLine(null); assertThat(issue.gap()).isNull(); assertThat(issue.severity()).isNull(); assertThat(issue.line()).isNull(); } @Test public void test_equals_and_hashCode() { DefaultIssue a1 = new DefaultIssue().setKey("AAA"); DefaultIssue a2 = new DefaultIssue().setKey("AAA"); DefaultIssue b = new DefaultIssue().setKey("BBB"); assertThat(a1) .isEqualTo(a1) .isEqualTo(a2) .isNotEqualTo(b) .hasSameHashCodeAs(a1); } @Test public void comments_should_not_be_modifiable() { DefaultIssue issue = new DefaultIssue().setKey("AAA"); List<DefaultIssueComment> comments = issue.defaultIssueComments(); assertThat(comments).isEmpty(); try { comments.add(new DefaultIssueComment()); fail(); } catch (UnsupportedOperationException e) { // ok } catch (Exception e) { fail("Unexpected exception: " + e); } } @Test public void all_changes_contain_current_change() { IssueChangeContext issueChangeContext = mock(IssueChangeContext.class); DefaultIssue issue = new DefaultIssue().setKey("AAA").setFieldChange(issueChangeContext, "actionPlan", "1.0", "1.1"); assertThat(issue.changes()).hasSize(1); } @Test public void adding_null_change_has_no_effect() { DefaultIssue issue = new DefaultIssue(); issue.addChange(null); assertThat(issue.changes()).isEmpty(); } @Test public void isQuickFixAvailable_givenQuickFixAvailable_returnTrue() { DefaultIssue defaultIssue = new DefaultIssue(); defaultIssue.setQuickFixAvailable(true); assertThat(defaultIssue.isQuickFixAvailable()).isTrue(); defaultIssue.setQuickFixAvailable(false); assertThat(defaultIssue.isQuickFixAvailable()).isFalse(); } }
lgpl-3.0
Jaspersoft/jrs-rest-java-client
src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/attributes/BatchAttributeAdapter.java
10505
/* * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program.&nbsp; If not, see <http://www.gnu.org/licenses/>. */ package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.attributes; import com.jaspersoft.jasperserver.dto.authority.hypermedia.HypermediaAttribute; import com.jaspersoft.jasperserver.dto.authority.hypermedia.HypermediaAttributesListWrapper; import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; import com.jaspersoft.jasperserver.jaxrs.client.core.Callback; import com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest; import com.jaspersoft.jasperserver.jaxrs.client.core.MimeTypeUtil; import com.jaspersoft.jasperserver.jaxrs.client.core.RequestExecution; import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; import com.jaspersoft.jasperserver.jaxrs.client.core.ThreadPoolUtil; import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.MandatoryParameterNotFoundException; import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling.DefaultErrorHandler; import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedMap; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import static java.util.Arrays.asList; /** * @author Alex Krasnyanskiy * @author Tetiana Iefimenko * @since 6.0.1-ALPHA */ public class BatchAttributeAdapter extends AbstractAdapter { public static final String SERVICE_URI = "attributes"; private static final String SEPARATOR = "/"; private MultivaluedMap<String, String> params = new MultivaluedHashMap<String, String>(); private Boolean includePermissions = false; private String userName; private String organizationId; private ArrayList<String> path = new ArrayList<String>(); public BatchAttributeAdapter(String organizationId, String userName, SessionStorage sessionStorage) { super(sessionStorage); if (!"/".equals(organizationId) && organizationId != null) { path.add("organizations"); path.add(organizationId); } if (userName != null) { path.add("users"); path.add(userName); } this.organizationId = organizationId; this.userName = userName; } public BatchAttributeAdapter(String organizationId, String userName, SessionStorage sessionStorage, String... attributesNames) { this(organizationId, userName, sessionStorage, asList(attributesNames)); } public BatchAttributeAdapter(String organizationId, String userName, SessionStorage sessionStorage, Collection<String> attributesNames) { this(organizationId, userName, sessionStorage); for (String attributeName : attributesNames) { if (attributeName.equals("")) { throw new IllegalArgumentException("Names of attributes are not valid."); } params.add("name", attributeName); } } public BatchAttributeAdapter parameter(AttributesSearchParameter parameter, String value) { if (parameter.equals(AttributesSearchParameter.HOLDER)) { String prefix; if (value.contains(SEPARATOR)) { if (value.equals(SEPARATOR)) { prefix = "tenant:"; } else { prefix = "user:/"; } } else { prefix = "tenant:/"; } value = prefix + value; } params.add(parameter.getName(), value); return this; } public BatchAttributeAdapter parameter(AttributesSearchParameter parameter, boolean value) { return this.parameter(parameter, String.valueOf(value)); } public BatchAttributeAdapter parameter(AttributesSearchParameter parameter, Integer value) { return this.parameter(parameter, value.toString()); } public BatchAttributeAdapter parameter(AttributesSearchParameter parameter, AttributesGroupParameter value) { return this.parameter(parameter, value.getName()); } public BatchAttributeAdapter setIncludePermissions(Boolean includePermissions) { this.includePermissions = includePermissions; return this; } public OperationResult<HypermediaAttributesListWrapper> get() { return buildRequest().get(); } public OperationResult<HypermediaAttributesListWrapper> search() { JerseyRequest<HypermediaAttributesListWrapper> jerseyRequest = buildSearchRequest(); return jerseyRequest.get(); } public <R> RequestExecution asyncGet(final Callback<OperationResult<HypermediaAttributesListWrapper>, R> callback) { final JerseyRequest<HypermediaAttributesListWrapper> request = buildRequest(); request.addParams(params); RequestExecution task = new RequestExecution(new Runnable() { @Override public void run() { callback.execute(request.get()); } }); ThreadPoolUtil.runAsynchronously(task); return task; } public OperationResult<HypermediaAttributesListWrapper> delete() { return buildRequest().delete(); } public <R> RequestExecution asyncDelete(final Callback<OperationResult<HypermediaAttributesListWrapper>, R> callback) { final JerseyRequest<HypermediaAttributesListWrapper> request = buildRequest(); request.addParams(params); RequestExecution task = new RequestExecution(new Runnable() { @Override public void run() { callback.execute(request.delete()); } }); ThreadPoolUtil.runAsynchronously(task); return task; } public OperationResult<HypermediaAttributesListWrapper> createOrUpdate(HypermediaAttributesListWrapper attributesListWrapper) { if (attributesListWrapper == null) { throw new MandatoryParameterNotFoundException("Attributes are required"); } if (params.get("name") != null && params.get("name").size() != 0) { LinkedList<HypermediaAttribute> list = new LinkedList<HypermediaAttribute>(attributesListWrapper.getProfileAttributes()); for (Iterator<HypermediaAttribute> iterator = list.iterator(); iterator.hasNext(); ) { HypermediaAttribute current = iterator.next(); if (!params.get("name").contains(current.getName())) { iterator.remove(); } } attributesListWrapper.setProfileAttributes(list); } return buildRequest() .setContentType(MimeTypeUtil.toCorrectContentMime(sessionStorage.getConfiguration(), "application/hal+{mime}")) .put(attributesListWrapper); } public <R> RequestExecution asyncCreateOrUpdate(final HypermediaAttributesListWrapper attributesList, final Callback<OperationResult<HypermediaAttributesListWrapper>, R> callback) { final JerseyRequest<HypermediaAttributesListWrapper> request = buildRequest(); RequestExecution task = new RequestExecution(new Runnable() { @Override public void run() { callback.execute(request.put(attributesList)); } }); ThreadPoolUtil.runAsynchronously(task); return task; } private JerseyRequest<HypermediaAttributesListWrapper> buildRequest() { path.add(SERVICE_URI); JerseyRequest<HypermediaAttributesListWrapper> request = JerseyRequest.buildRequest( sessionStorage, HypermediaAttributesListWrapper.class, path.toArray(new String[path.size()]), new DefaultErrorHandler()); if (includePermissions) { request.setAccept(MimeTypeUtil.toCorrectAcceptMime(sessionStorage.getConfiguration(), "application/hal+{mime}")); request.addParam("_embedded", "permission"); } request.addParams(params); return request; } private JerseyRequest<HypermediaAttributesListWrapper> buildSearchRequest() { JerseyRequest<HypermediaAttributesListWrapper> request = JerseyRequest.buildRequest( sessionStorage, HypermediaAttributesListWrapper.class, new String[]{SERVICE_URI}, new DefaultErrorHandler()); if (includePermissions) { request.setAccept(MimeTypeUtil.toCorrectAcceptMime(sessionStorage.getConfiguration(), "application/attributes.collection.hal+{mime}")); request.addParam("_embedded", "permission"); } else { request.setAccept(MimeTypeUtil.toCorrectAcceptMime(sessionStorage.getConfiguration(), "application/attributes.collection+{mime}")); } request.addParams(params); // if user did not specified holder make it form organizationId and userName variables if (!params.containsKey("holder") && (organizationId != null || userName != null)) { StringBuilder holderId = new StringBuilder(); holderId.append((userName == null) ? "tenant:" : "user:"); if (organizationId != null) { holderId.append(SEPARATOR); if (!SEPARATOR.equals(organizationId)) holderId.append(organizationId); } if (userName != null) { holderId.append(SEPARATOR); holderId.append(userName); } ; request.addParam("holder", holderId.toString()); } return request; } }
lgpl-3.0
NightKosh/Gravestone-mod-Extended
src/main/java/nightkosh/gravestone_extended/item/ItemEnderSkull.java
883
package nightkosh.gravestone_extended.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import nightkosh.gravestone_extended.helper.VanillaStructuresPosition; /** * GraveStone mod * * @author NightKosh * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) */ public class ItemEnderSkull extends ItemImpSkull { public ItemEnderSkull() { this.setUnlocalizedName("gravestone.ender_skull"); } @Override protected String getItemRegistryName() { return "gs_ender_skull"; } @Override protected boolean isCorrectDimension(World world) { return world.provider.isSurfaceWorld(); } @Override protected BlockPos getPos(EntityPlayer player) { return VanillaStructuresPosition.getStrongHold(player); } }
lgpl-3.0
mcphoton/Photon-ProtocolLib
src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/window/ServerWindowPropertyPacket.java
1980
package com.github.steveice10.mc.protocol.packet.ingame.server.window; import com.github.steveice10.mc.protocol.data.game.window.property.WindowProperty; import com.github.steveice10.mc.protocol.util.ReflectionToString; import com.github.steveice10.mc.protocol.data.MagicValues; import com.github.steveice10.packetlib.io.NetInput; import com.github.steveice10.packetlib.io.NetOutput; import com.github.steveice10.packetlib.packet.Packet; import java.io.IOException; public class ServerWindowPropertyPacket implements Packet { private int windowId; private int property; private int value; @SuppressWarnings("unused") private ServerWindowPropertyPacket() { } public ServerWindowPropertyPacket(int windowId, int property, int value) { this.windowId = windowId; this.property = property; this.value = value; } public <T extends Enum<T> & WindowProperty> ServerWindowPropertyPacket(int windowId, T property, int value) { this.windowId = windowId; this.property = MagicValues.value(Integer.class, property); this.value = value; } public int getWindowId() { return windowId; } public int getRawProperty() { return property; } public <T extends Enum<T> & WindowProperty> T getProperty(Class<T> type) { return MagicValues.key(type, value); } public int getValue() { return value; } @Override public void read(NetInput in) throws IOException { windowId = in.readUnsignedByte(); property = in.readShort(); value = in.readShort(); } @Override public void write(NetOutput out) throws IOException { out.writeByte(windowId); out.writeShort(property); out.writeShort(value); } @Override public boolean isPriority() { return false; } @Override public String toString() { return ReflectionToString.toString(this); } }
lgpl-3.0
leodmurillo/sonar
sonar-plugin-api/src/test/java/org/sonar/api/utils/RedirectServlet.java
1336
/* * Sonar, open source software quality management tool. * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * Sonar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with Sonar; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.api.utils; import javax.servlet.GenericServlet; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class RedirectServlet extends GenericServlet { public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { ((HttpServletResponse)response).sendRedirect("/"); } }
lgpl-3.0
fuinorg/units4j
src/test/java/org/fuin/units4j/AssertionResultTest.java
948
/** * Copyright (C) 2015 Michael Schnell. All rights reserved. * http://www.fuin.org/ * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see http://www.gnu.org/licenses/. */ package org.fuin.units4j; /** * Tests the {@link AssertionResult} class. */ @TestOmitted("Already tested implicitly with other classes") public class AssertionResultTest { // NOSONAR }
lgpl-3.0
MeteoSwiss-APN/omni-compiler
F-BackEnd/src/xcodeml/f/decompile/XfType.java
1604
/* * $TSUKUBA_Release: Omni OpenMP Compiler 3 $ * $TSUKUBA_Copyright: * PLEASE DESCRIBE LICENSE AGREEMENT HERE * $ */ package xcodeml.f.decompile; /** * Type expression in decompiler. */ enum XfType { VOID("Fvoid", null, false), INT("Fint", "INTEGER", true), REAL("Freal", "REAL", true), COMPLEX("Fcomplex", "COMPLEX", true), LOGICAL("Flogical", "LOGICAL", true), CHARACTER("Fcharacter", "CHARACTER", true), NUMERIC("Fnumeric", null, true), NUMERICALL("FnumericAll", null, true), DERIVED(null, null, false); private boolean _isPrimitive = false; private String _xcodemlName; private String _fortranName; private XfType(String xcodemlName, String fortranName, boolean isPrimitive) { _isPrimitive = isPrimitive; _xcodemlName = xcodemlName; _fortranName = fortranName; } public boolean isPrimitive() { return _isPrimitive; } public String xcodemlName() { return _xcodemlName; } public String fortranName() { return _fortranName; } public static XfType getTypeIdFromXcodemlTypeName(String xcodemlTypeName) { if (xcodemlTypeName == null) { throw new IllegalArgumentException(); } for (XfType type: XfType.values()) { String workTypeName = type.xcodemlName(); if (workTypeName != null) { if (xcodemlTypeName.compareToIgnoreCase(type.xcodemlName()) == 0) { return type; } } } return DERIVED; } }
lgpl-3.0