본문 바로가기
[Java] Reflection Tutorial - Generics Java, Reflection Tutorial - Generics 일반적으로 Generics 정보는 runtime 에 사라진다고 알고 있지만 꼭 그렇지만은 않다. The Generics Reflection Rule of Thumb 일반적으로 List 와 같은 녀석들은 어떤 Generic 이 쓰였는지 알기 어렵다.하지만 parameterized 된 method 나 field 를 조사해보면,어떤 generic 이 사용되었는지 알 수 있다. Generic Method Return Types Method method = TestClass.class.getMethod( "getStringList", null );Type returnType = method.getGenericReturnType(); if ( ret.. 2013. 12. 27.
[Java] Reflection Tutorial - Method Java, Reflection Tutorial - Method Obtaining Method Objects Method[] methods = aClass.getMethods(); // only public methodsMethod method = aClass.getMethod( "methodName", Class[]{ String.class} ); getMethod 함수는 NoSuchMethodException 을 throw 할 수 있음 no parameter case 는 Class[] 부분에 null 을 입력. Method Parameters and Return Types. Class[] parameterTypes = method.getParameterTypes();Class returnType = m.. 2013. 11. 28.
[PHP] 코드 재활용과 함수 작성 Tutorial PHP, 코드 재활용과 함수 작성 Tutorial =====require() 와 include() 사용하기 - require( "fileName" ) 을 사용하면require()를 호출한 자리가 해당 파일 내용으로 바뀌고 스크립트가 실행된다. - require() 로 불러들이는 파일이 로 감싸있지 않다면,html 파일 형식으로 불러들인다. - include 는 require 와 기능을 같다.다만 require 는 실패했을 경우 치명적 오류를 내지만, include 는 가벼운 오류만 내뿜는다. - require_once(), include_once()파일을 한번만 포함시킨다.library 를 포함시킬 때 같은 라이브러리를 두 번 이상 포함시키는 일을 막아준다. =====auto_prepend_file, a.. 2013. 11. 26.
[PHP] 배열( array ) tutorial PHP Tutorial 배열 =====생성 $products = array ( 'Tires', 'Oil', 'Spark Plugs' );$numbers = range( 1, 10 );$odds = range( 1, 10, 2 );$letters = range( 'a', 'z' ); =====배열 element 추가 배열은 길이 상관없이 추가하는 것도 가능하고, 정의없이 사용하는 것도 가능하다. $products[4] = 'Fuses';$products2[0] = 'Good Tires'; =====foreach foreach( $products as $current ) 위와 같은 방식으로 foreach 를 쓰는 것이 general 하다. =====key-value array $prices = array( .. 2013. 11. 21.
[Java] Reflection Tutorial - Constructor Java, Reflection Tutorial - Constructor Obtaining Constructor Objects Constructor[] constructors = aClass.getConstructors(); public Constructor 들만 가지고 온다. 만약 parameter 들을 확실히 알고 있다면, 다음과 같이 한개의 constructor 를 가져올 수 있다. Constructor constructor = aClass.getConstructor( new Class[]{ String.class} ); 만약 일치하는 constructor 가 없다면 NoSuchMethodException 이 return 된다. Constructor Parameters Class[] parameter.. 2013. 11. 15.
[android] Browser 의 링크를 통해 내 앱 실행시키기 android, Browser 의 링크를 통해 내 앱 실행시키기 Declare Intent-filter on Manifest The activity which wants to be started has to have action name "android.intent.action.VIEW".Additionally, it has two basic category; they are android.intent.category.DEFAULT and android.intent.category.BROWSABLE.To link the url to the activity, intent-filter has to have data and it declares one or some of followings : scheme, .. 2013. 11. 6.
[Spring] Spring Framework 의 개요 #3 Spring Framework 의 개요 #3 Spring의 IoC Spring Bean ( 그냥 Bean 이라고도 부름 )Spring Container 가 생성과 관계설정, 사용 등을 제어하는 IoC가 적용된 object. Bean Factory 확장한 Application Context별도의 정보를 참고하여 Bean의 생성, 관계 설정 등의 제어작업을 총괄코드에 상세내용이 들어가는 것이 아니라 설정정보를 가진 별개의 파일(xml)을가져와 활용하는 범용 IoC 엔진 Annotation Config Application Context @ConfigurationFactory class 에 붙는 annotation @BeanObject 만들어 return 하는 method. 예제코드ApplicationCont.. 2013. 6. 27.
"웹을 지탱하는 기술" 내용정리. "웹을 지탱하는 기술" 내용정리. "웹을 지탱하는 기술" 이라는 일본 저자가 쓴 책을 본 후에,핵심이 되는 내용이랑 내가 몰랐던 내용인데 정리해두면 좋을 것 같은 내용을 정리해본다. 설명과 함께 정확한 내용, 빠진 내용을 확인하고 싶은 사람은 책을 직접 볼 수 있도록~ 웹을 지탱하는 기술 서평을 보고 싶으면 여기를 클릭! 웹의 다양한 용도 1. 웹사이트 2. User InterfaceHTML 도움말, 웹 UI for embedded systems 3. APIWeb Service 라 부름 웹을 지탱하는 기술 1. HTTP, URI, HTML 2. 하이퍼미디어비선형적 컨텐츠. 중간에 link 타고 갈 수 있고, 동영상, 다른 사이트 등을 껴 넣을 수 있다. (책은 선형) 3. 분산시스템자료의 내용이 전세계적.. 2013. 6. 24.
[JavaScript/Tutorial] Closure 와 Function.bind 의 사용. Closure와 Function.bind 의 사용 [이전강좌] Scope. var 없이 변수 정의하면? Global variable 접근방법은? Closure Closure 는 Scope 의 확장판으로 이해할 수 있다. Function 에 Parameter 형태로 Variable 을 전달하여, 해당 변수를 Local 화 시키는 것도 Closure이고, Outer scope 접속을 위해 임의의 variable 에 this 를 저장한 후, sub procedure 를 실행하는 형태도 Closure 하고 한다. // 변수 로컬화 closure var localizeFunction = function( localizedIndex ){ return function(){ alert( localizedIndex );.. 2013. 5. 26.
반응형