@ -0,0 +1,38 @@ | |||
target/ | |||
!.mvn/wrapper/maven-wrapper.jar | |||
!**/src/main/**/target/ | |||
!**/src/test/**/target/ | |||
### IntelliJ IDEA ### | |||
.idea/modules.xml | |||
.idea/jarRepositories.xml | |||
.idea/compiler.xml | |||
.idea/libraries/ | |||
*.iws | |||
*.iml | |||
*.ipr | |||
### Eclipse ### | |||
.apt_generated | |||
.classpath | |||
.factorypath | |||
.project | |||
.settings | |||
.springBeans | |||
.sts4-cache | |||
### NetBeans ### | |||
/nbproject/private/ | |||
/nbbuild/ | |||
/dist/ | |||
/nbdist/ | |||
/.nb-gradle/ | |||
build/ | |||
!**/src/main/**/build/ | |||
!**/src/test/**/build/ | |||
### VS Code ### | |||
.vscode/ | |||
### Mac OS ### | |||
.DS_Store |
@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="Encoding"> | |||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> | |||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> | |||
</component> | |||
</project> |
@ -0,0 +1,14 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="ExternalStorageConfigurationManager" enabled="true" /> | |||
<component name="MavenProjectsManager"> | |||
<option name="originalFiles"> | |||
<list> | |||
<option value="$PROJECT_DIR$/pom.xml" /> | |||
</list> | |||
</option> | |||
</component> | |||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK"> | |||
<output url="file://$PROJECT_DIR$/out" /> | |||
</component> | |||
</project> |
@ -0,0 +1,124 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="Palette2"> | |||
<group name="Swing"> | |||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> | |||
</item> | |||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> | |||
</item> | |||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> | |||
</item> | |||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true"> | |||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> | |||
</item> | |||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> | |||
<initial-values> | |||
<property name="text" value="Button" /> | |||
</initial-values> | |||
</item> | |||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> | |||
<initial-values> | |||
<property name="text" value="RadioButton" /> | |||
</initial-values> | |||
</item> | |||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> | |||
<initial-values> | |||
<property name="text" value="CheckBox" /> | |||
</initial-values> | |||
</item> | |||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> | |||
<initial-values> | |||
<property name="text" value="Label" /> | |||
</initial-values> | |||
</item> | |||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |||
<preferred-size width="150" height="-1" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |||
<preferred-size width="150" height="-1" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> | |||
<preferred-size width="150" height="-1" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> | |||
</item> | |||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> | |||
<preferred-size width="150" height="50" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> | |||
<preferred-size width="200" height="200" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> | |||
<preferred-size width="200" height="200" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> | |||
</item> | |||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> | |||
</item> | |||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> | |||
</item> | |||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> | |||
</item> | |||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> | |||
<preferred-size width="-1" height="20" /> | |||
</default-constraints> | |||
</item> | |||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> | |||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> | |||
</item> | |||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> | |||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> | |||
</item> | |||
</group> | |||
</component> | |||
</project> |
@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="VcsDirectoryMappings"> | |||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||
</component> | |||
</project> |
@ -0,0 +1,113 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="AutoImportSettings"> | |||
<option name="autoReloadType" value="SELECTIVE" /> | |||
</component> | |||
<component name="ChangeListManager"> | |||
<list default="true" id="d0e2ddd8-efdc-4dce-b0fd-07c7411e37c2" name="Changes" comment=""> | |||
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Main.java" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Producto.java" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/Saludator.java" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/src/main/java/com/jorpelu/ServicioDeProductos/ServicioProductos.java" afterDir="false" /> | |||
<change afterPath="$PROJECT_DIR$/src/main/resources/beans.xml" afterDir="false" /> | |||
</list> | |||
<option name="SHOW_DIALOG" value="false" /> | |||
<option name="HIGHLIGHT_CONFLICTS" value="true" /> | |||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | |||
<option name="LAST_RESOLUTION" value="IGNORE" /> | |||
</component> | |||
<component name="FileTemplateManagerImpl"> | |||
<option name="RECENT_TEMPLATES"> | |||
<list> | |||
<option value="spring-beans.schema" /> | |||
<option value="Class" /> | |||
</list> | |||
</option> | |||
</component> | |||
<component name="Git.Settings"> | |||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> | |||
</component> | |||
<component name="MarkdownSettingsMigration"> | |||
<option name="stateVersion" value="1" /> | |||
</component> | |||
<component name="ProblemsViewState"> | |||
<option name="selectedTabId" value="CurrentFile" /> | |||
</component> | |||
<component name="ProjectId" id="2HxkMcjnwt6nytABR8EE0P52FXH" /> | |||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> | |||
<component name="ProjectViewState"> | |||
<option name="hideEmptyMiddlePackages" value="true" /> | |||
<option name="showLibraryContents" value="true" /> | |||
</component> | |||
<component name="PropertiesComponent">{ | |||
"keyToString": { | |||
"RunOnceActivity.OpenProjectViewOnStart": "true", | |||
"RunOnceActivity.ShowReadmeOnStart": "true", | |||
"SHARE_PROJECT_CONFIGURATION_FILES": "true", | |||
"WebServerToolWindowFactoryState": "false", | |||
"node.js.detected.package.eslint": "true", | |||
"node.js.detected.package.tslint": "true", | |||
"node.js.selected.package.eslint": "(autodetect)", | |||
"node.js.selected.package.tslint": "(autodetect)", | |||
"project.structure.last.edited": "Modules", | |||
"project.structure.proportion": "0.15", | |||
"project.structure.side.proportion": "0.2", | |||
"spring.configuration.checksum": "ded2ef21d2f7ddd4afc5d55389ed18eb" | |||
} | |||
}</component> | |||
<component name="RunManager"> | |||
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> | |||
<option name="MAIN_CLASS_NAME" value="com.jorpelu.ServicioDeProductos.Main" /> | |||
<module name="ServicioDeProductos" /> | |||
<extension name="coverage"> | |||
<pattern> | |||
<option name="PATTERN" value="com.jorpelu.ServicioDeProductos.*" /> | |||
<option name="ENABLED" value="true" /> | |||
</pattern> | |||
</extension> | |||
<method v="2"> | |||
<option name="Make" enabled="true" /> | |||
</method> | |||
</configuration> | |||
<recent_temporary> | |||
<list> | |||
<item itemvalue="Application.Main" /> | |||
</list> | |||
</recent_temporary> | |||
</component> | |||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> | |||
<component name="TaskManager"> | |||
<task active="true" id="Default" summary="Default task"> | |||
<changelist id="d0e2ddd8-efdc-4dce-b0fd-07c7411e37c2" name="Changes" comment="" /> | |||
<created>1669234080818</created> | |||
<option name="number" value="Default" /> | |||
<option name="presentableId" value="Default" /> | |||
<updated>1669234080818</updated> | |||
<workItem from="1669234082181" duration="4126000" /> | |||
<workItem from="1669327599329" duration="2673000" /> | |||
<workItem from="1669370939836" duration="886000" /> | |||
</task> | |||
<servers /> | |||
</component> | |||
<component name="TypeScriptGeneratedFilesManager"> | |||
<option name="version" value="3" /> | |||
</component> | |||
<component name="Vcs.Log.Tabs.Properties"> | |||
<option name="TAB_STATES"> | |||
<map> | |||
<entry key="MAIN"> | |||
<value> | |||
<State /> | |||
</value> | |||
</entry> | |||
</map> | |||
</option> | |||
</component> | |||
</project> |
@ -0,0 +1,25 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.jorpelu</groupId> | |||
<artifactId>ServicioDeProductos</artifactId> | |||
<version>1.0-SNAPSHOT</version> | |||
<properties> | |||
<maven.compiler.source>19</maven.compiler.source> | |||
<maven.compiler.target>19</maven.compiler.target> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
</properties> | |||
<dependencies> | |||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-context</artifactId> | |||
<version>6.0.0</version> | |||
</dependency> | |||
</dependencies> | |||
</project> |
@ -0,0 +1,17 @@ | |||
package com.jorpelu.ServicioDeProductos; | |||
import org.springframework.context.ApplicationContext; | |||
import org.springframework.context.support.ClassPathXmlApplicationContext; | |||
public class Main { | |||
public static void main(String[] args) { | |||
ApplicationContext appContext = new ClassPathXmlApplicationContext("beans.xml"); | |||
ServicioProductos servicioProductos = (ServicioProductos) appContext.getBean("productosService", ServicioProductos.class); | |||
System.out.println("id: " + servicioProductos.getProductos().getId()); | |||
System.out.println("nombre: " + servicioProductos.getProductos().getNombre()); | |||
System.out.println("descripcion: : " + servicioProductos.getProductos().getDescripcion()); | |||
System.out.println("cantidad: " + servicioProductos.getProductos().getCantidad()); | |||
System.out.println("precio: " + servicioProductos.getProductos().getPrecio()); | |||
((ClassPathXmlApplicationContext) appContext).close(); | |||
} | |||
} |
@ -0,0 +1,57 @@ | |||
package com.jorpelu.ServicioDeProductos; | |||
public class Producto { | |||
private int id; | |||
private String nombre; | |||
private String descripcion; | |||
private int cantidad; | |||
private float precio; | |||
public Producto(int id, String nombre, String descripcion, int cantidad, float precio) { | |||
this.id = id; | |||
this.nombre = nombre; | |||
this.descripcion = descripcion; | |||
this.cantidad = cantidad; | |||
this.precio = precio; | |||
} | |||
public int getId() { | |||
return id; | |||
} | |||
public void setId(int id) { | |||
this.id = id; | |||
} | |||
public String getNombre() { | |||
return nombre; | |||
} | |||
public void setNombre(String nombre) { | |||
this.nombre = nombre; | |||
} | |||
public String getDescripcion() { | |||
return descripcion; | |||
} | |||
public void setDescripcion(String descripcion) { | |||
this.descripcion = descripcion; | |||
} | |||
public int getCantidad() { | |||
return cantidad; | |||
} | |||
public void setCantidad(int cantidad) { | |||
this.cantidad = cantidad; | |||
} | |||
public float getPrecio() { | |||
return precio; | |||
} | |||
public void setPrecio(float precio) { | |||
this.precio = precio; | |||
} | |||
} |
@ -0,0 +1,12 @@ | |||
package com.jorpelu.ServicioDeProductos; | |||
public class Saludator { | |||
private String mensaje; | |||
public String saludo(){ | |||
return (mensaje==null) ? "No se ha encontrado el mensaje... " : mensaje; | |||
} | |||
public Saludator(String mensaje) { | |||
this.mensaje = mensaje; | |||
} | |||
} |
@ -0,0 +1,15 @@ | |||
package com.jorpelu.ServicioDeProductos; | |||
import java.util.ArrayList; | |||
public class ServicioProductos { | |||
private Producto productos; | |||
public Producto getProductos() { | |||
return productos; | |||
} | |||
public void setProducto(Producto productos) { | |||
this.productos = productos; | |||
} | |||
} |
@ -0,0 +1,16 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<beans xmlns="http://www.springframework.org/schema/beans" | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |||
<bean id="productosService" class ="com.jorpelu.ServicioDeProductos.ServicioProductos"> | |||
<property name="producto" ref="producto"></property> | |||
</bean> | |||
<bean id="producto" class="com.jorpelu.ServicioDeProductos.Producto"> | |||
<constructor-arg index="0" value="1"/> | |||
<constructor-arg index="1" value="nombreProducto"/> | |||
<constructor-arg index="2" value="descripcion_producto"/> | |||
<constructor-arg index="3" value="100"/> | |||
<constructor-arg index="4" value="19.99"/> | |||
</bean> | |||
</beans> |